Hello,
I’m working on a CAN connection between an ODrive (firmware v0.5.6) and a USB-CAN adapter (CH340) via a USB hub. The motor is functioning, but I’m not seeing any frames in candump can0
Hardware Setup:
- ODrive v3.6-56V (firmware v0.5.6)
- USB-CAN adapter (CH340-based, ID 1a86:7523)
- Physical connections: GND, CAN_H, CAN_L between ODrive and USB-CAN adapter
- Linux Ubuntu system with can-utils installed
Hardware Detection
- The PC properly detects the USB-CAN adapter:
lsusb
shows the CH340 (ID 1a86:7523). - The serial port is
/dev/ttyUSB1
ODrive Configuration (via odrivetool):
import odrive
odrv0 = odrive.find_any()
CAN configuration
odrv0.config.enable_can_a = True
odrv0.can.config.baud_rate = 250000
Node ID assignment
odrv0.axis0.config.can.node_id = 0
odrv0.axis1.config.can.node_id = 1
Periodic messages
odrv0.axis0.config.can.heartbeat_rate_ms = 100
odrv0.axis1.config.can.heartbeat_rate_ms = 100
odrv0.axis0.config.can.encoder_rate_ms = 1000
odrv0.axis1.config.can.encoder_rate_ms = 1000
Save and reboot
odrv0.save_configuration()
odrv0.reboot()
Linux CAN Interface Setup:
Load modules
sudo modprobe slcan can can-raw
Configure USB-CAN adapter
sudo slcand -o -c -s5 /dev/ttyUSB0 can0
sudo ip link set down can0
sudo ip link set can0 type can bitrate 250000
sudo ip link set up can0
Verify interface
ip -details link show can0
Shows: bitrate 250000, state UP
Status Verification:
Configuration confirmed
print(odrv0.config.enable_can_a) # True
print(odrv0.can.config.baud_rate) # 250000
print(odrv0.axis0.config.can.node_id) # 0
print(odrv0.axis1.config.can.node_id) # 1
No errors detected
print(odrv0.axis0.error) # 0
print(odrv0.axis1.error) # 0
print(odrv0.can.error) # 0
Problem:
candump can0
shows no messages from ODrive- CAN interface is functional (tested with
cansend can0 123#DEADBEEF
- message appears in candump) - Motor moves when commanded via USB, but no CAN traffic generated
- Both axes remain in IDLE state (current_state = 1)
Questions:
- Does firmware v0.5.6 require specific axis states for CAN message transmission?
- Are there additional CAN configuration parameters I’m missing?
- Should I see heartbeat messages even when axes are in IDLE state?
- Any known compatibility issues with CH340-based USB-CAN adapters?
Additional Notes:
- Motor calibration successful (odrv0.axis1.motor.is_calibrated = True)
- No encoder connected (planning sensorless control)
- Physical CAN bus may need 120Ω termination resistors
Any guidance would be greatly appreciated. The configuration appears correct based on documentation, but no CAN messages are being transmitted from the ODrive.
Thank you for your help!
.