0

Background: I need to set up a CAN bus between different components of an electric UAV (battery management system, motor inverter, autopilot, etc.). My avionics/networking experience up to now includes home networking, RC hobby servos (PWM), and "smart" hobby servos (serial), so I'm familiar with the general process I have to follow in terms of network software (device IDs, baud rates, etc).

Problem: I've never dealt with the idea of "termination". I keep reading something along the lines of "CAN needs 120Ω termination at each device".

This video helps me understand why I need termination, but I'm not sure how to implement that.

Am I supposed to slap a 120c resistor parallel to the CAN_H and CAN_L pins of each device?

OR

Should I measure the impedance of a length of desired wire length and match that impedance?

For example: I need 75 cm of wire between device A and B. I've set CAN bit rate to 250 kbps. I connect 75 cm of wire connected to a signal generator supplying a square wave at 250 kHz and measure an impedance of 75 Ohms. I terminate with a 75Ω resistor.

Followup questions:

  1. Do I need to terminate at both ends of a connection?
  2. Is there a hand-held tool for measuring impedance at a set frequency?
  3. What is the recommended way of connecting a wire branch from the main CAN line to a set device? Solder?
techSultan
  • 446
  • 1
  • 7
  • 23

1 Answers1

2

Not at each device. You're supposed to daisy chain CAN devices so you only need termination at both far ends, preferably a little bit past the last device (rather than slightly in front of it) so the termination is truly at the end.

Do you know how if you pour water into a bucket it splashes? And the faster you pour the more it splashes? Now imagine instead of a bucket it's a big long pipe with a closed end.Why does it splash? Because the water flow abruptly changes due to the bottom of the bucket or pipe. Now instead of a closed end the pipe diameter abruptly changes and narrows.

The water is like electricity, The pipe is like a conductor, the pipe diameter is the characteristic impedance, and the splashes are voltage reflections (and technically the far end of the pipe communicating to the near-end of the pipe that something has changed so the system can react and reach equilibrium).

Pouring faster is like trying to have a faster transition edge. How do you stop the splashing? One way is maybe to make a hole at the far end so that the water flow doesn't abruptly change. That's what a termination basically is (there's more to it and in electricity there's other ways to go about it that don't have mechanical analogs).

It's characteristic impedance that ideally determines the termination values you want, not impedance.

Go read up on transmission lines. Also:

Why does the CAN bus use a 120 ohm resistor as the terminating resistor and not any other value?

DKNguyen
  • 54,733
  • 4
  • 67
  • 153
  • Ok, I understand why I just need a resistor at each end ("terminal") of the BUS. If I'm reading this [site](https://www.kvaser.com/using-termination-ensure-recessive-bit-transmission/) correctly, I **can** use 120Ω terminal resistors if I'm doing high speed (>125 kbps) for any number of nodes on short distance (5-10 m cable). Correct? – techSultan Jun 25 '19 at 19:43
  • 1
    Yes. You can always scope to see if the ringing is acceptable or not and adjust the resistor value. A lot cheaper than getting equipment to measure the line's characteristic impedance, although I do wish those were more common. – DKNguyen Jun 25 '19 at 19:46
  • 1
    It’s not the bit rate that matters but the propagation delay vs rise time. If not matched, the rise time needs to be a 10th of the propagation delay and same for impulse noise down the line. – Tony Stewart EE75 Jun 25 '19 at 21:07