Sensorless control sometimes goes in the wrong direction

I’m trying to use sensorless control to spin some disks for a project, but I’m running into a strange problem.

Sometimes when switching from idle to sensorless mode the motor will begin spinning in the wrong direction and the ODrive is unable to fix this. I have uploaded a video showing the issue.

https://youtu.be/1ihjrGGxeJc

At the 17 second mark on the timeline the ODrive is put into sensorless mode. Around the 20 second mark the motor reaches the desired speed, but in the opposite direction as expected. The ODrive is supplying 40A to try to fix this, but it unable to.

At the 26 second mark the Odrive is put back into idle mode and the motor is allowed to return to a stop.

At the 31 second mark the Odrive is put into sensorless mode again. Around the 35 second mark the motor reaches the desired speed in the correct direction and the current drops to a few amps.

Does anyone have any suggestions on what parameters should be changed to ensure that the motor spins up in the correct direction each time?

Can you confirm that you’re using firmware version 0.4.11? If you just send the command odrv0 on odrivetool, you should get the firwmare version listed as:

fw_version_major.firmware_version_minor.fw_version_revision

It seems that I am currently running firmware version 0.4.7

I will try updating and see if the problem is fixed

I tried updating to 0.4.11 however I was unable to calibrate the motors. I would receive a motor error of 0x2, which seems to be that the phase inductance is out of range.

The phase inductances of my motors are 1.34e-06 and 1.07e-06.

In line 279 of the motor.cpp file it seems that the minimum allowed inductance is arbitrarily chosen as 2e-6. Looking through the changes I can see that at some point after the 0.4.7 firmware release the bound was changed from 1e-6 to 2e-6 (link).

:thinking: what motors are you using? That seems very low. @madcowswe may be able to explain why 2e-6 was chosen instead of 1e-6

Here is a link to the motor. They both read about the same value for phase resistance and inductance.

I might try measuring the inductance without the ODrive to confirm the values that it is giving me