## 4 ANF Based Active Damping
### Design of ANF with Frequency Adaption
\begin{aligned} i_{a}=i_{1}\text{cos}(\omega t+\theta_{1})+i_ {5}\text{cos}(-5\omega t+\theta_{2})+i_{7}\text{cos}(7\omega t+\theta_{3})+i_{ 1}\text{cos}(-11\omega t+\theta_{4})+i_{13}\text{cos}(13\omega t+\theta_{5})+ \cdots\\ i_{b}=i_{1}\text{cos}(\omega t+\theta_{1}-\frac{2}{3}\pi)+i_{5} \text{cos}(-5\omega t+\theta_{2}-\frac{2}{3}\pi)+i_{7}\text{cos}(7\omega t+ \theta_{3}-\frac{2}{3}\pi)+i_{11}\text{cos}(-11\omega t+\theta_{4}-\frac{2}{3 }\pi)+i_{13}\text{cos}(13\omega t+\theta_{5}-\frac{2}{3}\pi)+\cdots\\ i_{c}=i_{1}\text{cos}(\omega t+\theta_{1}+\frac{2}{3}\pi)+i_{5} \text{cos}(-5\omega t+\theta_{2}+\frac{2}{3}\pi)+i_{7}\text{cos}(7\omega t+ \theta_{3}+\frac{2}{3}\pi)+i_{11}\text{cos}(-11\omega t+\theta_{4}+\frac{2}{3 }\pi)+i_{13}\text{cos}(13\omega t+\theta_{5}+\frac{2}{3}\pi)+\cdots\\ \end{aligned} \right. \tag{32}\]  
where \(i_{1}\), \(i_{5}\), \(i_{7}\), \(i_{11}\), and \(i_{13}\) represent the current components of the fundamental wave and the corresponding harmonics separately; \(\theta_{1-5}\) correspond to the initial angles of the above currents; \(\omega\) is the fundamental rotating frequency. On the basis of the rotating magnetic field theory, the rotation direction of the fundamental current and that of the rotor are the same, while the 5 th harmonic and the fundamental wave rotate in the opposite direction, and the rotation speed of the fifth harmonic can be expressed as \(-5\omega\). The seventh harmonic has the same rotation direction with the fundamental wave, so the rotation speed is \(7\omega\), and so on. Based on (4), the current can be transformed into \(d\)-\(q\) coordinate system, which is written as  
\[\left\{ \begin{aligned} i_{a}=i_{41}+i_{5}\text{cos}(-6\omega t+ \theta_{2})+i_{7}\text{cos}(6\omega t+\theta_{3})+i_{11}\text{cos}(-12\omega t +\theta_{4})+i_{13}\text{cos}(12\omega t+\theta_{5})+\cdots\\ i_{q}=i_{q1}+i_{5}\text{sin}(-6\omega t+\theta_{2})+i_{7}\text{sin}(6 \omega t+\theta_{3})+i_{11}\text{sin}(-12\omega t+\theta_{4})+i_{13}\text{sin }(12\omega t+\theta_{5})+\cdots\\ \end{aligned} \right. \tag{33}\]  
It can be concluded from (33) that the angular speed of harmonics of order (6n \(\pm\) 1) are \(\pm\)6 n\(\omega\). According to this, by adjusting the inductance of the LC filter appropriately, the resonant frequency obtained by (23) can be close to (6n \(\pm\) 1) in the three-phase coordinate system. Then, based on the conclusion obtained from (33), the resonance frequency can be simply converted to 6 n in the \(d\)-\(q\) coordinate system, and this is also the center frequency that needs to be set in the ANF. However, the speed of HPMSM is bound to vary during operation, which in turn leads to the change of the current fundamental frequency. To ensure the ANF works properly at various speeds, it needs to be modified. The speed feedback is introduced to determine the motor resonant frequency, and then the resonant frequency can be calculated by the following formula:  
\[f=f_{abc}-f_{e}=f_{abc}-\frac{\text{P}_{\text{n}}\omega_{n}}{2\pi}. \tag{34}\]  
where \(f\) represents the notch frequency; \(f_{abc}\) represents the resonant frequency in the three-phase static coordinate system;\(f_{e}\) represents the fundamental frequency of the stator current; and \(\omega_{n}\) is the mechanical angular velocity. As shown in Figure 13, the adaptive notch appliance is equipped with a frequency tracking capability through the frequency calculation module. When the resonant frequency \(f\) is determined by the above calculations, the controller can generate the reference input signals \(r_{\rm s}(t)\) and \(r_{\rm c}(t)\). Finally, select an appropriate step size considering the bandwidth and convergence speed, and then the ANF is completed. It is worth adding that the parameters of PI controller in Figure 13 should be consistent with the current loop PI controller. During the HPMSM operation, the adaptive coefficients are continuously updated using the LMS algorithm according to (27), which allows the filter to work at the optimal state.