Position sensorless extended and unscented Kalman filters with permanent magnet flux linkage and load torque estimation for surface-mounted PMSM

In this paper, novel position sensorless state estimators with improved robustness to permanent magnet (PM) flux linkage variations in permanent magnet synchronous machines (PMSMs) are presented. Unlike state estimators using conventional infinite inertia or electromechanical models, the estimators presented here can also estimate the PM flux linkage, so they are not sensitive to its uncertainty. For each models used for state estimation, a detailed observability study is presented. Due to the nonlinear models, extended and unscented Kalman filter algorithms are used for the implementation. To compare the sensitivity of conventional and proposed state estimators to uncertainty in electrical parameters, numerical simulations are carried out. In addition, the computational burden of the estimators is compared by real-time execution.


Introduction
Estimators and observers are widely used in controlled permanent magnet synchronous machine (PMSM) drives to determine the required quantities without direct measurement.One such application is the online parameter estimation, since the control performance depends on the accurate knowledge of the machine parameters.However, these parameters can change during the operation.For example, permanent magnet (PM) flux linkage decreases and the stator winding resistance increases at high temperatures, as well as the inductances vary due to the magnetic saturation in PMSMs.To compensate the effect of parameter mismatches, online parameter estimations are often used.The most important methods are reviewed in [1].Besides parameter uncertainties, load disturbances have also significant impact on performance.To improve dynamics and reduce the impact of load variations, extended state observer-based disturbance rejection techniques are used in [2,3].These works compensate the output of the speed controller by the estimated value of load torque.As a result, the effect of load disturbance is much less on speed control performance.
Model-based estimators are also often used to improve the robustness of the drive system against sensor faults.In [4], a sliding mode observer (SMO) is used to estimate the position and speed of the rotor from the measured terminal voltages and currents.By comparing the estimated values with their measured counterparts, the fault of the position sensor can be detected.In case of a faulty sensor, the fault tolerant PMSM drive uses the estimated position and speed instead of the sensor output.Although the velocity and position sensors can be fully replaced by estimators.These position sensorless methods can be useful, e.g. if the size of the sensor makes it difficult to install the drive or if a low-maintenance and high-reliability system is recommended due to the harsh operating environment.One such tidal power application is shown in [5].Further advantages of position sensorless drives are the increased noise immunity and the reduced cost, as described in [6].The model-based position sensorless estimators can be implemented in open-loop or in closed-loop structures.The open-loop estimators are simpler and require less computational efforts, but these methods have worse dynamic performance and are highly sensitive to measurement errors and parameter uncertainties.In contrary, the Luenbergertype observers in [7,8], the SMOs in [9,10], as well as the nonlinear Kalman filters in [11,12] have closedloop structure, which reduces the effect of model inaccuracies.In addition, Kalman filter-type estimators use noise models to take into account the stochastic behaviour of the process and the measurement.However, this feature increases the computational complexity and makes tuning more difficult.It is important to point out that the accuracy of the model-based position sensorless estimators deteriorates at low speeds, where performance can be improved by signal injection-based methods as in [13].However, signal injection causes unwanted torque ripples, increased losses and acoustic noises as mentioned in [14].Signal injection is therefore recommended only at start-up and at low speed, but at medium and high speeds it is worth switching to a model-based estimation method.
In terms of modelling mechanical behaviour, there are two main groups of models used to design position sensorless state estimators.The first is the so-called infinite inertia model, which uses only the electrical equations and considers the rotor velocity as a slowly varying quantity.This approximation can often be applied, because the electrical time constants in PMSM drives are usually much smaller than the mechanical ones.An important advantage of the infinite inertia hypothesis is that the modelling does not require the identification of mechanical parameters, as these are not used.Applying this modelling approach to the surface-mounted PMSM, stochastic state estimators are developed using extended Kalman filter (EKF) in [11] and unscented Kalman filter (UKF) in [12].A detailed observability analysis of the infinite inertia model can be found in [15].The second type of models used for position sensorless state estimation includes the equation of motion.This model is usually called electromechanical or full model.Since the load torque is included in the equation of motion, it can be defined as an additional state variable.As a result, the load torque can be estimated and used to improve the speed control performance as shown in [16].An observability study of the electromechanical model is presented in [17], with particular attention to observability conditions at zero speed.
The main drawback of position sensorless modelbased estimators is their sensitivity to parameter uncertainties.In other words, the performance of the estimator is reduced if the machine parameters implemented in the estimator differ from the actual values.To reduce sensitivity, position and speed estimation can be combined with parameter estimation.In [18], an extended electromotive force model-based estimator is used, which is quite sensitive to the stator resistance variation, particularly at low speeds.To improve performance, the estimator is combined with an online resistance identifier using the recursive least squares method.In [19], an adaptive SMO is proposed in which the resistance value can be adjusted adaptively to achieve lower sensitivity.The combination of position and parameter estimators results in a complex structure.In contrast, Kalman filters can be easily extended for parameter estimation by defining the parameter to be estimated as an additional state variable.In [20], an augmented electromechanical model-based nonlinear Kalman filter is proposed, which is extended for stator resistance estimation.Using resistance estimation for adaptive control and estimated load torque for disturbance rejection, improved speed control performance can be achieved.But the negative effects are not only due to the inaccuracy of the resistance.As shown in [21], the effect of a decrease in magnetism is more dominant than the effect of resistance variation in model predictive control.In [22], the PM flux linkage is identified online by an EKF using the velocity from the model reference adaptive estimator.In contrast, a joint EKF is used to estimate the PM flux linkage, load torque, velocity and position in [23].The EKFbased model predictive speed control of PMSM is thus robust to PM flux linkage and load torque variations.In summary, the performance of position and velocity estimators can be improved by parameter estimation.In such cases, it is important that observable models are used for estimation, as only then can the state vector be fully reconstructed from the measurements.However, a shortcoming of [18-20, 22, 23] is that the observability of the models used for estimation is not analyzed.
In this paper, position sensorless state estimators for surface-mounted PMSM are presented and compared.Different estimators use different state-space models.In this way, it is possible to estimate not only the position and velocity but also the load torque and the PM flux linkage.The four different models used are the wellknown infinite inertia and electromechanical models, as well as augmented versions of these models.In augmented models, the PM flux linkage is an additional state variable.Using these augmented models reduces the sensitivity of the estimators to PM flux linkage variations.The main contributions of this study are as follows: • Novel position sensorless state estimators are presented, which are robust to PM flux linkage and load variations.• A detailed observability study is presented for different state-space representations used in different estimators.
• Numerical simulations are performed to compare the parameter sensitivities.• Extended and unscented Kalman filters are compared and it is shown that their performance is nearly identical for surface-mounted PMSM.The estimation performance depends mainly on the model used.
The author discloses that this study extends the results of former conference paper [24].For completeness, a fourth model is presented for estimation.The observability study is thus extended.Furthermore, the estimation performances using EKF and UKF are also compared, and the sensitivities to all electrical parameters are investigated.In addition, the computational burden of the estimators is compared by real-time execution.

Observability analysis of PMSM models used to design estimators
In this section, four different state-space models of surface-mounted PMSMs are presented.These models are used for position sensorless state estimation, so it is important to ensure that the models are observable, because only then can the state vector be fully reconstructed from the measurement.Therefore, detailed observability studies are also presented for these models.
To describe the electromagnetic behaviour of a PMSM, different coordinate systems can be used.Obvious choices could be the reference frame of the stator or the rotor.The later is often used for vector control, because the stator current vector can be divided into flux and torque producing components.However, stationary reference frame is more popular for estimator design, because the derivative of the stator currents are linearly related to both currents and excitation voltages, as mentioned in [11].It is also important that the inductance is independent of the rotor direction in case of the surface-mounted PMSM, unlike salientpole machines.Therefore, the use of the rotor reference frame is not justified.In addition, observability can be easily ensured if all the electrical variables are specified in stationary reference frame.
The voltage equations of surface-mounted PMSM in stationary two-axis reference frame are and where u α , u β and i α , i β are the stator voltage and current components, as well as, ϕ e and ω e denote the electrical position and velocity of the rotor, respectively.In (1) and (2), R is the stator resistance, L is stator inductance and λ is the PM flux linkage.By using the stator current components given in the stationary reference frame, the electromagnetic torque of a three-phase surface-mounted PMSM can be determined as where p is the number of pole pairs.To describe the dynamics of the rotor, the equation of motion is used as where D, T L and J are the viscous friction coefficient, the load torque, as well as the total inertia of the rotor and the load, respectively.In ( 1)-( 3), trigonometric functions and multiplications of variables result in nonlinear terms, which are also included in the state-space models used to design estimators.Therefore, the locally weak observability is used to analyze the nonlinear state-space representations, as in [15,24].A brief description of this approach is given below.
The state-space model of a nonlinear system in continuous time can be written as where f (x, u) and h(x, u) are given nonlinear functions of x state and u input vectors, as well as y denotes the output vector.For the model ( 5) and ( 6), the observability matrix is where L k f h denotes kth order Lie derivative of function h with respect to the vector field f , and n is the dimension of the state-space.The model ( 5) and ( 6) is locally weakly observable at x 0 , if the rank condition is fulfilled.

Infinite inertia model
The simplest state-space model used to design position sensorless state estimator is based only on voltage equations ( 1) and ( 2) and assumes the infinite inertia hypothesis.Accordingly, the electrical variables change much faster than the angular velocity.Therefore, dω e dt = 0 can be written in the state equation.Since ω e is the first order derivative of ϕ e , and by choosing stator currents, angular velocity and position as state variables, the state equation of infinite inertia model is The inputs of this model are u α , u β voltages, and the outputs are i α , i β stator currents for position sensorless application.
The observability matrix of the infinite inertia model can be written as Since the function h expresses two output variables, each element of the matrix O is actually a two element vector.Therefore, the total number of rows in matrix O is 8.If this matrix O has full rank, then the infinite inertia model is locally weakly observable.To satisfy the rank condition rank{O} = 4, there must be at least one regular matrix that can be constructed from 4 different rows of O.In this way, 70 different 4 × 4 matrices can be created from the 8 rows.Among these matrices, an important result is obtained from the analysis of matrix If det{O 1−4 } = 0, then O 1−4 is regular and matrix O has full rank, so the model ( 9) is locally weakly observable.Since λ and L are positive constants in the infinite inertia model, condition ω e = 0 ensures the locally weak observability.This well-known condition is the same as in [15].It is also important to note that the rank of O decreases in stationary position: Therefore, ω e = 0 is a necessary and sufficient condition for locally weak observability.

Infinite inertia model augmented by PM flux linkage
In state estimators, such as Kalman filters, the state variables of the applied model are estimated.So, these types of estimators can be easily extended to joint parameter estimation by choosing the parameter to be estimated as a state variable.In this way, the conventional infinite inertia model can be augmented for PM flux linkage estimation as in which a slowly varying PM flux linkage is assumed.
Since the state vector is augmented by λ, the observability matrix is As in (10), each element is actually a two element vector in (14), so the total number of rows in the observability matrix is 10.Based on (14), 252 different 5 × 5 matrices can be created to determine observability conditions.Among these, the matrices O 1−5 and O 1−4,6 lead to an important observability condition.In terms O 1−5 and O 1−4,6 , the subscripts indicate which rows of O are included in the matrix.The determinants of these matrices are and The infinite inertia model augmented by PM flux linkage is locally weakly observable if det{O 1−5 } = 0 or det{O 1−4,6 } = 0. Since sin(ϕ e ) and cos(ϕ e ) cannot be zero at the same time, and L is a constant parameter, the observability condition is It is important to highlight that the rank condition is not satisfied if the PM flux linkage or the rotor velocity is zero: Therefore, ( 17) is a necessary and sufficient observability condition.It should be noted that a fully demagnetized surface-mounted PMSM is not able to operate as it cannot produce torque.Thus the locally weak observability is ensured for a healthy machine if the rotor velocity is not zero.

Electromechanical model
Unlike the infinite inertia model, the electromechanical model includes the equation of motion.Using ( 1)-( 4), the electromechanical model can be written as where T L is defined as an additional state variable.Since load is usually unknown disturbance, the dynamics of T L are neglected in this model.The observability matrix of the electromechanical model is Among the 252 possible 5 × 5 matrices, which can be written based on (20), O 1−5 and O 1−4,6 are analyzed first.The determinants of these matrices are and Since sin(ϕ e ) and cos(ϕ e ) cannot be zero at the same time and JL 3 is a constant coefficient, the locally weak observability of the electromechanical model is ensured if ω e = 0.However, it is important to point out that the rank condition for the observability matrix can also be satisfied at zero angular velocity.Therefore, condition ω e = 0 is sufficient but not necessary in the case of the electromechanical model.To complete the observability condition, the matrices O 1,3−6 and O 2−6 should be analyzed.The determinants of these matrices are det{O As shown in ( 23) and ( 24), the rank condition is satisfied at zero speed if dω e dt = 0.In summary, the electromechanical model is locally weakly observable if ω e is not zero, or if ω e varies in the stationary position.The latter part of the condition is particularly important during speed reversal.

Electromechanical model augmented by PM flux linkage
For PM flux linkage estimation, the electromechanical model may be augmented as where λ is a state variable and not a constant parameter.Although it is assumed that λ is a slowly varying quantity.
The observability matrix of the above model is Based on (26), 924 different 6 × 6 matrices can be created.One of these matrices is O 1−6 , which leads to an important observability condition.The determinant of and ω e = 0, or if condition ( 30) is fulfilled at zero speed.

The applied nonlinear Kalman filter algorithms
For the design of estimators, different state-space models are presented in the previous section.In these models, the trigonometric functions and the multiplications of state variables result in nonlinear expressions.For nonlinear systems, the most commonly used stochastic estimators are the linearization-based EKF and the derivative-free UKF, which are discussed in detail in [25].Although the principles of these two methods are different, their performance in practice is often the same as shown in [26].However, the EKF is preferred for speed sensorless induction machine drives in [26] due to its lower computation time.Nevertheless, both EKF and UKF algorithms can be attractive solutions for surface-mounted PMSMs, so both approaches are applied and compared in this study.State-transition equations ( 9), ( 13), ( 19) and ( 25) are given in continuous-time.But digital processors can execute discrete-time algorithms, so the PMSM models must be discretized.In this work, the simple Euler method is used for the discrete-time approximation of the state-transition equations as where T s is the sampling time, as well as x k and u k are the state and input vectors at time k.
Although the applied state-transition equations are nonlinear, the measurement models are linear in this work, because the measured stator currents and the electrical state variables are also given in stationary reference frame.Thus, the discrete time state-space models used for position sensorless state estimation can be written as where y k is the output vector and H is the output matrix.Due to the linear measurement equation, simplified EKF and UKF algorithm can be used similarly to [27].As a result, the estimators have lower computational time.In (32) and (33), w k and v k are additive independent Gaussian noises for which stochastic hypotheses

EKF algorithm
In Kalman filtering, prediction and correction steps follow each other iteratively.These steps are so-called time update and measurement update, respectively.The EKF algorithm predicts the mean and the estimation error covariance matrix for the next time step as where x + k and P + k are the corrected values of the state vector and the error covariance matrix, as well as, F k is the Jacobian of the discrete-time nonlinear function in (32).Jacobian matrix F k is calculated as After time update, the predicted values are corrected based on the latest measurement results.Since the measurement model is linear, the equations of the linear Kalman filter can be used in the correction step as follows: x where I is the identity matrix and the Kalman gain is It is important to emphasize that the application of the linear measurement model simplifies the EKF algorithm and reduces the execution time.

UKF algorithm
In contrast to the EKF, the linear approximation of the nonlinear model is avoided in UKF.Instead, it uses the unscented transformation (UT) to predict the mean and the error covariance of the states.The general UT selects deterministically 2n + 1 sampling or so-called sigma points as follows: where n is the number of state variables and κ is a design parameter.In (40), is the ith row of matrix (n + κ)P + k , where the radical symbol denotes Cholesky factorization.For the prediction of the state vector and the error covariance matrix, the sigma points are calculated for the next time step as and x − k+1 , P − k+1 can be determined by weighting as where the weights are Due to the linear measurement model, (37)-(39) are used in the correction step as in the case of the EKF.

Comparison of estimators by numerical simulations
The focus of this research is to reduce the PM flux linkage sensitivity of position sensorless state estimation.To investigate the parameter sensitivity of the presented EKF and UKF estimators using different models, numerical simulations are carried out.The aim is to determine the impact of electrical parameter uncertainty on the accuracy of estimators.In addition, computational times are compared by real-time execution.The modelled surface-mounted PMSM has 2.8 Nm nominal torque and 1676 rad/s nominal electrical speed.Further parameters of the PMSM model are p = 4, R = 1.9 , L = 3 mH, λ = 0.1 Vs, D = 0.005 Nm s/rad and J = 0.00018 kg m 2 .To implement the Kalman filters, the noise parameters and some initial values must be defined.These are selected by trialand-error method in this work.The Q process noise covariance matrices are • diag{0.1,0.1, 100, 10 −7 } for the estimators using infinite inertia model, • diag{0.1,0.1, 100, 10 −7 , 10 −7 } for the estimators using infinite inertia model augmented by PM flux linkage, • diag{0.1,0.1, 100, 10 −7 , 0.1} for the estimators using electromechanical model, • diag{0.1,0.1, 100, 10 −7 , 0.1, 10 −7 } for the estimators using electromechanical model augmented by PM flux linkage.
The measurement noise covariance matrix is R = diag{10 −3 , 10 −3 } and the initial value of the error covariance matrix is P + 0 = 10 −4 I for all estimators.The initial states for state variables i α , i β , ω e , ϕ e , T L are zero and the nominal 0.1 Vs is used for λ.In the case of UKF estimators, the design parameter κ is set to 1.
In the first simulation, the nominal parameters of the PMSM are used and the rotor is accelerated to 500 rad/s.During acceleration, load disturbance is zero, but the external load torque steps to 1 Nm at 0.05 s.The results of the first simulation are shown in Figure 1.If there is no parameter uncertainty, then all EKF and UKF estimators work accurately.There are only minor differences in performance.The estimation of the speed during the start-up transient is less accurate if the infinite inertia hypothesis is assumed in the model used.It can also be seen that there is a small transient error at the beginning of the simulation for the estimated PM flux linkage and the estimated load torque.But these are not significant.When the load steps, the estimated load torques follow the actual value relatively slowly.Although the estimation error is less than 1% within 0.01 s.The slowness is due to the assumption of a slowly varying load torque in the electromechanical models, since the load disturbance is usually unknown.However, each estimator remains operational even if the load changes rapidly.It is also important to point out that the accuracy of the estimation depends mainly on the model used, but the effect of the estimation algorithm is not significant.In other words, the performance of EKF and UKF estimators using the same model is almost identical.For better comparison, the root-mean-square error (RMSE) values of the estimated variables are also calculated for all estimators.These are given in Table 1.It can be seen that the speed estimation error is smaller when using electromechanical models because these models describe the speed variation more accurately.However, the speed estimation is accurate for all estimators at constant speed.
In the second simulation, the PM flux linkage sensitivity of the estimators is investigated.Therefore, the parameter λ is reduced by 20% in the PMSM simulation model.Thus, λ parameter is inaccurate in estimators using conventional infinite inertia or electromechanical models, and the initial value of λ is incorrect in estimators using augmented models.The results are shown  in Figure 2 and Table 2. Conventional estimators without λ estimation show increased position estimation error and very significant velocity estimation error.In addition, load estimation is very poor for estimators using the conventional electromechanical model.On the other hand, EKF and UKF with PM flux linkage estimation are almost insensitive to the λ uncertainty.Since the estimated value of λ converges relatively quickly to the actual value, all variables are accurately estimated when using the augmented models.
The estimators with λ estimation show much better performance than the conventional estimators in case of PM flux linkage mismatch.However, the estimation error can also be caused by variations in other parameters.To analyze the impact of stator inductance and resistance uncertainty, two additional simulations are performed.First, parameter L is reduced by 20% and the results are shown in Figure 3 and Table 3.It can be seen that 20% difference in L has very little effect on the performance of the estimators.In contrast, the accuracy of speed and load estimation decreases if R differs by 20%, as shown in Figure 4 and Table 4.However, the error of estimators using augmented models is smaller than that of conventional estimators.In addition to electrical parameters, electromechanical models also include mechanical parameters D and J.However, these parameters are not used in infinite inertia models.Therefore, the effect of variations in mechanical parameters is not investigated in this study.
In summary, conventional EKF and UKF estimators work properly if the parameters of the PMSM are known accurately.Although the error in speed estimation is smaller during acceleration if the model used includes the equation of motion.However, all conventional estimators are highly sensitive to the uncertainty in the PM flux linkage.In contrast, estimators using augmented models are almost insensitive to PM flux linkage variation.The estimation accuracy depends mainly on the model used, but the Kalman filter algorithm used has practically no effect.The performance using the different models is summarized in Table 5.It is important to highlight that the observability conditions of the models used in the estimators were fulfilled in the simulations, when the rotor speed was not zero.Since the observability conditions are fulfilled, the models are locally weakly observable and the state vectors can be fully reconstructed from the measurements.If a model is unobservable, then the state-space model has several different solutions, so not all estimated state variables follow the actual values when they change.For this reason, it is important to analyze and ensure observability.
According to the simulation results, there is no difference between the performance of the EKF and UKF estimators when using the same model.However, it is well known that the UKF has higher computational burden than the EKF, since the application of the UT requires multiple evaluations of the nonlinear function.To compare the computational burdens, a target computer with Intel Core i5-2500 @ 3.3 GHz processor is used with the software tools provided by MATLAB R2018b Simulink Real-Time toolbox.Using Embedded Coder, target codes are generated for each estimator implemented in MATLAB/Simulink.Then the target codes are executed one by one in real-time on the target computer, while measuring the average task execution time using software tool Task Execution Time Monitor.For real-time execution of estimators, the sampling time is set to 100 μs.The average task execution times for each estimator are shown in Table 6.In case of the infinite inertia model with 4 state variables, the computational time of the UKF is approximately 14% higher than that of the EKF.If the model used for estimation has 5 state variables, the difference is 18%, and for 6 state variables it is about 19%.Since EKF and UKF provide the same accuracy, but UKF requires slightly more computational effort, the use of EKF estimators are recommended for PMSM drives.

Conclusions
In this study, novel position sensorless EKF and UKF state estimators have been presented for surfacemounted PMSM.The proposed estimators use augmented models in which the PM flux linkage is a state variable, so they can also estimate the PM flux linkage.For the models used for state estimation, a detailed observability study has been presented.To compare the estimation performances, numerical simulations have been carried out.The results showed that the proposed estimators are almost insensitive to the uncertainty in the PM flux linkage, unlike the conventional estimators using infinite inertia or electromechanical models.Since there is no difference between the performance of the EKF and UKF when using the same model, and the EKF has less computation time, EKF estimators are recommended for position sensorless PMSM drives.

Figure 1 .
Figure 1.Performance of the position sensorless state estimators using nominal parameters.(a) EKF estimators and (b) UKF estimators.

Figure 2 .
Figure 2. Performance of the position sensorless state estimators in the case of 20% detuned λ.(a) EKF estimators and (b) UKF estimators.

Figure 3 .
Figure 3. Performance of the position sensorless state estimators in the case of 20% detuned L. (a) EKF estimators, (b) UKF estimators.

Figure 4 .
Figure 4. Performance of the position sensorless state estimators in the case of 20% detuned R. (a) EKF estimators, (b) UKF estimators.
= 0 is a necessary observability condition for this model, because the rank of O decreases if λ = 0: ) Since p JL 4 is a constant coefficient, the electromechanical model augmented by PM flux linkage is locally weakly observable, if λ = 0 and ω e = 0.It is important to point out that λ

Table 1 .
Comparison of RMSE values for simulation using nominal parameters.

Table 3 .
Comparison of RMSE values for simulation using 20% detuned L.

Table 4 .
Comparison of RMSE values for simulation using 20% detuned R.

Table 5 .
Comparison of estimation performances using different state-space models.