Motor jumping on absolute encoder index search

I am working on recreating the Open Dog quadrupedal robot. When we search for the index, sometimes the motor will jump to the next index after finding the first one. I have attached a video of this happening. The leg joint is a 10:1 ratio of turns to the motor. I have tried messing with the encoder.config.calib_scan_omega as well as the calibration_current with no success.
Been stuck on this for a while, so I hope someone on here will have some idea on a fix.

ezgif.com-gif-maker-2

Is the motor idle before you start the index search?

I have it set to have the motor preconfigured, the encoder preconfigured, and the encoder looking for index on startup. Then the motor goes into closed loop. Before that, the motor is off.

This is the config I have been setting prior to initial start up:

→ Plug in

erase_configuration()

dump_errors(odrv0)

odrv0.axis0.clear_errors()

odrv0.axis1.clear_errors()

odrv0.axis0.encoder.config.cpr = 4000

odrv0.axis1.encoder.config.cpr = 4000

odrv0.axis0.motor.config.pole_pairs = 20

odrv0.axis1.motor.config.pole_pairs = 20

odrv0.axis0.motor.config.torque_constant = 8.27/90

odrv0.axis1.motor.config.torque_constant = 8.27/90

odrv0.axis0.controller.config.pos_gain = 60

odrv0.axis1.controller.config.pos_gain = 60

odrv0.axis0.controller.config.vel_gain = 0.1

odrv0.axis1.controller.config.vel_gain = 0.1

odrv0.axis0.controller.config.vel_integrator_gain = 0.2

odrv0.axis1.controller.config.vel_integrator_gain = 0.2

import math

odrv0.axis0.controller.config.vel_limit = math.inf

odrv0.axis1.controller.config.vel_limit = math.inf

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION

odrv0.axis0.motor.config.pre_calibrated = True

odrv0.axis1.motor.config.pre_calibrated = True

odrv0.axis0.requested_state = AxisState.ENCODER_INDEX_SEARCH

odrv0.axis1.requested_state = AxisState.ENCODER_INDEX_SEARCH

odrv0.axis0.requested_state = AxisState.ENCODER_OFFSET_CALIBRATION

odrv0.axis1.requested_state = AxisState.ENCODER_OFFSET_CALIBRATION

odrv0.axis0.config.startup_encoder_index_search = True

odrv0.axis1.config.startup_encoder_index_search = True

odrv0.axis0.encoder.config.pre_calibrated = True

odrv0.axis1.encoder.config.pre_calibrated = True

odrv0.axis0.config.startup_closed_loop_control = True

odrv0.axis1.config.startup_closed_loop_control = True

odrv0.save_configuration()

odrv0.reboot()

If you set odrv0.axis0.config.startup_closed_loop_control to False, does it still jump?

1 Like

It does seem like putting the motor in closed loop was the problem. I am now waiting for the index search to finish and then I put it in closed loop through the Arduino. Thank you!

2 Likes