Free shipping on every order. No tariffs or duties to pay at checkout or on delivery.

Wiring a CAN bus for robot joints

By Tolerance Labs engineering team · Updated

Most CAN problems in robots are wiring problems. A bus that works on the bench can fail when the robot moves, heats up or draws full current. This guide covers the physical layer; CAN, CAN FD, EtherCAT or RS485 covers protocols and how many joints fit on one bus.

Topology: one line, short stubs

High-speed CAN, the physical layer defined in ISO 11898-2, expects a linear bus: one twisted pair running from one end to the other, with each node tapped on by a short stub and a terminating resistor at each end. Stars, rings and long branches reflect signals, and reflections corrupt bits at high bit rates.

Allowed stub length shrinks as the bit rate rises. A commonly cited limit at 1 Mbit/s is about 0.3 m per stub. Most joint modules have two CAN connectors, in and out, so the bus passes through each joint and the stub is only the trace inside the module. Use both connectors and daisy-chain the joints instead of splitting the bus with Y-cables.

In a legged robot the usual layout is one bus per leg or per pair of legs, each running from the controller down the limb to the last joint. The controller’s interface sits at one end of the bus, so it must be terminated there.

Termination: 120 Ω at both ends

Each end of the bus needs a 120 Ω resistor between CANH and CANL, matching the cable’s characteristic impedance. Nodes in the middle must not be terminated. Many joints have a switchable terminator; turn it on only in the last joint. Check the bus with a multimeter between CANH and CANL, with power off:

ReadingMeaning
About 60 ΩCorrect: two 120 Ω resistors in parallel
About 120 ΩOne terminator missing
About 40 ΩThree terminators: 120 ÷ 3
About 30 ΩFour terminators: 120 ÷ 4
Open circuitNo termination, or a broken wire
Near 0 ΩCANH shorted to CANL

A missing terminator often works at low bit rates on short cables, then fails at 1 Mbit/s or when the cable grows. A split termination, two 60 Ω resistors in series with a capacitor from their midpoint to ground, typically 4.7 nF, improves noise immunity and is common on better adapters and controllers.

Cable, connectors and power

  • Twisted pair for CANH and CANL, with a characteristic impedance near 120 Ω. Untwisted wires pick up noise from motor phase cables.
  • Shield in electrically noisy robots, especially near separate drivers with long phase leads. Ground the shield at one point unless your grounding scheme says otherwise.
  • High-flex cable where wires cross a moving joint. Ordinary cable fatigues at the bend and fails intermittently; see hollow-shaft joints and cable routing.
  • Power alongside. Many joints take power and CAN through one connector. That keeps wiring short, but the power return current flows next to the signal ground. Keep the pair twisted up to the connector and route it away from motor phase wires.
  • Connectors that lock, rated for the robot’s vibration and mating cycles. Check every maker’s pinout: CANH, CANL and ground are not on the same pins on every joint.

Build cables to a drawing and test each one for continuity, shorts and pinout before it goes into the robot. Size the power conductors as described in power supplies and batteries for robot joints.

Ground reference and isolation

CAN is differential, but the transceivers still need their grounds to stay close together. Classic transceivers tolerate a common-mode range of roughly −2 V to +7 V; many newer parts accept more. Run a ground wire with the pair so every node shares a reference.

Motor current can shift that reference. If the power return also serves as the CAN ground, the drop along it adds to the common-mode voltage. Worked example: 30 A of joint current returning through 1 m of 14 AWG wire, at about 8.3 mΩ per meter, drops 30 × 0.0083 ≈ 0.25 V. That is fine. The same 30 A through a worn connector contact of 50 mΩ drops 30 × 0.05 = 1.5 V, and peak currents during a jump can be several times higher. Size returns and contacts for low drop, and bring returns together at one point.

Isolated transceivers and isolated USB-to-CAN adapters break the ground connection between parts of the system. Use them where grounds can differ by more than the common-mode range: between a lab PC and a robot on its own battery, or between separately powered sections of a robot. The bus side of an isolated node still needs a ground reference shared with the other nodes.

Bit rate, bus length and CAN FD

Every node must see each bit before the sample point, after the signal has crossed the bus and back, because arbitration and acknowledgment depend on all nodes agreeing on each bit. Signals travel at about 5 ns per meter in cable, and transceivers and controllers add their own delay. Commonly cited maximum lengths for classic CAN:

Bit rateTypical maximum bus length
1 Mbit/sAbout 25 to 40 m
500 kbit/sAbout 100 m
250 kbit/sAbout 250 m
125 kbit/sAbout 500 m

Robot buses are rarely more than a few meters long, so length is seldom the limit at 1 Mbit/s. A 3 m bus adds only about 2 × 3 × 5 = 30 ns of round-trip delay to a 1,000 ns bit. Stubs, termination and noise are the limits. All nodes must use the same bit rate and similar sample points, commonly 75 to 87.5% of the bit. A mismatch shows up as error frames that come and go.

CAN FD keeps the arbitration phase at classic rates, often 1 Mbit/s, and switches to a faster data phase, commonly 2 to 5 Mbit/s. At 5 Mbit/s a bit lasts 200 ns, so the wiring margin shrinks.

  • Use transceivers specified for CAN FD at your data rate.
  • Keep stubs shorter than you would at 1 Mbit/s, and avoid them where possible.
  • Enable transmitter delay compensation in each controller at the faster data rates, as its documentation describes.
  • Do not mix in classic CAN 2.0 controllers. They treat FD frames as errors and destroy them with error frames, unless they are specified as FD-tolerant.

Faults and how to find them

Each CAN node keeps a transmit and a receive error counter. Above 127 the node becomes error-passive and stops sending active error flags. When the transmit counter passes 255 the node goes bus-off and stops transmitting until it is reset or recovers. A joint that drops off the bus after a few seconds of motion is usually a node that went bus-off.

SymptomLikely causeCheck
No communication at allWrong bit rate, CANH and CANL swapped, or no terminationResistance, pinout, and bit rate on every node
A lone node retransmits foreverNo other node to acknowledge its framesPower and connection of the other nodes
Errors only at 1 Mbit/s or with all joints connectedMissing or extra termination, long stubsMeasure 60 Ω and remove Y-cables
Errors only when motors draw currentGround shift, or noise from phase wiresCommon-mode voltage on a scope, and a ground wire run with the pair
Errors when a joint movesBroken strand or loose contact at a bendFlex the cable while logging errors
Garbled data from two jointsDuplicate node IDsPower joints one at a time and read their IDs
Late or missing repliesBus load too highBus load on an analyzer, against the budget in the communication guide

Tools: a multimeter for the 60 Ω check, an oscilloscope across CANH and CANL to see ringing and slow edges, and a CAN adapter that reports error frames and counters. With the bus powered and idle, both lines sit near 2.5 V. When a node drives a dominant bit, CANH rises to about 3.5 V and CANL falls to about 1.5 V, about 2 V apart. On Linux, SocketCAN reports each interface’s error state and counters.

Checklist

  • One linear bus per segment, daisy-chained through the joints, with no Y-cables or long stubs.
  • 120 Ω at each end and nowhere else, with 60 Ω measured between CANH and CANL with power off.
  • Twisted pair, high-flex cable at moving joints, locking connectors, and pinouts checked for each maker.
  • Ground wire run with the pair, and isolation where grounds can differ.
  • Same bit rate and sample point on every node, and CAN FD-rated transceivers for FD.
  • Error counters and bus-off events logged during full-power motion.

Browse power and control cables and motor drivers, and compare joints by bus in Robot Parts.

More guides

Not sure what fits? Tell us what you're building.

We procure every part of the robot. Send a sentence or a BOM and we come back with options and a landed quote.

Send a request