ODrive 5065 with 8:1 Reduction - Velocity Control Issues Due to Gravity

I have the following setup:

  • Motor: ODrive 5065
  • Reduction: 8:1
  • Control: STM32 over CAN
  • Payload: 2kg spinning along a vertical axis
  • Mode: Velocity Control

I’m facing an issue where the motor cannot maintain a consistent velocity in velocity control mode due to gravity.

I’ve tried anticogging with high torque values, but it didn’t seem to work—possibly due to the gearbox. My last resort would be to calculate a torque and write it using the STM32, but I feel that wouldn’t be fast enough.

How can I properly compensate for gravity while maintaining accurate velocity control?

If you know the static torque needed to maintain position hold, you can just write to input_torque, which acts as a feedforward term while in velocity control mode. Note the set_input_vel command also has a field to set the feedforward torque and velocity setpoint simultaneously (ditto with set_input_pos in position control mode).