Skip calibration/Startup procces

Hello community,
I am learning with odrive right now. I use oDrive for 3D printer (X, Y axis), i use Step/Dir mode (Arduino mega 2560 + ramps shield 1.4). It works wery well, but i must do calibration by myself in every start up oDrive. I read about 2 way how to do automation calibration. So i have two problems.

  1. Problem
    If i set „odrv0.axis0.motor.config.pre_calibrated = True“ and after that send „odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION“ motor move little bit, after than make sound „beep“ next do nothing. I try to read error list but all of the error was „0“ (odrv0.axis0.error, odrv0.axis0.motor.error, odrv0.axis0.encoder.error)

  2. Problem
    If i try the „odrv0.axis0.requested_state = AXIS_STATE_STARTUP_SEQUENCE“ . I set „odrv0.axis0.config.startup_motor_calibration = True“ and „odrv0.axis0.config. startup_closed_loop_control = True“. After than switch off and switch on the power supply (odrive). Motor move little bit, after than make sond „beep“ next do nothing.

So i would like to asky you, which way is the best for use my example. Do you know where is a mistake? Do somebody have procedure how to do procces automation calibration?

Thank you very much
The best regards
Hynek

Hey Hynek,

To clarify, are you able to successfully manually calibrate the motor but when you try to do it automatically it fails? If not, you need to get manual calibration working first. If that’s working, here are the steps to set up automatic calibration at boot:

  1. Do an initial calibration of the motor/encoder
  2. Enable auto calibration in the ODrive’s config
  3. Save these parameters to the ODrive’s NVM

Here are the commands to do that:
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()

Change axis as needed. Setting the motor to precalibrated will use the phase resistance and inductance values from your initial configuration. Setting encoder offset calibration will rotate the motor to find the offset between the motor’s electrical phase and rotor’s position in encoder counts. Setting closed loop control will automatically transition to closed loop control when this sequence is completed.

If you are using an encoder with an index pulse you will need to set those options in the config as well.

Hope this helps!

1 Like

Thank you very much. Your commands works very well. Automatically calibration works without any problem.

Can you send me commands for precalibration??? I would like to try which way is the best.

I use LC5055 motor and amt 102 encoders.

Thank you
The best regards
Hynek

Glad it helped!

Here are the instructions for setting up encoder calibration. Specifically, look at the section for Encoder with index signal.
Note that you need an encoder with an index pulse or this will not work.

Let me know if that helps

Thank you, i will try it.

Hynek

Hello kedvall,

currently I am trying to get the index impulse running - I used your setup in order to compare the behaviors with and without index pulse - and I had the same problems with both:

without index:
setting the rotor manually to a “certain position” and starting with power up results in a closed loop where the rotor was moved some counts beside the “certain position” - than when using the “…controller.pos_setpoint = 0” command the rotor moved to the “certain position”

with index signal: the same behavior could be seen - after power on the rotor was placed nearby the index location and with the “…controller.pos_setpoint = 0” command the zero index pulse position was reached exactly
Is this the normal behavior - or are there any other setting ?

many thanks