# Observer-Based Rejection of Cogging Torque Disturbance for Permanent Magnet Motors
## 4 Simulation and Experimental Results
### Simulation Results  
The simulations were performed in Matlab/Simulink with ODE45, and the maximum step size was \(1\times 10^{-3}\) s. For the proposed observer, the harmonic of the cogging torque was assumed as 2 (i.e., \(n=2\) in (4)) and the observer gain of (8) was selected as \(L=\left[\begin{array}{cc}-1.52\times 10^{3},&3.12\times 10^{4},&1.45\times 1 0^{6},&2.78\times 10^{7},&2.60\times 10^{8}\end{array}\right]\). Additionally, the initial observer states were zero. Therefore, the proposed observer is implemented by  
\begin{table}
\begin{tabular}{c c c c} \hline  & \(J_{m}\) & \(B_{m}\) & \(K_{m}\) \\ \hline value: & \(1.1\times 10^{-5}\) & \(2.0\times 10^{-2}\) & \(5.9\times 10^{-2}\pm 10\%\) \\ unit: & kg \(\cdot\) m\({}^{2}\) & Nm & Nm/A \\ \hline \end{tabular}
\end{table}
Table 1: System parameters.  
\[\begin{bmatrix}\hat{\xi}_{1}\\ \hat{\xi}_{2}\\ \hat{\xi}_{3}\\ \hat{\xi}_{4}\\ \hat{\xi}_{55}\end{bmatrix}=\begin{bmatrix}-\frac{B_{m}}{J_{m}}&1&0&0&0\\ 0&0&1&0&0\\ 0&0&0&1&0\\ 0&0&0&0&1\\ 0&0&0&0&0\end{bmatrix}\begin{bmatrix}\xi_{1}\\ \xi_{2}\\ \xi_{3}\\ \xi_{4}\\ \xi_{5}\end{bmatrix}+\begin{bmatrix}\frac{K_{m}}{J_{m}}\\ 0\\ 0\\ 0\end{bmatrix}u+\begin{bmatrix}0&0\\ -y&0\\ -\frac{B_{m}}{J_{m}}y+\frac{K_{m}}{J_{m}}u&0\\ 0&-y\\ 0&-\frac{B_{m}}{J_{m}}y+\frac{K_{m}}{J_{m}}u\end{bmatrix}\begin{bmatrix}5y^{2}\\ 4y^{4}\end{bmatrix}+L\left(y-\hat{\xi}_{1}\right),\]  
\[\hat{d}=-J_{m}\xi_{2}\]  
where \(u\) and \(y\) are viewed as inputs.  
Figure 2 shows the reference speed profile \(\omega_{r}\) for the simulations and experiments (to be seen shortly) of this paper, in which the profile has a trapezoidal shape at three different speeds: 20, 40, and 10 rad/s. Additionally, the acceleration and deceleration times were selected as 100 ms at the respective speeds. As shown in Figure 3, we first introduce the result of applying only PI controller without the proposed observer. Although the motor angular speed \(\omega\) tracks the reference \(\omega_{r}\), its performance is still far from perfect regulation because of the cogging torque disturbance \(d\). On the other hand, our method shows that the motor angular speed converges to the reference after a few transients, as shown in Figure 4.  
In addition, as shown in Figure 5, a simulation with measurement noise is carried out in order to reflect the real situation. The measured signals \(y\) and \(u\) are disturbed by Gaussian noise whose the variance is \(5\times 10^{-8}\). Although the motor speed randomly oscillates around the reference trajectory due to the measurement noises, we can see effective tracking performance.  
Figure 3: Simulation result: motor angular speed \(\omega\) under the PI controller.  
Figure 2: Reference signal \(\omega_{r}\).  
Finally, we perform a simulation to compare the proposed observer with the conventional observer in [10] as depicted in Figure 6. While the motor speed tends to the reference trajectory all target speed 20, 40, and 10 rad/s, it is shown that with the conventional observer, the output speed effectively tracks the target speeds 20 and 10 rad/s, but not for 40 rad/s.  
The reason is that the stability of the observer in [10] depends on the motor angular speed, and thus the designed conventional observer of this paper is unstable at 40 rad/s. To solve the problem, a particular observer gain can be designed. Nevertheless, the gain does not guarantee stability at all motor angular speeds. On the other hand, our observer gain does not depend on the motor angular speed as shown in (8).