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
-
Turn on the ODrive. Move the motors by hand (to show that the motors are not at 0 position)
-
Listen on CAN for position and velocity messages (default every 10ms, although I have changed this and it has produced the same result).
-
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.
-
All other messages (e.g. voltage and current measurements) are as expected.
-
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.
-
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!