Calibration Saving Configuration

Hello,

I have been playing around with odrive for a wheeled robotics project, so we can’t do full motor calibration in everytime on the bootup. So a quick googling and searching around this website lead me to this

odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.axis0.config.startup_encoder_offset_calibration = True
odrv0.axis0.config.startup_closed_loop_control = True
odrv0.save_configuration()
odrv0.reboot()

but when I reboot odrive and try to start velocity control it doesn’t work instead throw MOTOR_UNKNOWN_PHASE_ERROR

1 Like

odrv0.axis0.motor.config.pre_calibrated = True is correct, but this only saves the resistance and inductance of the motor, NOT the encoder offset information required for commutation phase.
odrv0.axis0.config.startup_encoder_offset_calibration = True is wrong - that will just try (and fail, if the robot is on the ground) to do the encoder offset calibration which has to be done without load.

You need to have either an absolute encoder or an index signal.

If you are using an absolute encoder, you only need to set axis0.encoder.config.pre_calibrated = True.

If you are using an index pulse, you also need to set odrv0.axis0.encoder.config.use_index = True before you do the initial calibration, and also set odrv0.axis0.config.startup_index_search = True

good luck with your project :slight_smile:

Hi, Thanks for your response. I tried using your suggestion
I still get the following error
MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE

Please make sure you followed all the instructions in Encoder with index signal

Thanks for your help, I figured it out