Motor jumps about 1/8 a rotation then stalls and makes faint noise during Axis state motor calibration

I have been unable to get motor calibration to work. Whenever I try to run the command it will jump forward just a little bit and then stall. changing the amount of motor poll pairs didn’t help and neither did changing the motor calibration current. However, I did verify that changing the current and increasing it did make the motor hold its position with more torque than it does at a lower one. So the Odrive is working, I just seem to have a parameter wrong

Video

I am so close that I can taste it.

I am using an AMT1102-0096 CUI encoder and the motor is a propdrive V2 35-36 910Kv

In [2]: odrv0.axis0.controller.config
Out[2]:
anticogging:
  anticogging_enabled: True (bool)
  calib_anticogging: False (bool)
  calib_pos_threshold: 1.0 (float)
  calib_vel_threshold: 1.0 (float)
  cogging_ratio: 1.0 (float)
  index: 0 (uint32)
  pre_calibrated: False (bool)
axis_to_mirror: 255 (uint8)
circular_setpoint_range: 1.0 (float)
circular_setpoints: False (bool)
control_mode: 3 (uint8)
electrical_power_bandwidth: 20.0 (float)
enable_gain_scheduling: False (bool)
enable_overspeed_error: True (bool)
enable_torque_mode_vel_limit: True (bool)
enable_vel_limit: True (bool)
gain_scheduling_width: 10.0 (float)
homing_speed: 0.25 (float)
inertia: 0.0 (float)
input_filter_bandwidth: 2.0 (float)
input_mode: 5 (uint8)
load_encoder_axis: 0 (uint8)
mechanical_power_bandwidth: 20.0 (float)
mirror_ratio: 1.0 (float)
pos_gain: 30.0 (float)
spinout_electrical_power_threshold: 10.0 (float)
spinout_mechanical_power_threshold: -10.0 (float)
steps_per_circular_range: 1024 (int32)
torque_mirror_ratio: 0.0 (float)
torque_ramp_rate: 0.009999999776482582 (float)
vel_gain: 0.019999999552965164 (float)
vel_integrator_gain: 0.20000000298023224 (float)
vel_integrator_limit: inf (float)
vel_limit: 50.0 (float)
vel_limit_tolerance: 1.2000000476837158 (float)
vel_ramp_rate: 1.0 (float)

Does motor only detection work?

Sorry I am new to Odrive, do you mean does it work in Open loop mode?

requested_state = 3 will do full detection which includes motor, index, and encoder offset; requested_state =4 will just do the motor and runs regardless of the encoder, which helps narrow down the problem

You are following the getting started guide right? Did you try to read the error codes?

Thank you both for the help! I was following the getting started guide, but clearly not good enough! I will give it a try when I get back home and let you know.

I did both the 3 and 4 states and the motor acted exactly the same as it does in the video I linked above. I have 14 poles, i entered in 14 pole pairs, should it have been 14?

I also don’t get a beep when I try to the axis state motor calibration. It just stutters without any sort of beeping

I was actually just able to get an error and it is error 34359738368

which is a MOTOR_ERROR_UNBALANCED. the windings are incorrect? I had another simple ESC driving this motor just a couple weeks ago. If it is a hardware issue is it because I am using bullet connecters to connect the motor to the wires that lead into the Odrive terminals? Is that creating too much resistance differentials?

You may have some bad connections somewhere, check all your wires between the windings and the Odrive, you are looking for wires that are damaged (cut, kinked, twisted, crushed, stretched) or connections that are bad (not seated, oxide coated, poor solder joint, loose crimp/screw terminals)

If you have 14 poles then that means you have 7 pole pairs

I have replaced all motor wire connections, tried it with and without solder and shortened the length of the wires as well as increase the wire gauge. However the same error still remains. Also yes I mistyped I had 7 pole pairs entered. the only thing I have not tried is looking at the windings themselves.

You can try decreasing the calibration current and increasing max voltage, as detailed here:

https://docs.odriverobotics.com/v/0.5.5/fibre_types/com_odriverobotics_ODrive.html#ODrive.Motor.Error.PHASE_RESISTANCE_OUT_OF_RANGE

Maybe it’s marginal on one phase?

Hmm,
First I tried to decrease the calibration current and increase the max voltage, but there was no change in behavior.
Then, I typed in odrv0.axis0.motor.config.phase_inductance into anaconda and the output I received was “inf”.

Connected to ODrive 3678386B3131 as odrv0
In [1]: odrv0.axis0.requested_state=AXIS_STATE_MOTOR_CALIBRATION

In [2]: odrv0.axis0.motor.config.phase_inductance
Out[2]: inf

This occurred on all the motors I have. So, I just did a full configuration reset and tried it on both my 35-36 910 KV propdrive V2 and my 35-42 1000KV propdrive V2 with no change in behavior during calibration, but now I get an inductance of zero?

Connected to ODrive 3678386B3131 as odrv0
In [1]: odrv0.axis0.motor.config.phase_inductance
Out[1]: 0.0

In [2]: odrv0.axis0.requested_state=AXIS_STATE_MOTOR_CALIBRATION

In [3]: odrv0.axis0.requested_state=AXIS_STATE_MOTOR_CALIBRATION

In [4]: odrv0.axis0.motor.config.phase_inductance
Out[4]: 0.0

In [5]: odrv0.axis0.motor.config.calibration_current=10

In [6]: odrv0.axis0.requested_state=AXIS_STATE_MOTOR_CALIBRATION

In [7]: odrv0.axis0.motor.config.resistance_calib_max_voltage=8

In [8]: odrv0.axis0.motor.config.calibration_current=8

In [9]: odrv0.save_configuration()
←[93;1m12:46:00.515744500 [LEGACY_OBJ] protocol failed with 3 - propagating error to application←[0m
Oh no odrv0 disappeared

Reconnected to ODrive 3678386B3131 as odrv0
In [10]: odrv0.axis0.requested_state=AXIS_STATE_MOTOR_CALIBRATION

In [11]: odrv0.axis0.motor.config.phase_inductance
Out[11]: 0.0

Sounds like maybe there’s something wrong with that ODrive, tbh. If it’s the same behaviour on all motors.

Try an odrv0.erase_configuration(), then just go straight to AXIS_STATE_MOTOR_CALIBRATION, let it finish, and see what you get.

What are you powering the board with?

Thank you for your continued help anyway! I guess that’s what I get for trying to afford something I couldn’t by going through ebay. I will do what you suggested when I get home and if it still doesn’t work I will try my best to see if I can get a return.

I am powering the board with a 4s lipo battery that outputs a voltage of around 15V.

Okay, I just tried your suggestion and had no change in outcome. So it might be the hardware itself

If it doesn’t work after doing an erase config and then motor calibration like suggested above, you can also try the M1 motor channel to see if you get a different result, which would help to narrow down the set of possible causes.

I just tried the M1 motor channel with all the pins and such readjusted to no avail. The motor still behaves just as it did in the video I uploaded earlier in this thread. it turns a little bit, stalls and does not move anymore. its unfortunate It might be the hardware because I was finally starting to get better at using the python terminal. Will just have to save up more to afford a non-used one in the future.

Also thanks for offering your advice! Words can’t express how amazed I am at the work you have done here.

This is expected when running motor calibration. You need to run dump_errors to see what is actually happening. While possible, it is unlikely to be an inverter hardware issue on both channels at the same time.

Here is what I got

In [14]: dump_errors(odrv0)
system: Error(s):
  LegacyODriveError.DC_BUS_OVER_REGEN_CURRENT
axis0
  axis: no error
  motor: Error(s):
    MotorError.DRV_FAULT
    MotorError.SYSTEM_LEVEL
    MotorError.UNBALANCED_PHASES
  DRV fault: none
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MotorError.SYSTEM_LEVEL
  DRV fault: none
  sensorless_estimator: no error
  encoder: no error
  controller: no error

I followed the suggestions you made in this post, but still got the same errors. DC Bus Over Regen Current Errror?


ODrive control utility v0.6.3.post
Website: https://odriverobotics.com/
Docs: https://docs.odriverobotics.com/
Forums: https://discourse.odriverobotics.com/
Discord: https://discord.gg/k3ZZ3mS
Github: https://github.com/odriverobotics/ODrive/

Please connect your ODrive.
You can also type help() or quit().

Connected to ODrive 3678386B3131 as odrv0
In [1]: %pip install --updrage odrive

Usage:
  C:\Users\amued\anaconda3\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
  C:\Users\amued\anaconda3\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
  C:\Users\amued\anaconda3\python.exe -m pip install [options] [-e] <vcs project url> ...
  C:\Users\amued\anaconda3\python.exe -m pip install [options] [-e] <local project path> ...
  C:\Users\amued\anaconda3\python.exe -m pip install [options] <archive url/path> ...

no such option: --updrage
Note: you may need to restart the kernel to use updated packages.

In [2]: odrv0
Out[2]:
axis0:
  acim_estimator: ...
  config: ...
  controller: ...
  current_state: 1 (uint8)
  encoder: ...
  error: 0 (uint32)
  is_homed: False (bool)
  last_drv_fault: 0 (uint32)
  max_endstop: ...
  mechanical_brake: ...
  min_endstop: ...
  motor: ...
  requested_state: 0 (uint8)
  sensorless_estimator: ...
  step_dir_active: False (bool)
  steps: 0 (int64)
  task_times: ...
  trap_traj: ...
  watchdog_feed(obj: object_ref)
axis1:
  acim_estimator: ...
  config: ...
  controller: ...
  current_state: 1 (uint8)
  encoder: ...
  error: 0 (uint32)
  is_homed: False (bool)
  last_drv_fault: 0 (uint32)
  max_endstop: ...
  mechanical_brake: ...
  min_endstop: ...
  motor: ...
  requested_state: 0 (uint8)
  sensorless_estimator: ...
  step_dir_active: False (bool)
  steps: 0 (int64)
  task_times: ...
  trap_traj: ...
  watchdog_feed(obj: object_ref)
brake_resistor_armed: False (bool)
brake_resistor_current: 0.0 (float)
brake_resistor_saturated: False (bool)
can:
  config: ...
  error: 0 (uint8)
clear_errors(obj: object_ref)
config:
  brake_resistance: 2.0 (float)
  dc_bus_overvoltage_ramp_end: 59.92000198364258 (float)
  dc_bus_overvoltage_ramp_start: 59.92000198364258 (float)
  dc_bus_overvoltage_trip_level: 59.92000198364258 (float)
  dc_bus_undervoltage_trip_level: 8.0 (float)
  dc_max_negative_current: -0.009999999776482582 (float)
  dc_max_positive_current: inf (float)
  enable_brake_resistor: False (bool)
  enable_can_a: True (bool)
  enable_dc_bus_overvoltage_ramp: False (bool)
  enable_i2c_a: False (bool)
  enable_uart_a: True (bool)
  enable_uart_b: False (bool)
  enable_uart_c: False (bool)
  error_gpio_pin: 0 (uint32)
  gpio10_mode: 11 (uint8)
  gpio11_mode: 2 (uint8)
  gpio12_mode: 12 (uint8)
  gpio13_mode: 12 (uint8)
  gpio14_mode: 2 (uint8)
  gpio15_mode: 7 (uint8)
  gpio16_mode: 7 (uint8)
  gpio1_mode: 4 (uint8)
  gpio1_pwm_mapping: ...
  gpio2_mode: 4 (uint8)
  gpio2_pwm_mapping: ...
  gpio3_analog_mapping: ...
  gpio3_mode: 3 (uint8)
  gpio3_pwm_mapping: ...
  gpio4_analog_mapping: ...
  gpio4_mode: 3 (uint8)
  gpio4_pwm_mapping: ...
  gpio5_mode: 3 (uint8)
  gpio6_mode: 0 (uint8)
  gpio7_mode: 0 (uint8)
  gpio8_mode: 0 (uint8)
  gpio9_mode: 11 (uint8)
  max_regen_current: 2.0 (float)
  uart0_protocol: 3 (uint8)
  uart1_protocol: 3 (uint8)
  uart2_protocol: 3 (uint8)
  uart_a_baudrate: 115200 (uint32)
  uart_b_baudrate: 115200 (uint32)
  uart_c_baudrate: 115200 (uint32)
  usb_cdc_protocol: 3 (uint8)
enter_dfu_mode(obj: object_ref)
erase_configuration(obj: object_ref)
error: 8 (uint8)
fw_version_major: 0 (uint8)
fw_version_minor: 5 (uint8)
fw_version_revision: 4 (uint8)
fw_version_unreleased: 1 (uint8)
get_adc_voltage(obj: object_ref, gpio: uint32) -> voltage: float
get_dma_status(obj: object_ref, stream_num: uint8) -> status: uint32
get_drv_fault(obj: object_ref) -> drv_fault: uint64
get_gpio_states(obj: object_ref) -> status: uint32
get_interrupt_status(obj: object_ref, irqn: int32) -> status: uint32
hw_version_major: 3 (uint8)
hw_version_minor: 6 (uint8)
hw_version_variant: 56 (uint8)
ibus: 0.0 (float)
ibus_report_filter_k: 1.0 (float)
misconfigured: False (bool)
n_evt_control_loop: 9118710 (uint32)
n_evt_sampling: 9118718 (uint32)
oscilloscope:
  get_val(obj: object_ref, index: uint32) -> val: float
  size: 4096 (uint32)
otp_valid: True (bool)
reboot(obj: object_ref)
save_configuration(obj: object_ref) -> success: bool
serial_number: 59889970524465 (uint64)
system_stats:
  i2c: ...
  max_stack_usage_analog: 268 (uint32)
  max_stack_usage_axis: 604 (uint32)
  max_stack_usage_can: 348 (uint32)
  max_stack_usage_startup: 532 (uint32)
  max_stack_usage_uart: 292 (uint32)
  max_stack_usage_usb: 468 (uint32)
  min_heap_space: 47432 (uint32)
  prio_analog: -2 (int32)
  prio_axis: 3 (int32)
  prio_can: 0 (int32)
  prio_startup: 0 (int32)
  prio_uart: 0 (int32)
  prio_usb: 0 (int32)
  stack_size_analog: 1024 (uint32)
  stack_size_axis: 2048 (uint32)
  stack_size_can: 1024 (uint32)
  stack_size_startup: 2048 (uint32)
  stack_size_uart: 4096 (uint32)
  stack_size_usb: 4096 (uint32)
  uptime: 1139957 (uint32)
  usb: ...
task_timers_armed: False (bool)
task_times:
  control_loop_checks: ...
  control_loop_misc: ...
  dc_calib_wait: ...
  sampling: ...
test_function(obj: object_ref, delta: int32) -> cnt: int32
test_property: 0 (uint32)
user_config_loaded: 0 (uint32)
vbus_voltage: 16.072998046875 (float)

In [3]: odrv0.config.max_regen_current=2

In [4]: odrv0.config.dc_max_negative_current=-0.01

In [5]: odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

In [6]: dump_errors(odrv0)
system: Error(s):
  LegacyODriveError.DC_BUS_OVER_REGEN_CURRENT
axis0
  axis: no error
  motor: Error(s):
    MotorError.DRV_FAULT
    MotorError.SYSTEM_LEVEL
    MotorError.UNBALANCED_PHASES
  DRV fault: none
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MotorError.SYSTEM_LEVEL
  DRV fault: none
  sensorless_estimator: no error
  encoder: no error
  controller: no error