Close

Cogging Torque Compensation

A project log for ODrive - High performance motor control

Hobby brushless motors are incredibly cheap and powerful. However we need a way to make robots out of them. ODrive is that way.

Oskar WeiglOskar Weigl 11/06/2017 at 22:550 Comments

Inexpensive hobby brushless motors are powerful, but they are not built for precision applications. One of the undesirable characteristics of less expensive motors is cogging torque. This is the torque generated by the permanent magnets in the rotor being attracted to the iron in the stator in an unbalanced way.

In more expensive motors this is avoided by skewing the rotor magnets, as shown below. This balances the reluctance torque across the skew angle, which eliminates most cogging torque.

Straight and skewed rotor magnets.

Interestingly, the cogging torque exhibited by the motor is a constant function of the rotor angle. That means that if we can figure out what it is, we can improve the performance by simply compensating for it.

And that is exactly what we did. Thanks to the implementation of a calibration and compensation algorithm by @Wetmelon on the ODrive forums, we can estimate and cancel the cogging torque.

Cogging torque map: Current as a function of encoder count. Measured values in blue, fitted values in orange.

Without and with anticogging, showing rotor position at 25 RPM commanded velocity. Note that the feedback gains were not very stiff for this test.

Note that the above is just an excerpt of the full writeup, please see that for more detail, and full resolution plots.

This algorithm is already merged to the devel branch of the ODrive firmware, and after sufficient testing will be available in the next release.

Discussions