# Parameter Tuning of PI Control for Speed Regulation of a PMSM Using Bio-Inspired Algorithms
## 6 Results and Discussion  
The adjustment parameters of the algorithms, which were used for the BBO are number of habitats equal to 40, a permanence range of 1 and a mutation factor of 0.04 [46]. For SCA was set maximum of iterations equal to 40 and 40 search agents, \(r_{1}=2-(0.2t)\), \(r_{2}\), \(r_{3}\) and \(r_{4}\) with a randomized value [45]. While CSA occupied the parameters 40 nests and a probability of finding foreign eggs \(P_{a}=0.25\)[25], the adjustment of the FPA are as size of population equal to 40, a maximum number of iterations equal to 40 and initial value of \(p\) equal to 0.8 [47], and BA with \(r_{0}=0.1\), \(L_{0}=0.9\), \(\gamma=0.9\), \(\alpha=0.9\), \(F_{min}=0\) and \(F_{max}=0\)[43]. The initial population and the number of iterations for all the algorithms was fixed at 40, the same value was chosen so that the results could be object of comparison, the parameters of each algorithm are taken from the referenced articles. Obtaining the gains of the three PI controllers that make up the speed control scheme occurs based on simulations developed in the Matlab environment, where the different heuristics and the dynamic model of the PMSM described by the differential Equations (1)-(3) are integrated. The motor parameters used in the simulation are contained in Table 1. While the graphs in Figure 7 show the behavior of the system using the different algorithms, feeding with a step (1000 rad/s), and under constant load torque (1 Nm). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Symbol** & **Value and Units** \\ \hline Inertia moment & \(J\) & \(3.5\times 10^{-5}\) Nm \\ Nominal voltage & \(\
u\) & 200 V \\ Stator resistance & \(r_{s}\) & 2.6 \(\Omega\) \\ Stator inductance \(d\) & \(L_{d}\) & 6.73 mH \\ Stator inductance \(q\) & \(L_{q}\) & 6.73 mH \\ Magnetic flux & \(\lambda_{m}\) & 0.319 Wb \\ Pole pairs & \(n_{p}\) & 4 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters of PMSM. Figure 7: _Cont._The results of single run might be unreliable due to the stochastic nature of meta-heuristics. All of the algorithms are run 25 times and statistical results from the evaluation of the gains of the three PI controllers, calculated by the different optimization algorithms in the control the PMSM (minimum, maximum, mean and standard deviation) are collected and reported in Table 2. These results show that the FPA managed to obtain the smallest value of the minimum function, with the BBO being the second best, followed by SCA and CSA, with BA presenting the worst result. Figure 7: Motor response to step and constant torque (**a**) Response using BA; (**b**) Response using BBO; (**c**) Response using CSA; (**d**) Response using FPA; (**e**) Response using SCA. The gains of PI controllers found through BA, FPA, SCA, CSA and BBO are listed in Table 3. The tests were performed on PC with Intel (R) Core (TM) i7-7500U 2.9 GHz with 8.00 GB in RAM and with 2016b version of Matlab. The execution time of the different algorithms for the calculation of the profits of the PI controllers is shown in Table 4.  
In order to know the performance of controllers in operating conditions where an unknown variable load torque is presented, the load torque is modeled using a Lorenz system described by the following first-order differential equations. \[\frac{dx}{dt}=a(y-x) \tag{32}\]  
\[\frac{dy}{dt}=x(b-z)-y \tag{33}\]  
\[\frac{dz}{dt}=xy-cz \tag{34}\]  
\[T_{l}=0.04z \tag{35}\]  
where \(a=5\), \(b=12\)y, \(c=25\); with initial conditions: \(x(0)=0.1\), y(0) = 0.1 and \(z(0)=0.5\)[48]. Below are two cases in which the reference trajectory has different natures. In the first case the transition between the desired speed values is smooth. In the second case the changes in the reference speed are values with a constant rate of change defined by slopes. \begin{table}
\begin{tabular}{c c} \hline \hline
**Algorithm** & **Average Running Time (s)** \\ \hline FPA & 7.7704 \\ BBO & 30.0921 \\ BA & 5.8327 \\ CSA & 5.1923 \\ SCA & 5.2713 \\ \hline \hline \end{tabular}
\end{table}