# Research on Permanent Magnet Synchronous Motor Control System Based on Adaptive Kalman Filter
## 3 Simulation Results and Discussions  
### Simulation of PMSM Control System Based on EKF and PAEKF  
In this section, the simulation model of PMSM is established in MATLAB/Simulink software. The PMSM speed control and estimation block are shown in Figure 2. The performance of the PMSM control system is verified based on PAEKF. With the same measurement covariance matrix, the different noise covariance matrix Q is taken for the PAEKF algorithm and EKF algorithm, respectively. The results show that PAEKF does not need to rely on accurate noise covariance.  
Table 1 shows the relevant parameters of the motor. Table 2 shows different noise covariance matrices Q. It assumes that the measurement noise matrix is diagonal matrix R = diag(0.2,0.2). The PMSM control system is simulated with different noise covariance matrix Q to obtain the speed estimation of PAEKF and EKF. The stability of the estimated speed convergence and the error between the estimated speed and the actual speed is analyzed.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Values** \\ \hline Voltage \(V_{dc}\)(V) & 24 \\ Rated speed (r/min) & 3000 \\ Inductance L (mH) & 1.4 \\ Resistance R (\(\Omega\)) & 0.6 \\ viscous damping F (N\(\cdot\)m\(\cdot\)s) & \(1\times 10^{-4}\) \\ Pole pairs p & 1 \\ Rotor moment of inertia J (kg\(\cdot\)m\({}^{2}\)) & \(1.1\times 10^{-5}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: PMSM parameters.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Numbers** & **Values** \\ \hline \hline
1 & Q = diag(0.1,0.1,0.1,0.1) \\
2 & Q = diag(0.1,0.1,0.5,0.1) \\
3 & Q = diag(0.1,0.1,5.0,0.1) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Noise covariance Q value.  
Figure 2: The PMSM speed control and estimation block.  
Figure 3 shows the estimated speed obtained by the PAEKF algorithm and the EKF algorithm with a noise covariance Q of 1-2. Figure 4 shows the difference between the estimated speed and the actual speed shown in Figure 3. As shown in Figure 3a, when the Q value is 1-2, the estimation speed based on the PAEKF algorithm can converge. Figure 4a shows that the difference between the estimated speed and the actual speed is stable within plus or minus 0.5. When the Q value of the EKF algorithm is 1, the estimated rotational speed can converge in Figure 3b. However, Figure 4b shows that the convergence speed is quite different from the actual speed. Moreover, Figure 4b shows that with the increase in Q value, the estimated speed of the EKF algorithm fluctuates wildly during convergence, and the stability and accuracy are not as good as the PAEKF in Figure 4a.  
From Figure 5, under the condition of the noise covariance Q is \(\copyright\)-\(\copyright\), the estimation speed based on the PAEKF algorithm can converge, and the EKF algorithm cannot converge. The results show that the noise covariance parameter affects the stability of EKF. Figure 6 shows the difference between the actual speed and the speed estimated based on the above two algorithms. It can be observed from the figure that the difference between the speed estimated based on PAEKF and the actual speed is stable within plus or minus 0.5.  
The above simulation results show that when the process noise variance Q cannot be accurately obtained, the EKF cannot reach the optimal filtering state. For example, when the estimation result converges, there is a large fluctuation, or the estimated result is quite different from the actual value and even the filter does not converge. But the velocity estimation based on PAEKF still converges under imprecise Q. Moreover, the stability and accuracy of PAEKF in estimating the convergence rate are also better than EKF. The simulation results verify the performance of PAEKF in the PMSM control system.