How to increase the torque limit?

Hi
When I used CTRL_MODE_CURRENT_CONTROL,
I noticed that there was no current up to the commanded current value.(Fig)


setpoint is commanded current value.

The settings are as follows:

odrv0.axis0.controller.config.pos_gain = 35
odrv0.axis0.controller.config.vel_gain = 0.000325
odrv0.axis0.controller.config.vel_integrator_gain = 0.00075
odrv0.axis0.motor.config.current_lim = 50
odrv0.axis0.motor.config.calibration_current = 20
odrv0.axis0.motor.config.requested_current_range = 20
odrv0.axis0.motor.config.resistance_calib_max_voltage = 5
odrv0.axis0.controller.config.vel_limit = 120000.0

If this setting is used, can the current flow up to 50A ?
What should I change which parameter next ?

Why is requested_current_range set to 20? The default is 60; according to the odrive docs, you raise this to 90 if your current_lim exceeds 60, but there’s no indication about why you would drop the value to 20 and what effect (if any) that has. That said, since you’re experiencing issues around current, it seems to me that your requested_current_range setting might be the problem.

1 Like

I raised it to 60A .
However, the results did not change .
Which other parameters affect it?

Increasing to 80A worked well !
But the motor stopped when switching back and output an error code of ERROR_CURRENT_UNSTABLE .

In addition, the other motor increased the odrv0.axis0.motor.config.requested_current_range to 80A , but no current was flowing to the target value.

What should I do ?

You’re requesting -50A but only getting -30A?

Yes.
I used odrv0.axis0.controller.current_setpoint = -40, but I got -30A.

vel_gain = 0.000325
vel_integrator_gain = 0.00075

Are these too small ?
Or doesn’t it matter in CTRL_MODE_CURRENT_CONTROL?

This is probably not the issue, but It might be scaling back because it is too warm. Can you check the temperatures just to be sure? Or just check if the behaviour is the same after it has had time to cool down.

1 Like

Oh, thanks !
Certainly, the motor was generating heat.
The hot motor does not work well and there is almost no torque.
However it may not be related to the problem at the beginning.

True, it is probably not your issue, but just to be clear for future readers I’ll explain what happens.

When the odrive gets too warm, because you are demanding high currents (>15A continuous is my guess) for an extended amount of time and insufficient/no cooling, the software starts to limit the amount of current it will allow.

Also, look through odrv0.axis0.motor.current_control. It has a number of values that might help.

Thanks to your advice, I understand the reason for the restriction.
I guess max_allowed_current = 30.375 is the cause.

In [1]: odrv0.axis0.motor.current_control
Out[1]:
p_gain = 0.024017401039600372 (float)
i_gain = 55.83380126953125 (float)
v_current_control_integral_d = 0.0 (float)
v_current_control_integral_q = 0.0 (float)
Ibus = 0.0 (float)
final_v_alpha = 0.0 (float)
final_v_beta = 0.0 (float)
Iq_setpoint = 0.0 (float)
Iq_measured = 0.0 (float)
Id_measured = 0.0 (float)
I_measured_report_filter_k = 1.0 (float)
max_allowed_current = 30.375 (float)
overcurrent_trip_level = 33.75 (float)

So, I tried changing its parameter, but I got the following result.
How can I change this?

In [2]: odrv0.axis0.motor.current_control.max_allowed_current = 50

Exception                                 Traceback (most recent call last)
~/.local/lib/python3.7/site-packages/fibre/shell.py in <module>
----> 1 odrv0.axis0.motor.current_control.max_allowed_current = 50
~/.local/lib/python3.7/site-packages/fibre/remote_object.py in _setattr_(self, name, value)
    252                 attr.set_value(value)
    253             else:
--> 254                 raise Exception("Cannot write to property {}".format(name))
    255         elif not object._getattribute_(self, "_sealed_") or name in object._getattribute_(self, "_dict_"):
    256             object._getattribute_(self, "_dict_")[name] = value
Exception: Cannot write to property max_allowed_current

I think max_allowed_current and overcurrent_trip level are driven by
motor.config.current_lim and
motor.config.current_lim_tolerance

I set motor.config.current_lim = 58 and motor.config.current_lim_tolerance = 1.25.
Why is max_allowed_current = 30.375?

Not sure…
What is requested_current_range?

It’s 60.
When I set it 80, I thought the motor worked well but actually it was still max_allowed_current = 30.375.

max_allowed_current is determined by odrv.config.shunt_conductance and odrv.axis.motor.config.requested_current_range. Please check these values.

Where is it ?
I can’t find it .
I use ODrive 56V v3.6 (ODrive control utility v0.4.11) .

error = 0x0000 (int)
armed_state = 0 (int)
is_calibrated = True (bool)
current_meas_phB = 0.1105949878692627 (float)
current_meas_phC = 0.05519634485244751 (float)
DC_calib_phB = 0.27191853523254395 (float)
DC_calib_phC = -0.5587559938430786 (float)
phase_current_rev_gain = 0.012500000186264515 (float)
thermal_current_lim = 272.60174560546875 (float)
get_inverter_temp()
current_control:
  p_gain = 0.02397913858294487 (float)
  i_gain = 48.26555252075195 (float)
  v_current_control_integral_d = 0.0 (float)
  v_current_control_integral_q = 0.0 (float)
  Ibus = 0.0 (float)
  final_v_alpha = 0.0 (float)
  final_v_beta = 0.0 (float)
  Iq_setpoint = 0.0 (float)
  Iq_measured = 0.0 (float)
  Id_measured = 0.0 (float)
  I_measured_report_filter_k = 1.0 (float)
  max_allowed_current = 30.375 (float)
  overcurrent_trip_level = 33.75 (float)
gate_driver:
  drv_fault = 0 (int)
timing_log:
  TIMING_LOG_GENERAL = 0 (int)
  TIMING_LOG_ADC_CB_I = 2470 (int)
  TIMING_LOG_ADC_CB_DC = 13038 (int)
  TIMING_LOG_MEAS_R = 6658 (int)
  TIMING_LOG_MEAS_L = 6666 (int)
  TIMING_LOG_ENC_CALIB = 6982 (int)
  TIMING_LOG_IDX_SEARCH = 0 (int)
  TIMING_LOG_FOC_VOLTAGE = 6930 (int)
  TIMING_LOG_FOC_CURRENT = 0 (int)
config:
  pre_calibrated = True (bool)
  pole_pairs = 20 (int)
  calibration_current = 20.0 (float)
  resistance_calib_max_voltage = 5.0 (float)
  phase_inductance = 2.397913885943126e-05 (float)
  phase_resistance = 0.048265550285577774 (float)
  direction = -1 (int)
  motor_type = 0 (int)
  current_lim = 58.0 (float)
  current_lim_tolerance = 1.25 (float)
  inverter_temp_limit_lower = 100.0 (float)
  inverter_temp_limit_upper = 120.0 (float)
  requested_current_range = 90.0 (float)
  current_control_bandwidth = 1000.0 (float)

I made seriously stupid mistake.
I missed the following sentence in the ODrive document .
“save the configuration and reboot as the gains are written out to the DRV (MOSFET driver) only during startup.”

So I tried to save the configuration and reboot after changing requested_current_range .
It worked well .

Thanks a lot !!!

1 Like