# Nonlinear Identification of PMSM Rotor Magnetic Linkages Based on an Improved Extended Kalman Filter

Authors: Tao Chen; Bing Chen
Journal: Journal of Sensors
 (2022)

---

## Abstract

The permanent magnet synchronous motor (PMSM) has complex nonlinear, strongly coupled characteristics and the variation of motor parameters makes its control more difficult. Therefore, parameter identification is of great significance for the stable operation of its closed-loop control system. In this paper, a method based on an improved extended Kalman filter (EKF) for the identification of the rotor flux (ψf) of a permanent magnet synchronous motor is investigated for this nonlinear and strongly coupled model. Simulation results show that the method has a more fast convergence rate and more accurate identification result than traditional EKF algorithm.


---

## Body

## 1. Introduction

As the cost and price of rare earth permanent magnet materials continue to fall and motor design and manufacturing technology continues to develop, permanent magnet motors are gaining more and more attention for their small size, high efficiency, and high power density, with a wide range of applications from high-performance servo systems to aerospace systems [1]. In addition, the rotor magnetic field of permanent magnet motors is provided by permanent magnets, which do not need to be excited, and therefore have energy-saving features. In operation, the efficiency, reliability, and safety of permanent magnet motors are undoubtedly of great importance [2]. High-performance control technology and a perfect control system are therefore essential for the continued development of permanent magnet motors at high speed [3]. The vector control and direct torque control techniques originally used for induction motors have been successfully transferred to the control of permanent magnet motors with good results [4]. However, the implementation of high-performance control techniques such as vector control and direct torque control is dependent on the mathematical model of the motor, while the AC permanent magnet synchronous motor is a multivariable, strongly coupled, nonlinear system, whose parameters are constantly changing with time and there are certain coupling relationships between the parameters [5]. Therefore, in order to obtain high-performance control, it is necessary to provide the control algorithm with accurate motor parameters in real time, i.e., to carry out online parameter identification. On the other hand, in order to suppress the influence of measurement noise on the dynamic behavior of permanent magnet motors and to streamline the control system structure in order to further improve the control system performance, position sensor-free control techniques have been developed on the basis of vector control and direct torque control. When a position sensor is not present in the control system, the key variable of the motor’s rotor angle must be identified [6].PMSMs are widely used in AC servo drive systems for their fast response, good control performance, small size, and lightweight [7]. At present, the common parameter identification methods of PMSMs are Kalman filter identification [8], neural network identification method [9], and genetic algorithm. The Kalman filter is an efficient recursive filtering method that can estimate the state of a dynamic system from a series of incomplete noise measurements. It mainly uses the dynamic information of the target and tries to remove the effect of noise to obtain a good estimate about the target [10]. The Kalman filter identification is based on the Kalman filter algorithm, is applicable to linear or nonlinear systems, and allows for model bias and measurement error in the system. Since its introduction, the Kalman filter has been widely used in the fields of navigation, process control, signal tracking, and system identification [11].Until recently, the Kalman filter has been used in the control of AC permanent magnet synchronous motors, mainly to replace position sensors for position sensor-free control. The Kalman filter algorithm is used to estimate the angle and speed of the motor rotor independent of the initial rotor position [12].Neural networks are highly parallel and nonlinear in their global action, and are highly adaptive and self-learning. They have been widely used in modelling, identification, and control of nonlinear systems. Compared with traditional BP and RBF networks, feedback neural networks are able to detect and identify time-varying patterns [13].In order to improve the rotor flux identification accuracy and reduce the influence on the rotor flux identification results induced by stator resistance changes, the synchronous identification of rotor flux and stator resistance is realized for the first time by combining Kalman filter and feedback neural network. Firstly, the stator resistance and rotor flux calculated by EKF are used to train the feedback neural network off-line, and then the estimation errors of EKF algorithm are compensated by the trained feedback neural network [14]. The simulation results show that the method has high convergence and satisfactory parameter identification accuracy, and has good generalization ability.


## 2. Related Work

The extended Kalman filter is based on the Kalman filter algorithm, a recursive algorithm proposed by R.E. Kalman in 1960 for linear or nonlinear systems, which allows for measurement errors and model biases in the system and is robust to noise and is therefore widely used in industrial process control, navigation, and system identification [15]. The extended Kalman filter is divided into two processes: prediction and correction, where the prediction part is based on the estimation and covariance of the previous moment, and the correction part is based on the correction of the predicted system state from the measurement data [16].The first studies on EKF in permanent magnet synchronous motor control without position sensors and parameter identification were carried out by [17], which implemented the hardware of the EKF algorithm for permanent magnet synchronous motors into the online algorithm and achieved good results in parameter identification and state estimation. In [18], the EKF was combined with an adaptive control algorithm to achieve accurate estimation of several parameters such as the speed, rotational inertia, friction coefficient, and load torque of the permanent magnet motor, and the sensitivity of the parameters of the EKF algorithm was analyzed with important parameters [19] .The later development of EKF identification technology focuses on the reduction of the order of the identification model, which can significantly reduce the amount of data calculation, shorten the time required for the algorithm to run, simplify the system hardware implementation, and to a certain extent improve the performance of the motor control system, while ensuring a certain degree of accuracy [20].


## 3. Algorithmic Principles of the PMSM Mathematical Model

The mathematical model of the PMSM is described in terms of a reference coordinate system fixed to the rotor, i.e., thed-q rotating coordinate system, which is convenient for analyzing its steady-state and dynamic performance. The voltage equation in the d-q rotating coordinate system is
(1)uq=Rsİq+pψq+ωeψdud=Rsİd+pψd−ωeψq.The equation for the magnetic chain is(2)ψq=Lqiqψd=Ldid+ψf,where ud, uq are d, q-axis voltages; id, iq are d, q-axis currents; Ld, Lq are d, q-axis inductances; Rs is the stator phase resistance; ωe is the rotor electrical angular velocity; ψf is the chain of permanent magnet fundamental excitation field across the stator winding; ψd, ψq are the d, q-axis stator magnetic chain component; p is the differential operator. Without considering the torque equation, the mathematical model of a permanent magnet synchronous motor is a nonlinear, mutually coupled model of order 4, as can be seen from equations (1) and (2)
(3)İd=udLd−RsLdİd+ψdLdωe,İq=uqLq−RsLqİq−ψLqωe,Ṙs=0,ψ̇f=0.


## 4. Parametric Identification Systems and Identification Models

### 4.1. Parameter Recognition System

In modern motor drive and control technology, the rotor position is a critical variable. In the implementation of vector control algorithms, the rotor position needs to be transformed by coordinates; in the implementation of direct torque control algorithms, the rotor position needs to be estimated by the magnetic chain. The accuracy of the rotor position detection therefore has a significant impact on the performance of the PMSM control system. A common method of collecting rotor position information is to install a mechanical position sensor, such as an optical rotary encoder, in the motor control system, which is connected to the motor and the rotor rotates the code plate to signal the rotor position. For parameter recognition systems, the rotor position is not only used in the vector control algorithm but is also an indispensable input to the EKF observer.Figure1 shows the EKF parameter recognition system with position sensor. The error signal obtained by comparing the given speed ω∗ with the actual speed ω is used as input to the speed regulator, and the given torque Te∗ from the speed regulator is compared with the actual torque T to obtain the torque error signal, where the actual torque is calculated from the actual value of the cross-axis current component iq. These reference values, together with the actual values of the detected three-phase stator currents, are processed by the hysteresis loop current controller and generate the switching state signals of the PWM inverter. At the same time, the stator current value i∗d and the input voltage value of the permanent magnet synchronous motor are transformed to obtain the current components iq, id and voltage components ud, uq in the d and q axes, respectively, which are used as inputs to the EKF observer together with the actual speed. The rotor angle information used for the coordinate transformation in the above control process is provided by the position sensor.Figure 1
Parameter recognition system with position sensor.


### 4.2. Parameter Identification Models

In order to identify the parameters of a permanent magnet synchronous motor using the extended Kalman filter, an iterative computational model needs to be developed. Since a permanent magnet synchronous motor is a multivariable, strongly coupled, high-order nonlinear system, the process of parameter identification involves the inverse of a high-order matrix, and it is tedious and time-consuming to obtain the inverse of a matrix of order three or higher. In addition, in the conventional bit-trade sensor parameter recognition system, the rotor position variable is provided by the position sensor, which is equivalent to a reduced order of the system. During the identification of the individual parameters of the motor, the parameters themselves change slowly compared to the power transients, so that the parameters can be considered constant during each calculation cycle.


#### 4.2.1. Discriminative Models inαβ Coordinate Systems

For surface-mounted permanent magnet synchronous motors, it is convenient to use a two-phase stationary coordinate system with the stator field oriented in the EKF algorithm for parameter identification. At the same time, the control system contains a position sensor, so that rotor position and speed are known quantities. The identification model of the motor stator winding resistance can be divided into a second-order model and a third-order model, which are expressed as:(4)drdt=0diαdt=−rLiα+λLωsinθ+uαL,drdt=0diβdt=−rLiβ−λLωcosθ+uβL,drdt=0diαdt=−rLiα+λLωsinθ+uαLdiβdt=−rLiβ−λLωcosθ+uβL,where r is stator phase resistance. Most of the above identification models are still nonlinear, and they can only be analyzed using the Kalman filter after they have been linearized by means of the Jacobi matrix. Taking the third-order identification model of the stator resistance as an example to find the relevant Jacobi matrix, the dynamic equation of the model can be expressed as follows
(5)ẋ=ϕx,uz=cx,where ẋ=riαiβT state vectors, z=iαiβT measurement vectors, andu=uαuβT input vectors.After linearization, the discrete form of the dynamic equation is:(6)xk+1=Γkδxk+wkzk=Δkδxk+vk.The Jacobi matrix and the approximate discrete system matrixΓk and the measurement matrix Δk are obtained as follows
(7)Γk=I+Ts·∂ϕx,u∂xi:x=xk=100−iαTsL1−rTsL0−iβTsL01−rTsL,Δk=∂cx∂x=010001,where Ts is the system sampling period.


#### 4.2.2. Discriminative Model ind, q Coordinate System

For the parametric identification of surface-mounted permanent magnet synchronous motors, a two-phase rotating coordinate system with rotor field orientation can also be used. Again, the rotor position and speed signals required for the identification process are provided by the position sensors and are treated as known quantities. The reason for this is that thed-axis current is always controlled close to zero, making this term in the d-axis equation almost equal to zero, resulting in an equation with ‐rid/L no state variables to be estimated, which naturally makes identification difficult. The stator resistance identification model using the q-axis equation can be expressed as follows
(8)drdt=0diqdt=−rLiq−ωid−ψfLω+uqL.The rotor flux identification model inαβ coordinate systems and d, q coordinate system is similar with stator resistance identification model above mentioned.


## 4.1. Parameter Recognition System

In modern motor drive and control technology, the rotor position is a critical variable. In the implementation of vector control algorithms, the rotor position needs to be transformed by coordinates; in the implementation of direct torque control algorithms, the rotor position needs to be estimated by the magnetic chain. The accuracy of the rotor position detection therefore has a significant impact on the performance of the PMSM control system. A common method of collecting rotor position information is to install a mechanical position sensor, such as an optical rotary encoder, in the motor control system, which is connected to the motor and the rotor rotates the code plate to signal the rotor position. For parameter recognition systems, the rotor position is not only used in the vector control algorithm but is also an indispensable input to the EKF observer.Figure1 shows the EKF parameter recognition system with position sensor. The error signal obtained by comparing the given speed ω∗ with the actual speed ω is used as input to the speed regulator, and the given torque Te∗ from the speed regulator is compared with the actual torque T to obtain the torque error signal, where the actual torque is calculated from the actual value of the cross-axis current component iq. These reference values, together with the actual values of the detected three-phase stator currents, are processed by the hysteresis loop current controller and generate the switching state signals of the PWM inverter. At the same time, the stator current value i∗d and the input voltage value of the permanent magnet synchronous motor are transformed to obtain the current components iq, id and voltage components ud, uq in the d and q axes, respectively, which are used as inputs to the EKF observer together with the actual speed. The rotor angle information used for the coordinate transformation in the above control process is provided by the position sensor.Figure 1
Parameter recognition system with position sensor.


## 4.2. Parameter Identification Models

In order to identify the parameters of a permanent magnet synchronous motor using the extended Kalman filter, an iterative computational model needs to be developed. Since a permanent magnet synchronous motor is a multivariable, strongly coupled, high-order nonlinear system, the process of parameter identification involves the inverse of a high-order matrix, and it is tedious and time-consuming to obtain the inverse of a matrix of order three or higher. In addition, in the conventional bit-trade sensor parameter recognition system, the rotor position variable is provided by the position sensor, which is equivalent to a reduced order of the system. During the identification of the individual parameters of the motor, the parameters themselves change slowly compared to the power transients, so that the parameters can be considered constant during each calculation cycle.


### 4.2.1. Discriminative Models inαβ Coordinate Systems

For surface-mounted permanent magnet synchronous motors, it is convenient to use a two-phase stationary coordinate system with the stator field oriented in the EKF algorithm for parameter identification. At the same time, the control system contains a position sensor, so that rotor position and speed are known quantities. The identification model of the motor stator winding resistance can be divided into a second-order model and a third-order model, which are expressed as:(4)drdt=0diαdt=−rLiα+λLωsinθ+uαL,drdt=0diβdt=−rLiβ−λLωcosθ+uβL,drdt=0diαdt=−rLiα+λLωsinθ+uαLdiβdt=−rLiβ−λLωcosθ+uβL,where r is stator phase resistance. Most of the above identification models are still nonlinear, and they can only be analyzed using the Kalman filter after they have been linearized by means of the Jacobi matrix. Taking the third-order identification model of the stator resistance as an example to find the relevant Jacobi matrix, the dynamic equation of the model can be expressed as follows
(5)ẋ=ϕx,uz=cx,where ẋ=riαiβT state vectors, z=iαiβT measurement vectors, andu=uαuβT input vectors.After linearization, the discrete form of the dynamic equation is:(6)xk+1=Γkδxk+wkzk=Δkδxk+vk.The Jacobi matrix and the approximate discrete system matrixΓk and the measurement matrix Δk are obtained as follows
(7)Γk=I+Ts·∂ϕx,u∂xi:x=xk=100−iαTsL1−rTsL0−iβTsL01−rTsL,Δk=∂cx∂x=010001,where Ts is the system sampling period.


### 4.2.2. Discriminative Model ind, q Coordinate System

For the parametric identification of surface-mounted permanent magnet synchronous motors, a two-phase rotating coordinate system with rotor field orientation can also be used. Again, the rotor position and speed signals required for the identification process are provided by the position sensors and are treated as known quantities. The reason for this is that thed-axis current is always controlled close to zero, making this term in the d-axis equation almost equal to zero, resulting in an equation with ‐rid/L no state variables to be estimated, which naturally makes identification difficult. The stator resistance identification model using the q-axis equation can be expressed as follows
(8)drdt=0diqdt=−rLiq−ωid−ψfLω+uqL.The rotor flux identification model inαβ coordinate systems and d, q coordinate system is similar with stator resistance identification model above mentioned.


## 4.2.1. Discriminative Models inαβ Coordinate Systems

For surface-mounted permanent magnet synchronous motors, it is convenient to use a two-phase stationary coordinate system with the stator field oriented in the EKF algorithm for parameter identification. At the same time, the control system contains a position sensor, so that rotor position and speed are known quantities. The identification model of the motor stator winding resistance can be divided into a second-order model and a third-order model, which are expressed as:(4)drdt=0diαdt=−rLiα+λLωsinθ+uαL,drdt=0diβdt=−rLiβ−λLωcosθ+uβL,drdt=0diαdt=−rLiα+λLωsinθ+uαLdiβdt=−rLiβ−λLωcosθ+uβL,where r is stator phase resistance. Most of the above identification models are still nonlinear, and they can only be analyzed using the Kalman filter after they have been linearized by means of the Jacobi matrix. Taking the third-order identification model of the stator resistance as an example to find the relevant Jacobi matrix, the dynamic equation of the model can be expressed as follows
(5)ẋ=ϕx,uz=cx,where ẋ=riαiβT state vectors, z=iαiβT measurement vectors, andu=uαuβT input vectors.After linearization, the discrete form of the dynamic equation is:(6)xk+1=Γkδxk+wkzk=Δkδxk+vk.The Jacobi matrix and the approximate discrete system matrixΓk and the measurement matrix Δk are obtained as follows
(7)Γk=I+Ts·∂ϕx,u∂xi:x=xk=100−iαTsL1−rTsL0−iβTsL01−rTsL,Δk=∂cx∂x=010001,where Ts is the system sampling period.


## 4.2.2. Discriminative Model ind, q Coordinate System

For the parametric identification of surface-mounted permanent magnet synchronous motors, a two-phase rotating coordinate system with rotor field orientation can also be used. Again, the rotor position and speed signals required for the identification process are provided by the position sensors and are treated as known quantities. The reason for this is that thed-axis current is always controlled close to zero, making this term in the d-axis equation almost equal to zero, resulting in an equation with ‐rid/L no state variables to be estimated, which naturally makes identification difficult. The stator resistance identification model using the q-axis equation can be expressed as follows
(8)drdt=0diqdt=−rLiq−ωid−ψfLω+uqL.The rotor flux identification model inαβ coordinate systems and d, q coordinate system is similar with stator resistance identification model above mentioned.


## 5. Improved EKF Principle Analysis

Kalman filtering uses the statistical properties of Gaussian white noise signals to filter out the uninteresting components of the superimposed signal [21]. However, in motor filtering, the harmonic amplitude varies considerably when a high-capacity load is switched on, and the mean value is not zero, so the process noise in the system often does not conform to a Gaussian distribution. In this paper, a modified EKF filter module is used to replace the low-pass filter, and the harmonic current signal is introduced as process noise to reconstruct the noise signal. Since the classical Kalman filter is not suitable for nonlinear systems, the extended Kalman filter is used, and the noise reconstruction is improved by introducing the harmonic current signal into the EKF filter module through a coordinate transformation. The extracted three-phase harmonic current iapff−a∗, iapf−b, iapff−c is transformed by coordinates and the harmonic current in stationary coordinates is iapf−α∗, iapf−β∗ then
(9)iapf−α∗iapf−β∗=231−12−12032−32iapff−a∗iapf−biapff−c.The coordinate transformation from two-phase stationary to two-phase rotating is(10)iapf−p∗iapf−q∗=cosθsinθ−sinθcosθiapf−α∗iapf−β∗.Similarly, the load current is transformed to obtain the active current componentiq and the reactive current component id, which contain harmonic components, then, id, iq can be expressed as
(11)xk=Akxk−1+Wk−1wk−1yk=Hkxk+vk,xka=xkwkT=AkWk−10Ixk−1wk−1+0Iηk−1,yk=Hk0xkwk+vk.As a result, the process and measurement noise of the system after state expansion are both white noise with zero mean, so that the conditions of the extended Kalman filter are satisfied and the reconstruction of the noise is feasible.The improved EKF algorithm presented in this paper is implemented by using the motor parametersψf calculated by the EKF to train feedback neural network off-line, and trained feedback neural network is used to compensate the estimation error in EKF algorithm. There are two steps to improve EKF algorithm by using feedback neural network, that is, feedback neural network training by EKF output parameters and joint estimation by feedback neural network and EKF.


## 6. Simulation and Implementation

The identification of the stator resistanceRs and the rotor magnetic linkage ψf of the PMSM were implemented using MATLAB.
(1)
A simulation model of the dual closed-loop PMSM vector control system based on SVPWM is built in SIMILINK, and the model is shown in Figure2Figure 2
Dual closed-loop control model for PMSM AC servo system.The rated parameters of this model motor are rated speedωN at 366.5 rad/s; rated torque TN at 5 N-m; Rs at 0.28 Ω;ψf at 0.1278.
(2)
Import theid, iq, ud, uq data sets from the motor model output into a .mat file. Write MATLAB functions to call these data for the EKF algorithm to estimate the system state quantities and thus provide training samples for the Elman neural networkIn order to ensure the representativeness of the training data, the given speed of the motor and the load perturbation were changed during the simulation, and the given speed is shown in Figure3.Figure 3
PMSM rotor speed.After the EKF algorithm, the identification values of the state variables are shown in Figure4; the mean value of ψf is about 0.121 Wb, the standard deviation is 0.021, has a small amount variation and identification error; Rs falls from 0.257 to 0.246 a little around 0.025 s.Figure 4
Identification of the stator resistance and rotor flux linage.Figure5 shows the error between the estimated and actual values of iq with a load fluctuation, which is very small, at a maximum of 0.1%. The improved Kalman filter has very good convergence speed and accuracy, and the computational error is small enough to be used as a training sample for the Elman network.
(3)
Design of Elman neural network. The network was designed withid, iq as input, the error between estimation value and actual value of ψf, and Rs as output, and 15 neurons in the feedback network layer. The Elman network was trained for 200 time units with a target mean squared error of 0.000 5 and simulated using the sim(-) functionFigure 5
Error ofiq.Figure6 shows the identification results of improved extended Kalman filter (compensated by Elman neural network output), from which it can be seen that the proposed method has a higher identification accuracy and a smaller identification standard deviation than traditional EKF output shown in Figure 4.
(4)
To verify the generalization capability of the neural network. In the simulation model, the reference speed is set at 350 rad/s and the load is set 5 N-m at 0.01 s. In this case,id, iq are taken as the input to identify the difference between estimation value and actual value of ψf and Rs. As can be seen from Figure 7, the output only has small fluctuations around 0.01 s. The network can identify the two errors well and has good generalization abilityFigure 6
Identification results of improved extended Kalman filter.Figure 7
Neural network output values.


## 7. Conclusions

(1)
In the control system of permanent magnet synchronous motor, it often needs motor parameter identification to achieve better control performance. In order to improve the rotor flux identification accuracy and reduce the identification error induced by stator resistance changes, we propose an improved EKF algorithm to synchronously identify the rotor flux linkage and stator resistance of PMSM(2)
The research results show that the proposed improved EKF algorithm has high recognition accuracy and good generalization capability(3)
In practical systems, the accuracy of the system model and the correlation of noise cause the accumulation and transmission of errors in the calculation process, and the noise correlation is also considered in this paper



---

*Source: 9477659-2022-05-19.xml*