Table of Contents
Some rules on how to design a CAN network. Consider reading Problem Solving Questions.
- Always use twisted pairs for CAN_H and CAN_L.
- Several manufacturers offer also four twisted cables for CAN when using 4-wire construction. This makes cable thinner and enables moulding of 2x2x0.5mm2 into e.g. M12-connectors
- Maximum cable length is between the two farthermost nodes on the CAN bus line. Remember, in the worst case a signal has to travel from the node at one end to the node on the other and of the line. It is a function of the bit rate as follows:
|bit rate||max cable length (in m)|
(Table from CiA DS 301 4.02 page 20)
CiA 303 Part 1: Cabling and connector pin assignment has recommendations for connectors and cables used in CANopen systems.
If you ask for a formula? There is one rule of thumb: cable length < 40000 Kbit/s * 1 m / BitRate in Kbit/s BitRate given in Kbit/s as well. Using this, results in < 40m for 1Mbit/s or < 320m for 125Kbit/s. In this formula a typical transceiver propagation of 25ns and a typical cable propagation of 5 ns/m is used for calculation.
CD-Systems provides a nice overview.
CAN cable types
All big vendors have specialized CAN cables, but they are not necessary called CAN something
The maximum CAN cable length (considering cable and transceiver propagation delay)
An interesting discussion from the CANLIST:
'mb' Moshe Barazani:
According to the DS303-1 and the Bosch protocol and ISO 11898, the 1Mbit should be supported for bus length of 30meters. Practically we could reach not more than 10meters. This also stands with some notes that I could locate on the web.
Does anyone have any experience to share in such architecture? Did you use “Repeaters” to extend the bus length? Any suggestion in how can a bus be lengthen to 30meters? Any idea what were the different standrad calculations when allowing 30-40 meters?
Did you have done any calculations of your overall signal propagation, e.g. adding all relevant delay times
transceiver - opto coupler - cable - opto coupler - transceiver ??
As you already said, having all bad components, you will not reach 30m, in the worst case your calculation will end up with a length of minus some meters.
Repeaters will not extend cable length when you stay with 1Mbit/s. They will add additional delay.
'sc' Steve Corrigan:
A 30 meter bus should not be a problem with a 1 Mbps signaling rate as long as the cable is at the very least 120ohm CAT 5 twisted-pair cable. Shielded is even better. 5ns per meter propagation delay is typical for this cable. The down and back max prop delay is then 400ns. Then, if you add a 150ns total loop delay for a sending transceiver and another 150ns for the most distant receiving transceiver (in this case HVD251s), then the total prop delay from controller to controller is now around 700ns. Easily enough time for a correct sampling point. I have operated at 1Mbps on 40m without any problems at all. This is, by the way, the maximum bus length specified by ISO 11898 (1993).
Problems you may be having
- correct termination?
- too many stubs?
- stub length too long?
- stubs too close together?
- trying to use galvanic isolation?
- trying to use a non-standard topology like a star?
40m at 1Mbps on a standard bus is no trick at all, so something is not electrically correct with your bus arrangement. This is how your bus should be set up for high-speed operation.
'sc:' Stubs too close together increase the capacitive effects of each – they become a lump sum and damp the effective signaling rate. What isolators are you using? If they're optos you may want to switch to another part like ADI's ADuM1100.
'ob' Oliver Betz: is it a must to use isolation, or to use a (maybe specific) optocoupler? TI's parts are much faster, consume less power and cost less than fast optocouplers.
taking the worst case scenario according to the manufacturer you might end up with cable with minus length. The problem is that you cannot get the typical values of the delay and not even some statistics of “how many components might get to the max delay out of 1000”
with fast couplers and transceivers I see no problem to make a 100% design. ADuM1100 has typ. 10.5 and max. 18ns prop. delay. HCPLx710 typ. 20ns, max. 40ns. Two times transceiver delay (each 120ns..175ns). Still enough room for several meters of cable.
Regarding the probability: comparing the “worst case” and the “typical” values gives an idea about the distribution. A rectangular distribution would be a rather pessimistic but still acceptable assumption.
After all, I wonder in which case there could be a real need for galvanic isolation of such a small bus - different, distant power sources?
AFAIK galvanic isolation suppresses only low frequency noise, RF can be filtered better and cheaper.
Heikki Saha, explains propagation delay, 2013-10-18:
Propagation delay consists of:
- Propagation delays of transceiver: TX-to-CAN and CAN-to-RX
- Propagation delay of logic, if additional logic exist between controller and transceiver
- Propagation delays of isolation, if such is used
- Signal propagation delay required for signal to go from end to end of the network and back. Propagation delay needs to be taken as twice, because during arbitration and ACK, network state may be driven by multiple devices and there shall be enough time to enable network state to stabilize before taking a sample.
Some example values:
- TJA1050: TX-to-CAN worst case 110ns, CAN-to-RX worst case 155ns
- Logic depends on the implementation, but fast CPLDs such as Lattice ispM4A provide <10ns
- Best option is to use digital isolators, e.g. for ADuM1100 worst-case 18ns
- Signal propagation delay is 5ns/m in standard 120ohm CAN-cable
⇒ Basic implementation without isolation and logic, we get:
- At 1Mbps CANopen we have 4TQ=500ns reserved for propagation delay in a worst case
- 110ns + 155ns = 265ns for transceiver – 195ns is left for signal propagation
- We can achieve maximum cable length of 195ns/(2*5ns/m)=19.5m
- If we have the best possible 5TQ=625ns propagation segment
- Maximum cable length of 320ns/(2*5ns/m)=32m may be achieved
⇒ The basic timing is only one part of the truth. Additional constraints are required for the topology to keep the transmission line solid:
- Few group of devices far away from each other should be avoided, because the groups modify the line-impedance in the area of the group ⇒ impedance junctions introduce reflections
- In addition to previous, residual error probability decreases significantly when the number of devices are increased – use numerous devices, but try to install them evenly along the network.
- Too long drop-lines are unterminated ends, causing reflections ⇒ the longer drop-line, the closer to sample point the reflection can appear. The more there are long drop-lines, the higher power reflections appear