Antigravity 4004, calibration gives motor error phase resistance out of range

Hi!
I cannot get the calibration work with ODrive 3.6 / 56V (original), Antigravity 4004 (Antigravity MN4004 KV300 - 2PCS/SET_Antigravity Type_Motors_Multirotor_T-MOTOR Store-Official Store for T-motor drone motor,ESC,Propeller) and the encoder AEDM-5810-Z12.

It is powered it with 14.8V (4S). When I start calibration I get

In [161]: dump_errors(odrv0)
system: no error
axis0
axis: no error
motor: Error(s):
MOTOR_ERROR_PHASE_RESISTANCE_OUT_OF_RANGE
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error

This is my setting:
In [165]: odrv0.axis0.motor
Out[165]:
DC_calib_phA: 0.28591182827949524 (float)
DC_calib_phB: -0.49701595306396484 (float)
DC_calib_phC: 0.21123221516609192 (float)
I_bus: 0.0 (float)
config:
I_bus_hard_max: inf (float)
I_bus_hard_min: -inf (float)
I_leak_max: 0.10000000149011612 (float)
R_wL_FF_enable: False (bool)
acim_autoflux_attack_gain: 10.0 (float)
acim_autoflux_decay_gain: 1.0 (float)
acim_autoflux_enable: False (bool)
acim_autoflux_min_Id: 10.0 (float)
acim_gain_min_flux: 10.0 (float)
bEMF_FF_enable: False (bool)
calibration_current: 10.0 (float)
current_control_bandwidth: 1000.0 (float)
current_lim: 10.0 (float)
current_lim_margin: 8.0 (float)
dc_calib_tau: 0.20000000298023224 (float)
inverter_temp_limit_lower: 100.0 (float)
inverter_temp_limit_upper: 120.0 (float)
motor_type: 0 (uint8)
phase_inductance: 0.0 (float)
phase_resistance: 0.0 (float)
pole_pairs: 12 (int32)
pre_calibrated: False (bool)
requested_current_range: 60.0 (float)
resistance_calib_max_voltage: 2.0 (float)
torque_constant: 0.027566665783524513 (float)
torque_lim: inf (float)
current_control:
I_measured_report_filter_k: 1.0 (float)
Ialpha_measured: 0.0 (float)
Ibeta_measured: 0.0 (float)
Id_measured: 0.0 (float)
Id_setpoint: 0.0 (float)
Iq_measured: 0.0 (float)
Iq_setpoint: 0.0 (float)
Vd_setpoint: 0.0 (float)
Vq_setpoint: 0.0 (float)
final_v_alpha: 0.0 (float)
final_v_beta: 0.0 (float)
i_gain: nan (float)
p_gain: 0.0 (float)
phase: 0.0 (float)
phase_vel: 0.0 (float)
power: 0.0 (float)
v_current_control_integral_d: 0.0 (float)
v_current_control_integral_q: 0.0 (float)
current_meas_phA: -0.2879217863082886 (float)
current_meas_phB: 0.49901485443115234 (float)
current_meas_phC: -0.2115287184715271 (float)
effective_current_lim: 10.0 (float)
error: 0 (uint64)
fet_thermistor:
config: …
temperature: 26.77530288696289 (float)
is_armed: False (bool)
is_calibrated: False (bool)
last_error_time: 0.0 (float)
max_allowed_current: 60.75 (float)
max_dc_calib: 6.075000286102295 (float)
motor_thermistor:
config: …
temperature: 0.0 (float)
n_evt_current_measurement: 29945 (uint32)
n_evt_pwm_update: 29950 (uint32)
phase_current_rev_gain: 0.02500000037252903 (float)

and I configured it like this:
odrv0.erase_configuration()
odrv0.axis0.motor.config.current_lim = 10
odrv0.config.enable_brake_resistor = True
odrv0.config.brake_resistance = 2
odrv0.axis0.motor.config.pole_pairs = 12
odrv0.axis0.motor.config.torque_constant = 8.27 / 300
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.encoder.config.cpr=5000
odrv0.save_configuration()

Please help!

Best,
Jochen

… found it:
odrv0.axis0.motor.config.resistance_calib_max_voltage = 4 helped, case closed.
Best, Jochen

3 Likes

I have same problem and try to use your solution, it works.
could you explain more your configuration. I have a ENCODER_ERROR_CPR_POLEPAIRS_MISMATCH
Using the same motor, encoder and odriverboard
I connect CH.I (eincoder) to Z (odrive), CH.A to A and CH.B to B

With that encoder cpr has to be set to 5000, and this is the wiring I used:

After setting that you need to save the configuration and reboot.

1 Like

the same wiring, thank you
When I try shadow count, resulting around 20000, I changed to this number it just works for calibration. I think I need to check the result of the calibration.
When I try this command: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL, it has this following error

image

So sorry, ur right, CPR has to be set to 20000, copied it from my first attempt.

I am not using the motor will full power yet, however in my attempts these controller settings were working fine:

controller

odrv0.axis0.controller.config.vel_limit = 10
odrv0.axis0.controller.config.pos_gain =100
odrv0.axis0.controller.config.vel_integrator_gain = 0.02
odrv0.axis0.controller.config.vel_gain = 0.02

I tried your controller setting, and the same configuration you have. The close loop control runs okay that motor keep it’s position. but when I tried to command: odrv0.axis0.controller.input_pos = 1. it has following error. have you experienced the same issue and what did you do.
image

When I tried odrv0.axis0.controller.config.enable_overspeed_error = False, it can turn the motor with this command odrv0.axis0.controller.input_pos. But I think it should still be set to be True for safety.
I think the problem arise with this errors: MOTOR_ERROR_UNKNOWN_TORQUE, MOTOR_ERROR_UNKNOWN_VOLTAGE_COMMAND, and result with CONTROLLER_ERROR_OVERSPEED

In my setting I send the position to the controller at a high frequency, so the controller does not have very large steps to do and I did not face this. I would recommend to reduce the P and the I of the PID controller.