ODrive 3.6 Encoder Problem

Hi,
I have odrive 3.6 board. I am using axis0 for testing. My configuration is bellow.

350W Hoverboard Motor 140 rpm @ 12v → KV = 140/12 = 11.67
Power supply 24 v adjustable
AS5047P Encoder 1000 PPR = 4000 cpr using ABI mode (with z index)

I Tested encoder with Arduino sketch and read 4000 cpr as Incremental Encoder with no problem

oDrive Configs are (from hoverboard guide and little bit changed);

dev0.clear_errors()
dev0.erase_configuration()

dev0.axis0.motor.config.current_lim = 10
dev0.axis0.controller.config.vel_limit = 10
dev0.axis0.motor.config.calibration_current = 10

dev0.config.enable_brake_resistor=False
dev0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
dev0.axis0.motor.config.pole_pairs = 15

dev0.axis0.motor.config.resistance_calib_max_voltage=4
dev0.axis0.motor.config.requested_current_range = 25
dev0.axis0.motor.config.current_control_bandwidth = 1000
dev0.axis0.motor.config.torque_constant = 8.27 / 11.67

dev0.axis0.controller.config.enable_torque_mode_vel_limit=False

//hall
dev0.axis0.encoder.config.mode = ENCODER_MODE_HALL
dev0.axis0.encoder.config.cpr = 90
dev0.axis0.encoder.config.calib_scan_distance = 150
dev0.axis0.encoder.config.use_index=False

//hall
dev0.axis0.encoder.config.mode = ENCODER_MODE_INCREMENTAL
dev0.axis0.encoder.config.cpr = 4000
dev0.axis0.encoder.config.calib_scan_distance = 150
dev0.axis0.encoder.config.use_index=True

dev0.config.gpio9_mode = GpioMode.DIGITAL
dev0.config.gpio10_mode = GpioMode.DIGITAL
dev0.config.gpio11_mode = GpioMode.DIGITAL

dev0.axis0.controller.config.pos_gain = 1
dev0.axis0.controller.config.vel_gain = 0.02 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.vel_integrator_gain = 0.1 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.vel_limit = 10
dev0.axis0.controller.config.control_mode = ControlMode.TORQUE_CONTROL

dev0.save_configuration()

After reset, I am sending theese commands,

dev0.axis0.requested_state = AxisState.MOTOR_CALIBRATION //OK NO ERRORS
dev0.axis0.requested_state = AxisState.ENCODER_INDEX_SEARCH //OK. MOTORS TURNS AND NO ERRORS

dev0.axis0.requested_state = AxisState.ENCODER_OFFSET_CALIBRATION // MOTOR TURNS BUT ERROR = AxisError.ENCODER_FAILED
dev0.axis0.encoder.shadow_count SHOWS 0 AFTER MULTIPLE TURNS

And If I run

In [203]: dev0.axis0.requested_state = 3 // full calibration

In [204]: dump_errors(dev0)
system: Error(s):
ODriveError.MISSING_ESTIMATE
axis0
error: Error(s):
AxisError.MOTOR_FAILED
last_drv_fault: none

Also I am watching with osciloscope and I can see pulses.

What can be wrong.

Thanks.

MISSING_ESTIMATE means you haven’t configured something correctly… not sure what exactly though, as you seem to have a mix of new and old enums. Where did you plug in the HALL sensors?

And what is this for:

dev0.config.gpio9_mode = GpioMode.DIGITAL
dev0.config.gpio10_mode = GpioMode.DIGITAL
dev0.config.gpio11_mode = GpioMode.DIGITAL