# High-Performance Speed Control of PMSM Using Fuzzy Sliding Mode with Load Torque Observer
## 3 Controller Design
### Speed Sliding Mode Controller Design  
The purpose of designing the speed regulator is to make the actual speed follow the given speed quickly and accurately. The speed error and its derivative are defined as  
\[\left\{ \begin{array}{l}x_{1}=e(t)=\omega_{ref}-\omega_{m}\\ x_{2}=\frac{de(t)}{dt}=\frac{de\omega_{ref}}{dt}-\frac{de\omega_{m}(t)}{dt} \end{array} \right. \tag{6}\]  
The sliding surface of the design system is  
\[S=c_{1}x_{1}+c_{2}x_{2} \tag{7}\]  
Figure 2: Current feedback decoupling control block diagram. The exponential approach law is chosen, namely  
\[\dot{S}=-\epsilon\text{sgn}(S)-kS \tag{8}\]  
where \(-\epsilon\text{sgn}(S)\) is the constant velocity switching term, \(-kS\) is the exponential switching term, and \(\epsilon\) and \(k\) are constant greater than zero. When \(S>0\), there is  
\[\dot{S}=-\epsilon-kS \tag{9}\]  
From Equation (9), the solution of the differential equation is  
\[S(t)=-\frac{\epsilon}{k}+(S_{0}+\frac{\epsilon}{k})e^{-kt},\;S_{0}=S(0) \tag{10}\]  
From Equation (10), when \(t\) is sufficiently large, the rate of convergence is faster than the exponential law [23]. When \(t>0\), if \(S(t)=0\), there is  
\[\frac{\epsilon}{k}=(S_{0}+\frac{\epsilon}{k})e^{-kt} \tag{11}\]  
\[\ln\frac{\epsilon}{k}-\ln(S_{0}+\frac{\epsilon}{k})=-kt \tag{12}\]  
then  
\[t=\frac{1}{k}[\ln(S_{0}+\frac{\epsilon}{k})-\ln\frac{\epsilon}{k}] \tag{13}\]  
From Equation (13), it can be seen that the system can reach the sliding mode surface from the initial state in a finite time, and the parameters \(\epsilon\) and \(k\) all affect the time of reaching the sliding surface; increasing \(k\) can improve the response speed, but too much \(k\) will lead to too much speed of sliding surface. If \(k\) is too small, the sliding mode surface is too slow. Small \(\epsilon\) can reduce the switching chattering, while small \(\epsilon\) affects the rapidity. When the reference signal is a step signal, the following formula is available from Equation (6). \[\dot{x}_{1}=-\dot{\omega}_{m}=-\frac{1}{j}(T_{e}-T_{l})=-\frac{1}{j}(\frac{3}{ 2}p_{u}\psi_{f}i_{q}-T_{l}) \tag{14}\]  
\[\dot{x}_{2}=-\ddot{\omega}_{m}=-\frac{1}{j}\frac{3}{2}p_{n}\psi_{f}\frac{di_{ q}}{dt} \tag{15}\]  
The following formula is obtained from \(\dot{S}=c_{1}\dot{x}_{1}+c_{2}\dot{x}_{2}\) and the Equation (8). Figure 2:0  
The expression for the control quantity \(i_{q}\) is  
Figure 2:1  
From Equation (17), it can be seen that the chattering of the system is caused by the discontinuity of the symbolic function. The amplitude of chattering is related to \(\epsilon\), and the response speed of control variables is related to \(k\). For \(\text{sgn}(\cdot)\) with poor smoothness, this paper proposes a function which not only has good smoothness but also can adjust the curve shape flexibly. Figure 2:2This function has the same properties as \(\text{sgn}(\cdot)\). The shape of \(f(S,\gamma,\beta)\) can be changed by changing \(\gamma\); the slope of the output curve near the point \((0,0)\) can be changed by changing \(\gamma\). The value range of \(f(S,\gamma,\beta)\) can be changed by changing \(\beta\), that is, the maximum value when the function output is stable. When \(\beta=1\), \(\gamma\) is at 0.2 and 0.5 and 2, as shown in Figure 3; when \(\gamma=1\), \(\beta\) is at 1 and 1.5 and 2 and 2.5, as shown in Figure 4; it can be seen that \(f(S,\gamma,\beta)\) has the effect of nonlinear control theory smoothness and variable in shape. When S approaches 0, the approaching speed is \(\varepsilon\) rather than 0. \(\varepsilon\) is related to both the speed at which the system state point approaches the sliding surface and the amplitude of chattering when the state point slides on the sliding surface. Considering that \(\varepsilon\) is also one of the factors affecting system chattering, this paper proposes a fuzzy self-tuning algorithm for \(\varepsilon\). The fuzzy control system takes \(S\) and \(\dot{S}\) as inputs, and the output is \(\varepsilon=fuzzy\left(S,\dot{S}\right)\).