I'll respond taking your comments from the bottom up. You've raised some very important issues that I have to think about, so some of what I'll write here is just "off the top of my head".
How is it done in commercial wheel chairs? Are there extra connections in the bus cable of your daughter’s wheel chair? (How many contacts has the connector, and do you perhaps have a labelled pin-out for the connector?
I've attached the manual for the DX-PMB2 power module on Rachi's chair. All of Dynamic's manuals are available at http://www.dynamiccontrols.com/downloads
, but you need to register in some "professional" category to get full access. I briefly looked for a drawing of the bus connector, but didn't find one, perhaps because it's the one connector that the chair maker doesn't wire; Dynamic offers pre-made cables in various lengths. I'll try to describe that cable and connector in words. No, I can do better - I've attached a photo of a piece of old connector.
The cable contains only four wires, and there are no other wires going between modules. Two are 24V wires that look, by eye, to be about 18-20 AWG that Dynamic rates for up to 12A. The other two are a foil-shielded twisted pair for CAN-H and CAN-L. Plug and receptacle are OEM with Positronic machined pins.
Rachi's chair has the following DX modules:
DX-PMB2 - 90A/channel power module
DX-CLAM - combined lighting and actuator module
DX-4SW - takes 4 switch inputs (on a DB9) and translates to CAN messages
DX-ACU - attendant joystick: inductive joystick, user/attendant toggle
DX-SCR - Specialty Controls Remote; the equivalent of my MASTER. This is an obsolete item; current production is different but functionally more-or-less equivalent.
Dynamic puts the master MCU in the remote (either a full user Joystick or the Specialty remote), while P & G puts it in the power module, but the systems are otherwise pretty similar - ONLY 4 WIRES connect everything. On Rachi's the bus cables are in a star centered on a "hub" of two DX-4WAY multi-receptacle blocks.
Wiring on Rachi's chair, of course, involves more than just the CAN bus. There are 2 head-operated and 3 foot-operated switches connected to my 4049/4066 multiplexer, wiring from the multiplexer to the DX-4SW and to a switch-to-USB adapter for her computer, power for an audio amp and the computer, wiring from CLAM to lights and seat tilt and lift actuators, wiring from actuator limit switches to the CLAM and I don't recall what else. Obviously, I want to avoid adding any more, and indeed would like to reduce the number of connections if possible. Keeping all of this from being pinched somewhere has been quite a task: as delivered the chair was a disaster waiting to happen. Despite it's CE label, cables went every which way (and were constantly damaged), un-safetied bolts and nuts were falling off, cold solder joints and wires were stripped several cm beyond the connectors, motor wires were lighter gauge than that specified by Dynamic and below the minimum specified by Tyco for crimping, Anderson connectors for the battery cables were improperly crimped and one actually fell out, etc. etc.
By the way, doesn't look the reed controlled full power-down of the Robotec MCU exactly as what is done in Raymarine course computers?
I have no knowledge of anything marine, but the Roboteq user's manual (and a lot more) is available at http://roboteq.com/tech-support/manuals-and-software
Isn't there a simple way to implement it the same way for all bus nodes?
If there were a 5th wire, yes, but I'm trying to avoid that. I'll add some thoughts about this further down.
Resets and reinitialisation can better be initiated by software.
If done this way, there is full freedom to do it on every node needed, exactly at the momed needed, for example at power-up, wake-up or after longer stops. And if it's badly implemented you can change mind and recompile without changing the circuit.
Yes, but if the only communication between nodes is by the CAN bus, a situation calling for reset may be one in which the CAN bus is down -- there has to be a way to force a complete cold shutdown and re-start as well.
The wheelchair user can not do a complete system power-cycle.
I repaired once a "Supertrans" wheelchair with a faulty steering direction feedback potentiometer : when steering hard to one side, the potentiometer gave bad values, the system detected and reported the fault to the user. A power-cycle was necessary, before moving again.
That is a common practice for critical faults in WC controllers and in the Roboteq as well, and here you've highlighted a real flaw in what I've done that I must find a way around. My scheme let's the user cold start the Roboteq and the Master, but not AUX nor DISPLAY. I don't really care much about DISPLAY, but as AUX turns the Roboteq ON/OFF if AUX goes down the user can't shut things off (someone would have to pull a battery cable). That's NOT good. So how can I do this without adding an extra wire even if the entire CAN bus is out of commission? Dynamic manages to do it, but I don't know how they do it. My thinking is not fully baked yet, but here's what I'm thinking. The 2551 CANH pin is 50K impedance when there's no power, and between 2.5V and 5V (more-or-less) when powered. The Recom DC-DC converter will power on with 1.6 to 5V on its (very high impedance) control pin. Suppose that an AUX digital pin that is pulled HIGH during setup is connected to the Recom (as on Master) and that CANH is also OR connected there. Then, during MASTER's power-down routine it could tell AUX to pull that pin low turning off Vcc, and once MASTER was re-started it would put >= 2.5 onto CANH turning the Recom on and re-starting AUX. All the circuitry needed is already on the DC-DC board, and no more than a few lines of code would be needed to get a full, user-operated, system shut down and re-start. (NB: the Recom control pin is very high impedance and the pull down on my board is 1M, so this shouldn't interfere with CANH on the 2551). Just need to connect the Recom control pin (on everything except MASTER) to CANH instead of to the push-button, voltage-divider, RC delay used on MASTER. Well, seems to be getting better baked with every passing moment. Thank you for pushing me on this.
This looks too complicated to me.
Imagine that you start adding more nodes, complexity will increase further.
A few discrete components on the DC board seems a lot LESS complicated to me than running more wires (with more connectors to fail). Adding another node basically means adding one line
void nonMASTER (boolean State)
except that I will probably change State from boolean to byte so that the 3 states can be Wake, Sleep, and ShutOff to implement what I described in the last paragraph.
E' ora di pranzo e devo aiutare Rachi (it's time for lunch and I have to go help Rachi), so bye-bye for now.