Author Topic: CANBUS  (Read 3658 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark SomTopic starter

  • Newbie
  • Posts: 1
  • Country: us
CANBUS
« on: October 16, 2020, 10:47:57 am »
Hello, I read that the higher the communication speed, the shorter the cable is required. What are the reasons for this relationship? Is it because of stability like the higher the speeds, the easier the data get corrupted or distorted so we need shorter cable to reduce the chance of such problem?
เว็บแทงบอลบนมือถือฝากถอนauto
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: CANBUS
« Reply #1 on: October 16, 2020, 11:00:40 am »
It's due to the propagation delay of the cable, i.e. how long it takes for the signal to travel from the transmitter to the receiver.  The longer the cable, the longer it takes for the signal from the transmitter, to reach the receivers. CANBUS is a synchronous network, so all of the receivers need to pick up the signal in one clock cycle, so the longer, the cable, the longer the minimum cycle lengh needs to be, which corresponds to a lower speed.

Disclaimer: I've not actually used CANBUS before. This is just my basic understanding of how it works.
 
The following users thanked this post: joseph nicholas

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: CANBUS
« Reply #2 on: October 16, 2020, 01:56:22 pm »
CANBUS arbitration uses open drain or collector outputs and depends on the transmitter being able to see that another node is pulling the signal down within one bit time, so there is a maximum distance between nodes.
 

Offline GlennSprigg

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
Re: CANBUS
« Reply #3 on: October 17, 2020, 12:11:18 pm »
Hello Mark.
I know nothing of such devices, but as it's your first post,
I'm just saying 'Hi' from Australia!  ;D
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 
The following users thanked this post: Ed.Kloonk

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 2757
  • Country: ca
Re: CANBUS
« Reply #4 on: October 18, 2020, 06:43:11 am »
I think capacitance plays a role too, the longer the cable the more capacitance it has, so the longer it takes to "charge up" to the desired voltage and then "discharge".  That means you need to give more time between each pulse of data.    At least that's my understanding of it, someone correct me if I'm wrong.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: CANBUS
« Reply #5 on: October 18, 2020, 06:59:28 am »
You can indeed model the cable as a combination of dozens of inductances in series and dozens of capacitors in parallel, but at some point, it will be just easier to understand using transmission line theory. This happens when the cable is long enough so that you can actually consider the time of signal propagation at some 200 000 000 m/s. While this sounds very fast, it is only 200 m / µs. At 1 Mbaud/s, maximum for traditional CAN, 200 meters of transmission line is the time of one full bit already!

Now if you think about having to do a full round-trip, and settle well below one bit time for successful arbitration, you are going to see why the bus length is limited to 40m; just from the simple speed calculation alone, no need to think about capacitances.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: CANBUS
« Reply #6 on: October 18, 2020, 09:37:59 am »
You can indeed model the cable as a combination of dozens of inductances in series and dozens of capacitors in parallel, but at some point, it will be just easier to understand using transmission line theory. This happens when the cable is long enough so that you can actually consider the time of signal propagation at some 200 000 000 m/s. While this sounds very fast, it is only 200 m / µs. At 1 Mbaud/s, maximum for traditional CAN, 200 meters of transmission line is the time of one full bit already!

Now if you think about having to do a full round-trip, and settle well below one bit time for successful arbitration, you are going to see why the bus length is limited to 40m; just from the simple speed calculation alone, no need to think about capacitances.
Just looking at capacitance, implies you can increase the speed simply by reducing the resistance, up to the point of infinity. Inductance is also important and because it's evenly distributed with capacitance, we treat it as a transmission line.
 
The following users thanked this post: 4cx10000, Siwastaja

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: CANBUS
« Reply #7 on: October 19, 2020, 10:35:51 pm »
Cable capacitance only matters if the ends are not terminated into the characteristic impedance of the cable.
 

Online AndersJ

  • Frequent Contributor
  • **
  • Posts: 415
  • Country: se
Re: CANBUS
« Reply #8 on: October 20, 2020, 06:04:45 am »
Cable capacitance only matters if the ends are not terminated into the characteristic impedance of the cable.

Please discuss this further.
I don’t understand.
"It should work"
R.N.Naidoo
 

Offline filssavi

  • Frequent Contributor
  • **
  • Posts: 433
Re: CANBUS
« Reply #9 on: October 20, 2020, 08:01:36 am »
The propagation delay in itself have nothing to do with it unless you plan to somehow run canbus at GHz speed :-DD

The two problems you have with wire length are capacitive loading and transmission line effects

- since drivers in the transceivers have a limited current driving ability (usually few amps at most) the longer cable with the higher capacitance will slow down edges, if you go too far you will have reception problems

-if the line is long enough to be bigger than 1/10 of the wavelength (rule of thumb) the cable will not behave as as quasi-ideal conductor but as a full blown transmission line, with all the wacky and wonderful effects that this brings about (this condition is difficult to have in practice in standard systems, as you run into capacitance problems well before it)
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: CANBUS
« Reply #10 on: October 20, 2020, 10:31:09 am »
The propagation delay in itself have nothing to do with it unless you plan to somehow run canbus at GHz speed :-DD

Of course it has to do with it, as I showed with a simple calculation.

In order to your ":-DD" claim to be meaningful, you would need the signal to travel well over the speed of light which is, AFAIK, still very much impossible, but feel free to show otherwise, you'll be rich!
 

Online AndersJ

  • Frequent Contributor
  • **
  • Posts: 415
  • Country: se
Re: CANBUS
« Reply #11 on: October 21, 2020, 04:20:27 am »
Cable capacitance only matters if the ends are not terminated into the characteristic impedance of the cable.

How can added capacitance NOT affect signal integrity?
In particular during recessive bits when the terminators pull CAN-L and CAN-H together.
"It should work"
R.N.Naidoo
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5050
  • Country: si
Re: CANBUS
« Reply #12 on: October 21, 2020, 04:47:04 am »
The propagation delay in itself have nothing to do with it unless you plan to somehow run canbus at GHz speed :-DD

The two problems you have with wire length are capacitive loading and transmission line effects

- since drivers in the transceivers have a limited current driving ability (usually few amps at most) the longer cable with the higher capacitance will slow down edges, if you go too far you will have reception problems

-if the line is long enough to be bigger than 1/10 of the wavelength (rule of thumb) the cable will not behave as as quasi-ideal conductor but as a full blown transmission line, with all the wacky and wonderful effects that this brings about (this condition is difficult to have in practice in standard systems, as you run into capacitance problems well before it)

It is actually the propagation delay!

The signals remain pretty intact over long cables due to it being a differential transmission line. The CAN transceiver doesn't see all of the cables capacitance across its pins, it mostly sees the 120 Ohm characteristic impedance of those twisted pairs. For this reason it does not need amps of drive current to drive it fast. Only a part of the cable is charged up at any moment as the signal propagates down it, being limited by self inductance. Since it is behaving like a transmission line the CAN nodes also have termination resistors inside them to avoid signal reflections.

The actual problem with long cables on CAN comes from the bus arbitration process. At the start of each packet the address is sent out, if multiple CAN nodes transmit this address the logic OR nature of the bus makes the address with more 1s win arbitration. To additionally confirm this there is an acknowledge bit after it that is surrounded by bus inactive state. This acknowledge bit is sent out by other devices listening on the bus. So this means that if the propagation delay between two devices is larger than 1 bit time that acknowledge bit arrives 1 bit too late and this is seen as a error (Since now that far away device is out of sync) and the rest of the packet transmission is aborted by transmitting a error condition on purpose in order to get all other devices to stop listening too. The CAN protocol requires all nodes to be in sync for the arbitration to work correctly and this ensures it doesn't continue if they happen to de-sync for any reason.

So at 1Mbit this bit time is 1us. this determines the maximum propagation delay, but due to timing tolerance and transceiver propagation delay lets say 0.75us is what we need. Most copper cable is around 2/3 the speed of light so 0.75us*300Mm/s*(2/3) = 150m . But the signal needs to go there and back, so take half of that and you get 75m max with ideal conditions. But you would want to take some headroom so that you are not running on the edge so about half that would be practically usable in an actual CAN bus installation.

Ethernet deals with this problem by having separate RX and TX lines while things like GSM or Cable DSL modems deal with it by measuring the propagation delay and transmitting too early on purpose to compensate for it.
 
The following users thanked this post: Siwastaja

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: CANBUS
« Reply #13 on: October 21, 2020, 07:41:54 am »
Cable capacitance only matters if the ends are not terminated into the characteristic impedance of the cable.

Please discuss this further.

If the cable is properly terminated with a resistive load into its characteristic impedance, then it appears as a resistive load at all frequencies; the distributed capacitance and inductance cancel out to make a resistive load at all frequencies.

If the cable is unterminated, then it appears as a capacitive or inductive load depending on frequency.  In the common case where the end is open, it appears capacitive at low frequencies with a time constant RC from the series resistance of the driver and total capacitance of the cable which depends on cable length.  What is actually happening is the reflections bouncing back and forth charge the cable in steps, with each step lasting for a duration equal to the propagation time through the cable.  When the cable is properly terminated, then the reflections are absorbed and this never happens.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: CANBUS
« Reply #14 on: October 21, 2020, 08:10:36 am »
The actual problem with long cables on CAN comes from the bus arbitration process. At the start of each packet the address is sent out, if multiple CAN nodes transmit this address the logic OR nature of the bus makes the address with more 1s win arbitration.

Just to expand on this, during arbitration when the CAN transceiver is sending a 1, it watches for another transceiver sending a 1, and the propagation delay needs to be short enough for this to happen between the two nodes furthest from each other.

The CAN bus transceivers are able to watch the bus during the transmission of a 1 because that is when the driver output is disabled.

Quote
Ethernet deals with this problem by having separate RX and TX lines while things like GSM or Cable DSL modems deal with it by measuring the propagation delay and transmitting too early on purpose to compensate for it.

Half duplex Ethernet on shared media, coaxial cable or twisted pair with a hub, watches for a collision of the entire packet instead of bit period, and arbitration is handled with a randomized back-off time.
« Last Edit: October 21, 2020, 08:13:59 am by David Hess »
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1764
  • Country: us
Re: CANBUS
« Reply #15 on: October 21, 2020, 08:53:15 pm »
Here's a real-world data point: My weather station mounted on a radio tower sends sensor readings via CAN to my house over 178 feet of terminated CAT-5 twisted pair cable. It runs reliably at 500 kbps, but not at 1 mbps.
"That's not even wrong" -- Wolfgang Pauli
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: CANBUS
« Reply #16 on: October 22, 2020, 07:38:54 am »
Here's a real-world data point: My weather station mounted on a radio tower sends sensor readings via CAN to my house over 178 feet of terminated CAT-5 twisted pair cable. It runs reliably at 500 kbps, but not at 1 mbps.

Exactly as expected; it's just beyond the recommended 40m, but not so long it would be 100% impossible. It would be interesting to see if you could make it barely work by adjusting the CAN bit timing, especially the sampling point which is typically somewhere around 80% of the bit time but you could make it a bit later, to prove the point re propagation delays.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: CANBUS
« Reply #17 on: October 22, 2020, 06:30:40 pm »
The propagation delay in itself have nothing to do with it unless you plan to somehow run canbus at GHz speed :-DD
Are you confusing logic gate propagation delay, with that of the cable? Theoretically, 1GHz speed CAN would only work over 20cm, so practical purposes would be confined to the same small piece of equipment, perhaps just a single PCB. I doubt you can get line drivers which are fast enough and comply with the standard, but it's possible to make something like CAN, which works at that speed. If you need to transfer data that quickly over a PCB, there are far superior alternatives.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8526
Re: CANBUS
« Reply #18 on: October 23, 2020, 01:54:04 am »
If the cable is unterminated, then it appears as a capacitive or inductive load depending on frequency.  In the common case where the end is open, it appears capacitive at low frequencies with a time constant RC from the series resistance of the driver and total capacitance of the cable which depends on cable length.  What is actually happening is the reflections bouncing back and forth charge the cable in steps, with each step lasting for a duration equal to the propagation time through the cable.  When the cable is properly terminated, then the reflections are absorbed and this never happens.
Used to advantage in https://en.wikipedia.org/wiki/Reflected-wave_switching
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf