## 3 The Proposed PI-Tuned Speed Controller
\[\mathrm{i_{qs}^{*}}\mathrm{=}\left(\frac{2}{3}\right)\cdot\left(\frac{2}{P} \right)\cdot\left(\frac{\mathrm{L_{r}}}{\mathrm{L_{m}}}\right)\cdot\left( \frac{\mathrm{T_{e}^{*}}}{\left|\Psi\mathrm{r}\right|_{\mathrm{est}}}\right) \tag{3}\]  
\[\left|\Psi\mathrm{r}\right|_{\mathrm{est}}=\frac{\mathrm{L_{m}}\cdot\mathrm{i_ {ds}}}{1+\mathrm{T_{r}}\cdot\mathrm{s}} \tag{4}\]  
\[\mathrm{T_{r}}=\frac{\mathrm{L_{r}}}{\mathrm{R_{r}}} \tag{5}\]  
Here, P is the number of poles, \(\left|\Psi\mathrm{r}\right|_{\mathrm{est}}\) is the estimated rotor flux, \(\mathrm{L_{r}}\) and \(\mathrm{L_{m}}\) are rotor inductance and motor inductance, respectively, while \(\mathrm{R_{r}}\) is the rotor resistance and \(\mathrm{T_{r}}\) is the rotor time constant. Here, \(\mathrm{L_{r}}\) is calculated via Equation (6). Rotor frequency \(\omega_{\mathrm{r}}\) is measured using Equation (7). The direct axis reference current \(\mathrm{i_{ds}^{*}}\) is found by taking the rotor flux reference input \(\left|\Psi_{\mathrm{r}}\right|^{*}\) in Equation (8). \[\mathrm{L_{r}}\mathrm{=L_{lr}}\mathrm{+L_{m}} \tag{6}\]  
\[\omega_{\mathrm{r}}=\frac{\mathrm{L_{m}}\cdot\mathrm{I_{q}}}{\mathrm{T_{r}} \cdot\left|\Psi\mathrm{r}\right|^{*}} \tag{7}\]  
\[\mathrm{i_{ds}^{*}}\mathrm{=}\frac{\left|\Psi\mathrm{r}\right|^{*}}{\mathrm{ L_{m}}} \tag{8}\]  
Here, \(\mathrm{L_{lr}}\) is rotor leakage inductance, the rotor flux angle \(\mathrm{\theta_{e}}\) is utilized for the coordinate's transformation from dq to ABC and the coordinate's conversion from an ABC to a dq form, respectively. The above-mentioned angle is calculated from the integration taken for the sum of the rotor mechanical speed \(\omega_{\mathrm{m}}\), measured by the speed sensor, and rotor frequency \(\omega_{\mathrm{r}}\) in Equation (9), while rotor frequency is computed in Equation (3). For the ABC to dq transformation, the values of the measured 3-phase current \(\mathrm{I_{abc}}\) and rotor flux positions \(\mathrm{\theta_{e}}\) are used to generate dq currents for flux and theta generation, respectively. \[\mathrm{\theta_{e}}\mathrm{=}\int\left(\omega_{\mathrm{r}}+\omega_{\mathrm{m}}\right) \tag{9}\]  
Figure 3: FM-PI speed controller with a saturator for the upper and lower torque limit. DQ to ABC current conversion is calculated with Equations (10)-(12):  
Figure 3.0 Figure 3.1 (11) Figure 3.2  
ABC to DQ current conversion is calculated with Equations (13) and (14):  
Figure 3.3 Figure 3.4  
The \(\mathrm{i}_{\mathrm{qs}}^{*}\) and \(\mathrm{i}_{\mathrm{ds}}^{*}\) are the reference quadrature and reference direct currents, respectively. Both currents are converted into the 3-phase current references \(\mathrm{I}_{\mathrm{abc}}^{*}\) through \(\mathrm{\theta_{e}}\) for calculations related to the current regulators. The role of the current regulator is to generate gate pulses for the IGBT inverter. The three-phase hysteresis current regulator is taking the measured \(\mathrm{I_{abc}}\) and reference \(\mathrm{I}_{\mathrm{abc}}^{*}\) values to generate gate signals for the smooth operation of the IGBT inverter. The IM is implemented as an asynchronous machine Simulink block. The IM is supplied by a current-controlled PWM (IGBT)inverter, working as a three-phase AC source. The model developed in Simulink is presented in Figure 3.5 The output waveforms are generated for (a) voltage between two phases, (b) current (3-phase), (c) rotor speed, and (d) electromagnetic torque to analyze behavior at different time periods. The IM employed is set at 50 HP, 460 V, four-pole, and 60 Hz, with the parameters given in Figure 3.6  
The actions of the rotor and stator are synchronized by the swing equation. The purpose is to calculate the conversion efficiency from electrical power to mechanical power. The swing equation in terms of torque is calculated using Equation (15). Here, \(\mathrm{T_{m}}\), \(\mathrm{T_{g}}\), and \(\mathrm{T_{D}}\) are the mechanical, electrical, and damping torques, respectively.