Log in

View Full Version : Terminating Resistor CAN


414cnewq
01-10-2015, 16:25
We are making an offseason bot using the 2014 pdb. How do you connect the 120 ohm terminating resistor (and can you use a resistor of a value higher than 120 ohm)?

TheHolyHades1
01-10-2015, 16:35
Hey,

Assuming you're using this PDB:

http://www.usfirst.org/sites/default/files/uploadedImages/Robotics_Programs/FRC/Game_and_Season__Info/2014/Power_Distribution_Board.pdf

I don't actually see anywhere to hook up a CAN line. The PDB I linked doesn't have current monitoring or anything that would require data being sent back and forth from the roboRIO to the PDB.

That said, the exact mechanism to attach a 120 ohm resistor to the CAN circuit will vary. If you're using a talonSRX, for example, you could simply strip some wire back from each of the lines (green and yellow), and then solder a resistor onto there, with some heat shrink applied around there to prevent shorting.

As for the 120 ohm resistor, I believe that's a requirement. AFAIK it was fairly arbitrarily chosen, but since then it was standardized. The resistor is there to dampen noise, I think. Larger, and the signal itself will be attenuated. Smaller, and the noise will be exaggerated.

Above corrected by the helpful posts below.

GeeTwo
01-10-2015, 17:44
There should be a terminating resistor at each end of the CAN bus. The roboRIO has one built in (see page 9 of the roboRIO user's guide (http://www.ni.com/pdf/manuals/374474a.pdf)), and most 2015 FRC robots used the one built into the PDB. Using an older PDP, you will have to add your own terminator. This is simply a 120Ω resistor is connected to the green wire at one end and the yellow at the other. As this is just provided to make the impedance correct for how the lines are driven, it shouldn't be crucial that it be exactly 120Ω, but I wouldn't just use a 100Ω or 150Ω resistor either. There would certainly be no problem if you put (for example) a 100Ω and a 22Ω resistor in series with each other to make 122Ω.
Physically, I would recommend a few inches of green wire, the resistor(s), and a few inches of yellow wire, then plug this into the empty connectors of the last device on your chain.
Added: In case it wasn't clear, the green and yellow wire aren't important electrically, but they help communicate the purpose of the resistor to the controls team.

ozrien
01-10-2015, 18:08
Typically a CANBus will have 120Ω across CANH and CANL at each of the ends. This gives a measured 60Ω between CANH and CANL (parallel resistors). When the CAN transceiver in a CAN node drives dominant (logic 0) the transceiver provides high and low voltage across the termination resistors.

Using smaller than 120Ω means the total bus resistance would be less than 60Ω, causing the transceivers have to source more current (outside what they are spec'd). So I would stick to 120Ω if you can help it.

For bench top use, if your bus is short (like a couple feet or less) you can probably get away with just one side terminated. But since you are building a bot you should probably not skimp on the bus termination.

If the end of the chain is a PCM you can just insert the resistor into the empty weidmuller pair, like GeeTwo recommends.

If the end of the chain is a Talon you can wire/solder/or use an extra CAN connector to insert the final resistor.

Checkout section 1.3.2 in the Talon's SRX User's Guide for a diagram.
http://www.ctr-electronics.com/talon-srx.html#product_tabs_technical_resources

Extra CAN connectors...
http://www.ctr-electronics.com/adaptors/can-connector-5-pack.html

Alan Anderson
01-10-2015, 20:28
The terminator resistor value is not arbitrary. It's chosen to match the "characteristic impedance" of the CAN bus wiring. If the impedances do not match, some of the high-frequency signal will be reflected at the end of the bus. Reflected signals interfere with signals sent later. This Stack Exchange question (http://electronics.stackexchange.com/questions/55389/why-does-the-can-bus-use-a-120-ohm-resistor-as-the-terminating-resistor-and-not) has some good answers.

Of course, the CAN wiring used in an FRC robot isn't exactly standardized, so the value is more of a good idea than a perfect number.

TheHolyHades1
02-10-2015, 11:36
The terminator resistor value is not arbitrary. It's chosen to match the "characteristic impedance" of the CAN bus wiring. If the impedances do not match, some of the high-frequency signal will be reflected at the end of the bus. Reflected signals interfere with signals sent later. This Stack Exchange question (http://electronics.stackexchange.com/questions/55389/why-does-the-can-bus-use-a-120-ohm-resistor-as-the-terminating-resistor-and-not) has some good answers.

Of course, the CAN wiring used in an FRC robot isn't exactly standardized, so the value is more of a good idea than a perfect number.

Alan, when I said "arbitrary" I was referring to this statement in the very link you posted:

Why it's 120 is simply a function of the design limited by physical size. It isn't specifically important which value they picked within a broad range (for example, they could have gone with 300 Ohms). However, all devices in the network have to conform to the bus impedance, so once the CAN standard was published there can be no more debate.

Apologies for the ambiguity.

Alan Anderson
02-10-2015, 13:17
Alan, when I said "arbitrary" I was referring to this statement in the very link you posted:

If you study the rest of the words on that page, I hope you'll see why calling it arbitrary, even in scare quotes, is simply wrong.

That incorrect statement was made in only one of the three answers. Because it was corrected by a comment on that answer, I didn't think it necessary to warn anyone following the link to disregard it. The truth remains that it is not arbitrary at all. The other two answers both explained succinctly why 120 ohms is the proper value.

TheHolyHades1
02-10-2015, 16:08
If you study the rest of the words on that page, I hope you'll see why calling it arbitrary, even in scare quotes, is simply wrong.

That incorrect statement was made in only one of the three answers. Because it was corrected by a comment on that answer, I didn't think it necessary to warn anyone following the link to disregard it. The truth remains that it is not arbitrary at all. The other two answers both explained succinctly why 120 ohms is the proper value.

Got it. Thanks again for correcting me - I've modified the original post.

ozrien
04-10-2015, 13:50
Just backing up Alan's post with some screenshot captures from the Dual Wire CAN bus spec. Seems like every couple months there is a post asking where these numbers come from - a good question.

Using two term resistors that matches this spec...
www.ctr-electronics.com/downloads/images/canbus/termRes.png (https://www.ctr-electronics.com/downloads/images/canbus/termRes.png)
...to match the typical characteristic impedance of twisted pair...
www.ctr-electronics.com/downloads/images/canbus/physMedSpec.png (https://www.ctr-electronics.com/downloads/images/canbus/physMedSpec.png)
...gives us a termination at each end that matches the bus impedance. This gives us the sufficiently good signal quality by reducing signal reflections.

So to wrap up: stick to 120Ω if you are terminating the bus yourself. One end of the resistor is common to green (CANL) and the other end to yellow(CANH). The resistor should be physically at the end of the bus.

Al Skierkiewicz
05-10-2015, 08:21
To back up Alan and Oz, the termination of the CAN bus has more to do with transmission line theory than anything else. A typical twisted pair of #22 wire with approx. 1/3 turn per inch has a stable impedance (above 1 kHz) of about 60 ohms. As the bus can have several receivers and transmitters, it is not practical to treat this system with matched sources and loads so the transmission line is terminated at each end with a nominal 120 ohm resistor. The receivers and transmitters then present a high impedance to the line (except when transmitting data). As the bus length is typically much less than 1/10 wavelength of the highest frequency, the two resistors do appear to properly terminate the line in 60 ohms. By terminating the line in it's characteristic impedance, reflections at each end are reduced and the overall signal degradation is minimized. The greatest problems we see in the field with teams using CAN is the improper termination resistors and failure to properly install the resistors. The ability to use the termination on the PDP, while it may not directly fit your design, is perhaps the best method to prevent termination problems from affecting your operation.

GeeTwo
05-10-2015, 22:08
To back up Alan and Oz, the termination of the CAN bus has more to do with transmission line theory than anything else. A typical twisted pair of #22 wire with approx. 1/3 turn per inch has a stable impedance (above 1 kHz) of about 60 ohms.

There's a bit more good info here than just how to pick a terminating resistor. While it's always best to keep any wire run as short as possible, there may come a day when you want to use CAN cable runs that are longer than the motor controller pigtails. When you do, try to match those same size and twist count specs as they use. An easy place to find 20-24 AWG pairs with 3-4 twists per foot is in a CAT3 cable; these are mostly easily found as telephone station wire. Matching the diameter is also about not reflecting signals, and the twists serve to reduce the size of the "loop antenna" which causes parallel runs of data cable to radiate signals out, and accept other signals in. (Don't untwist your motor controller CAN cables.) Finally, to minimize reflections, use connectors designed for approximately #22 wire - do not use power connectors like Andersons or Molex.

Rina
06-10-2015, 12:23
I am looking for help with a resistor that matches this specifications, thank you
https://www.mrosupply.com/tools/hydraulic-tools/1980135_spx-8-0038_spx-power-team/

Al Skierkiewicz
06-10-2015, 13:44
Rina,
You can buy these from Digikey, Mouser or any supplier you normally buy from. You are looking for a metal film or carbon film 120 ohm, 1/4 watt resistor. Digikey 120QTR-ND (http://www.digikey.com/product-detail/en/CFR-25JR-52-120R/120QTR-ND/11952) are 10 cents a piece. You may even find them at Radio Shack. The hard part is meeting minimum order. I like Digikey because they have always been a reliable company and they support First in Minnesota.

CortEnis
21-10-2015, 13:46
According to my experience the CANBus will have 120Ω across CANH and CANL at each of the ends.
This gives a measured 60Ω between CANH and CANL.
When the CAN transceiver in a CAN node drives dominant the transceiver provides high and low voltage across the termination resistors.
For bench top use, if your bus is short you can probably get away with just one side terminated.

GeeTwo
21-10-2015, 20:13
According to my experience the CANBus will have 120Ω across CANH and CANL at each of the ends.
This gives a measured 60Ω between CANH and CANL.
When the CAN transceiver in a CAN node drives dominant the transceiver provides high and low voltage across the termination resistors.
For bench top use, if your bus is short you can probably get away with just one side terminated.

The #1 problem with this setup is that it draws twice as much current as the transceiver is designed to deliver. I would expect it to shorten the transceiver life, at least. The #2 problem is signal reflection from the "open" end. With short runs, the reflected signal level is probably well below the actual signal, and you'll do OK. As the bus gets longer, the difference between the reflected and direct level (that is, the signal to noise ratio) degrades.

Alan Anderson
21-10-2015, 22:13
The #2 problem is signal reflection from the "open" end. With short runs, the reflected signal level is probably well below the actual signal, and you'll do OK. As the bus gets longer, the difference between the reflected and direct level (that is, the signal to noise ratio) degrades.

The relevant measure here isn't amplitude, it's time. A sufficiently short bus will have the reflection swallowed up by the terminated end quickly enough that the signal will not suffer. But if it's just a bit too long, the devices at the opposite end of the bus from the unterminated end can encounter enough interference to lose their ability to communicate.

That goes along with a good heuristic when trying to debug a high-speed bus like CAN: wiring problems near one end of the bus often produce symptoms at the other end.