Sensorless control of marine permanent magnet synchronous propulsion motor based on adaptive extended Kalman filter

Gross error interference or noise statistical deviation is the main factor that leads to the accuracy deterioration of extended Kalman filter (EKF) in estimating the speed and rotor position of ship propulsion permanent magnet synchronous motor (PMSM). In this paper, an adaptive extended Kalman filter (AEKF) algorithm based on innovation sequence is proposed. In the proposed method, gross error interference is first added to EKF to analyze its influence on the observation accuracy. Then, the weighting coefficient is set in the calculation of innovation covariance. By adjusting the weight of the innovation covariance matrix at the adjacent time, the innovation covariance difference is calculated and then used in the calculation of Kalman gain. The observation performance comparison between AEKF and EKF strategies is conducted with subject to gross error interference and noise statistics deviate. Simulation and experimental results demonstrate that the proposed AEKF has stronger robustness and higher prediction accuracy of speed and rotor position.


Introduction
The propulsion motor is the hard-core components of ship electric propulsion system, high power permanent magnet synchronous motor, with the advantages of high efficiency, high power density, good control performance, is widely used in compact podded propeller. Traditional PMSM control systems typically use mechanical sensors to obtain the rotor position and speed of the motor. However, the use of sensors not only increases the cost, but also brings the problem of reliability deterioration. Therefore, sensorless control has become an important research direction of PMSM control system. The sensorless control methods of PMSM can be classified into model reference adaptive (Lin et al., 2017), sliding mode observer (Liang et al., 2017;He et al., 2020), Lomberg observer (Wu et al., 2016), full order observer (Wang et al., 2019), extended Kalman filter, etc. (Luo and Luo 2019;Shi and Qi, 2020;Li and Kennel, 2021).
Extended Kalman filter (EKF) is an iterative algorithm based on minimum variance. In recent years, the development of highspeed processors has solved the problem of the large amount of EKF calculation, and is widely used in sensorless vector control systems. As an iterative discrete calculation method, EKF uses the state prior estimation and measurement feedback of the system, and then adjusts the Kalman gain matrix in real time to obtain the posterior estimation value of the infinite approximation system state truth value at this time. Compared with other observation algorithms, EKF has the advantages of wide speed range and strong immunity, so it has become a hot spot in the research of motor state estimation.
The estimation accuracy of EKF is related to the selection of Kalman gain matrix, system and measurement noise covariance matrix. In recent years, many methods have been proposed to improve the estimation accuracy and immunity of EKF. References (Wang et al., 2019;Li and Kennel, 2021) improve the observation performance of EKF by establishing dead time compensation or nonlinear compensation system at the output of inverter to eliminate the influence of current harmonic and voltage loss on the input of EKF. The experimental results show that the compensated EKF has stronger state estimation performance. References (Luo and Liu, 2019) optimizes the calculation process of the covariance matrix of the system and measurement noise based on genetic algorithm, which reduces the calculation difficulty of the covariance matrix value and the anti-interference ability of the system. References (Yin et al., 2016;Yi et al., 2014;Lu and Xu, 2009) reduced the parallel price of EKF to reduce the complexity of the algorithm while maintaining the performance of EKF. References (Zerdali, 2019;Özkurt and Zerdali, 2022) established an adaptive mechanism to compensate for the influence of the changing system noise covariance matrix on the observation performance. Reference (Deng et al., 2019;Miguel-Espinar et al., 2021) proposed a robust EKF algorithm, which makes adjustment rules for the ratio of estimation error to external interference under interference. The results show that this kind of method has stronger anti-interference performance than the unmodified EKF under disturbance.
In order to improve the prediction accuracy of EKF in the case of noise statistics bias and gross error interference, in this paper, an adaptive Kalman filter algorithm based on innovation sequence is proposed. In the proposed method, the influence of gross error on system observation is first analyzed, and then the weighting factor is introduced to formulate the calculation rules of innovation covariance matrix, which is also used in the calculation of Kalman gain. The simulation results show that the adaptive EKF has higher robustness and observation accuracy for speed observation under gross error interference.
The reminder of this paper is organized as follows: Section 2 introduces the mathematical model of PMSM and the principle of extended Kalman filter. Section 3 presents the design details of adaptive extended Kalman filter (AEKF) algorithm based on innovation sequence. The feasibility simulation and physical verification of AEKF algorithm based on permanent magnet synchronous motor are carried out in Sections 4, 5. A conclusion is given in Section 6.

Extended Kalman filter
2.1 Mathematical model of permanent magnet synchronous motor Ignoring core saturation, eddy current and hysteresis losses, the PMSM current equation can be expressed as: where R s is the stator resistance; Ls is stator inductance; ω e is the electrical angular speed of the rotor; ψ f is permanent magnet flux linkage; i α and i β respectively stator current α, β axial component; u α and u β stator voltage respectively α, β axis component, θ is the rotor position angle. Combining Eq. 1, establish the PMSM state equation and observation equation as follows: Where, T , B is the system input matrix; H is the output matrix; w, v are the system error and measurement error respectively, and they are uncorrelated Gaussian white noise. Their statistical characteristics are w~N (0,Q), v~N (0,R).

Extended Kalman filter principle
EKF is the application of Kalman filter in nonlinear systems. It is an optimal state estimation method in the sense of minimum Frontiers in Energy Research frontiersin.org variance. In the vector control system based on EKF, it is necessary to linearize and discretize the motor equation of PMSM. Combined with Eq. 1, the extended Kalman state equation is established as follows. x where T s is the sampling time, the superscript "^" represents the estimated value, and k|k − 1 represents the state transition from time k − 1 to time k.
The specific implementation steps of EKF algorithm are as follows: 2) Error covariance matrix estimation where, 3) Kalman gain matrix calculation 5) Update error covariance matrix 3 Adaptive extended Kalman filter strategy 3.1 Influence of gross error on adaptive extended Kalman filter EKF is an optimal observation algorithm based on the accurate system modeling. In the actual operation process, the observation module is often disturbed by external variables of non-Gaussian white noise. When there is interference in the observation, the observation equation of the system can be expressed as: where g k is the gross error interference matrix.
On the basis of EKF, AEKF adjusts the weight of innovation sequence to eliminate the influence of gross error on parameter estimation. In this process, innovation sequence is introduced to improve EKF. The innovation sequence with gross error interference is expressed as: where ε k is the innovation sequence. From Eq. 10, it can be seen that the existence of gross error directly affects the calculation of innovation sequence of the system. Assuming that C is the covariance matrix of innovation estimation, it can be deduced that: In the observation interval with a time length of K, recordĈ as the optimal estimate in the interval, and it is obtained: The observation equation of the system obeys Gaussian distribution, and the optimal estimation value of Eq. 12 is verified based on the maximum likelihood estimation method hypothesis δ. To include the noise statistics of the nonlinear system, the likelihood function is established at time k with parameter δ as follows: Taking logarithms of Eq. 13 respectively to obtain the following equation: where m is the dimension of the measurement matrix. If Eq. 14 is accumulated, the maximum value based on the maximum likelihood estimation can be converted into: Taking the derivative of pair δ for J(δ), yielding following formula: Frontiers in Energy Research frontiersin.org Find the partial derivative of Eq. 16 with respect to parameter δ, and it is obtained: From Eq. 17, it can be seen that Eq. 12 is the optimal estimate of the information covariance matrix C in the interval with a length of K. Considering the influence of gross error interference on Kalman gain calculation, re-integrate Eq. 12 and Eq. 6 and rederive the Kalman gain matrix K k as follows: According to Eq. 18, in the process of speed observation, gross error affects the Kalman gain matrix by changing the innovation process, which affects the state estimation of the whole system, but this method fails to improve the utilization weight of recent data. In order to improve the observation performance in the case of gross error and statistical information deviation, an adaptive extended Kalman algorithm is designed to weaken the influence of the above interference on the observer performance by increasing the proportion of the covariance matrix of the innovation sequence at the latest time.

Establishment of adaptive extended Kalman filter algorithm
First, the gross error is introduced into the observation equation, and the equation is established as follows: Then, the innovation estimation covariance sequence with length N is selected. When k > N, the weighting coefficient at time k is selected as } i , and satisfying the following conditions.
For the innovation estimation covariance matrix at time k, the weighting coefficient of Eq. 20 is introduced to obtain: Similarly, at time k − 1, the innovation covariance estimate of C k−1 is: From Eqs 16, 17, we can get the recursive form of the exponentially weighted innovation covariance matrix as: A new calculation method of Kalman gain matrix is obtained by substituting Eq. 23 into Eq. 18. This method formulates exponential weighting rules on the selection of innovation covariance matrix, and improves the weight of recent data in the calculation of Kalman gain matrix. Compared with the calculation method of taking the average value of Eq. 12, it has the advantage of high estimation accuracy. AEKF based on exponential weighting rules can be expressed as follows: Based on Eq. 24, a PMSM sensorless vector control system based on AEKF is built, and the system structure is shown in Figure 1. The control loop is composed of an outer speed loop and an inner current loop, in which the speed error is taken as the given value of the q-axis current  through the sliding mode controller; The error signal between the current and the given current in the static coordinate system is modulated by PI as the given value of d-axis and q-axis voltage. The input of AEKF is the current and voltage in the static coordinate system, and the output speed and rotor position.      Table 1. The simulation speed is n = 1,200 r/min and the simulation interval is 1 s.
In order to verify the feasibility of AEKF algorithm, simulation experiments are as follows. The current regulator adopts the form of PI regulator, with a proportional coefficient of 0.3 and an integral coefficient of 10. Considering that the change of load torque will have an impact on the whole control system, the motor speed will change significantly when the load is suddenly increased or decreased, and it will take some time to recover to the given speed, in order to maintain the stability of the ship's traveling process, the impact of the change of load torque on the ship's electric propulsion control system should be reduced. The speed regulator adopts sliding mode controller (SMC), the sliding mode surface is the angular velocity error of the motor, and the control law adopts the improved constant speed approach law. Through experimental comparison, the PI controllers of both sides have the same parameter settings as

Frontiers in Energy Research
frontiersin.org SMC, and the system adopts the vector control strategy with i d = 0.
In the motor loading experiment, 0.5 N•m load was suddenly applied at the time of t = 0.2 s. Figure 2 shows the speed error waveform of the two control strategies in response to the sudden load change, and Figure 3 shows the rotor position and position error waveform. It can be seen from the simulation waveform that when the load changes suddenly, the error of speed estimation of AEKF is lower, and the rotor position observation has stronger stability.
When t = 0.6 s, suddenly add 1 A current to i α The external gross error interference in speed estimation is simulated. Figure 4 shows the speed error comparison curve of the two strategies under gross error interference, and Figure 5 shows the rotor position and position error comparison diagram of the two strategies. It can be seen from above figures that both strategies will have speed error waveform when encountering interference, but the fluctuation of AEKF encountering external interference is lower, and the rotor position observation performance is more stable and has stronger immunity.
In order to verify the anti-interference performance of the algorithm to the internal error disturbance, the error signal of x = [0 1 0 0] T is added to the input of the observer at the time of t = 0.6 s. The experimental results are shown in Figure 6 and Figure 7. Under the interference of internal error signal, the fluctuation amplitude of AEKF is smaller than that of EKF, there is no obvious waveform in the rotor position error curve, and the speed and rotor position tracking performance of AEKF is better.
The following figure shows the rotor position curve of the two control strategies under internal interference. It can be seen

Experimental verification
The EKF and AEKF strategies are compared and verified on the experimental platform shown in Figure 8. The STM32F446 chip of Italian semiconductor is used in the main control board, and the hall encoder is used to obtain the actual speed. The observed speed, actual speed and motor current of the motor are monitored through the upper computer and oscilloscope. The experimental speed is set at 1,200 r/min, and the anti-interference performance and load performance of the algorithm are compared and analyzed for two different control algorithms.

Frontiers in Energy Research
frontiersin.org phase current variation of AEKF is lower, the error between the observed speed and the actual speed of the observer is smaller, and the speed tracking performance is stronger. In terms of rotor position observation, both control strategies can accurately follow the actual rotor position. Figure 11 and Figure 12 show the data after unloading the load when the motor is loaded and operates stably at 1,200 r/min. It can be seen from above figures that under the condition of sudden unloading of the motor, the overshoot of the speed reference actual value observed by AEKF is lower, and the following performance of the actual speed is stronger. In terms of rotor position estimation, both have the same performance, and can accurately follow the actual position.

External interference experiment
The current sampling resistance of the motor control board shown in Figure 8 is 0.02 Ω. In the external interference

Frontiers in Energy Research
frontiersin.org experiment, adding 1 A interference signal to the input of the observer can be equivalent to superimposing 0.02 v voltage on both ends of the sampling resistance of the control board to simulate the influence of 1 A current interference on the Clark transform input. Figure 13 and Figure 14 show the comparison of the observer performance of the two algorithms after external interference. It can be seen from above figures that AEKF has smaller offset of observed speed, lower current ripple and stronger immunity in the face of external interference. In rotor position observation, both algorithms can track the actual position signal when interference occurs, but the position error of AEKF is smaller than that of EKF.

Internal interference experiment
Similar to the external interference experiment, in the program operation, set the time when the interference variable is added to EKF through the internal timer TIM2 of STM32, by adding [1,1] disturbances to the inputs i α , i β of the observer, Conduct internal interference experiment, and set the timer duration to 1s. It can be seen from Figures 15, 16 that when the input of the two observers encounters interference, the observed speed is deviated from the actual speed to a certain extent. However, compared with EKF, AEKF has a lower degree of separation in the face of interference, and the current recovers faster after encountering interference. Both of them have the same performance in estimating the rotor position, and can follow the actual position information under internal interference.

Conclusion
This paper proposes a sensorless control method of PMSM based on adaptive extended Kalman filter. Firstly, the principles of AEKF and EKF are introduced, and the differences between them are analyzed. Compared with EKF, AEKF has higher observation accuracy of speed and stronger anti-interference ability in the case of gross error interference and noise statistical deviation. In terms of rotor position estimation, the performance of the two control strategies is the same. Finally, the dynamic and static performances of the two are compared and analyzed through simulation and experiment. The simulation and experimental results demonstrate that AEKF can significantly reduces the speed estimation error and has stronger anti-interference ability in the case of sudden load change, gross error interference and noise statistical deviation, and which can meet the needs of ship electric propulsion system in complex environment.

Data availability statement
The raw data supporting the conclusion of this article will be made available by the authors, without undue reservation.

Author contributions
ZC and YL proposed the scheme and wrote the manuscript. ZC designed and carried out experiments.