Ok, this isn’t strictly simplefoc related, I’m trying to write my own BLDC position control code from scratch because I want to learn the underlying principles and only really find I get an understanding of this sort of stuff by implementing it rather than using an existing library or trying to read over existing code, and this seemed to be the only place I could find online with a lot of active discussions about this sort of thing… so …
How on earth does one hold position with a BLDC when doing FOC?
When one is moving, however slowly, one says “align the electrical fields in the stator to be 90 electrical degrees ahead of the measured rotor position”, this is the whole FOC principle and gives you maximum torque. But when one tries to hold a position there aren’t relevant lead and lag directions, which way the rotor deviates from the ideal location will depend on the torque loads applied on to the motor by the object being moved. This can constantly vary, especially when holding position against minimal deviating torques.
There are quite a few electrical angles involved:
1.The measured electrical angle of the rotor at a given instant
2.The electrical angle of the stator’s field at a given instant
3.The target electrical angle which the rotor is supposed to be held at
4.The angle which the stator’s field should be at so as to hold the rotor at the target angle, this will be 90 degrees “ahead” of the target angle of the rotor, but “ahead” can constantly switch back and forth at low torques
Constantly switching the stator field angle back and forth as a way of holding position is surely not good, particularly if the position control loop is slowed at all in which case the motor gets time to deviate by quite a bit before being sent back the other way and physically measurable, and very audible, vibration can result.
The trick must be to find a way to precisely balance the amount of current flowing in the motor’s stator, together with the eletrical angle of the field this current generates, so as to hold position against whatever torques are being exerted on the motor by the load it is holding. But whenever the motor’s measured rotor position crosses the target rotor position the electrical angle has to jump by 180 electrical degrees from “ahead” to “behind” or vice-versa. Given this sharp jump involved I’m not sure if anything like a normal PID loop can help, because there isn’t a stable value for the angle to settle on, but rather two angles, each stable for torque loads in one drection but not the other, and both separated by a 180 electrical degree gap.
Setting the stator’s electrical angle to match the target angle for the rotor can’t work, as it would be incredibly wasteful of motor current, you’d get no restoring force at all when the stator field and rotor were aligned, and whatever restoring force you did get for a displacement in either direction would therefore never be able to bring the rotor quite to the proper position.
Can anyone point me to resources to explain the theory of what is going on in this situation? How am I to achieve a desired rotor position, and equal curves for the ramping up of restoring torque when displaced from it in either direction, when all I can control is the position of the stator’s field, to be placed 90 degrees ahead of or behind the rotor?
Thank you