0

CAN Bus limitations

CAN Bus is an extremely reliable protocol, but some errors in bus implementation can lead to problems, even severe ones. If there are continuous errors, bus nodes will switch them off the bus and they will be no more accessible. The following scenarios can lead to errors:

  • Too many CAN Bus devices. In theory, You could have a very big number of nodes. However, You must sacrifice bus length and data transfer speed. Some electrical requirements have to be met, too. If You like to have more than about 12 nodes at normal ML-R bus speed, it is mandatory to use ML-R CAN Bus power supply (mrm-can-pow). If You do not do so, after a certain number of nodes You will have precipitous deterioration of the recessive signal and a big number of errors. Just removing any of the nodes will solve the problem, too. If measures are taken, over 100 nodes can be achieved.
  • Oscillator tolerance. Some of the ML-R boards use microcontroller's internal oscillators and some external crystals. A bigger board is needed for crystals, and more energy, too. On the other hand, they yield a much better tolerance and enable higher bus speeds. If You plan to have a long bus at a high bus speed, like 1 MHz, consider crystal models.
  • CAN Bus uses 2 wires. If there is a ground connection between 2 nodes, one of them can be disconnected (but You shouldn't do so intentionally, of course). The system will continue to work, but not as reliably. You may have a faulty cable and the system that still works but not always. Check the cables with ohm-meter.
  • The bus has to be properly terminated with 2 120 Ω resistors, one on each end. Many ML-R boards feature the resistors and You just have to enable them by using a jumper. If no terminator is presented, there will be a lot of reflected waves and the system will perform very poorly, if at all. For a very short bus, 1 terminator may be enough, although it advisable to always use 2 of them. A standard configuration is MRMS ESP32: Arduino, IMU, eFuse, BT, WiFi, CAN Bus (mrm-esp32) on one end and ML-R CAN Bus power supply (mrm-can-pow) on the other, both with termination jumpers installed.
  • Each CAN Bus node maintains error counters and takes actions according to their states. After a threshold is reached, the node enters bus-off mode in which it doesn't participate in network traffic anymore, in order not to spoil the network. It is important not to allow power fluctuations for an extended period of time, like powering MRMS ESP32: Arduino, IMU, eFuse, BT, WiFi, CAN Bus (mrm-esp32) through USB. The nodes will be transmitting a lot of errors and many will not be reachable anymore. After You finally switch the appropriate power on, You will find many nodes nonexistent.