Shop OBEX P1 Docs P2 Docs Learn Events
New CAN device - Page 2 — Parallax Forums

New CAN device

2»

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-01-11 09:54
    The establishing of DIY voltage regulators for alternators is an interesting CAN application.

    Quite awhile ago, I had a posting about DIY voltage regulators for yachts that I was considering adapting to use with one of Ken Gracy's robots that used a gasoline engine and an altenator to provide power to a couple of drive motors via a BasicStamp. My thought was that a thermal sensor on the batteries could be useful to develop a more sophisticated algorithm.

    What I did not post was some later insights. There were some alternative circuits - one had an op amp controlling the regulator and the other was using discrete components. Since automotive and marine circuits are a small network with huge surges from relays and lights going on and off, I have very strong suspicions that unless the op amp is particularly well protected, it may be best to use discrete semiconductor components as both BJT transistors and MOSfets are now available with voltage ratings up to 200 or so VDC. It seems that most of the energy in spikes and surges in such a context are well handled below 200 Volts - so the circuit should be very durable, even though in theory the surges might go above that. (Of course, lightning strikes is a completely separate issue and be best managed with carrying spares).

    Anyway, the discrete component form of voltage regulator for a marine alternator is not a difficult circuit to design and build. While it would be interesting to have a CAN interface, I even suspect that charging the batteries might be easily achieved in a full analog system with mechanical relays for shifting banks. The CANbus could additional monitor charge and suggest shifting charging to optimize the batteries; but it is certainly not necessary in this context.

    Also, I like the idea of using the CANbus to handle latching relays on items such as AC bilge pumps that may be used at dock side, but subject to transient power outages. There is no need for the system to restart a bilge pump when power returns to on; the CANbus would merely monitor status, notify you via cell phone, and again notify if the status resolved itself. This would be very handy for a boat owner that cannot always remain close to his boat. And it would be less prone to error than a normal relay system that requires power to keep the relay engaged.

    I guess I am interested in how CANbus could optimize in a marine setting.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-01-11 16:10
    I am waiting for my pcb to arrive. I have used the MCP2551.

    There is so much to be saved by using a CAN bus on my boat. It is a 35ft (10.7m) sailing catamaran with twin diesels. I have 510AH AGM batteries for the house.

    Jon: Your sniffer is a great idea. I am interested in doing the driver using a prop cog of course. I just have way too many projects on atm.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-01-12 06:44
    The main advantage with CANbus is that you only need one twisted pair of wires installed from bow to stern and you can tap in for multiple masters and slaves as required.

    But I suspect it is much wiser to pull a typical LAN cable of 4 twisted pairs and use them in the following way.

    1 pair -- for your CANbus
    1 pair -- held in reserve if your CANbus cable is damaged
    1 or 2 pair -- provide low voltage DC power to all CANbus nodes. (It is up to you to decide what distribution voltage you want to use, but the nodes should have their own regulators so at least 7VDC available at each node is wise.)

    The main points here are to having to pull one cable for complete installation AND having extra capacity to deal with eventual damage from salt water corrosion or a mishap at sea. Above all, make the wiring so that repair can happen quickly and a backup system is always available. I suppose having the cable inside a 3/4" PVC pipe would make exchanging a damaged cable with a new one much easier than if wire is just attached to the hull. CANbus is best run in one long wire without Tees or Star hubs. The ends may require some 300 ohm resistors for termination to reduce signal reflection back into the line. If you need starboard and port side access, just run a big horseshoe of wire with both ends in the engine room (where your power supply is.)

    It is rather pointless to pull separate power lines to each CANbus node and buying 4 twisted pair cable is much cheaper than most specialty twist pair cables. I have used this arrangement and also 4 wire telephone line (maybe not twisted pair) very successfully for 100 feet, but in theory you can easily get into 1000s of feet.
  • JonnyMacJonnyMac Posts: 9,207
    edited 2012-01-12 09:14
    Jon: Your sniffer is a great idea. I am interested in doing the driver using a prop cog of course.

    It's actually not a very original idea, but it is useful when getting started with CAN, especially with an unknown system. My initial involvement with CAN was on a client project that was inadequately documented. The original version of the product was written for a PIC with a built-in CAN engine. The engineer that designed the PIC version was dismissed and a new engineer was tasked with redesigning the product around the Propeller using the MCP2515 and MCP2551 for the CAN interface. The problem was the original source code was a giant, undocumented mess (apparently the first engineer keep the specs in his head), and the implementation of CAN was very nonstandard. I got the commercial buss sniffer hardware/software to check my own code, then created a custom sniffer for the new engineer (using the non-standard implantation of CAN ids) so that he could monitor the old product in order to provide specs for me (he's on the other side of the country so I have never seen any hardware except a prototype of the new control board that sits on my desk).

    At any rate, after that project (which is a success) I rewrote my own CAN object to be very standard and easy to use in a practical sense. On my PCB -- as with the faxjacton board -- I included a DB-9 which will allow experimenters (with a DB-9 to OBD-2 cable) to connect to their car electronics. My Montero Sport is a 2002 model (I drive so little I tend to keep cars a long time) and I'm not even sure it has CAN on the OBD connector but I'm going to try. Combining CAN from the car and GPS from a simple receiver could lead to some interesting datalogging projects for car performance.

    For me, I have some ideas for using CAN in my special effects work. I have a client who is tasked with building a 20'x20' model of Los Angeles (from LAX to the Hollywood sign) and I've been hired to provide lighting control for many of the buildings in the model. While it's likely that DMX will be used on this project, based on what the customer ultimately asks for in terms of performance and control, I'm keeping the CAN option on the table.

    I'm also working on some "tools" for my own kit that will allow me to monitor and control a variety of IO modules on a CAN network. On a recent FX job I had wires dangling out of all four sides of a house (what we call a "practical set") and on the command of a director I would literally run to the appropriate set of wires to trigger the effect -- first and last time I'm doing that. I've got an idea for a set of modules that will let me control and monitor a variety of digital and analog IO from a single location -- like the motor home where the producers/directors where monitoring this 36-hour "oner" (a Hollywood term for one take). The project is called BlackBxx:Haunted (http://blackbxx.com/Haunted/BBHaunt.htm).

    When you get you CAN engine running I'd be happy to test it. I think it's going to be bear, but then, you Aussies are known for your grit, aren't you? ;)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-01-12 12:46
    Jon:
    My Montero Sport is a 2002 model (I drive so little I tend to keep cars a long time) and I'm not even sure it has CAN on the OBD connector but I'm going to try. Combining CAN from the car and GPS from a simple receiver could lead to some interesting datalogging projects for car performance.
    
    mmm... well my 1988 Supra is a little older and I have had it since new... but alas, no CAN bus!

    Actually the CAN specs are quite interesting. Much better than SDLC on an IBM.

    I can see where CAN would be nifty for what you do. As Loopy said, CAT5 cable might make a simple wiring job and is always available closeby. RJ45 breakouts and crimps etc also available.

    Loopy: In my cat (its a production cat and I own the moulds) cat5 cable is what I intend to use because RJ45 breakouts are readily available. I will be running 5V on one pair but where more power is required I will be running 4AWG or tap from the large supply cable that runs throughout the boat. In fact, I think that it will reduce the amount of heaby cable running in the boat as well. Once I get the CAN bits working I will be able to think it out better. I may run 2 CAN busses on the cable to seperate the primary and secondary controls.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-01-13 05:45
    I had forgotten to mention that I use RJ45 breakouts as well as the CAT5 cable as it gets very expensive and complicated to order anything else these days. Or in some cases, I use the 4 pin RJ plugs on a 4 wire set up with generic telephone extension cord. These approaches make exploring CANbus a lot more fun as connections and insertions are handled very simply.

    At one time, I had a test bench with two CANbus node perpetually exchanging information and 100' coil of telephone extension cord in between - no glitches over a period of about 90 days.

    There are several vehicles that run two CANbus for the sake of simplicity (one bus for propulsion control, the other bus for secondary tasks) or maybe even redunancy (the second bus is there to take over in the event of a failure on the first bus). I believe Airbus uses redundant CANbus for the fly by wire, but I've not been able to verify this.

    The main point about routing wire for CANbus is that it is a bit silly to be too frugal in running wire as you will end up having to repull your wire for a later expansion. I did a bit of sketching of what I thought an ideal run on a boat would be (but not a catamaran) and it looked like a spiral of two or so turns. I am wondering if you need to run the CANbus up the mast to control running lights and other equipment aloft.

    It really doesn't matter what the application, using copious amounts of wire allow more future capacity - try to think in terms of all the locations that a node might later be installed rather than in terms of the shortest run.

    Unfortunately, my sole transportation is 125cc Yamaha motor scooter - no CANbus included in motor scooters ;-)
  • JonnyMacJonnyMac Posts: 9,207
    edited 2012-01-14 10:16
    I got my boards in, built, and working! The BOM is easy and only takes a few minutes to put together. Will work on my original Propeller Platform and Nicks "short" (USB) version -- though using it on the latter suggests adding stand-offs to the holes near the big connectors to stabilize it when it's on the bench. I have spare boards and will make them available for sale in another thread.
    640 x 457 - 499K
Sign In or Register to comment.