## 3 Sensorless FOC with Luenberger-Type Back-EMF Observer
### Sensorless FOC
#### 3.1.2 Speed Loop  
The speed loop is the outer loop in the cascade control structure of FOC. In the speed loop, a PI controller is employed to provide appropriate speed control of the PMSM machine. The output of the speed controller creates a reference value for the \(q\)-axis current controller, as is evident in Figure 7. In most applications, it is advantageous to use a PI controller with an anti-windup function limiting the controller output and preventing current overload of the machine or inverter. An electrical time constant of the machine is usually much smaller than the time constant of the mechanical part. A small electrical time constant requires a higher sampling frequency of the current loop, while the speed loop operates at a lower sampling frequency. This ensures enough time to control the machine current between two speed samples properly. Therefore, the current loop can be considered the gain equal to 1. Furthermore, it simplifies the speed controller design, reducing the speed loop transfer function to a second-order system. The block diagram of the simplified speed loop scheme is presented in Figure 8.  
Figure 8: Block diagram of the simplified speed loop. Figure 7: Block diagram of the speed loop. The closed speed loop can then be designed with the following transfer functions representing mechanical system and speed controller:  
\[F_{m}(s)=\frac{k_{T}}{Js+B} \tag{17}\]  
\[F_{Pl_{\omega}}(s)=\frac{K_{Pl_{\omega}}s+K_{I_{\omega}}}{s} \tag{18}\]  
where \(k_{T}\) is the torque constant, \(B\) is the viscous friction coefficient, and \(K_{Pl_{\omega}}\), \(K_{I_{\omega}}\) are the proportional and integral gains of the speed controller. The transfer function of the speed loop can be created based on (17) and (18):  
\[F_{\omega}(s)=\frac{F_{Pl_{\omega}}(s)F_{m}(s)}{1+F_{Pl_{\omega}}(s)F_{m}(s)}= \frac{\frac{k_{T}K_{Pl_{\omega}}s}{J}+\frac{k_{T}K_{I_{\omega}}}{J}}{s^{2}+ \Big{(}\frac{k_{T}K_{Pl_{\omega}}+B}{J}\Big{)}s+\frac{k_{T}K_{I_{\omega}}}{J}} \tag{19}\]  
Similarly, as in the current loop, zero is introduced in the nominator of (19) due to the PI controller increasing system overshoot. The zero can be compensated again with the zero-cancellation block, as shown in Figure 9, to improve the speed loop control performance during machine transients. As an alternative to the zero-cancellation block, a ramp function is commonly used in several applications to prevent system overshoot. The transfer function of the zero-cancellation with speed controller gains is defined as:  
\[F_{ZC_{\omega}}(s)=\frac{1}{\frac{K_{Pl_{\omega}}}{K_{I_{\omega}}}s+1} \tag{20}\]  
Introducing (20) into (19), the transfer function of the speed loop with compensated zero is in the following form:  
\[F_{\omega}(s)=\frac{F_{Pl_{\omega}}(s)F_{m}(s)}{1+F_{Pl_{\omega}}(s)F_{m}(s)}= \frac{\frac{k_{T}K_{I_{\omega}}}{J}}{s^{2}+\Big{(}\frac{k_{T}K_{I_{\omega}}+B} {J}\Big{)}s+\frac{k_{T}K_{I_{\omega}}}{J}} \tag{21}\]  
Comparing the characteristic polynomial of (21) with the ideal second-order system, the parameters of the speed controller can be derived as:  
\[ \begin{array}{c}K_{P_{\omega}}=\frac{2\xi_{\omega}\omega_{0_{\omega}}J-B}{ k_{T}}\\ K_{I_{\omega}}=\frac{I}{k_{T}}\omega_{0_{\omega}}^{2}\end{array}  \tag{22}\]  
Figure 9: Block diagram of the simplified speed loop with zero-cancellation. where \(\omega_{0,\omega}\) is the natural frequency of the speed loop, and \(g_{\omega}\) is the damping factor of the speed loop. The discrete form of speed controller gains can be designed as:  
\[ \begin{split} K_{P_{\omega}}(z)=K_{P_{\omega}}\\ K_{L_{\omega}}(z)=K_{L_{\omega}}T_{s_{\omega}}\end{split}  \tag{23}\]  
where \(T_{s_{\omega}}\) is the sampling period of the speed loop. It should be noticed that the current loop is usually maintained faster than the speed loop. The reason is that the electrical time constant of the motor is much smaller than the mechanical time constant of the motor, and so the small electrical time constant requires the current control loop to run at a higher sampling frequency.