Skip to Content

Documentation

Basics of controlling a motor controller via CAN bus*

The CAN bus (Controller Area Network) is a robust, real-time communication protocol, widely used for controlling BLDC, PMSM, or DC motors in the fields of automation, electric vehicles, or robotics.

Its reliability relies on rigorous implementation both at the hardware and protocol levels. Here are the essential points to know for correctly controlling a motor controller via CAN.

1. Bus topology

The CAN bus adopts a linear topology — simple, efficient, and stable:

  • The network consists of a single main segment, connecting all nodes (master, motor controllers, sensors, etc.).

  • Two 120 Ω termination resistors must be placed at both ends of the bus, between CAN_H and CAN_L. They ensure proper impedance matching and prevent signal reflections.

  • Stubs should be as short as possible (ideally < 30 cm) to limit disturbances and ensure signal integrity, especially at high speed.

 Good practice: each intermediate device should be traversed by the bus, not connected via a long stub.

2. Wiring and network length

The choice of cable and adherence to the physical limits of CAN determine the reliability of communication.

  • Use a twisted pair (CAN_H / CAN_L) to minimise electromagnetic interference.

  • Shielding (braid or foil connected to ground on one side only) is highly recommended in industrial or motorised environments.

  • The maximum bus length depends on the transmission speed:

Speed (kbps)Typical maximum length
1,000≈ 40 m
500≈ 100 m
250≈ 250 m
125≈ 500 m
  • Therefore, adjust the speed (baudrate) according to the total length and quality of the wiring.

3. Addressing and ID configuration

Each node on the CAN bus (motor, PLC, sensor…) must have a unique identifier (ID):

  • IDs determine the priority of messages (the lower the ID, the higher the priority).

  • Avoid any address conflict: two nodes must never transmit with the same ID.

  • Configure the communication speed (baudrate) identically for all devices.

  • During initial tests, monitor the CAN error counters (bit error, ACK error, bus-off) to validate network integrity.

An ACK error often indicates a wiring issue, termination problem, or a missing/unconfigured node.

4. Communication protocol and motor control

For controlling motors via CAN bus, the CiA 402 profile (also known as DS402) is the reference.

This protocol, defined by CAN in Automation (CiA), standardises the commands for drives and servomotors.

  • It manages the main control modes:

    • Speed mode

    • Torque mode

    • Position mode

  • The exchanged frames follow a state logic (enable, disable, fault, ready-to-switch-on, etc.).

  • A master node (often an industrial PLC or an embedded microcontroller – MCU) controls the slaves (motor controllers).

  • It is essential to integrate a safety logic:

    • Emergency Stop (E-Stop) wired physically or logically.

    • Software watchdog to detect communication loss and bring the system to a safe state.

 Compliance with CiA 402 facilitates interoperability between products from different manufacturers.

Conclusion

Controlling a motor controller via the CAN bus combines robustness, modularity, and standardisation — provided a few fundamental rules are followed:

linear topology, correct termination, careful wiring, unique IDs, and standardised protocol (CiA 402).

By mastering these basics, the engineer or technician can ensure reliable communication and precise motor control, whether for an industrial machine, a mobile robot, or an electric vehicle.


*: The technical information presented in this article is provided for guidance only. It does not replace the official manuals of the manufacturers. Before any installation, handling, or use, please consult the product documentation and follow the safety instructions. Torque.works cannot be held responsible for inappropriate use or incorrect interpretation of the information provided.