CAN wiring needs twisted pair or not - Page 1
Forum section: electronics / projects

author: snarkysparky
author_rank: Frequent Contributor
timestamp: May 04, 2018, 05:37:58 pm
content: 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 frequenterratic 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

author: wraper
author_rank: Unknown
timestamp: May 04, 2018, 05:46:05 pm
content: It must be twisted and need termination resistors on the ends as well.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: May 04, 2018, 06:12:05 pm
content: 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.

author: MosherIV
author_rank: Super Contributor
timestamp: May 04, 2018, 06:49:46 pm
content: Quotehttps://en.m.wikipedia.org/wiki/CAN_busQuote

author: wraper
author_rank: Unknown
timestamp: May 04, 2018, 07:55:13 pm
content: Those people are idiots.http://www.ti.com/lit/an/slla270/slla270.pdfQuoteQuote

author: max_torque
author_rank: Super Contributor
timestamp: May 04, 2018, 08:23:41 pm
content: 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...

author: lem_ix
author_rank: Regular Contributor
timestamp: May 04, 2018, 09:11:49 pm
content: 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

author: HwAoRrDk
author_rank: Super Contributor
timestamp: May 04, 2018, 09:31:18 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: May 04, 2018, 10:04:37 pm
content: Quote from: HwAoRrDk on May 04, 2018, 09:31:18 pmI did not dig into this. But Ethernet works at much higher frequencies, so it is more critical.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 04, 2018, 10:24:19 pm
content: Quote from: snarkysparky on May 04, 2018, 05:37:58 pmTherein lies your proof.Yes, a bus monitor would be a good idea. These should exist, I don't know any offhand. Look around?Quote from: snarkysparky on May 04, 2018, 06:12:05 pmTell them to fix it for you. When they give up, replace the run with STP and throw the old wires in their faces.Tim

author: Tomorokoshi
author_rank: Super Contributor
timestamp: May 04, 2018, 11:45:21 pm
content: 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.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: May 04, 2018, 11:50:31 pm
content: This place:https://vector.com/vi_index_en.htmlhas a CAN analysis package, but I'm not personally that familiar with it. I don't know if it does signal integrity analysis.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: May 05, 2018, 02:12:31 am
content: 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

author: C
author_rank: Super Contributor
timestamp: May 05, 2018, 03:23:05 am
content: Might also want to look at software logic used.A receiver getting a garbled message should cause transmitter to do a retransmission.C

author: Rerouter
author_rank: Super Contributor
timestamp: May 05, 2018, 05:41:00 am
content: 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 twistedIf 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.

author: MosherIV
author_rank: Super Contributor
timestamp: May 05, 2018, 09:00:43 am
content: QuoteHow ?I am not aware of how one sees reflections on an oscilloscope, so please explain.QuoteI 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 120termination.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?"

author: wraper
author_rank: Unknown
timestamp: May 05, 2018, 09:13:56 am
content: Quote from: MosherIV on May 05, 2018, 09:00:43 am

author: MosherIV
author_rank: Super Contributor
timestamp: May 05, 2018, 09:21:26 am
content: 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

author: Niklas
author_rank: Frequent Contributor
timestamp: May 05, 2018, 09:38:13 pm
content: 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.