Torque control not work

I am trying to use odrv0.axis0.controller.input_torque to control my motor, the problem is that whatever Nm that I input, the odrv0.axis0.motor.current_control.Iq_measured and odrv0.axis0.motor.current_control.Iq_setup is around 0.5 A, In my opinion, it should give me a constant number that keeps the motor having Nm that I input, and when I push the motor, the current keeps going up and stop and 1A.
I don’t know the problem is
This is my motor config:


and
controller config:
anticogging:
anticogging_enabled: True (bool)
calib_anticogging: False (bool)
calib_pos_threshold: 1.0 (float)
calib_vel_threshold: 1.0 (float)
cogging_ratio: 1.0 (float)
index: 0 (uint32)
pre_calibrated: False (bool)
axis_to_mirror: 255 (uint8)
circular_setpoint_range: 1.0 (float)
circular_setpoints: False (bool)
control_mode: 1 (uint8)
electrical_power_bandwidth: 20.0 (float)
enable_gain_scheduling: False (bool)
enable_overspeed_error: True (bool)
enable_torque_mode_vel_limit: True (bool)
enable_vel_limit: True (bool)
gain_scheduling_width: 10.0 (float)
homing_speed: 0.25 (float)
inertia: 0.0 (float)
input_filter_bandwidth: 2.0 (float)
input_mode: 1 (uint8)
load_encoder_axis: 0 (uint8)
mechanical_power_bandwidth: 20.0 (float)
mirror_ratio: 1.0 (float)
pos_gain: 18.0 (float)
spinout_electrical_power_threshold: 10.0 (float)
spinout_mechanical_power_threshold: -10.0 (float)
steps_per_circular_range: 1024 (int32)
torque_mirror_ratio: 0.0 (float)
torque_ramp_rate: 0.009999999776482582 (float)
vel_gain: 0.14000000059604645 (float)
vel_integrator_gain: 0.0 (float)
vel_integrator_limit: inf (float)
vel_limit: 1.0 (float)
vel_limit_tolerance: 1.2000000476837158 (float)
vel_ramp_rate: 1.0 (float)

It looks like you did not change the control mode. I haven’t worked with torque mode, but you can try odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL

1 Like

thank you, but iam pretty sure mode 1 is the torque control mode.
image

1 Like

Did you follow these instructions? Control Modes — ODrive Documentation 0.0 documentation

It sounds like you may be experiencing an issue with the current control loop on your oDrive. The input_torque command sets the target torque for the motor, but the actual torque achieved by the motor will depend on the current control loop. The current control loop uses the Iq_measured and Iq_setup values to regulate the current in the motor and achieve the target torque.

There are several factors that can affect the performance of the current control loop. One possible reason for the behavior you are seeing is that the current control loop may not be properly tuned for your motor. The oDrive has several current control parameters that can be adjusted to optimize the performance of the loop for your specific motor.

Another possible reason could be that the motor is not able to achieve the desired torque due to mechanical constraints or other issues. For example, if the motor is not properly loaded or if the load is too heavy, the motor may not be able to achieve the desired torque.

You can try to adjust the current control parameters of the oDrive, such as the Iq_measured and Iq_setup, and also check if the motor is loaded properly and there is no mechanical constrains

Thanks OpenAI