## 2 Mathematical Models of the Induction Motor and the PQ-MRAS Estimator
### Mathematical Model of the PQ-MRAS Estimator  
The proposed estimator consists of two subsystems:  
* P-MRAS--based on the active power (P) of the machine; it is used to calculate the stator resistance. * Q-MRAS--based on the reactive power (Q) of the machine; it is used to calculate the rotor resistance. Each subsystem has its own independent adaptation mechanism based on a PI (proportional-integral) controller. The common part of P and Q-MRAS is the rotor flux estimator. A reference model of the P-MRAS is given by:  
\[P^{\mathrm{ref}}=\mathrm{Re}\Big{[}\mathbf{u_{s}}\cdot\mathbf{i_{s}}^{*} \Big{]}=u_{s\alpha}i_{s\alpha}+u_{s\beta}i_{s\beta} \tag{7}\]  
In an adjustable model, estimated stator voltage is used instead of the measured one. Based on Equations (1), (3) and (4), the estimated stator voltage vector can be expressed as:  
\[\mathbf{u_{s}}^{\mathrm{est}}=R_{s}\mathbf{i_{s}}+\frac{L_{m}}{L_{r}}\frac{ \mathrm{d}\psi_{\mathbf{r}}^{\mathrm{est}}}{\mathrm{d}t}+\sigma L_{s}\frac{ \mathrm{d}\mathbf{i_{s}}}{\mathrm{d}t} \tag{8}\]  
Finally, the formula of P-MRAS adjustable model is:  
\[P^{\mathrm{adj}}=\mathrm{Re}\Big{[}\mathbf{u_{s}}^{\mathrm{est}}\cdot\mathbf{ i_{s}}^{*}\Big{]}=R_{s}^{\mathrm{est}}\Big{(}i_{s\alpha}{}^{2}+i_{s\beta}{}^{2} \Big{)}+\sigma L_{s}\Bigg{(}i_{s\alpha}\frac{\mathrm{d}i_{s\alpha}}{\mathrm{d }t}+i_{s\beta}\frac{\mathrm{d}i_{s\beta}}{\mathrm{d}t}\Bigg{)}+\frac{L_{m}}{L_{ r}}\Bigg{(}i_{s\alpha}\frac{\mathrm{d}\psi_{m}{}^{\mathrm{est}}}{\mathrm{d}t}+i_{s \beta}\frac{\mathrm{d}\psi_{r\beta}{}^{\mathrm{est}}}{\mathrm{d}t}\Bigg{)} \tag{9}\]It can be observed that the value of active power, calculated by the adjustable model, directly depends on stator resistance. Therefore, the role of stator resistance adaptation mechanism is the minimization of the error between the two models:  
\[\varepsilon_{\mathrm{P}}=P^{\mathrm{ref}}-P^{\mathrm{adj}}, \tag{10}\]  
\[R_{\mathrm{s}}^{\mathrm{est}}=K_{PRs}\varepsilon_{P}+K_{IRS}\int\varepsilon_{P} \mathrm{d}t \tag{11}\]  
where \(K_{PRs}\), \(K_{IRS}\)--coefficients of the proportional and integral terms, respectively. Rotor flux components in (9) are derived from the current model estimator [1]:  
\[\psi_{\mathbf{r}}^{\mathrm{est}}=\int\Big{(}\frac{R_{r}}{L_{r}}\Big{(}L_{m}i_{ \mathbf{s}}-\psi_{\mathbf{r}}^{\mathrm{est}}\Big{)}+jp_{b}\omega_{m}\psi_{ \mathbf{r}}^{\mathrm{est}}\Big{)}\mathrm{d}t. \tag{12}\]  
The reference model of the Q-MRAS is given by:  
\[Q^{\mathrm{ref}}=\mathrm{Im}\{\mathbf{u}_{\mathrm{s}}\cdot\mathbf{i}_{ \mathrm{s}}\mathrm{*}\}=u_{\mathrm{s}\beta}i_{\mathrm{s}\alpha}-u_{\mathrm{s} \alpha}i_{\mathrm{s}\beta}, \tag{13}\]  
whereas the adjustable model of this subsystem uses the estimated value of the stator voltage (8):  
\[Q^{\mathrm{adj}}=\mathrm{Im}\Big{\{}\mathbf{u}_{\mathrm{s}}^{\mathrm{est}} \cdot\mathbf{i}_{\mathrm{s}}\mathrm{*}\Big{\}}=\sigma L_{\mathrm{s}}\bigg{(}i _{\mathrm{s}\alpha}\frac{\mathrm{d}i_{\mathrm{s}\beta}}{\mathrm{d}t}-i_{ \mathrm{s}\beta}\frac{\mathrm{d}i_{\mathrm{s}\alpha}}{\mathrm{d}t}\bigg{)}+ \frac{L_{m}}{L_{r}}\bigg{(}i_{\mathrm{s}\alpha}\frac{\mathrm{d}\psi_{r\beta}^ {\mathrm{est}}}{\mathrm{d}t}-i_{\mathrm{s}\beta}\frac{\mathrm{d}\psi_{r\alpha} ^{\mathrm{est}}}{\mathrm{d}t}\bigg{)}. \tag{14}\]  
In this model the dependence on the rotor resistance is implicit. It consists of the rotor flux components which are calculated by the current model (12) which directly depends on the value of this parameter. The rotor resistance adaptation mechanism minimizes the error between the reference and adjustable models:  
\[\varepsilon_{Q}=\big{|}Q^{ref}\big{|}-\big{|}Q^{\mathrm{adj}}\big{|}, \tag{15}\]  
\[R_{r}^{\mathrm{est}}=K_{PRr}\varepsilon_{Q}+K_{IRr}\int\varepsilon_{Q} \mathrm{d}t. \tag{16}\]  
where \(K_{PRr}\), \(K_{IRr}\)--coefficients of the proportional and integral terms, respectively. The sign of the reactive power is changed due to the shaft rotational speed reversals, therefore in the adaptation mechanism the absolute values of \(Q^{\mathrm{ref}}\) and \(Q^{\mathrm{adj}}\) are used.