CAN bus length

Hello,

I need to calculate the maximum CAN bus length that I can use in my CAN network. Obviously the maximum length depends on the bitrate used. I'm planning to use 250 kbit/s. But it should also depend on the number of nodes in the network and the impedance of these nodes. Am I right? This should affect the shape of the signals, i.e. voltage level of the signal when received, the shape of the signal edge (how fast the edge is rising) etc. At some point the signal is not "good enough" to be read by the receiving node = a too long CAN bus is used. Am I still right? Maybe other things affect the maximum lenght to (the impedance of the bus cables etc)?

Could anybody help me with the calculations of the maximum CAN bus length as a function of needed variables?

Thanks in advance!

Best regards,

Eric

Reply to
Eric
Loading thread data ...

For 250 kbit/s the cable length should not exceed 250 metres.

No. The node impedance should be 120 Ohm.

Vadim

Reply to
Vadim Borshchev

I have no idea about CAN busses, but for busses in general the most important feature is the propagation time. The sender has to hear something before continuing. The actual impedance at the receiver nodes is normally high, and won't affect the transmissions too much. Buss termination will matter a great deal.

As a rule of thumb you can expect about 1 nSec per foot delay. This will vary with the actual line, and may be as much as 2 nSec. Now you have to figure in down and back propagation time, plus whatever it takes for the receiver to decide to respond. So a 10 foot line requires 20 feet of signal propagation, or about 20 to 40 nSec. That puts an upper limit of transmission (for non-pipelined systems) at about 25 to 50 mHz. Don't forget the receiver response time, which will normally not vary with distance.

The other factor with distance is high frequency attenuation, which effectively reduces the rise time of the received signal, and appears as further delay. This is normally a function of the actual line used, and its apparent varying impedance with frequency.

--
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 "show options" at the top of the article, then click on the 
 "Reply" at the bottom of the article headers." - Keith Thompson
Reply to
CBFalconer

Not particularly. The length of the bus is limited almost exclusivel by timing, not by the number of nodes. The number of nodes is limited by the drive power of the CAN transceivers you use.

You'll find formulae for this in textbooks on CAN. It's essentially the usual "cable shorter than twice the propagation time allowed, for the given bus rate". A rule of thumb is

Bitrate * Buslength < 50000 kBit m/s

At 250 kBit, with careful design, people claim that 250 meters should be possible.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

FWIW, SAE J1939 specifies 250 kHz CAN, with a maximum 40 meter bus terminated at each end with 120 Ohm resistors. Each node is connected to the bus by a stub no longer than 1 meter. Nodes are not terminated, and the shield "connects" to module ground through a resistor and capacitor in series.

Regards, -=Dave

--
Change is inevitable, progress is not.
Reply to
Dave Hansen

Un bel giorno Eric digitò:

IIRC the length of a CAN bus is limited by the fact that the signal must be able to travel across the entire bus within the time of a bit. Therefore, I suppose that you have to consider the maximum distance between two nodes.

--
asd
Reply to
dalai lamah

Hi,

Yes I've also read that you can only have a 40 m long bus at 250 kbit/s for J1939. But why, since it should be possible to have up to 250 m bus at that bitrate according to posts here for instance? Why only 40 m for J1939? I need at least a 55 m long CAN bus.

Br, Eric

Reply to
Eric

You should give this cool new web site a try:

formatting link

It's called a "search engine". It indexes web sites and Usenet newsgroups and allows you to search for stuff via keywords or phrases.

The spec I'm most familiar with is DeviceNet. It says says

250m max at 250K baud. I'm sure that's a bit on the conservative side.

I think you'd have to put an awful lot of nodes on to see much of an effect. The nodes should be high-impedance unless they're transmitting. The DeviceNet spec is 64 nodes, but that's a protocol limitation rather than a physical layer limitation.

BTW, the length limit is based on the CAN bus requirement that any node be able to see a failure signal jammed onto to bus by any other node within some percentage of one bit time. Or something like that. The first few hits from the google search above explain it all in detail.

--
Grant Edwards                   grante             Yow!  Hmmm... A hash-singer
                                  at               and a cross-eyed guy were
                               visi.com            SLEEPING on a deserted
                                                   island, when...
Reply to
Grant Edwards

The best answer I can give is "Because SAE says so."

It's specified in Table 8 of SAE J1939-11. No rationale is given. My best guess would be an overengineering safety factor.

If you don't have to comply to SAE J1939, I expect a 55 m bus will work fine (assuming the Vadim and the other posters are correct, and I've no reason to doubt them).

Regards,

-=Dave

--
Change is inevitable, progress is not.
Reply to
Dave Hansen

Please include context with your replies, even if you are using the foul google interface to usenet. See my sig in my other reply to you [1] for how to do this. Otherwise people will tend to ignore you, because your articles do not stand by themselves and it is a major pain to read them.

Specifications normally include a safety margin. How that is calculated depends on the actual organization, implementation, and timing of the buss. You might well find that the 55 m buss works some of the time, at some temperature, or some supply voltage. If you want a reliable system you won't exceed the specifications. So my advice is either to reduce the distance, or look for another buss. There is nothing worse to debug than an intermittent failure.

The designer of the Brooklyn Bridge (in New York) knew he didn't have all the information, so he allowed an ample margin of safety. The result is a bridge that is still in good condition almost 150 years after construction. The designer of the Tacoma Narrows bridge thought he knew everything, and the result was a bridge that fell down within a year for unforseen reasons. Which reputation do you want?

[1] which read: "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

Eric schrieb:

J1939 is a completely different (and slower) physical layer than that used by "standard" CAN.

--
Dipl.-Ing. Tilmann Reh
http://www.autometer.de - Elektronik nach Maß.
Reply to
Tilmann Reh

Not really --- it's more like an upper limit for rather optimal conditions. The key quantity is ACK propagation speed. That'll be

2 * 250 m * 250e3 s^{-1} = 125e6 = 1.25e8 m/s

without reserving some time for electronic delay (optocouplers, anyone?). This corresponds to 40% of light speed, which is a bit uncomfortably close to usual signal speed on cables.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Dave Hansen skrev:

Thank you for all your answers. However, one big questionmark remains for me. How did SAE come to the conclusion that 40 meters is the maximum CAN length @ 250 kbit/s when a lot of websites states 200-250 meter?

This is a extract from SAE J1939-15 "Reduced Physical Layer, 250K bits/sec, Un-Shielded Twisted Pair (UTP)" (I use un-shielded twisted pair):

Parameter | Symbol Min Nom Max Unit Conditions

--------------------------------------------------------------------- Bus Length| L 0 40 m not including cable stubs

----------|---------------------------------------------------------- Cable Stub| Length | S 0 3 m Note 1

----------|---------------------------------------------------------- Node | Distance | d 0.1 40 m

----------|---------------------------------------------------------- Minimum | Distance | from RL | d0 0 m RL may be located within an ECU, | but shall be marked as a Type II | J1939-15 ECU

---------------------------------------------------------------------- Note 1: To maintain J1939-11 off-board diagnostic tool compatibility, the cable stub length for the diagnostic connector is 2.66m maximum for the vehicle, and 0.33m maximum for the off-board diagnostic tool. The total stub length should not exceed 3m.

This is two of many websites stating a CAN length of 200-250 meters @

250 kbit/s:
formatting link
formatting link

There is a huge difference between 40 and 200 meters!

Br, Eric

Reply to
Eric

250 metres is maximum for CAN bus (as in ISO 11898), for SAE J1939 it is 40 metres. Just that. They are dwo different standards. Yes, J1939 is based on CAN, so what?

formatting link

The last sentence on this page says a lot.

Indeed. Safety margins have been mentioned earlier in this thread.

Vadim

Reply to
Vadim Borshchev

The 250 meters are for *optimal* conditions. That would imply:

*) no electronic signalling delay (i.e. the signals on the cables arrive in the CAN controller *immediately*)

*) no clock deviations, regardless of the enormous temperature differences that can happen between nodes' locations inside a vehicle.

*) no cable capacitance (or infinite transmitter power to overcome it)

*) infinite time resolution of the receiving devices for sampling the bus

In reality, you'll have opto-couplers introducing signalling delays, uncompensated oscillators causing clock drift, non-negligible rise-times of pulses, and slow clocks in the receivers limiting where during a bit time the sample-point will be.

All combined, this may very well justify under-rating the bus that much, to have some margin of safety.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Vadim Borshchev skrev:

[snip]

No. The node impedance should ideally be infinitely high. In practice, I suspect is somewhere around 10-100 kOhm. The wave impedance of the

*line* should be 120 Ohm. Thus, when the line is terminated by 120 Ohm at both ends, there will be no signal reflections at the line ends.

Hans

Reply to
Hans Odeberg

^^^^^^^^^^^

I suspect much can be explained by the phrase "Cable Stub Length" above. For a good ref on CAN bus layout, see

formatting link

The 250 m is what you get when all nodes are attached right next to the bus. When you start allowing stubs of several metres, the nasty old physics problem of reflection starts popping up: The electric signal propagates along the cable as an elecromagnetic wave, at somewhere around 30-70% of the speed of light, all comfortable in its sheltered 120 Ohm environment. Then, all of a sudden, it comes upon a stub. It sees two cables, both with 120 Ohm wave impedance, resulting in a new impedance of 60 Ohm. Unfortunately, when an electromagnetic wave encounters a new impedance, it will be reflected. Part of the wave is sent back towards the transmitter, and part will continue in both main line and stub. The signal that runs in the stub will eventually reach the node. This has a high impedance, so all of the wave is reflected back. When this wave again reaches the stub, there is a new 120->60 Ohm split, so part of the wave that was sent down the stub will pass on down the main line, delayed the few nanoseconds it took to travel down the stub and back. Part of the signal will be reflected back down the stub, and will arrive back at the 120-60 Ohm split a bit later, and so on, and so on.

Thus, after each stub, the signal will consist not only of the original signal, but of "ghost signals", with successively lower amplitudes and larger time delays.

The net effect is that the edges of the pulse train are rounded off, introducing an uncertainty about the timing that must be compensated by reducing the length of the bus.

So: if you want to use the full 250m, keep your stubs really, really short.

Hans

Reply to
Hans Odeberg

Another point to note is that these reflections are double the original voltage and are capable of popping receivers. It should also be noted that it is not the frequency of your signal that affects the reflections but the edge rate (rise time and fall time) of the signal. By definition a high frequency signal will have a high edge rate but not all drivers are the same and the cheaper older ones often have a slower edge than the latest and greatest thing, reducing the transmission line effects and thus allowing a longer cable run.

Reply to
Tom

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.