Calibration Fails with Absolute Encoder

Whenever I run the full calibration it fails. When I run dump_erros(odrv0) I get the following:

axis0
axis: no error
motor: no error
encoder: no error
controller: no error
axis1
axis: Error(s):
UNKNOWN_ERROR!
ERROR_INVALID_STATE
ERROR_DC_BUS_UNDER_VOLTAGE
ERROR_DC_BUS_OVER_VOLTAGE
ERROR_CURRENT_MEASUREMENT_TIMEOUT
ERROR_BRAKE_RESISTOR_DISARMED
ERROR_MOTOR_DISARMED
ERROR_MOTOR_FAILED
ERROR_SENSORLESS_ESTIMATOR_FAILED
ERROR_ENCODER_FAILED
ERROR_CONTROLLER_FAILED
ERROR_POS_CTRL_DURING_SENSORLESS
ERROR_WATCHDOG_TIMER_EXPIRED
motor: Error(s):
UNKNOWN_ERROR!
ERROR_PHASE_RESISTANCE_OUT_OF_RANGE
ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE
ERROR_ADC_FAILED
ERROR_DRV_FAULT
ERROR_CONTROL_DEADLINE_MISSED
ERROR_NOT_IMPLEMENTED_MOTOR_TYPE
ERROR_BRAKE_CURRENT_OUT_OF_RANGE
ERROR_MODULATION_MAGNITUDE
ERROR_BRAKE_DEADTIME_VIOLATION
ERROR_UNEXPECTED_TIMER_CALLBACK
ERROR_CURRENT_SENSE_SATURATION
ERROR_CURRENT_LIMIT_VIOLATION
encoder: no error
controller: no error

I am using the v 3.6 56V Odrive
I have the AS5048A as my encoder in absolute pos mode (Using SPI)
I am using the razors-edge branch firmware
For the motor I am using the 100KV Turnigy Multistar

The encoder works flawlessly. My config settings are as follows:

odrv0.config:

brake_resistance = 2.0 (float)
max_regen_current = 0.0 (float)
enable_uart = True (bool)
enable_i2c_instead_of_can = False (bool)
enable_ascii_protocol_on_usb = True (bool)
dc_bus_undervoltage_trip_level = 8.0 (float)
dc_bus_overvoltage_trip_level = 59.92000198364258 (float)
power_supply_wattage = 100.0 (float)
gpio1_pwm_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)
gpio2_pwm_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)
gpio3_pwm_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)
gpio4_pwm_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)
gpio3_analog_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)
gpio4_analog_mapping:
endpoint = (0, 0) (RemoteProperty)
min = 0.0 (float)
max = 0.0 (float)

odrv0.axis1.config:

startup_motor_calibration = False (bool)
startup_encoder_index_search = False (bool)
startup_encoder_offset_calibration = False (bool)
startup_closed_loop_control = False (bool)
startup_sensorless_control = False (bool)
startup_homing = False (bool)
enable_step_dir = False (bool)
counts_per_step = 2.0 (float)
watchdog_timeout = 0.0 (float)
enable_watchdog = False (bool)
step_gpio_pin = 7 (int)
dir_gpio_pin = 8 (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)
can_node_id = 1 (int)
can_heartbeat_rate_ms = 100 (int)

When I trigger calibration the motor moves slightly and then stops. Calibration never completes

Solved:

I checked the odrv0.axis1.motor.error which was 0x80

This lead me to the following:

ERROR_MODULATION_MAGNITUDE = 0x0080

My issue was that odrv0.axis1.motor.resistance_calib_max_voltage was set to VBUS (16V for me )
when it is suppose to be VBUS/2

Setting it to 8 solved my problem

2 Likes