# Modified Grey Wolf Optimizer and Application in Parameter Optimization of PI Controller
## 4 Experimental Evaluation and Results
### Application of M-GWO to PI Controller Parameters  
The requirement of high-precision control of motors in modern industrial conditions is increasing. A permanent magnet synchronous motor (PMSM) is now widely used in  
Figure 3: Partial convergence curve and box plot in 50 dimensions: (**a**) F1 convergence curve; (**b**) F1 box plot; (**c**) F4 convergence curve; (**d**) F4 box plot; (**e**) F12 convergence curve; (**f**) F12 box plot; (**g**) F30 convergence curve; (**h**) F30 box plot. various working conditions. While controlling the speed in the PMSM, the system is actually controlling the current. The current loop is the basis of the speed loop design, so that the output current can track the set current well for the system. For the PMSM system, the voltage equation of the \(d\)-axis and the \(q\)-axis is presented as follows:  
\[U_{d}=r\cdot I_{d}+\frac{dL_{d}I_{d}}{dt}-\omega_{e}L_{q}I_{q} \tag{18}\]  
\[U_{q}=r\cdot I_{q}+\frac{dL_{q}I_{q}}{dt}+\omega_{e}L_{d}I_{d}+\omega_{e} \psi_{f} \tag{19}\]  
where \(L_{d}\) and \(L_{q}\) are the inductance of the \(d\)-axis and \(q\)-axis respectively; \(\omega_{e}\) is the speed; and \(\psi_{f}\) is the permanent magnet flux link. The motor torque is directly related to \(I_{q}\) and \(I_{d}\). The expression of torque as follows:  
\[T_{e}=\frac{3}{2}p_{n}I_{q}\Big{[}I_{d}\big{(}L_{d}-L_{q}\big{)}+\psi_{f}\Big{]} \tag{20}\]  
For motor control, the current loop is the most internal system of the motor. The tracking accuracy of the current loop is very important, and is related to the overall performance of the motor. The smaller the current-tracking error fluctuation value of the q-axis and d-axis, the better. At present, the parameters of the PI controller added to the current loop are usually obtained through the empirical method. The empirical method can only meet the general conditions and cannot make the system have enough control accuracy. Therefore, it is important to select the appropriate PI controller parameters in the current loop. Figure 4 shows the parameter optimization process of the M-GWO for the current loop PI controller of the PMSM system. Figure 5 shows the actual parameter optimization control system. The control unit is a 32-bit floating-point DSP processor that contains TMS320F28335 and is used to implement three-phase PWM inverter processing. A STC15W10X single-chip microcomputer plays an important role as the switching unit. The manufacturer of this device is Hardman Technology in Jiande, China. The signal from the controller is transmitted to the switching board and then to the driving board. The driving board transmits the electrical signal to the PMSM system for driving. The current situation of the PMSM system is transmitted to the converter board through the encoder adapter, and then to MATLAB for data preservation. In the PI controller optimization, actual parameter values of the PMSM are selected. The PMSM parameters involved are shown in Table 2. To demonstrate the effectiveness of the method, it was compared with other excellent intelligent algorithms. Table 3 shows the parameters of the PI controller after system tuning using the WOA-PI, HHO-PI, and M-GWO-PI method. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Meaning of Parameter** & **Value** \\ \hline \(K_{PWM}\) & Inverter amplification actor & 1 \\ \(L_{q}\) & Stator q-axis inductance & 0.1 mH \\ \(L_{d}\) & Stator d-axis inductance & 0.1 mH \\ \(T_{s}\) & Inverter switching cycle & 0.1 ms \\ \(r\) & Stator resistance per phase & 0.025 \(\Omega\) \\ \(n\) & Number of poles & 5 \\ \(k_{e}\) & Back electromotive force constant & 0.004 V/rpm \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters of PMSM. operation. The q-axis current of the M-GWO-PI in the stable stage is about \(-\)2\(\sim\)1 A, while the q-axis currents of WOA-PI and HHO-PI are both around \(-\)3\(\sim\)2 A.  
Figure 5: Actual control process.