## 2 A Harmonic Model of PMSMs  
During the steady-state operation of PMSM, factors such as air gap magnetic field distortion, inverter voltage drop, and the inherent magnetic field distortion of the motor can cause the current waveform to become distorted. These distorted current waveforms generate various harmonic components, with the fifth and seventh harmonics having a particularly significant impact on motor operation. These harmonics induce torque ripple at the sixth harmonic frequency, thereby compromising the stability of motor operation. To thoroughly investigate and address this issue, a corresponding mathematical model of the PMSM was established. Assuming the PMSM is ideal under perfect conditions, the stator voltage equations and stator flux linkage equations in the d-q coordinate system can be derived as follows:  
\[\left[ \begin{array}{c}u_{d}\\ u_{q}\end{array} \right]= \begin{bmatrix}R_{s}&-w_{e}L_{q}\\ w_{e}L_{d}&R_{s}\end{bmatrix} \left[ \begin{array}{c}i_{d}\\ i_{q}\end{array} \right]+\frac{\mathrm{d}}{\mathrm{dt}}\left[ \begin{array}{c} i_{d}\\ i_{q}\end{array} \right]+ \begin{bmatrix}0\\ w_{e}\Psi_{f}\end{bmatrix}  \tag{1}\]  
where \(u_{d}\) and \(u_{q}\) are the voltage components of the stator in the d-axis and q-axis, respectively; \(i_{d}\) and \(i_{q}\) are the current components of the stator in the d-axis and q-axis, respectively; \(L_{d}\) and \(L_{q}\) are the inductances on the d-axis and q-axis, respectively; \(\Psi_{f}\) is the permanent magnet flux linkage of the motor rotor; \(w_{e}\) is the electrical angular speed of the motor; and \(\Psi_{d}\) and \(\Psi_{q}\) are the flux linkages in the d-axis and q-axis of the stator, respectively. Considering a surface-mounted PMSM, the stator inductances in the d-axis and q-axis are equal, i.e., \(L_{d}=L_{q}=L_{s}\). In the d-q coordinate system, the electromagnetic torque equation can be expressed as follows:  
\[T_{e}=\frac{3}{2}p\Psi_{f}i_{q} \tag{2}\]  
where \(T_{e}\) represents the electromagnetic torque of the motor, and \(p\) denotes the number of pole pairs. Under mechanical load, the dynamic motion equation of the PMSM can be expressed as follows:  
\[T_{e}-T_{L}-Bw=J\frac{d\omega}{dt} \tag{3}\]  
where \(T_{L}\) represents the load torque; \(J\) is the moment of inertia of the motor; \(w\) is the mechanical angular velocity; and \(B\) is the damping coefficient. The expressions for the fifth and seventh harmonic components of the three-phase stator current are defined as follows:  
\[\left\{ \begin{aligned} i_{\text{A5}}=I_{\text{5}}\sin(5 \omega t+\varphi_{\text{5}})\\ i_{\text{B5}}=I_{\text{5}}\sin(5\omega t+\varphi_{\text{5}}+120^{\circ}) \\ i_{\text{C5}}=I_{\text{5}}\sin(5\omega t+\varphi_{\text{5}}-120^{\circ}) \end{aligned} \right. \tag{4}\]  
\[\left\{ \begin{aligned} i_{\text{A7}}=I_{\text{7}}\sin(7 \omega t+\varphi_{\text{7}})\\ i_{\text{B7}}=I_{\text{7}}\sin(7\omega t+\varphi_{\text{7}}-120^{\circ}) \\ i_{\text{C7}}=I_{\text{7}}\sin(7\omega t+\varphi_{\text{7}}+120^{\circ}) \end{aligned} \right. \tag{5}\]  
After performing a rotor flux-oriented coordinate transformation, the expressions for the fifth and seventh current harmonic components in the two-phase rotating coordinate system (d-q coordinate system) are given by:  
\[\left\{ \begin{aligned} i_{\text{d5}}=I_{\text{5}}\cos(6 \omega t+\varphi_{\text{5}})\\ i_{\text{q5}}=I_{\text{5}}\sin(6\omega t+\varphi_{\text{5}}) \end{aligned} \right. \tag{6}\]  
\[\left\{ \begin{aligned} i_{\text{d7}}=I_{\text{7}}\cos(6 \omega t+\varphi_{\text{7}})\\ i_{\text{q7}}=I_{\text{7}}\sin(6\omega t+\varphi_{\text{7}}) \end{aligned} \right. \tag{7}\]  
It can be observed that the frequencies of the fifth and seventh current harmonics in the d-q coordinate system are both six times the fundamental frequency. Additionally, the harmonic torque will induce a frequency component identical to the harmonic speed component, with the sixth harmonic torque being the primary component [21].