CAN Protocol

This document describes the CAN Protocol. For examples of usage, check out our CAN Guide!

Configuring ODrive for CAN

Configuration of the CAN parameters should be done via USB before putting the device on the bus.

To set the desired baud rate, use <odrv>.can.config.baud_rate = <value>.

Each axis looks like a separate node on the bus. Thus, they both have the two properties can_node_id and can_node_id_extended. The node ID can be from 0 to 63 (0x3F) inclusive, or, if extended CAN IDs are used, from 0 to 16777215 (0xFFFFFF). If you want to connect more than one ODrive on a CAN bus, you must set different node IDs for the second ODrive or they will conflict and crash the bus.

Example Configuration

odrv0.axis0.config.can_node_id = 3
odrv0.axis1.config.can_node_id = 1
odrv0.can.config.baud_rate = 500000
odrv0.save_configuration()
odrv0.reboot()

Transport Protocol

We’ve implemented a very basic CAN protocol that we call “CAN Simple” to get users going with ODrive. This protocol is sufficiently abstracted that it is straightforward to add other protocols such as CANOpen, J1939, or Fibre over ISO-TP in the future. Unfortunately, implementing those protocols is a lot of work, and we wanted to give users a way to control ODrive’s basic functions via CAN sooner rather than later.

CAN Frame

At its most basic, a CAN Simple message ID is 11 bits, interpreted as follows:

  • Upper 6 bits - Node ID - max 0x3F

  • Lower 5 bits - Command ID - max 0x1F

For example, an Axis ID of 0x01 with a command of 0x0C would be result in a message ID 0x2C:

can_id = axis_id << 5 | cmd_id

0x01 << 5 | 0x0C = 0x2C

Messages

See the .dbc file for the description of all messages. We recommend the free CANdb++ software from Vector for viewing and editing this database.

CAN Messages

CMD ID

Name

Signals

Start Byte

Bits

Factor

Offset

0x000

Axis0_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x001

Axis0_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x002

Axis0_Estop

0x003

Axis0_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x006

Axis0_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x007

Axis0_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x009

Axis0_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x00b

Axis0_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x00c

Axis0_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x00d

Axis0_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x00e

Axis0_Set_Input_Torque

Input_Torque

0

32

1

0

0x00f

Axis0_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x010

Axis0_Start_Anticogging

0x011

Axis0_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x012

Axis0_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x013

Axis0_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x014

Axis0_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x015

Axis0_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x016

Axis0_Reboot

0x017

Axis0_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x018

Axis0_Clear_Errors

0x019

Axis0_Set_Absolute_Position

Position

0

32

1

0

0x01a

Axis0_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x01b

Axis0_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x01c

Axis0_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x01d

Axis0_Get_Controller_Error

Controller_Error

0

32

1

0

0x01f

Axis0_Enter_DFU_Mode

0x020

Axis1_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x021

Axis1_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x022

Axis1_Estop

0x023

Axis1_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x026

Axis1_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x027

Axis1_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x029

Axis1_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x02b

Axis1_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x02c

Axis1_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x02d

Axis1_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x02e

Axis1_Set_Input_Torque

Input_Torque

0

32

1

0

0x02f

Axis1_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x030

Axis1_Start_Anticogging

0x031

Axis1_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x032

Axis1_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x033

Axis1_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x034

Axis1_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x035

Axis1_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x036

Axis1_Reboot

0x037

Axis1_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x038

Axis1_Clear_Errors

0x039

Axis1_Set_Absolute_Position

Position

0

32

1

0

0x03a

Axis1_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x03b

Axis1_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x03c

Axis1_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x03d

Axis1_Get_Controller_Error

Controller_Error

0

32

1

0

0x03f

Axis1_Enter_DFU_Mode

0x040

Axis2_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x041

Axis2_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x042

Axis2_Estop

0x043

Axis2_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x046

Axis2_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x047

Axis2_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x049

Axis2_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x04b

Axis2_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x04c

Axis2_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x04d

Axis2_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x04e

Axis2_Set_Input_Torque

Input_Torque

0

32

1

0

0x04f

Axis2_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x050

Axis2_Start_Anticogging

0x051

Axis2_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x052

Axis2_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x053

Axis2_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x054

Axis2_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x055

Axis2_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x056

Axis2_Reboot

0x057

Axis2_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x058

Axis2_Clear_Errors

0x059

Axis2_Set_Absolute_Position

Position

0

32

1

0

0x05a

Axis2_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x05b

Axis2_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x05c

Axis2_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x05d

Axis2_Get_Controller_Error

Controller_Error

0

32

1

0

0x05f

Axis2_Enter_DFU_Mode

0x060

Axis3_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x061

Axis3_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x062

Axis3_Estop

0x063

Axis3_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x066

Axis3_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x067

Axis3_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x069

Axis3_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x06b

Axis3_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x06c

Axis3_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x06d

Axis3_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x06e

Axis3_Set_Input_Torque

Input_Torque

0

32

1

0

0x06f

Axis3_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x070

Axis3_Start_Anticogging

0x071

Axis3_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x072

Axis3_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x073

Axis3_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x074

Axis3_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x075

Axis3_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x076

Axis3_Reboot

0x077

Axis3_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x078

Axis3_Clear_Errors

0x079

Axis3_Set_Absolute_Position

Position

0

32

1

0

0x07a

Axis3_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x07b

Axis3_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x07c

Axis3_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x07d

Axis3_Get_Controller_Error

Controller_Error

0

32

1

0

0x07f

Axis3_Enter_DFU_Mode

0x080

Axis4_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x081

Axis4_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x082

Axis4_Estop

0x083

Axis4_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x086

Axis4_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x087

Axis4_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x089

Axis4_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x08b

Axis4_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x08c

Axis4_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x08d

Axis4_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x08e

Axis4_Set_Input_Torque

Input_Torque

0

32

1

0

0x08f

Axis4_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x090

Axis4_Start_Anticogging

0x091

Axis4_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x092

Axis4_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x093

Axis4_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x094

Axis4_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x095

Axis4_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x096

Axis4_Reboot

0x097

Axis4_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x098

Axis4_Clear_Errors

0x099

Axis4_Set_Absolute_Position

Position

0

32

1

0

0x09a

Axis4_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x09b

Axis4_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x09c

Axis4_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x09d

Axis4_Get_Controller_Error

Controller_Error

0

32

1

0

0x09f

Axis4_Enter_DFU_Mode

0x0a0

Axis5_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x0a1

Axis5_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x0a2

Axis5_Estop

0x0a3

Axis5_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x0a6

Axis5_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x0a7

Axis5_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x0a9

Axis5_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x0ab

Axis5_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x0ac

Axis5_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x0ad

Axis5_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x0ae

Axis5_Set_Input_Torque

Input_Torque

0

32

1

0

0x0af

Axis5_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x0b0

Axis5_Start_Anticogging

0x0b1

Axis5_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x0b2

Axis5_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x0b3

Axis5_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x0b4

Axis5_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x0b5

Axis5_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x0b6

Axis5_Reboot

0x0b7

Axis5_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x0b8

Axis5_Clear_Errors

0x0b9

Axis5_Set_Absolute_Position

Position

0

32

1

0

0x0ba

Axis5_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x0bb

Axis5_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x0bc

Axis5_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x0bd

Axis5_Get_Controller_Error

Controller_Error

0

32

1

0

0x0bf

Axis5_Enter_DFU_Mode

0x0c0

Axis6_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x0c1

Axis6_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x0c2

Axis6_Estop

0x0c3

Axis6_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x0c6

Axis6_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x0c7

Axis6_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x0c9

Axis6_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x0cb

Axis6_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x0cc

Axis6_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x0cd

Axis6_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x0ce

Axis6_Set_Input_Torque

Input_Torque

0

32

1

0

0x0cf

Axis6_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x0d0

Axis6_Start_Anticogging

0x0d1

Axis6_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x0d2

Axis6_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x0d3

Axis6_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x0d4

Axis6_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x0d5

Axis6_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x0d6

Axis6_Reboot

0x0d7

Axis6_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x0d8

Axis6_Clear_Errors

0x0d9

Axis6_Set_Absolute_Position

Position

0

32

1

0

0x0da

Axis6_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x0db

Axis6_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x0dc

Axis6_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x0dd

Axis6_Get_Controller_Error

Controller_Error

0

32

1

0

0x0df

Axis6_Enter_DFU_Mode

0x0e0

Axis7_Get_Version

Protocol_Version

Hw_Version_Major

Hw_Version_Minor

Hw_Version_Variant

Fw_Version_Major

Fw_Version_Minor

Fw_Version_Revision

Fw_Version_Unreleased

0

1

2

3

4

5

6

7

8

8

8

8

8

8

8

8

1

1

1

1

1

1

1

1

0

0

0

0

0

0

0

0

0x0e1

Axis7_Heartbeat

Axis_Error

Axis_State

Procedure_Result

Trajectory_Done_Flag

0

4

5

6

32

8

8

1

1

1

1

1

0

0

0

0

0x0e2

Axis7_Estop

0x0e3

Axis7_Get_Error

Active_Errors

Disarm_Reason

0

4

32

32

1

1

0

0

0x0e6

Axis7_Set_Axis_Node_ID

Axis_Node_ID

0

32

1

0

0x0e7

Axis7_Set_Axis_State

Axis_Requested_State

0

32

1

0

0x0e9

Axis7_Get_Encoder_Estimates

Pos_Estimate

Vel_Estimate

0

4

32

32

1

1

0

0

0x0eb

Axis7_Set_Controller_Mode

Control_Mode

Input_Mode

0

4

32

32

1

1

0

0

0x0ec

Axis7_Set_Input_Pos

Input_Pos

Vel_FF

Torque_FF

0

4

6

32

16

16

1

0.001

0.001

0

0

0

0x0ed

Axis7_Set_Input_Vel

Input_Vel

Input_Torque_FF

0

4

32

32

1

1

0

0

0x0ee

Axis7_Set_Input_Torque

Input_Torque

0

32

1

0

0x0ef

Axis7_Set_Limits

Velocity_Limit

Current_Limit

0

4

32

32

1

1

0

0

0x0f0

Axis7_Start_Anticogging

0x0f1

Axis7_Set_Traj_Vel_Limit

Traj_Vel_Limit

0

32

1

0

0x0f2

Axis7_Set_Traj_Accel_Limits

Traj_Accel_Limit

Traj_Decel_Limit

0

4

32

32

1

1

0

0

0x0f3

Axis7_Set_Traj_Inertia

Traj_Inertia

0

32

1

0

0x0f4

Axis7_Get_Iq

Iq_Setpoint

Iq_Measured

0

4

32

32

1

1

0

0

0x0f5

Axis7_Get_Temperature

FET_Temperature

Motor_Temperature

0

4

32

32

1

1

0

0

0x0f6

Axis7_Reboot

0x0f7

Axis7_Get_Bus_Voltage_Current

Bus_Voltage

Bus_Current

0

4

32

32

1

1

0

0

0x0f8

Axis7_Clear_Errors

0x0f9

Axis7_Set_Absolute_Position

Position

0

32

1

0

0x0fa

Axis7_Set_Pos_Gain

Pos_Gain

0

32

1

0

0x0fb

Axis7_Set_Vel_Gains

Vel_Gain

Vel_Integrator_Gain

0

4

32

32

1

1

0

0

0x0fc

Axis7_Get_ADC_Voltage

ADC_Voltage

0

32

1

0

0x0fd

Axis7_Get_Controller_Error

Controller_Error

0

32

1

0

0x0ff

Axis7_Enter_DFU_Mode

Note

  • Messages labeled GET_ are call & response. The Master node sends a message with the RTR bit set, and the axis responds with the same ID and specified payload.

  • The CANopen NMT message is reserved by CANSimple. It is not currently used or implemented.

  • All multibyte values are little endian (aka Intel format, aka least significant byte first).

Cyclic Messages

Cyclic messages are sent by ODrive on a timer without a request. The cycle times can be configured for each axis, see axis.config.can. A cycle time of 0 disables the message.

Watchdog

Each valid CAN message resets the ODrive Watchdog. If CAN communication is disrupted and the watchdog expires, the axis will be put into IDLE. See axis.config.enable_watchdog for more information.

Interoperability with CANopen

You can deconflict with CANopen like this:

  • odrv0.axis0.config.can.node_id = 0x010 - Reserves messages 0x200 through 0x21F

  • odrv0.axis1.config.can.node_id = 0x018 - Reserves messages 0x300 through 0x31F

It may not be obvious, but this allows for some compatibility with CANOpen. Although the address space 0x200 and 0x300 correspond to receive PDO base addresses, we can guarantee they will not conflict if all CANopen node IDs are >= 32. E.g.:

  • CANopen nodeID = 35 = 0x23

  • Receive PDO 0x200 + nodeID = 0x223, which does not conflict with the range [0x200 : 0x21F]

Be careful that you don’t assign too many nodeIDs per PDO group. Four CAN Simple nodes (32*4) is all of the available address space of a single PDO. If the bus is strictly ODrive CAN Simple nodes, a simple sequential Node ID assignment will work fine.