Get Current over CAN is always 0


I am trying to read the current being drawn by the motors over CAN, but the bus current is always reported as zero (0). I am able to decode the bus voltage fine from the same CAN message.

CAN is otherwise working fine. I am able to set limits, setpoints, read encoder positions and velocities, etc. So it’s most definitely not an issue with CAN.

To repro:

  • Set an axis into any closed loop control mode (need to get it moving for it to draw any current). I have tried setting it to torque control mode and locking the motor, or to velocity control and adding friction to the motor.
  • Send message GET_BUS_VOLTAGE_CURRENT (0x017) over CAN to the desired axis.
  • Decode the 4 bytes starting from byte 0 into the bus voltage value (this works fine)
  • Decode the 4 bytes starting from byte 4 into the bus current value (this does not work).

Note that the decoding process is exactly the same as that for encoder_position and encoder_velocity, which I am able to do successfully.

Could it be that the ibus_ value is not set properly when populating the CAN message in the ODrive firmware? And the message being sent from the ODrive is in fact 0?

This bug was fixed a while ago, what board and what firmware are you on?

Thanks for the quick reply, wasn’t aware of the fix in the new firmware. I’ll update and report back. Feel free to mark as closed :slight_smile: