Model Predictive Direct Torque Control of Permanent Magnet Synchronous Motor (PMSM) with Online Parameter Estimation Based on Extended Kalman Filter

Aiming at the torque and flux ripples in the direct torque control and the time-varying parameters for permanent magnet synchronous motor (PMSM), a model predictive direct torque control with online parameter estimation based on the extended Kalman filter for PMSM is designed. By predicting the errors of torque and flux based on the model and the current states of the system, the optimal voltage vector is selected to minimize the error of torque and flux. The stator resistance and inductance are estimated online via EKF to reduce the effect of model error and the current estimation can reduce the error caused by measurement noise. The stability of the EKF is proved in theory. The simulation experiment results show the method can estimate the motor parameters, reduce the torque, and flux ripples and improve the performance of direct torque control for permanent magnet synchronous motor (PMSM).


Introduction
In the traditional direct torque control (DTC) method of permanent magnet synchronous motor (PMSM), the adjustment of the torque and flux by the hysteresis comparator is of Bang-Bang control, and the voltage vector is chosen by table lookup according to different sectors, so the deviation size cannot be distinguished [1]; The pure integral method is mostly used for traditional DTC flux observation, greatly affected by motor parameters, causing inaccurate flux and torque estimation and large torque and flux ripples [2] [3].
To overcome the disadvantages of traditional DTC, and improve the control performance of traditional DTC, the hysteresis comparator is improved (such as control method [4] combining the space vector modulation (SVM) technology and the traditional DTC) so that SVM-DTC can obtain continuously changing space voltage vector to achieve accurate control of torque and flux. The literature [5] subdivides traditional 6 sectors into 18 sectors by the technology of combining the sector subdivision and the duty cycle, and calculates and adjusts the action time of effective voltage vector promptly according to torque error to reduce the torque ripple. Furthermore, the torque and flux observation accuracy directly determine the performance of DTC, thus improving the stator flux and torque observation accuracy is another way to reduce the torque ripple. To improve the observation accuracy of flux and torque, the full order observer, nonlinear feedback correction compensation observer, sliding-mode observer [6] [7] [8], etc. are used for PMSM-DTC control system.
The model predictive control (MPC) is also called as receding horizon control and a feedback control strategy widely discussed in recent years. The basic principle of MPC is to use the model of the system to predict and optimize the future behavior of the system. By combining MPC with traditional DTC, the literature [9] proposes the DTC control (MPDTC) based on MPC for induction motor, and uses the cost function to replace the hysteresis comparator of traditional DTC pursuant to the predicted torque and flux error to seek for the space voltage vector that minimizes the torque and flux among 8 space voltage vectors; The literature [10] combines MPDTC with duty cycle to reduce the torque and flux ripple. However, the PMSM model which is a time-varying model hasn't been considered in the above literature, and the accuracy of prediction model directly influences the torque control performance.
The extended Kalman filter (EKF) has an excellent state estimation capability for nonlinear systems, and can still estimate the state of the system especially in the case of noise and measurement bias errors [11]. EKF is widely used in the motor position less control system. The literature [12] [13] has adopted the stator flux, motor speed and rotor position, and designed the permanent magnet synchronous motor position less DTC control system. The literature [14] uses the EKF on-line estimation stator resistance and inductance for the maximum torque per ampere (MTPA) control system.
By combining the permanent magnet synchronous motor MPDTC and EKF online parameter estimation, this paper carries out online estimate of PMSM stator resistance and inductance parameters for the calibration of prediction model in MPDTC control. At the same time, EKF estimates the current of PMSM in a rotating coordinate system to correct the noise and bias errors when current sensor measurement. Therefore, the MPDTC of permanent magnet synchronous motor based on EKF can overcome the torque ripple arising from traditional DTC hysteresis, and reduce the influence of motor parameter variation and measurement error on control accuracy. The simulation and experimental results show that the model predictive direct torque control for permanent magnet synchronous motor (PMSM) based on extended Kalman filter proposed in this paper can effectively reduce torque ripple, and is of good torque and flux control performance.

Model Predictive Direct Torque Control of the Permanent
Magnet Synchronous Motor (PMSM)

Model of the Permanent Magnet Synchronous Motor (PMSM)
The voltage equation of permanent magnet synchronous motor in the rotating where i d and i q refer to direct-axis and cross-axis current; u d and u q refer to direct-axis and cross-axis voltage; R s refers to stator resistance; L d and L q refer to direct-axis and cross-axis inductance. As for the surface-mount technology If the current in Equation (1) is in the state variable, namely , Equation (1) can be written as: According to the literature [15], the prediction model of permanent magnet synchronous motor can be obtained by discretization of the model as follows: The corresponding motor flux and torque are:

Model Predictive Direct Torque Control
The idea of model predictive direct torque control is to predict the flux and torque errors in the next control cycle according to the current torque, flux state and voltage vector in the discrete state, and select the voltage vector minimizing the cost function from the eight voltage vectors pursuant to the cost function chosen. The Control Block Diagram of MPDTC is shown in Figure 1.
The realization process for MPDTC of permanent magnet synchronous motor can be divided into several parts below: 1) Measurement: The stator current, rotor position and stator voltage of the current control cycle can be measured by the corresponding sensor, and the rotation rate can be calculated by position differential; 2) Prediction: Bring the current stator current and speed into Equation (3), and calculate the predicted values of electromagnetic torque and flux linkage corresponding to 8 inverter switching states after one cycle as per (4) where T λ and ϕ λ refer to weight coefficient, respectively.

Model of Parameter Estimation Based on Extended Kalman Filter
According to Equation (1), the equation of state when the parameters are time-varying can be obtained as follows: where ( ) t σ refers to motor parameter change and other system noise; ( ) t µ refers to noise arising from the system, If the optimal value of the state variable x(t) estimated at t is x , the estimation error can be defined as: x as a Taylor series, ignore higher-order terms and consider Equation (8) to obtain: Set the sampling time to be T s which is small enough, and discretize the above equation to obtain the discrete nonlinear system equation of Equation (7): where 1, k k F + refers to state transition matrix. When the sample time is small enough, exists, and I refers to unit matrix; Record

Algorithm of Parameter Estimation Based on Extended Kalman Filter (EKF)
After discretization of PMSM nonlinear system, according to recursion formula of EKF, the recursion formula of parameter estimation of PMSM can be obtained as: According to Equations (11) 2) Update of error covariance matrix and gain matrix. Update the error covariance matrix and filter gain matrix in accordance with Equations (12), (13) and (14); 3) Update of optimum estimate. Estimate the optimal value of the current state (namely Equation (15)) pursuant to current measured value and current estimate value.

4)
In line with the estimated optimal current and PMSM motor parameters, the optimal electromagnetic torque and flux can be estimated by bringing into Equation (5), and the motor parameters shall be updated in the predictive control algorithm.

Analysis of Stability
The MPDTC system of PMSM is a typical nonlinear system and its stability consists of two parts: Firstly, stability of the original system; Secondly, stability of designed EKF. According to literature [16], the EKF of the uniformly completely controllable and observable system is stable, and the initial value of the error covariance matrix can be arbitrary value.
Pursuant to Equations (10)- (15), the equation of discrete EKF can be obtained as follows: G. Yang et al.
To prove the convergence of EKF, three assumptions and one lemma are put forward: Assumption 1: The original system is uniformly completely controllable and observable. As per the state equation and output equation of the system, the system is obviously a controllable and observable system and a physically realizable system that is to say that the system is a bounded input and output system, so the assumption is established.    M on the left and on the right, respectively, can be obtained, The above can be rewritten as: Based on Equation (19) and (22), obtain [ ] Because of V M k is bounded with monotone decreasing due to 1 0 r > , 2 0 r > , so the designed EKF is uniformly asymptotically stable, that is to say that EKF is of bounded output.
As for the whole system, the original system is of uniform asymptotic stability, and the EKF estimation system is uniformly asymptotically stable, so the whole system designed is also uniformly asymptotically stable.

Simulation Results
To verify the validity of the proposed method, the MATLAB/Simulink is used to establish the simulation model of the system. The Control Block Diagram is shown in Figure 2. The permanent magnet synchronous motor parameters are shown in Table 1.  [ ] 0 1,1,1,1 P diag = is chosen in this paper.
In the simulation process, the maximum switching frequency and sampling time are 10 KHz and 100 μs, respectively. To verify the accuracy of parameter estimation, the robustness of motor parameter estimation at different speeds is verified firstly. The estimation result is shown in Figure 3. The given initial resistance value is 0.5 time of actual resistance value, and the give inductance value is 2 times of actual inductance value. The simulation results show that the actual value has been tracked at 0.08s, the maximum steady-state error on tracking is 6.8%, and the resistance and inductance estimation results are little affected in the process of speed change. Figure 4 is the torque and speed waveform when the measurement noise occurs to the current sensor. Figure 4(a) is the actual torque and speed signal after the interference signal with an average value of 0 added to the current. As per the figures, the torque signal is with obvious burrs, and the speed feedback signals are also influenced in case of interference in current measurement. Figure   4(b) shows the torque and current waveform after the current signal is filtered by EKF. Compared to Figure 4(a), the waveform of torque and speed decreases significantly.
When the resistance and inductance change, the control parameters in the MPDTC contain resistance and inductance parameters causing the control effect is affected by the resistance and inductance. Figure 5 and Figure 6 show that the load torque is rated load and 0.5 time of rated load, respectively when the resis-  value. The control effect of the controller before parameter adjustment is shown in Figure 5(a) and Figure 6(a), and the control effect of the controller after parameter adjustment is shown in Figure 6(b) and Figure 7(b). Figure 6 shows the actual parameter is 0.6 time of the original value. According to Figure 5(a), when the resistance and inductance decrease, the electromagnetic torque and flux prediction models are influenced by parameters, leading to inaccurate prediction of torque and flux, and torque ripple, but the parameters have less influence as the speed increases. Figure 6 Simulation Result When the Parameter Changes To 1.5 Times. Similar to the motor parameter reduction, the torque control accuracy is also influenced, causing the torque ripple.

Conclusion
To suppress the torque and flux ripple of traditional direct torque control, this paper studies the model predictive direct torque control for permanent magnet synchronous motor (PMSM) based on EKF observer, seeks the optimal voltage vector which minimizes torque and flux among the 8 voltage vectors available pursuant to predicted torque error and flux error, carries out real-time estimation of resistance and inductance by the EKF observer, modifies the motor model parameters predicted by the model, and observes the direct-axis and cross-axis currents to compensate the torque and flux estimates and improve the calculation and estimation accuracy of torque and flux. The simulation results demonstrate the effectiveness of the method. In the future work, we can consider multi-step prediction and parameter time variation for further refinement.