Hi guys ,
I started playing around with my ODrive (v3.6 - 56v, Firmware v0.4.12) recently, and I am getting this ERROR_CURRENT_UNSTABLE when i try to move the motor to a pos_setpoint in AXIS_STATE_CLOSED_LOOP_CONTROL. This happens for smaller positions changes as well(eg-400cpr). When a pos_setpoint command is giving motor starts to rotate at a very high speed and stops. and the error dump give the above error. My setup is as follows - 8308 Motor, AS5047D encoder(ABI interface) and a 6S lipo battery.
My motor,encoder and controller settings are attached below along with the error dump.
I have tried increasing motor current_lim, which caused ERROR_CURRENT_SENSE_SATURATION at some point. And there seem to be no issue with the motor inductance as well because i used to play with this motor few months back without any problems.
Can anyone help me with this problem?
I guess the motor draws a huge amount of current due to high acceleration. Is there a way to limit the acceleration in order to limit the current?
Thanks in advance!!!
Error Dump -
In [14]: dump_errors(odrv0,True)
axis0
axis: Error(s):
ERROR_MOTOR_FAILED
motor: Error(s):
ERROR_CURRENT_UNSTABLE
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
encoder: no error
controller: no error
Axis Config -
In [18]: odrv0.axis0.config
Out[18]:
startup_motor_calibration = False (bool)
startup_encoder_index_search = True (bool)
startup_encoder_offset_calibration = False (bool)
startup_closed_loop_control = False (bool)
startup_sensorless_control = False (bool)
enable_step_dir = False (bool)
counts_per_step = 2.0 (float)
watchdog_timeout = 0.0 (float)
step_gpio_pin = 1 (int)
dir_gpio_pin = 2 (int)
calibration_lockin:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 20.0 (float)
vel = 40.0 (float)
sensorless_ramp:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 200.0 (float)
vel = 400.0 (float)
finish_distance = 100.0 (float)
finish_on_vel = True (bool)
finish_on_distance = False (bool)
finish_on_enc_idx = False (bool)
general_lockin:
current = 10.0 (float)
ramp_time = 0.4000000059604645 (float)
ramp_distance = 3.1415927410125732 (float)
accel = 20.0 (float)
vel = 40.0 (float)
finish_distance = 100.0 (float)
finish_on_vel = False (bool)
finish_on_distance = False (bool)
finish_on_enc_idx = False (bool)
Controller Settings -
In [15]: odrv0.axis0.controller
Out[15]:
error = 0x0000 (int)
pos_setpoint = 0.0 (float)
vel_setpoint = 0.0 (float)
vel_integrator_current = 0.0 (float)
current_setpoint = 0.0 (float)
vel_ramp_target = 0.0 (float)
vel_ramp_enable = False (bool)
config:
control_mode = 3 (int)
pos_gain = 30.0 (float)
vel_gain = 0.001792160328477621 (float)
vel_integrator_gain = 0.008960802108049393 (float)
vel_limit = 200000.0 (float)
vel_limit_tolerance = 1.2000000476837158 (float)
vel_ramp_rate = 5000.0 (float)
setpoints_in_cpr = True (bool)
set_pos_setpoint(pos_setpoint: float, vel_feed_forward: float
set_vel_setpoint(vel_setpoint: float, current_feed_forward: f
set_current_setpoint(current_setpoint: float)
move_to_pos(pos_setpoint: float)
move_incremental(displacement: float, from_goal_point: bool)
start_anticogging_calibration()
Encoder Settings -
In [16]: odrv0.axis0.encoder
Out[16]:
error = 0x0000 (int)
is_ready = True (bool)
index_found = True (bool)
shadow_count = 42799 (int)
count_in_cpr = 1839 (int)
interpolation = 0.5 (float)
phase = 0.038392066955566406 (float)
pos_estimate = 42799.75 (float)
pos_cpr = 1839.7542724609375 (float)
hall_state = 2 (int)
vel_estimate = 0.0 (float)
calib_scan_response = 801.0 (float)
config:
mode = 0 (int)
use_index = True (bool)
find_idx_on_lockin_only = False (bool)
pre_calibrated = False (bool)
zero_count_on_find_idx = True (bool)
cpr = 2048 (int)
offset = -404 (int)
offset_float = -0.14370310306549072 (float)
enable_phase_interpolation = True (bool)
bandwidth = 1000.0 (float)
calib_range = 0.05000000074505806 (float)
calib_scan_distance = 50.26548385620117 (float)
calib_scan_omega = 12.566370964050293 (float)
idx_search_unidirectional = False (bool)
ignore_illegal_hall_state = False (bool)
set_linear_count(count: int)
Motor Settings -
In [17]: odrv0.axis0.motor
Out[17]:
error = 0x0000 (int)
armed_state = 0 (int)
is_calibrated = True (bool)
current_meas_phB = 0.11798018217086792 (float)
current_meas_phC = -0.06924906373023987 (float)
DC_calib_phB = -0.8404545187950134 (float)
DC_calib_phC = -0.131206214427948 (float)
phase_current_rev_gain = 0.02500000037252903 (float)
thermal_current_lim = 168.91783142089844 (float)
get_inverter_temp()
current_control:
p_gain = 0.025867974385619164 (float)
i_gain = 55.49924087524414 (float)
v_current_control_integral_d = 0.0 (float)
v_current_control_integral_q = 0.0 (float)
Ibus = 26.162839889526367 (float)
final_v_alpha = -2.0920491218566895 (float)
final_v_beta = 8.765569686889648 (float)
Iq_setpoint = 40.0 (float)
Iq_measured = 50.51939392089844 (float)
Id_measured = -0.7509180307388306 (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 = 2482 (int)
TIMING_LOG_ADC_CB_DC = 13130 (int)
TIMING_LOG_MEAS_R = 6670 (int)
TIMING_LOG_MEAS_L = 6678 (int)
TIMING_LOG_ENC_CALIB = 6982 (int)
TIMING_LOG_IDX_SEARCH = 0 (int)
TIMING_LOG_FOC_VOLTAGE = 6930 (int)
TIMING_LOG_FOC_CURRENT = 7670 (int)
config:
pre_calibrated = True (bool)
pole_pairs = 21 (int)
calibration_current = 15.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 2.586797381809447e-05 (float)
phase_resistance = 0.05549923703074455 (float)
direction = -1 (int)
motor_type = 0 (int)
current_lim = 40.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 = 60.0 (float)
current_control_bandwidth = 1000.0 (float)
Id (Blue) and Iq (Orange) plot during the process