Author Topic: CAN wiring needs twisted pair or not  (Read 13695 times)

0 Members and 1 Guest are viewing this topic.

Offline snarkysparkyTopic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
CAN wiring needs twisted pair or not
« on: May 04, 2018, 05:37:58 pm »
I am working with some equipment that is communicating over CAN BUS at 1Mbit per second.  There are three CAN buss pairs in a bundle of 200 loose wires going a distance of around 30 feet.

So the can pairs are not fixed to each other and are located wherever fate has placed them.  The system seems to operate but there are relatively frequent
erratic behavior.

The end devices have no diagnostic info available as standard outputs that can be monitored.

I though can pairs should be at least twisted together and probably shielded but others say it isn't a problem, even at 30 ft of wire length.

Please contribute your thoughts on whether this needs rewiring with proper twisted pair controlled impedance wiring.

Thanks







 
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17575
  • Country: lv
Re: CAN wiring needs twisted pair or not
« Reply #1 on: May 04, 2018, 05:46:05 pm »
It must be twisted and need termination resistors on the ends as well.
 

Offline snarkysparkyTopic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: CAN wiring needs twisted pair or not
« Reply #2 on: May 04, 2018, 06:12:05 pm »
wraper,

That is what I think but i have untold countless people advising me that it doesn't matter.

A link to some supporting material would help me.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: CAN wiring needs twisted pair or not
« Reply #3 on: May 04, 2018, 06:49:46 pm »
Quote
A link to some supporting material would help me.

https://en.m.wikipedia.org/wiki/CAN_bus

Quote
All nodes are connected to each other through a two wire bus. The wires are a twisted pair with a 120 Ω (nominal) characteristic impedance.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17575
  • Country: lv
Re: CAN wiring needs twisted pair or not
« Reply #4 on: May 04, 2018, 07:55:13 pm »
Those people are idiots.
http://www.ti.com/lit/an/slla270/slla270.pdf

Quote
The High-Speed ISO 11898 Standard specifications are given for a maximum signaling rate of 1 Mbps
with a bus length of 40 m and a maximum of 30 nodes. It also recommends a maximum un-terminated
stub length of 0.3 m. The cable is specified to be a shielded or unshielded twisted-pair with a 120-Ω
characteristic impedance (ZO). The Standard defines a single line of twisted-pair cable with the network
topology as shown in Figure 6. It is terminated at both ends with 120-Ω resistors, which match the
characteristic impedance of the line to prevent signal reflections. According to ISO 11898, placing RL on a
node should be avoided since the bus lines lose termination if the node is disconnected from the bus.

Quote
Although unshielded 120-Ω cable is used in many applications, data transmission circuits employing CAN
transceivers are used for jobs requiring a rugged interconnection with a wide common-mode voltage
range. Therefore, shielded cable such as Belden Cable 3105A is recommended in these electronically
harsh environments.
« Last Edit: May 04, 2018, 07:59:36 pm by wraper »
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1322
  • Country: gb
    • bitdynamics
Re: CAN wiring needs twisted pair or not
« Reply #5 on: May 04, 2018, 08:23:41 pm »
At 1mbps you are at the very top end of (normal) CAN data bit rate.  (CAN FD and Flexray go faster, but we are talking std CAN 2.0b here)

This means that timing is everything, and hence bus impedance IS important!

At say just 100kbaud, then sure, CAN will probably work over just about anything, you could probably get it to work over some wire coat hangers twisted together, but at 1mbps, er, nope, you will need to have  a robust bus.

The topology of your bus also matters, with the distribution and length of each spur being critical to avoid bit reflections resulting in bit errors.  And of course, the higher the effective capacitance of the bus, the slower it transistions, creating rounded corners to the bits. Again, at 100kbaud, probably un-important, at 1Mbaud, VERY important.

You may also need to check the SJW (Synchronous Jump Width)  clock correction settings for your nodes to ensure that small timing drifts in the nodes does not result in bit errors.

Do you need to run at 1Mbaud?  Unless you require a high data rate (CAN 2.0b is never that high, as the payload per message is just 8 bytes of course) then slowing things down will give you a significant improvement in robustness...
 

Offline lem_ix

  • Regular Contributor
  • *
  • Posts: 192
  • Country: cs
Re: CAN wiring needs twisted pair or not
« Reply #6 on: May 04, 2018, 09:11:49 pm »
On your desk between dev boards it'll work without twisting, termination, gnd wire and in star configuration even, all of which are not recommended. But that's not really a realistic scenario is it :palm:
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1561
  • Country: gb
Re: CAN wiring needs twisted pair or not
« Reply #7 on: May 04, 2018, 09:31:18 pm »
Something I've always wondered about with regard to the twisted pair wiring CAN should have, is the exact nature of the twisted pairs. Is there a defined specification for how the twists should be formed - that is, number of twists per metre?

I'm sure I remember seeing once or twice that ethernet CAT5/6/etc has a specification for twists/metre, but I don't recall ever coming across a similar specification for CAN wiring.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17575
  • Country: lv
Re: CAN wiring needs twisted pair or not
« Reply #8 on: May 04, 2018, 10:04:37 pm »
I'm sure I remember seeing once or twice that ethernet CAT5/6/etc has a specification for twists/metre, but I don't recall ever coming across a similar specification for CAN wiring.
I did not dig into this. But Ethernet works at much higher frequencies, so it is more critical.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22315
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: CAN wiring needs twisted pair or not
« Reply #9 on: May 04, 2018, 10:24:19 pm »
So the can pairs are not fixed to each other and are located wherever fate has placed them.  The system seems to operate but there are relatively frequent
erratic behavior.

Therein lies your proof.

Yes, a bus monitor would be a good idea.  These should exist, I don't know any offhand.  Look around?


That is what I think but i have untold countless people advising me that it doesn't matter.

Tell them to fix it for you.  When they give up, replace the run with STP and throw the old wires in their faces.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: CAN wiring needs twisted pair or not
« Reply #10 on: May 04, 2018, 11:45:21 pm »
Look at the receiving end with an oscilloscope and check for reflections.

What is the nature of the signals in the other conductors? If anything is high-speed or high-voltage it will couple into the CAN lines. That is one place where the twisted pair would help.

Industrial CAN communication cables that carry DC power usually have the power pair twisted and screened, with the CAN lines twisted in a separate screen, all of which is then in yet another screen or braid with a drain.
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: CAN wiring needs twisted pair or not
« Reply #11 on: May 04, 2018, 11:50:31 pm »
This place:

https://vector.com/vi_index_en.html

has a CAN analysis package, but I'm not personally that familiar with it. I don't know if it does signal integrity analysis.
 

Offline snarkysparkyTopic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: CAN wiring needs twisted pair or not
« Reply #12 on: May 05, 2018, 02:12:31 am »
Thanks all for informative replies.

I do have a laptop with canalyser installed and the needed hardware.  Will try to tap in and log errors.

Watched the CAN high and low signals on the scope this afternoon.  Scope was attached to high and low with a diff channel setup.  The signal looks clean with ringing into about the first 20% of the pulse but otherwise clean....
However the wire bundle with the CAN lines contains many other loads including some PWM driven loads so I suspect there is interference that I could not capture on the scope. 

The symptom of the trouble is lost messages in the receiving device.  And I actually only infer the lost messages due to the device not responding to transmissions. 

Trouble is I don't have any diagnostic interface into either end of the CAN bus.

I have recommended to my management that we replace the loose bundled wire with 120 ohm twisted pair.

thanks to all
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: CAN wiring needs twisted pair or not
« Reply #13 on: May 05, 2018, 03:23:05 am »

Might also want to look at software logic used.
A receiver getting a garbled message should cause transmitter to do a retransmission.

C
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: CAN wiring needs twisted pair or not
« Reply #14 on: May 05, 2018, 05:41:00 am »
canbus does not "need" to be twisted, provided you understand why its heavily recommended,

being a differential bus, it relies on similar amounts of crosstalk and noise hitting both wires, so they cancel out at the termination resistors,

Equally being twisted means there is likely to be no seperation of the conductors (e.g. loose wires as comparison) allowing for less impedance changes, and less length variation.

In situations where both wires are screened inside a shield, most of these concerns are equally met, so in this case, it does not need to be twisted

If you pick 2 random wires out of a large bundle, your seperation likely will vary, and you throw away all the benifits that being differential gains against noise.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: CAN wiring needs twisted pair or not
« Reply #15 on: May 05, 2018, 09:00:43 am »
Quote
Look at the receiving end with an oscilloscope and check for reflections.
How ?
I am not aware of how one sees reflections on an oscilloscope, so please explain.

Quote
I do have a laptop with canalyser installed and the needed hardware.
I use Vector CANAlyser, CANoe and CANape at work as well.
They are protocol analysers, data measurement/analysis, automating/scripting tools.
I do not think they can anaylse signal integrity, other than logging the number of invalid packets.

If you have more than a few bad packets, then yes there may be something not right with the hardware/electrical layer.

You have had plenty of responses here to verify that yes you do need twisted pair with 120 \$\Omega\$ termination.
Both TI and the wikipedia site should have reference to the offical standards for CAN. If you company management do not understand the relevance (or refuse to), then I am affraid you are fighting a loosing battle and it is time to ask "do I want to work for people who do not or refuse to empower engineers to do their work?"
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17575
  • Country: lv
Re: CAN wiring needs twisted pair or not
« Reply #16 on: May 05, 2018, 09:13:56 am »
Quote
Look at the receiving end with an oscilloscope and check for reflections.
How ?
I am not aware of how one sees reflections on an oscilloscope, so please explain.
 
The following users thanked this post: MosherIV

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: CAN wiring needs twisted pair or not
« Reply #17 on: May 05, 2018, 09:21:26 am »
Thanks wraper for clearing that up for me.
I thought you meant there is some magical way to actually see the reflected waveform travelling up/down the cable.

Basically, if the output waveform is not like the one going in, then something is wrong.
Thanks
 

Offline Niklas

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: se
Re: CAN wiring needs twisted pair or not
« Reply #18 on: May 05, 2018, 09:38:13 pm »
We sent 5 samples of a sensor used on trucks and buses to the EMC lab and they all failed on pulse 1 (-600V transient on Battery+). No previous issues on similar sensors, so this should have been just a routine test. I went to the lab to see what was wrong and the sensors started to send error frames as soon as the test began.

If we start at the vehicle connector, we have 4 wires located inside a tight 20 cm long protective tube followed by 5 cm free hanging wire before entering a potted unit. The pinout of the wires where they enter the module was: Battery+, CANH, CANL, 0V.
The fix was easy, twist all 4 wires together to minimize the loops and hence the mutual inductance. After that, the sensors passed all the pulse tests.

The electrical equivalent for the 5 cm free hanging wires is a transformer. Both loops were closed by the filter capacitors on the PCBA. One loop inside the magnet flux from the other loop.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf