## 2 Analytical Representation Regulation Scheme of PMSM
### Control Algorithm  
The system depicted in (1)-(4) is a set of coupled nonlinear differential equations with two control inputs, \(v_{d}\) and \(v_{q}\) and one disturbance signal (\(T_{l}\)). The main task of the PMSM drive based on linear controllers is to design an asymptotically stable regulation scheme for robust tracking tasks against different operating conditions and desired speed reference profiles.  
The PMSM used in this servo system demands a particular configuration of control scheme, Figure 1. The system contains a permanent magnet synchronous motor, a field oriented control, coordinate transformations \(abc\) to \(dq\) and vice versa, a sinusoidal pulse width modulation, a power source rectifier based on semiconductor devices, a direct current voltage bus (\(V_{CD}\)) an encoder used to detect speed and three PI controllers. The controllers apply a structure of cascade control loops, consisting of an external speed loop and two inners currents loops. The cascade control is used to attenuate the effect of disturbances. In this work, the three control loops are used to track desired speed reference profiles and provide robustness against exogenous disturbances (mechanical load torque) and parametric variations due to operating temperature.  
The external control loop with negative feedback is used for speed regulation and compensate variations of load torque. Figure 1 shows that the outer control loop computes the desired current signal \((i_{q}^{*})\) in \(q\) axes, for the desired speed \(\omega^{*}\) with the rotor speed error signal \(e_{\omega}\). The expression to compute the rotor speed error signal can be represented as,  
\[e_{\omega}=\omega^{*}-\omega_{r} \tag{5}\]  
where \(\omega^{*}\) is the desired rotor speed and \(e_{\omega}\) is the rotor speed error. The external loop equation can be expressed as  
\[i_{q}^{*}=k_{p,\omega_{r}}(\omega^{*}-\omega_{r})+k_{i,\omega_{r}}\int_{0}^{t }(\omega^{*}(\tau)-\omega_{r}(\tau))d\tau \tag{6}\]  
where \(k_{p,\omega_{r}}\) and \(k_{i,\omega_{r}}\) are the proportional gain of rotor speed and the integral gain of rotor speed, respectively. The two internal control loops are called the secondary control. The inner loops attenuate the effect due to the parametric variations of PMSM. The equations of the two internal control loops are given by  
\[\begin{gathered} v_{d}=k_{p,i_{d}}(i_{d}^{*}-i_{d})+k_{i,i_{d}} \int_{0}^{t}(i_{d}^{*}(\tau)-i_{d}(\tau))d\tau-L_{q}\omega_{e}i_{q}\\ v_{q}=k_{p,i_{q}}(i_{q}^{*}-i_{q})+k_{i,i_{q}}\int_{0}^{t}(i_{q}^{*}( \tau)-i_{q}(\tau))d\tau+L_{d}\omega_{e}i_{d}+\omega_{e}\lambda_{m}\end{gathered} \tag{7}\]  
where \(k_{p,i_{d}}\) and \(k_{i,i_{d}}\) are proportional and integral gains of the current on \(d\)-axis, respectively; \(i_{d}^{*}\) is the \(d\)-axis current reference value, \(k_{p,i_{q}}\) and \(k_{i,i_{q}}\) are proportional and integral gains of the current on \(q\)-axis, respectively; and  
\[\begin{gathered} v_{d}=L_{q}\omega_{e}i_{q}+U_{d}\\ v_{q}=-L_{d}\omega_{e}i_{d}-\omega_{e}\lambda_{m}+U_{q}\end{gathered} \tag{8}\]  
where \(U_{d}\) and \(U_{q}\) are two new auxiliary control variables. The auxiliary variables are used to obtain the desired dynamics for the PMSM stator currents eliminating the nonlinearities and the coupling of the mechanical and electrical variables indicated in (1) and (2) [7,37]. Thus, \(k_{p,i_{q}}\), \(k_{i_{d},i_{q}}\), \(k_{p,i_{d}}\), \(k_{i_{d},i_{d}}\), \(k_{p,\omega_{r}}\) and \(k_{i,\omega_{r}}\) are computed simultaneously using six nature-inspired algorithms to ensure high speeds tracking performance and efficient disturbances rejection. The purpose of this analysis is to compare  
Figure 1: Schematic diagram of the permanent magnet synchronous motor (PMSM) control system.  
different reactive, nature-inspired algorithms for tuning parameters of the PID controller in order to discover the most suitable algorithm for the velocity trajectory tracking controller problem.