I intend to control the position and speed of a BLDC motor (still to be selected) using field oriented control (FOC) and an Encoder to determine shaft position and speed.
From what I understand from FOC, the Id reference should be set to 0 as the and with Iq the torque is controlled. Iq can be set from a PI controller which works with the error signal between the reference shaft speed and the actual shaft speed.
What is still not clear to me is how could I control the position of the shaft? for example, moving from speed control (speed= 10sec/rev, position: don't care) to position control (speed= 0 rev/unittime, position 36°). Could this be done setting the reference speed to zero and adding a PI control (similar as with the speed) to control Id (instead of setting Id) to zero?
Thank you very much for your help. It is much appreciated
i.e. setting n_ref to zero and using pos_ref? and when speed control is desired, use n_ref but not adding the output of the PI controller what works with pos_ref and pos_real?