## 2 Mathematical Model of Permanent Magnet Synchronous Motor  
The topology of the three-phase two-level voltage source inverter permanent magnet synchronous motor system is shown in Figure 1, where Vdc represents the dc voltage and Q1-Q6 constitute the six upper and lower bridge arms of the inverter, with a total of eight switching states. A set of voltages u(t) (u(t) \(\in\) U) is applied to the motor, which can be selected from the switching states \"U\"[000, 100, 110, \(\ldots\), 111 ], where U is a finite set of voltage vectors, including the six non-zero vectors U1 (001), U2 (010), U3 (011), U4 (100), U5 (101), and U6 (110) and the two zero vectors U0 (000) and U7 (111). The permanent magnet synchronous motor is a nonlinear system with multiple variables and strong coupling. Due to the complex relationships and challenging calculations between various variable parameters, we simplify the analysis by transforming the motor equations from the three-phase stationary ABC coordinate system to the two-phase stationary d-q coordinate system. Ignoring the iron losses and leakage flux in the motor, the external voltage formula for the circuit is as follows:  
\[\vec{u_{s}}=R_{s}\vec{i_{s}}+\frac{d\overrightarrow{\textbf{v}}_{s}}{dt}\]  
Additionally, since the total induced electromotive force in the windings is the sum of the induced and motional electromotive forces, the external voltage formula for the circuit is as follows:  
\[\vec{u_{s}}=R_{s}\vec{i_{s}}+L_{s}\frac{d\vec{i_{s}}}{dt}+j\omega_{e}\vec{ \textbf{v}}_{m}\]  
where \(u_{s}\) is the stator voltage vector, \(R_{s}\) is the stator resistance, \(\psi_{s}\) is the stator magnetic chain vector and \(i_{s}\) is the stator current vector. \(\textbf{v}_{m}\) represents the back electromotive force. \(L_{s}\) is the stator inductance. The corresponding equivalent circuit is shown in Figure 2.  
Figure 1: Voltage-type three-phase bridge inverter topology. Assuming that the core saturation and hysteresis losses are not considered, the stator voltage equation is satisfied as follows:  
\[u_{s}=R_{s}i_{s}+\frac{\text{d}\psi_{s}}{\text{d}t} \tag{1}\]  
In the two-phase d and q rotating coordinate system, the stator voltage, electromagnetic torque, and stator magnetic chain equations are as follows:  
\[ \begin{bmatrix}u_{d}\\ u_{q}\end{bmatrix} = \begin{bmatrix}R_{s}&0\\ 0&R_{s}\end{bmatrix}\begin{bmatrix}i_{d}\\ i_{q}\end{bmatrix} + \begin{bmatrix}\frac{\text{d}\psi_{q}}{\text{d}t}\\ \frac{\text{d}\psi_{q}}{\text{d}t}\end{bmatrix} + \begin{bmatrix}-\omega_{\text{ e}}\psi_{q}\\ \omega_{\text{e}}\psi_{d}\end{bmatrix}  \tag{2}\]  
The flux linkage equations are as follows:  
\[ \begin{bmatrix}\psi_{d}\\ \psi_{q}\end{bmatrix} = \begin{bmatrix}L_{d}&0\\ 0&L_{d}\end{bmatrix}\begin{bmatrix}i_{d}\\ i_{q}\end{bmatrix} + \begin{bmatrix}\psi_{f}\\ 0\end{bmatrix}  \tag{3}\]  
The torque equation is as follows:  
\[T_{e}=\frac{3}{2}p_{n}\left(\psi_{d}i_{q}-\psi_{q}i_{d}\right) \tag{4}\]  
Substituting Equation (3) into Equations (2) and (4), we obtain the final voltage equations and the torque equation for the d-axis and q-axis:  
\[ \begin{bmatrix}u_{d}\\ u_{q}\end{bmatrix} = \begin{bmatrix}R_{s}&-\omega_{e}L_{q}\\ \omega_{e}L_{d}&R_{s}\end{bmatrix}\begin{bmatrix}i_{d}\\ i_{q}\end{bmatrix} + \begin{bmatrix}L_{d}&0\\ 0&L_{q}\end{bmatrix}\begin{bmatrix}\frac{d_{d}}{dt}\\ \frac{d_{q}}{dt}\end{bmatrix} + \begin{bmatrix}0\\ \omega_{e}\psi_{f}\end{bmatrix}  \tag{5}\]  
\[ \begin{split}\text{{Te}}=\frac{3}{2}p_{n}\left[\psi_{f}i_{q}+ \left(L_{d}-L_{q}\right)i_{d}i_{q}\right]\end{split}  \tag{6}\]  
Since \(L_{d}=L_{q}\) for surface-mounted permanent magnet synchronous motors, the following torque equation can be obtained:  
\[ \begin{split}\text{{Te}}=\frac{3}{2}p\psi_{f}i_{q}\end{split}