Keywords

1 Introduction

PMSM has high power density, strong overload capacity, and excellent dynamic and static performance [1], it is widely used in high-precision control fields such as new energy vehicles and Industrial robots. In modern high performance drives of PMSM, speed and rotor position is the key to realize accurate motor control. The sensor can accurately measure the above two values. However, the installation of sensors affects the robustness and reliability of the control system. Therefore, sensorless control has attracted many scholars to study.

In [2], a phased PI regulator-based Model Reference Adaptive System (MRAS) is proposed to realize sensorless control over the full speed range. In order to solve the problems of chattering noise inherent, a method of terminal Sliding Mode Observer (SMO) based on closed-loop control of back electromotive force harmonics was proposed [3]. The literature [4] had replaced the band-pass filter and the high-pass filter in the conventional signal demodulation through the second-order generalized integrator. Compared with the first three methods, EKF observer has advantage of suppressing measurement error and model error. The literature [5] introduce the development and research status of EKF. An improved Kalman filter based on differential evolution algorithm (DEA) and multi-objective DEA (MODEA) is proposed [6], which can choose optimal covariance matrix. A parallel reduced-order EKF is proposed which can improve prediction accuracy [7]. A variety of optimization algorithms are combined with EKF to obtain the optimal control [8,9,10]. In this paper, PMSM motion equation is added to EKF algorithm to decrease the loss of estimation caused by load change.

2 Mathematical Model of PMSM

PMSM is a nonlinear and strong coupling system. In order to achieve decoupling control, the three-phase coordinate system needs to be decoupled into a two-phase stationary coordinate. The mathematical model in the stationary frame of PMSM are as follows.

$$ \begin{gathered} u_{\alpha } = L_{s} \tfrac{{di_{\alpha } }}{dt} + R_{s} i_{\alpha } - \omega_{e} \psi_{f} \sin \theta \hfill \\ u_{\beta } = L_{s} \tfrac{{di_{\beta } }}{dt} + R_{s} i_{\beta } + \omega_{e} \psi_{f} \cos \theta \hfill \\ \end{gathered} $$
(1)

where iα, iβ, uα and uβ are the current and voltage in the α-β reference frame, respectively, Rs, Ls and ψf are stator resistance, stator inductance and rotor permanent magnet flux, ωe is the electric angular velocity of the motor, θ is the rotor position angle, and np is pole-pairs. Motor motion equation can be written as.

$$ \tfrac{{d\omega_{e} }}{dt} = \tfrac{3}{2}\tfrac{{n_{P} }}{J}\psi_{f} (i_{\beta } \cos \theta - i_{\alpha } \sin \theta ) - \tfrac{{T_{L} }}{J} $$
(2)

where Tl and J are load torque and momentum of inertia. In order to realize precise control of PMSM, it is necessary to use EKF algorithm to estimate the motor speed and rotor position. Firstly, Combine Formula (1) with Formula (2), we can get f(x), matrix B and matrix C as follows

$$ \begin{gathered} f(x) = \left[ {\begin{array}{*{20}c} { - \tfrac{R}{{L_{s} }}i_{\alpha } + \tfrac{1}{{L_{s} }}\omega_{e} \psi_{f} \sin \theta } \\ { - \tfrac{R}{{L_{s} }}i_{\beta } - \tfrac{1}{{L_{s} }}\omega_{e} \psi_{f} \cos \theta } \\ {\tfrac{3}{2}\tfrac{{n_{p} }}{J}\psi_{f} (i_{\beta } \cos \theta - i_{\alpha } \sin \theta ) - \tfrac{{T_{L} }}{J}} \\ {\omega_{e} } \\ \end{array} } \right] \hfill \\ \,\,\,\,\,\,\,\,B = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\tfrac{1}{{L_{s} }}} \\ 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ {\tfrac{1}{{L_{s} }}} \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ 0 \\ \end{array} } \\ \end{array} } \right]^{T} \hfill \\ \,\,\,\,\,\,\,\,\,C = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 1 \\ 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ 1 \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 \\ 0 \\ \end{array} } \\ \end{array} } \right]^{T} \hfill \\ \end{gathered} $$
(3)

Then, the state equation and observation equation are established as follows.

$$ \begin{gathered} \dot{x} = f(x) + Bu + w \hfill \\ y = Cx + v \hfill \\ \end{gathered} $$
(4)

where x = [iα iβ ωe θ]T is the state variable, u = [uα uβ]T is the input variable, y = [iα iβ]T is the measurement variable, w is the system noise, which represents the inaccuracy of the motor mathematical model and the system disturbance noise; v is the measurement noise, which is caused by sampling deviation and AD sampling error.

3 State Estimation Based on EKF

EKF is the application of Kalman filter algorithm in nonlinear systems, and it is an optimal state estimation with minimum variance. Compared with other sensorless control strategies, it can effectively suppress the system error and measurement error, and improve the accuracy of state estimation. Firstly, the nonlinear mathematical model of PMSM needs to be linearized and discretized. The Jacobian matrix F(x) is the derivative of f(x) in Formula (3) versus iα, iβ, ωe and θ respectively. The F(x) can be written as follows.

$$ F(x) = \left[ {\begin{array}{*{20}c} { - \tfrac{{R_{s} }}{{L_{s} }}} & 0 & {\tfrac{{\psi_{f} }}{{L_{s} }}\sin \theta } & {\tfrac{{\psi_{f} }}{{L_{s} }}\omega_{e} \cos \theta } \\ 0 & { - \tfrac{{R_{s} }}{{L_{s} }}} & { - \tfrac{{\psi_{f} }}{{L_{s} }}\cos \theta } & {\tfrac{{\psi_{f} }}{{L_{s} }}\omega_{e} \sin \theta } \\ { - \tfrac{3}{2}\tfrac{{n_{p} \psi_{f} }}{J}\sin \theta } & {\tfrac{3}{2}\tfrac{{n_{P} \psi_{f} }}{J}\cos \theta } & 0 & {\tfrac{3}{2}\tfrac{{n_{P} \psi_{f} }}{J}( - i_{\beta } \sin \theta - i_{\alpha } \cos \theta )} \\ 0 & 0 & 1 & 0 \\ \end{array} } \right] $$
(5)

Assuming that the sampling time TS is small enough, Formula (2) can be discretized as follows.

$$ \begin{gathered} x(k + 1) = (I + T_{S} F_{k|k - 1} )x(k) + Bu(k)T_{s} + w(k) \hfill \\ y(k) = Cx(k) + v(k) \hfill \\ \end{gathered} $$
(6)

where I is the identity matrix and both w(k) and v(k) satisfy Gaussian distribution. According to Formula (6), Q and R are covariance matrix of w(k) and v(k), respectively. The value of Q and R will affect the robustness and dynamic performance of system. It requires many experience to get optimal value.

$$ \begin{gathered} Q = {\text{cov}} (w) = E\{ ww^{T} \} \hfill \\ R = {\text{cov}} (v) = E\{ vv^{T} \} \hfill \\ \end{gathered} $$
(7)

Based on the above, EKF algorithm is implemented as follows. Formula (7) is the prediction estimation equation, and \({\hat{\text{x}}}\) is the estimated value, respectively, \(\hat{y}\) is the input estimate value.

$$ \left\{ \begin{gathered} \mathop x\limits^{\Lambda }_{k|k - 1} = \mathop x\limits^{\Lambda }_{k - 1|k - 1} + [f(\mathop x\limits^{\Lambda }_{k - 1|k - 1} ) + Bu]T_{s} \hfill \\ \mathop y\limits^{\Lambda }_{k|k - 1} = C\mathop x\limits^{\Lambda }_{k|k - 1} \hfill \\ \end{gathered} \right. $$
(8)

Formula (8) is the calculation of system error covariance matrix Pk|k-1 and Fk|k-1 is Jacobian matrix.

$$ \left\{ \begin{gathered} P_{k|k - 1} = \Phi_{k|k - 1} P_{k - 1|k - 1} \Phi_{k|k - 1}^{T} + Q \hfill \\ \Phi_{k|k - 1} = [I + T_{s} F_{k|k - 1} ] \hfill \\ \end{gathered} \right. $$
(9)

Formula (9) is used to calculate the Kalman gains. The purpose of EKF is to find the optimal Kk, so that the estimated value can approach the actual value.

$$ K_{k|k - 1} = P_{k|k - 1} c^{T} [cP_{k|k - 1} c^{T} + R]^{ - 1} $$
(10)

Formula (10) is based on the optimal Kk, which corrects the error between forecast and updates value, and the update covariance matrix can apply to the next calculation.

$$ \left\{ \begin{gathered} \mathop x\limits^{\Lambda }_{k|k} = \mathop x\limits^{\Lambda }_{k|k - 1} + K_{k} (y_{k} - c\mathop x\limits^{\Lambda }_{k|k - 1} ) \hfill \\ P_{k|k} = (I - K_{k|k - 1} c)P_{k|k - 1} \hfill \\ \end{gathered} \right. $$
(11)

In the above formula, ‘^’ represents the estimated value.

EKF is a recursive algorithm. In the initial stage of the algorithm, the initial values of the state vector x and the error covariance matrix P need to be determined first. The selection of the initial value of x is related to the initial state of the motor. When the PMSM is at standstill, the current and speed are both zero. Assuming that the initial position is also zero, then the initial value of state variable x = [0,0,0,0]T. Moreover, The initial value of the error covariance matrix affects the error of the initial state. Generally, P is a diagonal matrix. According to experiments, P = [0.1 0.1 0 0] is the optimal parameter.

In addition, the key of state estimation is to choose a reasonable Kk so that the estimated value can effectively track the actual value x. According to Formula (7), when Kk is large, the state prediction value is more inclined to the input value. On the contrary, the predicted value is more related to the estimator.

When choosing a reasonable Kk value, it is necessary to consider the system covariance matrix Q and noise covariance matrix R to prevent the system from diverging, causing the rotation speed and rotor position to deviate from the actual value. After many experiments, set Q = [0.5 0.5 20 0.02]T, R = [0.02 0.02]T.

4 Experimental Results and Analysis

In order to verify the EKF algorithm, it is necessary to carry out a simulation experiment on the proposed speed sensorless vector control system. The system block diagram is shown in Fig. 1. The system adopts the control method of id = 0, and the control loop includes speed control loop and current control loop. The output PI of the speed loop is used as the quadrature axis current reference signal, the difference between the reference current and the actual current is used as the input of the current loop PI, and its output is used as the SVPWM signal to drive the inverter.

Fig. 1.
figure 1

Block diagram of sensorless vector control based on EKF

The parameters of PMSM used in the experiment are shown in Table 1. Set the speed n = 1200 r/min, set the simulation time as 1 s, and suddenly add 3N\(\cdot\)m load at 0.2 S.

Table 1. Parameter table of the PMSM

According to Fig. 2, the algorithm needs time to estimate the speed. Therefore, at the start-up time, there is a delay between the estimated speed and the actual speed. After about 0.07 s, the estimated speed follows the actual speed, both of which are stable on the reference speed.

Fig. 2.
figure 2

Motor speed curve base on EKF

As can be seen from Fig. 3, after reaching the steady state, the operating speed error is within plus or minus 10 r/min. At 0.2 s, the system suddenly adds a 3N\(\cdot\)m load. Meanwhile, the actual speed has dropped about 50 r/min. In this case, the EKF algorithm can still follow the speed quickly and reach stability. In general, no matter in no-load or load conditions, the error of speed estimation is small.

Fig. 3.
figure 3

Motor speed error curve base on EKF

Figure 4 is a comparison diagram of the estimated rotor position and the actual position, and Fig. 5 is the error curve of the two. In the case of sudden load, the position error changes very little, which can meet the control requirements.

Fig. 4.
figure 4

Motor rotor position curve base on EKF

Fig. 5.
figure 5

Motor rotor position error curve base on EKF

According to Fig. 6, when the load changes suddenly, the torque can be accurately stabilized on the reference value, and the response is fast. At this time, the system runs stably and has better dynamic performance.

Fig. 6.
figure 6

Motor torque curve base on EKF

5 Conclusion

This paper uses PMSM α−β reference frame to design a vector control system based on EKF. In this method, the anti-disturbance advantage of EKF reduces the sensitivity of the system to parameters and realizes double closed-loop control of motor speed and current. The simulation results show that the system can accurately follow the rotor position and speed in the no-load or load conditions.