# Sensorless Control of Permanent Magnet Synchronous Motors and EKF Parameter Tuning Research

Authors: Yong Zhang; Xu-Feng Cheng
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

This paper concerns the parameter tuning and the estimated results postprocessing of the extended Kalman filter for the sensorless control application of permanent magnet synchronous motors. At first an extended Kalman filter parameter tuning method is proposed based on the theoretical and simulation analysis of extended Kalman filter parameters. Furthermore, a sensorless control system is proposed based on the parameter tuning method and the simulation analysis of extended Kalman filter estimation results in different reference speeds and different load torques. The proposed sensorless control system consists of two parts. The first one is a module to self-regulate extended Kalman filter parameters. The second part can correct the estimated speed and the estimated rotation angle based on the reference speed and the electromagnetic torque. Finally, simulation results are presented to verify the feasibility and validity of the proposed sensorless control system.


---

## Body

## 1. Introduction

The sensorless control of the PMSM (permanent magnet synchronous motor) is the technology which, respectively, uses the estimated speed and the estimated rotation angle to replace the actual speed and the actual rotation angle. Nowadays, various sensorless control methods have been proposed. These methods can be classified as follows [1, 2]: direct methods based on the motor model, model reference adaptive methods, observer based methods, signal injection methods, and intelligent control methods. Direct methods utilize the electromagnetic model of the PMSM to estimate the speed and the rotation angle directly, and the accuracy of estimated results depends on PMSM parameters [3]. Model reference adaptive methods utilize adaptive parameters identification theory to estimate the speed and the rotation angle. These methods use a closed-loop control to eliminate the dependence on PMSM parameters [4]. Observer based methods include the EKF (extended Kalman filter), the SMO (Sliding Mode Observer), and other observers [5–8]. Injection methods estimate the speed and the rotation angle by injecting high or low frequency signal to the salient PMSM [9, 10]. Intelligent control methods can be used independently to estimate the speed and the rotation angle or combined with other methods to improve the accuracy of estimated results [11, 12]. Signal injection methods can be used in low-speed situations; other methods are used in medium-speed and high-speed situations. The EKF is one of observers, which estimate the speed and the rotation angle through the input voltage and the output current of the PMSM.The EKF parameter tuning is an important but difficult work. EKF parameters have great influence on the stability and reliability of the EKF estimated results. In many papers the EKF parameter tuning is also discussed and studied. The simple EKF parameters meaning and trend without further study have been presented in [13]. The relatively detailed studies of the EKF parameter tuning and a parameter tuning method have been given in [14]. The other EKF parameter tuning study has been presented in various papers, which concern the EKF sensorless control of the PMSM [15–18]. However, comprehensive and detailed study is lacking. Thus, it is required to do detailed and comprehensive study in the EKF parameter tuning.Due to estimating errors it is not appropriate to use the EKF estimated results directly in sensorless control of the PMSM. And in different load torques and different reference speeds, the accuracy of EKF estimated results is different. However, few papers studied the estimated results postprocessing of the EKF and the estimated results in different load torques and different reference speeds. Thus, it is required to design a method to correct the EKF estimated results and self-regulate EKF parameters by electromagnetic torque and reference speed.The remainder of this paper is organized as follows. The EKF sensorless control theory and the parameters theoretical analysis are presented in Section2. In Section 3, simulation analysis of EKF estimated results in different EKF parameters, different load torques, and different reference speeds is given. The EKF parameter tuning method and the EKF sensorless control system are presented in Section 4. Simulation results are shown in Section 5 for two speed signals. Finally, the conclusion is given in Section 6.


## 2. Theoretical Analysis of the EKF

### 2.1. The EKF Model of the PMSM

The EKF is the Kalman filter to be applied to the continuous nonlinear system. The EKF model of the continuous nonlinear system can be obtained by linearization and discretization. The PMSM is a continuous nonlinear system. The mathematical model of the non-salient-pole PMSM in theα
-
β coordinate is presented as follows. The stator voltage equation is(1)
u
α
u
β
=
R
s
0
0
R
s
i
α
i
β
+
d
d
t
ψ
α
ψ
β
,where u
α
u
β
T is the stator voltage, i
α
i
β
T is the stator current, R
s is the stator resistance, and ψ
α
ψ
β
T is the flux linkage.The stator flux linkage equation is(2)
ψ
α
ψ
β
=
L
0
0
L
i
α
i
β
+
λ
cos
⁡
θ
sin
⁡
θ
,where L is the PMSM winding inductance, θ is the rotation angle, and λ is the rotor permanent magnet flux.Based on (1) and (2), and the hypothesis that the speed is constant in the very short sampling time, the PMSM equation in α
-
β coordinate is (3)
d
i
α
d
t
=
-
R
s
L
i
α
+
λ
ω
r
L
sin
⁡
θ
+
u
α
L
,
d
i
β
d
t
=
-
R
s
L
i
β
-
λ
ω
r
L
cos
⁡
θ
+
u
β
L
,
d
ω
r
d
t
=
0
,
d
θ
d
t
=
ω
r
.State variables, control variables, and output variables arex
=
i
α
i
β
ω
r
θ
e
T, u
=
u
α
u
β
T, and y
=
i
α
i
β
T, respectively. Nonlinear state equation of the PMSM is (4)
x
˙
t
=
f
x
t
+
B
·
u
t
+
w
t
y
˙
t
=
h
x
t
+
v
t
,where B is the input matrix, w
(
t
) is the state noise, and v
(
t
) is the measurement noise.Based on the comparison between (3) and (4), the coefficient equations in (4) can be obtained: (5)
f
x
t
=
-
R
s
L
i
α
+
λ
ω
r
L
sin
⁡
θ
-
R
s
L
i
β
-
λ
ω
r
L
cos
⁡
θ
0
ω
r
,
B
=
1
L
0
0
0
0
1
L
0
0
,
h
x
t
=
i
α
i
β
.Equation (6) is the linear equation of (4) by Taylor series method. Equation (7) is the discrete equation of (6) by sampling cycle T: (6)
x
˙
=
F
x
x
+
B
·
u
+
w
,
y
˙
=
H
x
x
+
v
,
(7)
x
k
=
Φ
x
k
-
1
+
B
T
u
k
-
1
+
w
k
-
1
,
y
k
=
H
x
k
+
v
k
.The Jacobi matrixF
(
x
), H
(
x
) in (6) is (8)
F
x
=
δ
f
δ
x
=
-
R
s
L
0
λ
L
sin
⁡
θ
λ
L
ω
r
cos
⁡
θ
0
-
R
s
L
-
λ
L
cos
⁡
θ
λ
L
ω
r
sin
⁡
θ
0
0
0
0
0
0
1
0
,
(9)
H
x
=
δ
h
δ
x
=
1
0
0
0
0
1
0
0
.Because ofΦ
=
e
F
T
≈
I
+
F
T, the PMSM EKF equations (10) and (11) can be obtained based on Kalman filter equations:(1)
Prediction is(10)
x
^
k
∣
k
-
1
=
x
^
k
-
1
+
f
x
^
k
-
1
+
B
u
k
-
1
T
P
k
∣
k
-
1
=
Φ
P
k
-
1
Φ
T
+
Q
.
(2)
Correction is(11)
K
k
=
P
k
∣
k
-
1
H
T
H
P
k
∣
k
-
1
H
T
+
R
-
1
,
x
^
k
=
x
^
k
∣
k
-
1
+
K
k
y
-
H
x
^
k
∣
k
-
1
,
P
k
=
I
-
K
k
H
P
k
∣
k
-
1
,where P
k is the state covariance matrix, Q is the state noise covariance matrix, K
k is the Kalman gain, and R is the measurement noise covariance matrix.The EKF model of the PMSM is built based on (10) and (11). Appropriate EKF parameters are required to obtain accurate and stable estimated results.


### 2.2. EKF Parameters Analysis

Kalman filter parameters are the noise covariance matrixQ and R, the PMSM initial state matrix X
o, and the initial state covariance matrix P
o.X
o represents the PMSM initial state based on (9). X
o contains the two-phase current information, the speed information, and the rotation angle information. X
o can be selected based on the PMSM initial state.R is measurement noise covariance of the stator current in the α
-
β coordinate. It is a 2 × 2 matrix. The current noise is uncorrelated, so R is actually a diagonal matrix composed of measurement noise variance of two-phase current in the α
-
β coordinate. This diagonal matrix is related to the current measurement noise. R can be selected by measuring the noise in practical application.P is the covariance matrix of the PMSM state X. P
o is the initial value of P. Because the PMSM state X is uncorrelated, P is a 4
×
4 diagonal matrix. In the matrix, p
11 and p
22 are the current covariance in the α
-
β coordinate. p
33 is the covariance of the speed. p
44 is the covariance of the rotation angle. P will be automatically adjusted to the appropriate value in the recursive filtering process of the Kalman filter. The selection of P
o does not affect the steady-state output of the Kalman filter. However, the EKF equations of the PMSM are approximate equations; the inappropriate selection of P
o may lead to the change of estimated results in both initial state and steady-state. The selection of p
o
11 and p
o
22 is based on current changes in the α
-
β coordinate. They usually choose the moderate value. Speed will rapidly increase after the PMSM starts to run, so p
o
33 should take the large value. The change of the rotation angle is from slow to fast when the PMSM starts up, so p
o
44 should take the small value.The selection of the state noise covariance matrixQ is the most important work in the EKF design. The state noise is assumed to be Gaussian white noise, which is independent and zero-mean; therefore, Q is a 4
×
4 diagonal matrix. q
11 and q
22 are the current noise covariance in the α
-
β coordinate. q
33 is the speed noise covariance. q
44 is the noise covariance of the rotation angle. The PMSM status cannot be obtained directly, so Q is also not directly obtained. There are many factors affecting the PMSM state noise generation. For instance, the simplification and approximation error of the PMSM equations can be considered to be noise. Therefore, Q cannot be selected by existing methods. Generally the optimum Q needs to be obtained by trial and error.


## 2.1. The EKF Model of the PMSM

The EKF is the Kalman filter to be applied to the continuous nonlinear system. The EKF model of the continuous nonlinear system can be obtained by linearization and discretization. The PMSM is a continuous nonlinear system. The mathematical model of the non-salient-pole PMSM in theα
-
β coordinate is presented as follows. The stator voltage equation is(1)
u
α
u
β
=
R
s
0
0
R
s
i
α
i
β
+
d
d
t
ψ
α
ψ
β
,where u
α
u
β
T is the stator voltage, i
α
i
β
T is the stator current, R
s is the stator resistance, and ψ
α
ψ
β
T is the flux linkage.The stator flux linkage equation is(2)
ψ
α
ψ
β
=
L
0
0
L
i
α
i
β
+
λ
cos
⁡
θ
sin
⁡
θ
,where L is the PMSM winding inductance, θ is the rotation angle, and λ is the rotor permanent magnet flux.Based on (1) and (2), and the hypothesis that the speed is constant in the very short sampling time, the PMSM equation in α
-
β coordinate is (3)
d
i
α
d
t
=
-
R
s
L
i
α
+
λ
ω
r
L
sin
⁡
θ
+
u
α
L
,
d
i
β
d
t
=
-
R
s
L
i
β
-
λ
ω
r
L
cos
⁡
θ
+
u
β
L
,
d
ω
r
d
t
=
0
,
d
θ
d
t
=
ω
r
.State variables, control variables, and output variables arex
=
i
α
i
β
ω
r
θ
e
T, u
=
u
α
u
β
T, and y
=
i
α
i
β
T, respectively. Nonlinear state equation of the PMSM is (4)
x
˙
t
=
f
x
t
+
B
·
u
t
+
w
t
y
˙
t
=
h
x
t
+
v
t
,where B is the input matrix, w
(
t
) is the state noise, and v
(
t
) is the measurement noise.Based on the comparison between (3) and (4), the coefficient equations in (4) can be obtained: (5)
f
x
t
=
-
R
s
L
i
α
+
λ
ω
r
L
sin
⁡
θ
-
R
s
L
i
β
-
λ
ω
r
L
cos
⁡
θ
0
ω
r
,
B
=
1
L
0
0
0
0
1
L
0
0
,
h
x
t
=
i
α
i
β
.Equation (6) is the linear equation of (4) by Taylor series method. Equation (7) is the discrete equation of (6) by sampling cycle T: (6)
x
˙
=
F
x
x
+
B
·
u
+
w
,
y
˙
=
H
x
x
+
v
,
(7)
x
k
=
Φ
x
k
-
1
+
B
T
u
k
-
1
+
w
k
-
1
,
y
k
=
H
x
k
+
v
k
.The Jacobi matrixF
(
x
), H
(
x
) in (6) is (8)
F
x
=
δ
f
δ
x
=
-
R
s
L
0
λ
L
sin
⁡
θ
λ
L
ω
r
cos
⁡
θ
0
-
R
s
L
-
λ
L
cos
⁡
θ
λ
L
ω
r
sin
⁡
θ
0
0
0
0
0
0
1
0
,
(9)
H
x
=
δ
h
δ
x
=
1
0
0
0
0
1
0
0
.Because ofΦ
=
e
F
T
≈
I
+
F
T, the PMSM EKF equations (10) and (11) can be obtained based on Kalman filter equations:(1)
Prediction is(10)
x
^
k
∣
k
-
1
=
x
^
k
-
1
+
f
x
^
k
-
1
+
B
u
k
-
1
T
P
k
∣
k
-
1
=
Φ
P
k
-
1
Φ
T
+
Q
.
(2)
Correction is(11)
K
k
=
P
k
∣
k
-
1
H
T
H
P
k
∣
k
-
1
H
T
+
R
-
1
,
x
^
k
=
x
^
k
∣
k
-
1
+
K
k
y
-
H
x
^
k
∣
k
-
1
,
P
k
=
I
-
K
k
H
P
k
∣
k
-
1
,where P
k is the state covariance matrix, Q is the state noise covariance matrix, K
k is the Kalman gain, and R is the measurement noise covariance matrix.The EKF model of the PMSM is built based on (10) and (11). Appropriate EKF parameters are required to obtain accurate and stable estimated results.


## 2.2. EKF Parameters Analysis

Kalman filter parameters are the noise covariance matrixQ and R, the PMSM initial state matrix X
o, and the initial state covariance matrix P
o.X
o represents the PMSM initial state based on (9). X
o contains the two-phase current information, the speed information, and the rotation angle information. X
o can be selected based on the PMSM initial state.R is measurement noise covariance of the stator current in the α
-
β coordinate. It is a 2 × 2 matrix. The current noise is uncorrelated, so R is actually a diagonal matrix composed of measurement noise variance of two-phase current in the α
-
β coordinate. This diagonal matrix is related to the current measurement noise. R can be selected by measuring the noise in practical application.P is the covariance matrix of the PMSM state X. P
o is the initial value of P. Because the PMSM state X is uncorrelated, P is a 4
×
4 diagonal matrix. In the matrix, p
11 and p
22 are the current covariance in the α
-
β coordinate. p
33 is the covariance of the speed. p
44 is the covariance of the rotation angle. P will be automatically adjusted to the appropriate value in the recursive filtering process of the Kalman filter. The selection of P
o does not affect the steady-state output of the Kalman filter. However, the EKF equations of the PMSM are approximate equations; the inappropriate selection of P
o may lead to the change of estimated results in both initial state and steady-state. The selection of p
o
11 and p
o
22 is based on current changes in the α
-
β coordinate. They usually choose the moderate value. Speed will rapidly increase after the PMSM starts to run, so p
o
33 should take the large value. The change of the rotation angle is from slow to fast when the PMSM starts up, so p
o
44 should take the small value.The selection of the state noise covariance matrixQ is the most important work in the EKF design. The state noise is assumed to be Gaussian white noise, which is independent and zero-mean; therefore, Q is a 4
×
4 diagonal matrix. q
11 and q
22 are the current noise covariance in the α
-
β coordinate. q
33 is the speed noise covariance. q
44 is the noise covariance of the rotation angle. The PMSM status cannot be obtained directly, so Q is also not directly obtained. There are many factors affecting the PMSM state noise generation. For instance, the simplification and approximation error of the PMSM equations can be considered to be noise. Therefore, Q cannot be selected by existing methods. Generally the optimum Q needs to be obtained by trial and error.


## 3. Simulation Analysis of the EKF

In this section, the simulation analysis of the EKF will be presented. A preset model of the PMSM in MATLAB/Simulink is used to build the simulation model of the sensorless control system. The sensorless control system is based on the field-oriented control; the PMSM parameters are shown in Table1.Table 1
PMSM parameters.
VoltageV
dc (V)
300
Rated speed (r/min)
3000
InductanceL (H)
0.02682
ResistanceR (Ω)
18.7
Permanent magnet fluxλ (Wb)
0.1717
Pole pairsp
2
Rotor moment of inertiaJ (kg⋅m2)
2.26
×
10
-
5
Mechanical damping factorB
m
1.349
×
10
-
5


### 3.1. Simulation Analysis in Different EKF Parameters

Take values ofP
o, Q, and R based on the theoretical analysis and the trial and error method. The values are R
=
[
0.01
0
;
0
0.01
], P
o
=
[
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
], and Q
=
[
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
30
]. The load torque is 0, and the reference speed is 3000 r/min. The direct output rotation angle of the EKF is recorded as the absolute estimated angle; the remainder of the absolute angle divided by 2
π is recorded as the relative estimated angle.ChangeP
o and Q and observe the estimated results of the EKF. P
o contains four parameters of p
o
11, p
o
22, p
o
33, and p
o
44. p
o
11 is equal to p
o
22, so there will be three parameters to be tested. Take p
o
11 to be 0.1, 1, 10, and 100. Take p
o
33 to be 0.1, 1, 10, and 100. Take p
o
44 to be 0.01, 0.1, 1, and 10. Change one parameter of P
o while other parameters are kept constant, and test all the parameters term by term. All estimated speeds are shown in Figure 1. All the estimated angles are shown in Figure 2. From the figures, it can be known that P
o has almost no effect on the estimated speed and the estimated angle.Figure 1
The estimated speed in differentP
o.Figure 2
The relative estimated angle in differentP
o.The selection ofQ has great influence on the EKF performance. Q contains q
11, q
22, q
33, and q
44, and q
11 is equal to q
22. Take successively q
11 to be 0.1, 1, 10, and 100 while other parameters are kept constant; the simulation results are shown in Figures 3, 4, and 5. Take successively q
33 to be 0.01, 0.1, 1, and 10 while other parameters are kept constant; the simulation results are shown in Figures 6, 7, and 8. Take q
44 to be 0.3, 3, 30, and 300; the simulation results are shown in Figures 9, 10, and 11.Figure 3
The estimated speed in differentq
11.Figure 4
The absolute estimated angle in differentq
11.Figure 5
The relative estimated angle in differentq
11.Figure 6
The estimated speed in differentq
33.Figure 7
The absolute estimated angle in differentq
33.Figure 8
The relative estimated angle in differentq
33.Figure 9
The estimated speed in differentq
44.Figure 10
The absolute estimated angle in differentq
44.Figure 11
The relative estimated angle in differentq
44.Based on these results from Figures3–11, the following conclusions can be obtained. The increases of q
11 will reduce the fluctuation of the estimated speed, increase the steady-state error of the estimated speed, and increase response time of the estimated speed. Meanwhile, the leading time of the estimated angle will become larger. The decrease of q
11 has the opposite result. Some inappropriate values of q
11 will lead to the large initial angle. q
33 represents the response performance of the estimated speed. The increase of q
33 will reduce the response time of the estimated speed and strengthen the fluctuation of the estimated speed. The decrease of q
33 has the opposite result. With the increases of q
44, the steady-state error of the estimated speed is reduced, the leading time of estimated angle is also reduced, and the fluctuation of initial estimated angle is strengthened. The decrease of q
44 has the opposite result.


### 3.2. Simulation Analysis in Different Load Torques and Different Reference Speeds

The EKF estimated results in different load torques are given in the following. The load torque range of the PMSM is from 0 Nm to 0.8 Nm, and the torque simulation interval is 0.2 Nm. Speed simulation results are shown in Figure12. With the increases of the PMSM load torque, the estimated steady-state speed increases and the fluctuation becomes larger. Angular errors with the sinusoidal operation are shown in Figure 13. The increase of the load torque will lead to the increase of the estimated angle leading time. Meanwhile, the error and distortion of the estimated angle occur when the load torque increases.Figure 12
Estimated speeds in different torques.Figure 13
Angular errors in different torques.Set the load torque to 0.2 Nm; EKF simulation results are presented in different reference speed. The reference speed is 1000 r/min, 2000 r/min, and 3000 r/min; simulation results are shown in Figures14 and 15.Figure 14
Estimated speeds in different reference speeds.Figure 15
Angular errors in different reference speeds.Based on Figures12 and 13, when EKF parameters are constant, the steady-state errors of the estimated speed and the steady-state errors of the estimated angular will increase with the load torque increases. In the fixed load torque, EKF parameters can be adjusted to make the estimated steady-state speed track the actual speed, but it has little effect on the angular error. Based on Figures 14 and 15, the decrease of the reference speed will reduce errors of the estimated speed and the estimated angle.


## 3.1. Simulation Analysis in Different EKF Parameters

Take values ofP
o, Q, and R based on the theoretical analysis and the trial and error method. The values are R
=
[
0.01
0
;
0
0.01
], P
o
=
[
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
], and Q
=
[
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
30
]. The load torque is 0, and the reference speed is 3000 r/min. The direct output rotation angle of the EKF is recorded as the absolute estimated angle; the remainder of the absolute angle divided by 2
π is recorded as the relative estimated angle.ChangeP
o and Q and observe the estimated results of the EKF. P
o contains four parameters of p
o
11, p
o
22, p
o
33, and p
o
44. p
o
11 is equal to p
o
22, so there will be three parameters to be tested. Take p
o
11 to be 0.1, 1, 10, and 100. Take p
o
33 to be 0.1, 1, 10, and 100. Take p
o
44 to be 0.01, 0.1, 1, and 10. Change one parameter of P
o while other parameters are kept constant, and test all the parameters term by term. All estimated speeds are shown in Figure 1. All the estimated angles are shown in Figure 2. From the figures, it can be known that P
o has almost no effect on the estimated speed and the estimated angle.Figure 1
The estimated speed in differentP
o.Figure 2
The relative estimated angle in differentP
o.The selection ofQ has great influence on the EKF performance. Q contains q
11, q
22, q
33, and q
44, and q
11 is equal to q
22. Take successively q
11 to be 0.1, 1, 10, and 100 while other parameters are kept constant; the simulation results are shown in Figures 3, 4, and 5. Take successively q
33 to be 0.01, 0.1, 1, and 10 while other parameters are kept constant; the simulation results are shown in Figures 6, 7, and 8. Take q
44 to be 0.3, 3, 30, and 300; the simulation results are shown in Figures 9, 10, and 11.Figure 3
The estimated speed in differentq
11.Figure 4
The absolute estimated angle in differentq
11.Figure 5
The relative estimated angle in differentq
11.Figure 6
The estimated speed in differentq
33.Figure 7
The absolute estimated angle in differentq
33.Figure 8
The relative estimated angle in differentq
33.Figure 9
The estimated speed in differentq
44.Figure 10
The absolute estimated angle in differentq
44.Figure 11
The relative estimated angle in differentq
44.Based on these results from Figures3–11, the following conclusions can be obtained. The increases of q
11 will reduce the fluctuation of the estimated speed, increase the steady-state error of the estimated speed, and increase response time of the estimated speed. Meanwhile, the leading time of the estimated angle will become larger. The decrease of q
11 has the opposite result. Some inappropriate values of q
11 will lead to the large initial angle. q
33 represents the response performance of the estimated speed. The increase of q
33 will reduce the response time of the estimated speed and strengthen the fluctuation of the estimated speed. The decrease of q
33 has the opposite result. With the increases of q
44, the steady-state error of the estimated speed is reduced, the leading time of estimated angle is also reduced, and the fluctuation of initial estimated angle is strengthened. The decrease of q
44 has the opposite result.


## 3.2. Simulation Analysis in Different Load Torques and Different Reference Speeds

The EKF estimated results in different load torques are given in the following. The load torque range of the PMSM is from 0 Nm to 0.8 Nm, and the torque simulation interval is 0.2 Nm. Speed simulation results are shown in Figure12. With the increases of the PMSM load torque, the estimated steady-state speed increases and the fluctuation becomes larger. Angular errors with the sinusoidal operation are shown in Figure 13. The increase of the load torque will lead to the increase of the estimated angle leading time. Meanwhile, the error and distortion of the estimated angle occur when the load torque increases.Figure 12
Estimated speeds in different torques.Figure 13
Angular errors in different torques.Set the load torque to 0.2 Nm; EKF simulation results are presented in different reference speed. The reference speed is 1000 r/min, 2000 r/min, and 3000 r/min; simulation results are shown in Figures14 and 15.Figure 14
Estimated speeds in different reference speeds.Figure 15
Angular errors in different reference speeds.Based on Figures12 and 13, when EKF parameters are constant, the steady-state errors of the estimated speed and the steady-state errors of the estimated angular will increase with the load torque increases. In the fixed load torque, EKF parameters can be adjusted to make the estimated steady-state speed track the actual speed, but it has little effect on the angular error. Based on Figures 14 and 15, the decrease of the reference speed will reduce errors of the estimated speed and the estimated angle.


## 4. The Design of EKF Sensorless Control System

### 4.1. EKF Parameters Tuning Method

An EKF parameter tuning method can be proposed based on the theoretical and simulation analysis results as follows.(1) Set Initial Values of
R
,
P
o
, and
Q
Based on the Theoretical Analysis. Set R based on the measurement errors. Set P
o based on the theoretical analysis. It is impossible to set the initial Q based on the theoretical analysis, so set Q as a unit diagonal matrix.(2)
Q
Is Set at First. The first step is to set q
33 to ensure the response performance of the estimated speed. The second step is to set q
44 to ensure the steady-state tracking performance of the estimated speed. q
11 and q
44 are set to reduce the fluctuation of the estimated speed at last step. Finally adjust P
o to obtain the optimized initial performance of the estimated speed and the estimated angle.


### 4.2. The Structure of the Sensorless Control System

The EKF estimated results cannot directly be used in the sensorless control for the following issues: (1) the errors between EKF estimated values and actual values always exist because of the approximation of PMSM equations; (2) the EKF estimated initial angle is inaccurate and cannot be used; (3) the accuracy of EKF estimated results is different in different load torques and different reference speeds.To solve these issues a sensorless control system is proposed based on the analysis of the EKF sensorless control. The system takes the following measures. (1) The leading time of the estimated angle can be corrected by the time delay module. (2) The inaccurate initial estimated angle can be replaced by the estimated angle of a direct method based on the PMSM model when the PMSM starts. (3) A parameter self-regulating system is designed to self-regulate EKF parameters and correct the estimated speed and the estimated angle based on the electromagnetic torque and the reference speed.The EKF sensorless control system of the PMSM is shown in Figure16. The parameter self-regulating system is shown in Figure 17. The field-oriented control is used in this sensorless control system. An electromagnetic torque estimation module is designed to estimate the electromagnetic torque. The postprocessing module is designed to correct the estimated speed and the estimated angle.Figure 16
The sensorless control system.Figure 17
The parameter self-regulating system.


### 4.3. The Design of the Parameter Self-Regulating System

The electromagnetic torque can be obtained by the torque estimation module. Angle distortion will occur by using a single EKF parameter when the load torque is large. Therefore, the PMSM self-regulating system is divided into three sections based on values of the electromagnetic torque. Each section has itself EKF parameters. According to the simulation analysis of EKF estimated results, the torque section is divided as follows: Section  1: load torque 0–0.25 Nm; Section  2: load torque 0.25–0.55 Nm; and Section  3: load torque 0.55–0.8 Nm.Only the state noise covariance matrixQ needs to be regulated in each section; other parameters are constant. EKF parameters of each section are obtained through the EKF parameter tuning method as follows.Section  1 is(12)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
25
;Section  2 is(13)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
0.6
;Section  3 is(14)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
0.25
.The influence of the reference speed on estimated results is assumed to be linear based on the simulation analysis of EKF estimated results. At speed compensation, the lower limit torque of each section is set to be the electromagnetic torque reference, and the correction reference of the reference speed is the PMSM rated speed. The negative compensation is added to the estimated speed when the electromagnetic torque increases from the reference value. The absolute value of the compensation decreases when the reference speed decreases from the PMSM rated speed. The increase of the reference speed has the opposite result. The general equation of the speed modification can be obtained:(15)
ω
c
=
ω
r
-
G
T
×
T
e
-
T
e
_
r
e
f
×
1
-
G
ω
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
,where ω
c is the corrected speed, unit:  r/min; ω
r is the EKF estimated speed; T
e is the electromagnetic torque; ω
r
a
t
e
d is the PMSM rated speed; ω
r
_
r
e
f is the reference speed; T
e
_
r
e
f is the lower limit torque in each section; G
T is the torque correction gain; G
ω is the speed correction gain.The EKF estimated rotation angle always has the leading time compared with the actual rotation angle. The leading time of the estimated rotation angle is related to the load torque and the reference speed. The delay module can be used to solve the problem. The delay time is set as follows. The reference delay time is set to be the inherent leading time of the EKF estimated rotation angle in the electromagnetic torque reference and the PMSM rated speed. The delay time compensation is added to the reference delay time. The delay time compensation increases when the electromagnetic torque increases from the reference value. The delay time compensation and the reference delay time decrease when the speed decreases from the PMSM rated speed. The increase of the reference speed has the opposite result. The general equation of the delay time is(16)
τ
=
T
e
-
T
e
_
r
e
f
×
G
T
×
1
+
G
ω
1
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
+
τ
r
e
f
×
1
+
G
ω
2
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
,where τ is the actual delay time, τ
r
e
f is the reference delay time, and G
ω
1 and G
ω
2 are the speed correction gain.The estimated angle contains harmonics, which will affect motor control. So the estimated angle must be filtered, and the filter will bring the delay time to be considered. The selection of the correction gain in (11) and (15) is based on the low pass filter and PMSM parameters through repeated simulation and debugging. The speed modification compensations are as follows.Section  1 is(17)
ω
r
+
25
-
700
×
T
e
×
1
-
0.0005
×
3001
-
ω
r
_
r
e
f
.Section  2 is(18)
ω
r
-
700
×
T
e
-
0.25
×
1
-
0.001
×
3001
-
ω
r
_
r
e
f
.Section  3 is(19)
ω
r
+
0.055
×
3001
-
ω
r
_
r
e
f
-
700
×
T
e
-
0.55
×
1
-
0.0005
×
3001
-
ω
r
_
r
e
f
.Angle delay times in each section are as follows.Section  1 is(20)
T
e
×
48
×
1
0
-
5
×
1
+
0.001
×
3001
-
ω
r
_
r
e
f
+
12
×
1
0
-
6
×
1
+
0.003
×
3001
-
ω
r
_
r
e
f
.Section  2 is(21)
T
e
-
0.25
×
42
×
1
0
-
5
×
1
+
0.0005
×
3001
-
ω
r
_
r
e
f
+
112
×
1
0
-
6
×
1
+
G
ω
2
×
3001
-
ω
r
_
r
e
f
,
G
ω
2
=
0.0018
×
2001
-
ω
r
_
r
e
f
+
1.9
×
0.001
.Section  3 is(22)
T
e
-
0.55
×
32
×
1
0
-
5
×
1
+
0.0007
×
3001
-
ω
r
_
r
e
f
+
10
×
1
0
-
6
×
1
+
G
ω
2
×
3001
-
ω
r
_
r
e
f
,
G
ω
2
=
0.05
×
2001
-
ω
r
_
r
e
f
+
35
×
0.001
.


## 4.1. EKF Parameters Tuning Method

An EKF parameter tuning method can be proposed based on the theoretical and simulation analysis results as follows.(1) Set Initial Values of
R
,
P
o
, and
Q
Based on the Theoretical Analysis. Set R based on the measurement errors. Set P
o based on the theoretical analysis. It is impossible to set the initial Q based on the theoretical analysis, so set Q as a unit diagonal matrix.(2)
Q
Is Set at First. The first step is to set q
33 to ensure the response performance of the estimated speed. The second step is to set q
44 to ensure the steady-state tracking performance of the estimated speed. q
11 and q
44 are set to reduce the fluctuation of the estimated speed at last step. Finally adjust P
o to obtain the optimized initial performance of the estimated speed and the estimated angle.


## 4.2. The Structure of the Sensorless Control System

The EKF estimated results cannot directly be used in the sensorless control for the following issues: (1) the errors between EKF estimated values and actual values always exist because of the approximation of PMSM equations; (2) the EKF estimated initial angle is inaccurate and cannot be used; (3) the accuracy of EKF estimated results is different in different load torques and different reference speeds.To solve these issues a sensorless control system is proposed based on the analysis of the EKF sensorless control. The system takes the following measures. (1) The leading time of the estimated angle can be corrected by the time delay module. (2) The inaccurate initial estimated angle can be replaced by the estimated angle of a direct method based on the PMSM model when the PMSM starts. (3) A parameter self-regulating system is designed to self-regulate EKF parameters and correct the estimated speed and the estimated angle based on the electromagnetic torque and the reference speed.The EKF sensorless control system of the PMSM is shown in Figure16. The parameter self-regulating system is shown in Figure 17. The field-oriented control is used in this sensorless control system. An electromagnetic torque estimation module is designed to estimate the electromagnetic torque. The postprocessing module is designed to correct the estimated speed and the estimated angle.Figure 16
The sensorless control system.Figure 17
The parameter self-regulating system.


## 4.3. The Design of the Parameter Self-Regulating System

The electromagnetic torque can be obtained by the torque estimation module. Angle distortion will occur by using a single EKF parameter when the load torque is large. Therefore, the PMSM self-regulating system is divided into three sections based on values of the electromagnetic torque. Each section has itself EKF parameters. According to the simulation analysis of EKF estimated results, the torque section is divided as follows: Section  1: load torque 0–0.25 Nm; Section  2: load torque 0.25–0.55 Nm; and Section  3: load torque 0.55–0.8 Nm.Only the state noise covariance matrixQ needs to be regulated in each section; other parameters are constant. EKF parameters of each section are obtained through the EKF parameter tuning method as follows.Section  1 is(12)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
25
;Section  2 is(13)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
0.6
;Section  3 is(14)
R
=
0.01
0
;
0
0.01
,
P
=
1
0
0
0
;
0
1
0
0
;
0
0
10
0
;
0
0
0
0.1
,
Q
=
1
0
0
0
;
0
1
0
0
;
0
0
0.1
0
;
0
0
0
0.25
.The influence of the reference speed on estimated results is assumed to be linear based on the simulation analysis of EKF estimated results. At speed compensation, the lower limit torque of each section is set to be the electromagnetic torque reference, and the correction reference of the reference speed is the PMSM rated speed. The negative compensation is added to the estimated speed when the electromagnetic torque increases from the reference value. The absolute value of the compensation decreases when the reference speed decreases from the PMSM rated speed. The increase of the reference speed has the opposite result. The general equation of the speed modification can be obtained:(15)
ω
c
=
ω
r
-
G
T
×
T
e
-
T
e
_
r
e
f
×
1
-
G
ω
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
,where ω
c is the corrected speed, unit:  r/min; ω
r is the EKF estimated speed; T
e is the electromagnetic torque; ω
r
a
t
e
d is the PMSM rated speed; ω
r
_
r
e
f is the reference speed; T
e
_
r
e
f is the lower limit torque in each section; G
T is the torque correction gain; G
ω is the speed correction gain.The EKF estimated rotation angle always has the leading time compared with the actual rotation angle. The leading time of the estimated rotation angle is related to the load torque and the reference speed. The delay module can be used to solve the problem. The delay time is set as follows. The reference delay time is set to be the inherent leading time of the EKF estimated rotation angle in the electromagnetic torque reference and the PMSM rated speed. The delay time compensation is added to the reference delay time. The delay time compensation increases when the electromagnetic torque increases from the reference value. The delay time compensation and the reference delay time decrease when the speed decreases from the PMSM rated speed. The increase of the reference speed has the opposite result. The general equation of the delay time is(16)
τ
=
T
e
-
T
e
_
r
e
f
×
G
T
×
1
+
G
ω
1
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
+
τ
r
e
f
×
1
+
G
ω
2
×
ω
r
a
t
e
d
-
ω
r
_
r
e
f
,where τ is the actual delay time, τ
r
e
f is the reference delay time, and G
ω
1 and G
ω
2 are the speed correction gain.The estimated angle contains harmonics, which will affect motor control. So the estimated angle must be filtered, and the filter will bring the delay time to be considered. The selection of the correction gain in (11) and (15) is based on the low pass filter and PMSM parameters through repeated simulation and debugging. The speed modification compensations are as follows.Section  1 is(17)
ω
r
+
25
-
700
×
T
e
×
1
-
0.0005
×
3001
-
ω
r
_
r
e
f
.Section  2 is(18)
ω
r
-
700
×
T
e
-
0.25
×
1
-
0.001
×
3001
-
ω
r
_
r
e
f
.Section  3 is(19)
ω
r
+
0.055
×
3001
-
ω
r
_
r
e
f
-
700
×
T
e
-
0.55
×
1
-
0.0005
×
3001
-
ω
r
_
r
e
f
.Angle delay times in each section are as follows.Section  1 is(20)
T
e
×
48
×
1
0
-
5
×
1
+
0.001
×
3001
-
ω
r
_
r
e
f
+
12
×
1
0
-
6
×
1
+
0.003
×
3001
-
ω
r
_
r
e
f
.Section  2 is(21)
T
e
-
0.25
×
42
×
1
0
-
5
×
1
+
0.0005
×
3001
-
ω
r
_
r
e
f
+
112
×
1
0
-
6
×
1
+
G
ω
2
×
3001
-
ω
r
_
r
e
f
,
G
ω
2
=
0.0018
×
2001
-
ω
r
_
r
e
f
+
1.9
×
0.001
.Section  3 is(22)
T
e
-
0.55
×
32
×
1
0
-
5
×
1
+
0.0007
×
3001
-
ω
r
_
r
e
f
+
10
×
1
0
-
6
×
1
+
G
ω
2
×
3001
-
ω
r
_
r
e
f
,
G
ω
2
=
0.05
×
2001
-
ω
r
_
r
e
f
+
35
×
0.001
.


## 5. Simulation Result

The simulation model of the EKF sensorless control system is built in MATLAB/Simulink software based on Figures16 and 17. Two reference speed signals shown in Figure 18 are used to test the performance of the EKF sensorless control system.Figure 18
The speed signals.For the reference speed signals, the performance of the sensorless control system is, respectively, given in the load torques 0 Nm, 0.2 Nm, 0.4 Nm, and 0.6 Nm while other parameters are kept constant. The simulation results at the first speed signal are in Figures19–22. The simulation results at the second speed signal are in Figures 23–26.Figure 19
Speeds and angles response in load torque 0 Nm.Figure 20
Speeds and angles response in load torque 0.2 Nm.Figure 21
Speeds and angles response in load torque 0.4 Nm.Figure 22
Speeds and angles response in load torque 0.6 Nm.Figure 23
Speeds and angles response in load torque 0 Nm.Figure 24
Speeds and angles response in load torque 0.2 Nm.Figure 25
Speeds and angles in load torque 0.4 Nm.Figure 26
Speeds and angles in load torque 0.6 Nm.At the speed estimation, with the load torque increases, the fluctuation of the estimated speed becomes large, and the settling time becomes large when the reference speed changes. Especially in load torque 0.6 Nm, when the reference speed changes, the fluctuation of the new speed is very severe, and it is impossible to eliminate the fluctuation in speed 1000 r/min. At the angle estimation, the estimating error of the angle is very small when the system is running steadily. But in the regulating process, the angular error is obvious.Based on all speed and angle response results in Figures19–26, it can be seen that by using the estimated speed and the estimated angle the sensorless control system performs well in startup, operation, and speed change of the PMSM. The sensorless control system can estimate the speed and the angle accurately in different load torques and different reference speeds; thus, the PMSM can run smoothly without sensors. The system operates fast and smoothly when the speed changes from 3000 r/min down to 2000 r/min or from 2000 r/min down to 1000 r/min.


## 6. Conclusion

Based on the theoretical and simulation analysis of the EKF sensorless control system, an EKF parameters tuning method is proposed for the PMSM sensorless control application. Then the simulation study of EKF estimated results in different reference speeds and different load torques is presented. Thus, the EKF postprocessing system is given to use the reference speed and the electromagnetic torque to self-regulate EKF parameters and correct the estimated speed and the rotation angle. Simulation results verify that this method can realize PMSM sensorless operation in different torques and different speeds; the performance of the speed response and tracking is satisfying.



---

*Source: 3916231-2016-02-18.xml*