How to use start_anticogging_calibration


the search doesn´t help, there are only outdated posts and incomplete descriptions which all do not work.

I use a brand new odrive v3.6 24 V with originally installed dev firmware.

So please advice how to start/use e.g. odrv0.axis0.controller.start_anticogging_calibration()

At the time being, can anti_cogging be used in real-life applications or is it just for “playing” ?

Your command should work with no changes.

It works but it’s best at low-speed, constant velocity or to smooth out velocity control (rather than position control).

Thanks a lot !

  1. Aha, first I tried in position control and it did nothing. With vel_control it works (without changing gains in my case).

  2. Is the calibration data stored automatically? How do i save it ?

  3. A short description of how it works for me: (in case other people also have troubles)

  • run full calibration sequence if not calibrated

  • set controller mode to velocity control: odrv0.axis0.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL

  • start closed-loop control: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL

  • maybe you have to increase the gains a lot (i didn´t have to)

  • start anti_cogging_calibration with e.g. odrv0.axis0.controller.start_anticogging_calibration()

  • motor should spin slowly

  • wait until motor stops - or stop it if it does something weird

  1. Weird, all it does is switch back to position control mode before starting the calibration. It needs to be in closed_loop_control, however.
  2. It is not. It cannot be saved (this will be fixed eventually)

How long should that anticogging-calibration process take? I see pos_setpoint changing very little over time, but not constant. contoller.calib_anticogging = true but it already takes like 5 Minutes now. Am i doing something wrong?

if you don’t increase your gains dramatically, between 5 and 10 minutes. You’ll want to multiply your pos_gain and vel_integrator_gain by something like 10x

How does the anti-cogging calibration look like?

We have our motors already installed, and it is difficult to get the belts off from a few of them. Is it safe to run the calibration procedure on a live system? I’m concerned if the motors will have to spin for several minutes. A few revolutions would be ok for us. What about payload mass? Can the calibration be done with it or do we need to strip done everything?

The calibration just does one revolution, but no, you can’t do it with a payload mass. Needs to be done on a disconnected motor.

1 Like