Alan B
100 GW
A simple isolated interconnect for communications between modules is useful for many ebike projects. Isolation must be able to handle the voltage range of the ebike battery pack plus noise so that modules can be connected into the battery stack and still communicated with.
Requirements
* simple, low cost and parts count
* standard, commonly available parts
* work with small inexpensive microprocessors, low pin count (1-2 I/O pins)
* isolated to at least 200VDC
* multi master to facilitate more than one master, but most nodes are slave-only
* nodes: one per cell plus 8 so 32 to 48 nodes
* speed requirement?
* data transfer validation (CRC or equivalent)
Candidates, in no particular order
* CANbus
* LINbus
* I2C
* Serial
* ModBus
* One-Wire (MicroLAN)
* EnergyBus (a CANbus variant)
CANBus seems to be a bit complicated for simple stuff, and not inherently isolated. There are isolation chips for CANBus, though it stretches the requirement of commonly available parts. TI ISO1050 is one example of a chip for isolated CANBus, cost about $4, available in SMT only. It has the advantage that it is smaller than a pair of standard optical isolators and requires less power. It uses capacitive coupling for isolation. The software complexity of CANBus is rather high for the smaller chips. One thought might be to use the CANBus driver or isolation hardware but use a simpler software approach. CANBus requires fairly precise clock so is not a good fit for RC timed processors such as the Tiny45/85. update - the CANbus hardware (either in CPU or an external chip) handles the complexity rather nicely and present a simple register or SPI interface to the CPU (see MPC2515). They do require a crystal for timing precision, but that means the CPU doesn't have to be crystal controlled (unless it has internal CAN hardware).
LINbus is a one wire serial automotive bus that requires only a UART (though some processors have LIN hardware). It is a single master synchronous polled bus so there is no need for arbitration. Up to 16 nodes are supported. It is lower cost than CANbus. Optical isolators can be used for isolation. It looks like a good candidate here, though I don't see other projects using it. CANbus has become cheap enough, perhaps.
Isolated I2C presents special difficulties due to the bidirectional nature of the signals, but there exist isolation chips for it as well. One example is the ADuM1250 which requires six passive external components. I2C is generally not multi-master. Chip cost about $6. Clock and data remove precise timing requirement. Clock and data pins required.
Isolated Serial requires a fairly small parts count. One design uses a pair of standard optical couplers, an FET and a couple of resistors. I have not come across any neat chips for this, though they may be out there. Variations on this theme abound such as differential RS422/485, single ended "TTL" levels, and of course higher voltages like RS232. RS232 is not desirable due to the bipolar voltages required.
RS485 is multi-drop and differential, designed for 32 nodes (some implementations go higher) which is adequate. Example chip is ADM2483. May require more than 2 pins on CPU, or may be able to do a direction pin and an I/O pin, or 3 pins with direction, in and out. Another chip IL3185 may be a good choice. The il3285 has lower loading so more nodes are allowed.
ModBus is really a specific protocol to use over serial. Simple and popular. Might be a good choice if Isolated Serial hardware is used. Could this protocol be used over the CANBus isolation chips? There are AVR libraries for ModBus, it might be good to check the memory size of this code.
Isolated One Wire bus may be a bit slow, what are the speed requirements here? Designs for isolation use quite a few parts. Is there an isolation chip out there? Isolation can of course be constructed from optical isolators, the question is how much circuitry does it take?
USB and Ethernet are obvious serial interfaces but their complexity is too high for this application so they are omitted.
Sample Applications
One example application for this bus at the low end of the scale is battery management. A small microprocessor such as an ATTiny45/85 across each cell group reads the voltage and temperature and controls the balancing resistor load. Two pins are available for communications with other parts of the ebike system. Code space and hardware is limited. CANBus protocol stacks may be too large and hardware support not available in these chips. The clock stability is also an issue. These small chips have a Universal Serial Interface module that can do half duplex serial modes including I2C.
Other applications include the motor controller talking to the battery management subsystems, the cycle analyst (user console display/interface) equivalent talking to everything, and perhaps the throttle talking to the motor controller (or talking to two motor controllers, solving the usual throttle isolation issue). The front and rear lights could be on this bus, as could the ebrakes if we trusted it enough.
Another application area is in the charging system. The charger can use this bus to talk to the BMS. The Data Logger can talk to everyone with this bus. The ignition switch might just be a member of this network as well. It would be nice to have the tail-lights, headlights, etc on this one bus and get rid of all the other signal wiring. A node on the forks could pick up everything there and put it on the bus, and another node at the tail-light.
Power
If this bus can provide power to devices that need small amounts of it that would be good. Perhaps +5 and +12 would be available. That would make it a four pin bus. If there were 5 amps or so available it would be sufficient for LED lighting. Another approach is to run the bus at +12 and just have that one voltage available. Plus 12, signal(s) and ground would be 3-4 wire cabling.
Other thoughts and suggestions?
Requirements
* simple, low cost and parts count
* standard, commonly available parts
* work with small inexpensive microprocessors, low pin count (1-2 I/O pins)
* isolated to at least 200VDC
* multi master to facilitate more than one master, but most nodes are slave-only
* nodes: one per cell plus 8 so 32 to 48 nodes
* speed requirement?
* data transfer validation (CRC or equivalent)
Candidates, in no particular order
* CANbus
* LINbus
* I2C
* Serial
* ModBus
* One-Wire (MicroLAN)
* EnergyBus (a CANbus variant)
CANBus seems to be a bit complicated for simple stuff, and not inherently isolated. There are isolation chips for CANBus, though it stretches the requirement of commonly available parts. TI ISO1050 is one example of a chip for isolated CANBus, cost about $4, available in SMT only. It has the advantage that it is smaller than a pair of standard optical isolators and requires less power. It uses capacitive coupling for isolation. The software complexity of CANBus is rather high for the smaller chips. One thought might be to use the CANBus driver or isolation hardware but use a simpler software approach. CANBus requires fairly precise clock so is not a good fit for RC timed processors such as the Tiny45/85. update - the CANbus hardware (either in CPU or an external chip) handles the complexity rather nicely and present a simple register or SPI interface to the CPU (see MPC2515). They do require a crystal for timing precision, but that means the CPU doesn't have to be crystal controlled (unless it has internal CAN hardware).
LINbus is a one wire serial automotive bus that requires only a UART (though some processors have LIN hardware). It is a single master synchronous polled bus so there is no need for arbitration. Up to 16 nodes are supported. It is lower cost than CANbus. Optical isolators can be used for isolation. It looks like a good candidate here, though I don't see other projects using it. CANbus has become cheap enough, perhaps.
Isolated I2C presents special difficulties due to the bidirectional nature of the signals, but there exist isolation chips for it as well. One example is the ADuM1250 which requires six passive external components. I2C is generally not multi-master. Chip cost about $6. Clock and data remove precise timing requirement. Clock and data pins required.
Isolated Serial requires a fairly small parts count. One design uses a pair of standard optical couplers, an FET and a couple of resistors. I have not come across any neat chips for this, though they may be out there. Variations on this theme abound such as differential RS422/485, single ended "TTL" levels, and of course higher voltages like RS232. RS232 is not desirable due to the bipolar voltages required.
RS485 is multi-drop and differential, designed for 32 nodes (some implementations go higher) which is adequate. Example chip is ADM2483. May require more than 2 pins on CPU, or may be able to do a direction pin and an I/O pin, or 3 pins with direction, in and out. Another chip IL3185 may be a good choice. The il3285 has lower loading so more nodes are allowed.
ModBus is really a specific protocol to use over serial. Simple and popular. Might be a good choice if Isolated Serial hardware is used. Could this protocol be used over the CANBus isolation chips? There are AVR libraries for ModBus, it might be good to check the memory size of this code.
Isolated One Wire bus may be a bit slow, what are the speed requirements here? Designs for isolation use quite a few parts. Is there an isolation chip out there? Isolation can of course be constructed from optical isolators, the question is how much circuitry does it take?
USB and Ethernet are obvious serial interfaces but their complexity is too high for this application so they are omitted.
Sample Applications
One example application for this bus at the low end of the scale is battery management. A small microprocessor such as an ATTiny45/85 across each cell group reads the voltage and temperature and controls the balancing resistor load. Two pins are available for communications with other parts of the ebike system. Code space and hardware is limited. CANBus protocol stacks may be too large and hardware support not available in these chips. The clock stability is also an issue. These small chips have a Universal Serial Interface module that can do half duplex serial modes including I2C.
Other applications include the motor controller talking to the battery management subsystems, the cycle analyst (user console display/interface) equivalent talking to everything, and perhaps the throttle talking to the motor controller (or talking to two motor controllers, solving the usual throttle isolation issue). The front and rear lights could be on this bus, as could the ebrakes if we trusted it enough.
Another application area is in the charging system. The charger can use this bus to talk to the BMS. The Data Logger can talk to everyone with this bus. The ignition switch might just be a member of this network as well. It would be nice to have the tail-lights, headlights, etc on this one bus and get rid of all the other signal wiring. A node on the forks could pick up everything there and put it on the bus, and another node at the tail-light.
Power
If this bus can provide power to devices that need small amounts of it that would be good. Perhaps +5 and +12 would be available. That would make it a four pin bus. If there were 5 amps or so available it would be sufficient for LED lighting. Another approach is to run the bus at +12 and just have that one voltage available. Plus 12, signal(s) and ground would be 3-4 wire cabling.
Other thoughts and suggestions?