# Modeling and Speed Tuning of a PMSM with Presence of Fisure Using Dragonfly Algorithm
## 7 Results
For the convergence test between answers to the control action of the linear test model and the proposed model of nonlinear PMSM, the desirable behavior of angular velocity is proposed through a defined step function where  
\[\omega_{rd}=\left\{ \begin{array}{ll}188.5\frac{\mathrm{rad}}{\mathrm{s}}&if \ t<0.0005\ \mathrm{s}\\ 100.0\frac{\mathrm{rad}}{\mathrm{s}}&if\ t>0.0005\ \mathrm{s}\end{array} \right.\]  
The response of behavior of the angular velocity \(\omega_{r}\) and current consumption corresponding to \(i_{q}\) of linear comparison model of the PMSM in the desired angular velocity input \(\omega_{rd}\) are shown in Figure 9. The parameters for proper convergence of search-tuning of the DA after numerical simulation tests are shown in Table 2.  
In Figure 10, the behavior of the DA regarding the pursuit of gains for tune the PMSM model is illustrated, with the presence of degradation in rotational inertia, under search conditions defined by the sensitivity analysis and the desired model of behavior of linear PMSM, as well as angular speed's desired behavior under a first search iteration. Figures 10 and 11 show, in different colors, the dynamic response of the closed-loop system (controller-PMSM), with all gains calculated in the first iteration and in the tenth search evolution, respectively. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Numerical Value** \\ \hline Population size & 40 \\ \hline Maximum of iteration & 100 \\ \hline Random values & \(r_{1}=r_{2}=[0;1]\) \\ \hline Separation weight & 0.12 \\ \hline Alignment weight & 0.12 \\ \hline Cohesion weight & 0.75 \\ \hline Food factor & 1 \\ \hline Enemy factor & 1 \\ \hline Inertia weight & 0.9–0.2 \\ \hline \(\beta\) & 1.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Dragonfly algorithm implementation details. Figure 9: Desired behavior of angular velocity (lower) and current consumption \(i_{q}\) (higher) in the linear comparison system. In Figure 11, the behavior of the collection of gains generated by the DA is illustrated, and applied to a proposed model of the PMSM with the presence of degradation in rotational inertia. In the tenth search evolution, the convergence of the behaviors of all these gains obtained by the DA is obtained for the desired model of linear reference to the PMSM. In Figure 12, the best response obtained in the \(\omega_{\rm r}\) angular velocity tuning process is illustrated. The consumption of current \(i_{q}\) by the controller action defined by the dragonfly algorithm, in the case of the analysis, is  
\[k_{1}=1521.6;\;k_{2}=223.1;\;k_{p}=-799.4;\;k_{i}=-4.4;\;k_{d}=12.4\]  
Figure 11: Behavior of the DA for the dynamic system PMSM with crack presence, better control gains in the tenth search evolution. Figure 10: Behavior of the dragonfly algorithm in the search of tuning, for both current consumption (up), and desired angular velocity (below), first iteration. It is observed that the obtained trajectory has a performance with behavior close to the desired angular velocity, \(\omega_{nd}\), therefore, the gains obtained are considered optimal. The behavior of the proposed nonlinear model and linear model PMSM reference for times greater than 0.001 s is achieved with these gains, so the robustness of the tuning algorithm is checked under the presence of the initial fissure given. Figure 13 illustrates the \(\omega_{r}\) angular velocity behavior and consumption of current \(i_{q}\) under the action of the gains obtained through the simulation done for an evaluation time of 0.03 s, which shows that the system keeps responding to the action of control. In Figure 14, the speed behavior angular \(\omega_{r}\) and current consumption \(i_{q}\) of the nonlinear model of the PMSM, proposed with degradation in rotational inertia for a simulation time of 450 s, are illustrated. The time of evaluation is large so that the effects of steady state be seen, and it is observed that the behavior of the desired angular velocity \(\omega_{rd}\) is maintained under the action of control.