Skip the alignment of the position sensor

I am using a motor with an encoder and I would like to be able to skip position sensor alignment.
I think I understand that with the encoder alone I will not be able to skip the alignment of the position sensor.
The motor also has hall sensors. I can equip both for that purpose.

Thank you so much.

What type of encoder? If it is the type A-B (quadrature) then it is not possible to skip homing.
If absolute (such as magnetic encoder) then it is possible, you need to just record the electric zero angle and provide this during motor.initFOC.

It is not possible to skip alignment with hall sensors either.

is the type A-B (quadrature)

SimpleFOC needs to know the absolute position of the sensor (well, the electrical angle within the rotor’s rotation, but it works out to the same thing).

So the calibration on startup is required for encoders (AB type) or HallSensors or any other encoder which is not “absolute” - e.g. gives an absolute angle right after starting up.
Encoders with an Index pin can be made absolute by searching for the Index, but this also requires moving the motor. Encoders with no Index pin or Hall Sensors require the calibration to run on startup.

At the end of the calibration process. The motor makes a sharp turn to get into position. Is there a way to do that in a smoother way? It can be this parameter: motor.velocity_index_search = 3;

Thank you.

Is this in position mode?

If so, I think the motor is moving to the current target position after starting the main loop. So maybe the solution is to do this at the end of the setup: = motor.shaft_angle;

1 Like