I’m having trouble to find a way to convert the torque I input into Odrive to the real-life torque and force, due to the effects of controller.config.vel_limit
. I’m using D5065 motor, I have set the torque constant to 8.23/270 as per the guide. However, the output torque is highly affected by the vel_limit
for some reason. Like if I input 0.5 as input_torque
with a vel_limit
of 1, I’m having 0.5 Kg of force on my 50mm radius pulley. But when I keep the same torque value, and increase the vel_limit
to 1 or higher, I’m getting 1 Kg, or even 3+ Kg at vel_limit
of 2.
How should I set the vel_limit
so the input torque matches the output torque real-life, without making the motor goes insanely fast as I’m having a high weight on it. Theoretically speaking the motor should have higher torque on lower velocities correct?
a snippet of the code is below:
vel_lim = 0.5
odrv0.axis0.controller.config.vel_limit = vel_lim + (vel_lim*0.5)
odrv0.axis1.controller.config.vel_limit = vel_lim + (vel_lim*0.5)
odrv1.axis0.controller.config.vel_limit = vel_lim + (vel_lim*0.5)
odrv1.axis1.controller.config.vel_limit = vel_lim + (vel_lim*0.5)
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv1.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv1.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv1.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv1.axis1.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
odrv0.axis1.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
odrv1.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
odrv1.axis1.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
torque_const = 8.23 / 270
odrv0.axis0.motor.config.torque_constant = torque_const
odrv0.axis1.motor.config.torque_constant = torque_const
odrv1.axis0.motor.config.torque_constant = torque_const
odrv1.axis1.motor.config.torque_constant = torque_const
#Set torque of each motor
tor = 0.05
odrv0.axis0.controller.input_torque = tor
odrv0.axis1.controller.input_torque = tor
odrv1.axis0.controller.input_torque = tor
odrv1.axis1.controller.input_torque = tor