ODrive V3.6 Encoder Position and Velocity == 0 over CAN until it's put in closed loop control

Hi, I am experiencing a bug with encoder positions and velocities over CAN.

Issue
ODrive does not report encoder position and velocities over CAN until Closed loop control is turned on.

Repro Steps

  1. Turn on the ODrive. Move the motors by hand (to show that the motors are not at 0 position)

  2. Listen on CAN for position and velocity messages (default every 10ms, although I have changed this and it has produced the same result).

  3. Notice that there are incoming encoder pos and vel messages, but they contain all 0s in the data field. Other than that, the node ID and the “command” (i.e. message type) are fine, just that the positions and velocities are 0.

  4. All other messages (e.g. voltage and current measurements) are as expected.

  5. Run calibration sequence (I am doing this via CAN, and that works fine). Still after this, the encoder positions and velocities are still reported as 0.

  6. Put the axis state to Closed Loop Control (I am doing this via CAN, and that works fine). The Control Mode can be anything (e.g., position or velocity control). The exact moment the axis goes into Closed Loop Control, the encoder positions and velocities start reporting as non-zero.

Note: The encoder position and velocity are reported properly over UART. If you follow the steps above, while also reading the encoder position and velocity via odrivetool, it will show the correct values at the same time as it shows all 0s over CAN…

Let me know if there is any more info I can provide to make debugging this easier. Thanks!

Hi! What ODrive firmware version are you running? You can check by reporting the output of odrv0.fw_version_major, odrv0.fw_version_minor, odrv0.fw_version_revision

Firmware version: 0.5.6

I upgraded to this recently (can’t remember if I was on 0.5.4 or 0.5.5 before this). I can confirm that this bug was not present in the old firmware version.