## 3 Control Strategy of Motor Control System
### Closed Loop Regulator Design
#### 3.2.2 Fuzzy PI Regulator Design  
The fuzzy control system takes the deviation, the deviation variation rate, and the variation rate of deviation change as the input of the fuzzy controller. According to the input numbers, fuzzy controllers can be divided into one-dimensional, two-dimensional, and three-dimensional. This paper chose a two-dimensional fuzzy controller as the core of the fuzzy control system.  
In this paper, there are two inputs of the fuzzy controller. One is the difference between the target speed and the actual speed of the electric motor, and the other one is the change in the difference. The output is the change in the PI parameters, they are \(\Delta K_{p}\) and \(\Delta K_{i}\). It can be concluded that the structure of the online tuning regulator for speed PI parameters of PMSM vector control system is shown in Figure 7. The final expression of the speed PI parameter online tuning regulator is:  
\[\left\{\begin{aligned} & K_{\text{p}}=K_{\text{p0}}+\Delta K_{\text{p}}\\ & K_{\text{i}}=K_{\text{i0}}+\Delta K_{\text{i}}\end{aligned}\right. \tag{17}\]  
where \(K_{\text{p0}}\) and \(K_{\text{i0}}\) are the initial PI parameters obtained by the engineering method for the mathematical model of PMSM.  
To make the fuzzy controller work normally, variables should be defined by fuzzy language. In this paper, fuzzy variables \(e\) and \(ec\) are defined as:  
\[\left\{\text{NB,NM,NS,ZO,PS,PM,PB}\right\} \tag{18}\]  
where N is negative, B is big, M is middle, S is small, ZO is zero, and P is positive.  
According to engineering practice experience, the adjustment function of PI parameters and fuzzy inference rules, the requirements of \(e\) and \(ec\) for \(K_{p}\) and \(K_{i}\) can be obtained.  
* When \(e\) is large and \(e>0\), \(K_{p}\) should be increased to make the system output quickly approach the target value, while \(K_{i}\) should be reduced to prevent the system from overshooting;
* When \(e\) is large and \(e<0\), \(K_{p}\) should be appropriately reduced to reduce overshoot, while \(K_{i}\) should be increased to eliminate the steady-state error;
* When \(e\) is small and \(ec\) is large, \(K_{p}\) should be reduced and \(K_{i}\) should be appropriately increased;
* When \(e\) is close to zero, \(K_{p}\) and \(K_{i}\) should be increased appropriately to improve the steady-state accuracy and dynamic characteristics of the system.  
According to the characteristics of PI parameters and the above requirements, fuzzy control rules of \(K_{p}\) and \(K_{i}\) changing for \(e\) and \(ec\) can be obtained, as shown in Tables 1 and 2.  
Figure 7: Diagram of the online tuning regulator for speed PI parameters.  
The fuzzy controller parameters that are the quantization factor of the input variable and the proportional factor of the output control quantity affects the performance of the system directly. The quantization factor of the input variable and the scale factor of the output control quantity can be expressed as:  
\[\left\{\begin{array}{c}K_{\text{e}}=\frac{n}{x_{\text{e}}};K_{\text{ec}}=\frac {m}{x_{\text{ec}}}\\ K_{\text{up}}=\frac{y_{\text{up}}}{l_{\text{p}}};K_{\text{ui}}=\frac{y_{\text{ui }}}{l_{\text{i}}}\end{array}\right. \tag{19}\]  
The quantization factor of the input variable and the scale factor of the output control value calculated according to Equation (19) are ideal values. In practical application, the specific value of the fuzzy controller parameters should be adjusted according to the actual control effect.