Newbie - No calibration - getting stuck

Hi all,

New to ODrive and most electronics here and just getting started and wanted to try things out before I start a project build.

I did a bit of searching on here and haven’t been able to get through initial setup. I’m trying to test out sensorless to begin with but have been unable to get a beep or any indication that calibration occurred so unable to get motion.

New v3.6 board: 56V running off of a 48V power supply.
Flipsky 6374 190KV motors.

Here’s the process I followed and feel I must be missing something basic.

odrv0.axis0.motor.config.pole_pairs=7
odrv0.axis0.motor.config.torque_constant=8.27/190
odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.controller.input_vel = 10
odrv0.axis0.controller.config.vel_limit = 15
odrv0.axis0.motor.config.current_lim = 2 odrv0.axis0.config.sensorless_ramp.current
odrv0.axis0.motor.config.direction = 1
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (7
190)
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.controller.input_vel=2

At this point I didn’t get a beep or any indication that anything was happening.
Error dump indicates AXIS_ERROR_MOTOR_FAILED and
MOTOR_ERROR_PHASE_RESISTANCE_OUT_OF_RANGE

output axis0.motor and it shows is_calibrated = False so my assumption is that since there was no beep that calibration isn’t actually happening and that’s causing the phase resistance issue? Is my thinking correct here?

I’m just stuck so any nudge in the right direction is helpful.

Error and .Motor listed below:


axis0
axis: Error(s):
AXIS_ERROR_MOTOR_FAILED
motor: Error(s):
MOTOR_ERROR_PHASE_RESISTANCE_OUT_OF_RANGE
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error

In [51]: odrv0.axis0.motor
Out[51]:
error = 0x0001 (int)
armed_state = 0 (int)
is_calibrated = False (bool)
current_meas_phB = -0.0010186731815338135 (float)
current_meas_phC = -0.05084037780761719 (float)
DC_calib_phB = -0.4022209644317627 (float)
DC_calib_phC = 0.45377033948898315 (float)
phase_current_rev_gain = 0.02500000037252903 (float)
effective_current_lim = 10.0 (float)
current_control:
p_gain = 0.0 (float)
i_gain = nan (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)
Id_setpoint = 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 = 60.75 (float)
overcurrent_trip_level = 67.5 (float)
acim_rotor_flux = 0.0 (float)
async_phase_vel = 0.0 (float)
async_phase_offset = 0.0 (float)
gate_driver:
drv_fault = 0 (int)
timing_log:
general = 63687 (int)
adc_cb_i = 2578 (int)
adc_cb_dc = 12842 (int)
meas_r = 7642 (int)
meas_l = 52571 (int)
enc_calib = 10261 (int)
idx_search = 990 (int)
foc_voltage = 7614 (int)
foc_current = 61007 (int)
spi_start = 22776 (int)
sample_now = 2140 (int)
spi_end = 61689 (int)
config:
pre_calibrated = False (bool)
pole_pairs = 7 (int)
calibration_current = 10.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 0.0 (float)
phase_resistance = 0.0 (float)
torque_constant = 0.043526314198970795 (float)
direction = 1 (int)
motor_type = 0 (int)
current_lim = 20.0 (float)
current_lim_margin = 8.0 (float)
torque_lim = inf (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)
acim_slip_velocity = 14.706000328063965 (float)
acim_gain_min_flux = 10.0 (float)
acim_autoflux_min_Id = 10.0 (float)
acim_autoflux_enable = False (bool)
acim_autoflux_attack_gain = 10.0 (float)
acim_autoflux_decay_gain = 1.0 (float)

PHASE_RESISTANCE error indicates the motor or wiring has a problem. Make sure it’s actually plugged into the axis you think it is, and make sure the motor doesn’t have a short circuit or open circuit.

Thanks, I’ll double check everything.

I managed to reconnect everything and finally got a beep however the motors didn’t run, just moved a short distance before I got a beep but I did not throw any errors on calibration.

Unfortunately, I quite promptly got stuck again. After trying to follow the sensorless setup exactly as it’s listed in the documentation I was only able to get a couple of turns of the motor before it stops. I tried running dump_errors but the python windows just hung and wouldn’t respond until I disconnected the USB and reconnected. Then the odrivetool would reconnect. I tried recalibrating and starting sensorless again a few times with the same issues.

dump_errors gives MOTOR_ERROR_CURRENT_LIMIT_VIOLATION

I increased the current limit a bit but was nervous going farther than that without advice.

and I can get the below
In [16]: odrv0.axis0.motor
Out[16]:
error = 0x0000 (int)
armed_state = 0 (int)
is_calibrated = True (bool)
current_meas_phB = 0.3409847915172577 (float)
current_meas_phC = -0.06511184573173523 (float)
DC_calib_phB = -0.42166149616241455 (float)
DC_calib_phC = 0.4276370108127594 (float)
phase_current_rev_gain = 0.02500000037252903 (float)
effective_current_lim = 20.0 (float)
current_control:
p_gain = 0.022203704342246056 (float)
i_gain = 58.67827606201172 (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.9199409484863281 (float)
final_v_beta = -1.168621301651001 (float)
Id_setpoint = 0.0 (float)
Iq_setpoint = 0.22061662375926971 (float)
Iq_measured = -7.624598026275635 (float)
Id_measured = -28.80390167236328 (float)
I_measured_report_filter_k = 1.0 (float)
max_allowed_current = 60.75 (float)
overcurrent_trip_level = 67.5 (float)
acim_rotor_flux = 0.0 (float)
async_phase_vel = 0.0 (float)
async_phase_offset = 0.0 (float)
gate_driver:
drv_fault = 0 (int)
timing_log:
general = 63687 (int)
adc_cb_i = 2578 (int)
adc_cb_dc = 12842 (int)
meas_r = 7642 (int)
meas_l = 7642 (int)
enc_calib = 11285 (int)
idx_search = 478 (int)
foc_voltage = 7602 (int)
foc_current = 8946 (int)
spi_start = 22776 (int)
sample_now = 34908 (int)
spi_end = 61689 (int)
config:
pre_calibrated = False (bool)
pole_pairs = 7 (int)
calibration_current = 10.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 2.220370515715331e-05 (float)
phase_resistance = 0.0586782805621624 (float)
torque_constant = 0.043526314198970795 (float)
direction = 1 (int)
motor_type = 0 (int)
current_lim = 15.0 (float)
current_lim_margin = 8.0 (float)
torque_lim = inf (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)
acim_slip_velocity = 14.706000328063965 (float)
acim_gain_min_flux = 10.0 (float)
acim_autoflux_min_Id = 10.0 (float)
acim_autoflux_enable = False (bool)
acim_autoflux_attack_gain = 10.0 (float)
acim_autoflux_decay_gain = 1.0 (float)

The motor is set up completely unloaded and seems well connected.
What else should I try?

Help appreciated, Thanks!

Minor update…redid everything with essentially the same result.
After requesting sensorless control the motor turns a few times then stops. I’m sitting at a prompt on odrivetool so tried to dump errors and the prompt locks.

In [45]: odrv0.axis0.requested_state = AXIS_STATE_SENSORLESS_CONTROL
In [46]: dump_errors(odrv0)
axis0

Control C doesn’t do anything. Only disconnecting USB and reconnecting will get me back to a prompt. After that dump errors works properly and gives the current limit violation. Is this an indication of anything?

Thanks,
B

In case anyone else hits these issues here is what I figured out.

I suspect the hanging of the commands was related to USB noise as mentioned elsewhere. I was using a cobbled together setup and twisting my motor cables along with physical separation of some of the wires seems to have helped so far.

Regarding the current limit violation I made two changes (not being as systematic as I could be) and was able to get the motors to spin and control velocity.

Flipsky, the motor manufacturer also makes and Odrive clone and gives some setup parameters for use as electric skateboard. I noticed they set resistance_calib_max_voltage to 4V instead of the default 2.

Can anyone explain why this might be needed?

I increased my calibration current to 20A to see if I would get any rotation. I was making a few adjustments in sequence and unsure if this needed to be increased or not until I more systematically test.

I increased my .motor.config.current_lim = 30 after previously trying 20 and that got it working.

Next up will be encoder based operation but I need to work on the mechanical side. I feel more comfortable now that I was able to get basic testing working.

-B

That seems to have been enough to get things turning

If the motors are higher resistance, you need higher voltage to push the requisite amperage through the motor for calibration.