CAN wiring practices and troubleshooting - dalathegreat/Battery-Emulator GitHub Wiki

CAN wiring troubleshooting

CAN networks are vulnerable to lightning strikes. See the dedicated wiki page for this for more info :cloud_with_lightning:

[!CAUTION]
Grounding everything is especially important for certain inverters. If you fail to ground inverter or battery casing to protective earth (PE), there might be a voltage difference between the two components, which can fry the CAN communication chips on the Battery-Emulator. Always connect every component, and the communication shield wire to protective earth before turning the system on!

See this image for grounding:

image

Here is the best way to ensure that there are no paths for spikes in CAN voltage to fry chips on the boards (Important for Solax and Foxess, other inverters are more lenient on what power supply you use)

image

[!CAUTION]
Never connect the signal wire shields in both sides. This creates a ground loop. One side of the shield should be freefloating, like shown in the above pictures.

Every CAN bus must be terminated with a 120 Ohm resistor at each end of the bus. For quick testing, the exact value of the termination resistors is not always critical. Sometimes a single terminator is sufficient. For final installs, proper termination is essential. If you see strange errors, you should check the termination.

[!IMPORTANT]
To save yourself a lot of trouble, always terminate the CAN bus properly.

If you get events like BATTERY_MISSING or INVERTER_MISSING, you need to check the CAN wiring. Here are some basic tips:

  • Make sure all CAN devices are turned ON
  • Make sure the polarity of High/Low is correct. High goes to High, Low to Low
  • Make sure the terminating resistors are correct. CAN networks should have two 120 Ohm resistors in each end of the network. With everything OFF, you can measure resistance between CAN-H and CAN-L. The result should be 60 Ohm. If it shows 120 Ohm, one resistor is missing at an end. If it shows 40 Ohm, you have too many terminating resistors.
  • On the LilyGo, the termination resistor can be removed like shown here: RemoveThisWhenUsingCANinverter
  • On the Stark CMR board, the terminating resistor can be turned on/off via the switches on the PCB image
  • Make sure the cable you are using is a twisted pair cable. This is important for signal quality.
  • Make sure the cable you are using is shielded. One side of the shield should be connected to a pin labelled SHIELD (or PE if no dedicated shield exists). This improves signal quality
  • Try a different powersupply for the board. Powering it via USB from a computer can cause noise on the signal output. Powerbank or phone charger might have cleaner voltage output. If you see CAN_TX_FAILURE occasionally your powersupply might be noisy