## 2 Proposed PMSM-SCS Based on DTC Strategy
### PMSM-SCS Based on DTC Strategy Using Constant Flux
#### 2.1.2 Observer for Speed, Electromagnetic Torque, and Flux Estimations
\tag{22}\]  
An observer based on Equation (23) is employed to estimate the stator flux expressed in the \(\alpha\)-\(\beta\) stationary reference frame [23; 24]. \[\left\{ \begin{array}{l}\dot{\hat{\psi}}_{\alpha}=-R_{s}i_{\alpha}+u_{\alpha} +k_{1}\widetilde{i}_{\alpha}+K_{1 SMO}sigmoid\left(\widetilde{i}_{\alpha} \right)\\ \dot{\hat{\psi}}_{\beta}=-R_{s}i_{\beta}+u_{\beta}+k_{2}\widetilde{i}_{\beta}+ K_{2 SMO}sigmoid\left(\widetilde{i}_{\beta}\right)\end{array} \right. \tag{23}\]  
where \(\hat{\psi}_{\alpha}\) and \(\hat{\psi}_{\beta}\)--estimated stator-flux variables in the \(\alpha\)-\(\beta\) stationary frame; \(\widetilde{i}_{\alpha}\) and \(\widetilde{i}_{\beta}\)--stator current errors in the \(\alpha\)-\(\beta\) stationary frame if given in Equation (24); \(k_{1}\), \(k_{2}\)\(K_{1 SMO}\), and \(K_{2 SMO}\)--projected factors (observer gains). \[\left\{ \begin{array}{l}\widetilde{i}_{\alpha}=i_{\alpha}-\hat{i}_{\alpha}\\ \widetilde{i}_{\beta}=i_{\beta}-\hat{i}_{\beta}\end{array} \right. \tag{24}\]  
Equation (25) is utilized to estimate the \(\hat{i}_{\alpha}\) and \(\hat{i}_{\beta}\) stator currents in the \(\alpha\)-\(\beta\) stationary reference frame [23; 24]. \[\hat{i}=T^{-1}\big{(}\hat{\theta}\big{)}L^{-1}T\big{(}\hat{\theta}\big{)}\hat{ \psi}+\frac{\lambda_{0}}{L_{d}}\binom{\cos\hat{\theta}}{-\sin\hat{\theta}} \tag{25}\]where \(\hat{l}=\left[\hat{l}_{\alpha}\quad\hat{l}_{\beta}\right]^{T}\); \(\hat{\psi}=\left[\hat{\psi}_{\alpha}\quad\hat{\psi}_{\beta}\right]^{T}\); \(L= \begin{bmatrix}L_{d}&0\\ 0&L_{q}\end{bmatrix} \); and the transformation matrix \(T\big{(}\hat{\theta}\big{)}\) is given in Equation (14). Equation (25), explained for the components \(\alpha\) and \(\beta\), can be written as  
\[\left\{ \begin{array}{l}\hat{i}_{\alpha}\frac{1}{L_{d}}\hat{\psi}_{\alpha}+ \frac{\lambda_{0}}{L_{d}}\cos(\hat{\theta})\\ \hat{i}_{\beta}\frac{1}{L_{q}}\hat{\psi}_{\beta}-\frac{\lambda_{0}}{L_{q}}\sin (\hat{\theta})\end{array} \right. \tag{26}\]  
The PMSM rotor angular position is estimated using the following Equation [23; 24]:  
\[\hat{\theta}=\tan^{-1}\left(\frac{\hat{\lambda}_{\alpha\beta}}{\hat{\lambda}_ {\alpha\alpha}}\right) \tag{27}\]  
where  
\[\left\{ \begin{array}{l}\hat{\lambda}_{\alpha\alpha}=\hat{\psi}_{\alpha}-L_{ d}i_{\alpha}\\ \hat{\lambda}_{\alpha\beta}=\hat{\psi}_{\beta}-L_{q}i_{\beta}\end{array} \right. \tag{28}\]  
In Equation (23), which describes a Sliding Mode Observer (SMO), the _sign_ function is substituted with the _sigmoid_ function to achieve a smooth transition between +1 and -1. The definition of the _sigmoid_ function is given by equation (29). \[H(x)=\frac{2}{1+e^{-a(x-b)}}-1 \tag{29}\]  
where \(a=4\) and \(b=0\) are positive constants chosen for this application. The convergence of the observer is proved by choosing a Lyapunov function of the following form:  
\[V=\frac{1}{2}\Big{(}\widetilde{\psi}^{T}T^{-1}L^{-1}T\widetilde{\psi}\Big{)}>0 \tag{30}\]  
in which \(\widetilde{\psi}=\psi-\hat{\psi}\). After a few calculations, we can obtained \(\dot{V}<0\), which demonstrates global asymptotic stability [23; 24]. To estimate the electromagnetic torque value, the following equation is used, according to [23; 24]:  
\[\hat{T}_{e}=\frac{3}{2}n_{p}\big{(}\hat{\psi}_{\alpha}i_{\alpha}-\hat{\psi}_{ \beta}i_{\beta}\big{)} \tag{31}\]  
Similarly, by deriving Equation (27), the PMSM rotor speed estimate is expressed as follows:  
\[\hat{\omega}(k)=\frac{\hat{\lambda}_{\alpha\alpha}(k-1)\hat{\lambda}_{\alpha \beta}(k)-\hat{\lambda}_{\alpha\beta}(k-1)\hat{\lambda}_{\alpha\alpha}(k)}{T_ {s}\big{(}\hat{\lambda}_{\alpha\alpha}^{2}(k)+\hat{\lambda}_{\alpha\beta}^{2 }(k)\big{)}} \tag{32}\]  
where the sampling period is denoted by \(T_{s}\), and the current sampling step is noted with \(k\).