Iq_setpoint capped out at 10?

Hi,
I can’t seem to get the odrive.axis.motor.iq_setpoint to go higher than ~10.0 during position control.

Everything is working fine except that when I set the axis state to AXIS_STATE_CLOSED_LOOP_CONTROL using position control the axis.motor.iq_setpoint seems to cap out at ±10 even if I continue to increase the position error.

The odrivetool readout from axis.motor at some large position error looks as follows:

odrv0.axis0.motor
Out[131]:
error = 0x0000 (int)
armed_state = 3 (int)
is_calibrated = True (bool)
current_meas_phB = -9.204837799072266 (float)
current_meas_phC = 7.248827934265137 (float)
DC_calib_phB = 0.2616193890571594 (float)
DC_calib_phC = -1.2868441343307495 (float)
phase_current_rev_gain = 0.02500000037252903 (float)
thermal_current_lim = 124.23703002929688 (float)
get_inverter_temp()
current_control:
p_gain = 0.01444556936621666 (float)
i_gain = 32.21977996826172 (float)
v_current_control_integral_d = 0.03880928456783295 (float)
v_current_control_integral_q = -0.4024716317653656 (float)
Ibus = 0.24956266582012177 (float)
final_v_alpha = 0.12881840765476227 (float)
final_v_beta = -0.39056292176246643 (float)
Iq_setpoint = -10.125000953674316 (float)
Iq_measured = -9.832939147949219 (float)
Id_measured = 0.1624072641134262 (float)
I_measured_report_filter_k = 1.0 (float)
max_allowed_current = 60.75 (float)
overcurrent_trip_level = 67.5 (float)
gate_driver:
drv_fault = 0 (int)
timing_log:
TIMING_LOG_GENERAL = 0 (int)
TIMING_LOG_ADC_CB_I = 2494 (int)
TIMING_LOG_ADC_CB_DC = 13030 (int)
TIMING_LOG_MEAS_R = 0 (int)
TIMING_LOG_MEAS_L = 0 (int)
TIMING_LOG_ENC_CALIB = 0 (int)
TIMING_LOG_IDX_SEARCH = 0 (int)
TIMING_LOG_FOC_VOLTAGE = 0 (int)
TIMING_LOG_FOC_CURRENT = 7470 (int)
config:
pre_calibrated = True (bool)
pole_pairs = 7 (int)
calibration_current = 30.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 1.4445569831877947e-05 (float)
phase_resistance = 0.0322197824716568 (float)
direction = 1 (int)
motor_type = 0 (int)
current_lim = 30.0 (float)
inverter_temp_limit_lower = 100.0 (float)
inverter_temp_limit_upper = 120.0 (float)
requested_current_range = 60.0 (float)
current_control_bandwidth = 1000.0 (float)

Note that the axis.motor.config.current_lim is set to 30.0.

I’ve stepped through the axis/motor/controller .cpp source files and see no reason why the motor.effective_current_lim should be less than the motor.config.current_lim.

Am I missing something?
Thanks,
Lewis

Interesting to note - that I can run set_current_setpoint(30) and the motor.iq_setpoint value will match that without issue which is good for my purposes.

But I am still puzzled why position control is unable to set the motor.iq_setpoint higher than 10…

Gah - didn’t look at source-code close enough.

current is indirectly limited by the controller.vel_lim parameter. Upping that allows for higher torque currents during position control.

Seems a bit funny that even under static loads the velocity limit overrides the position error. I would think the velocity limit shouldn’t impact the current unless the measured velocity was actually near it…
Oh well, now I know.

1 Like

Yeah this one is difficult. Do you allow a velocity setpoint higher than the velocity limit? If you do, then limit the current AFTER the velocity controller you end up with integral wind-up if you’re not careful. We recently implemented velocity limiting in current-control mode in a development branch, and maybe it can be used?