Real-Time Speed Estimation for an Induction Motor: An Automated Tuning of an Extended Kalman Filter Using Voltage–Current Sensors

This paper aims at achieving real-time optimal speed estimation for an induction motor using the Extended Kalman filter (EKF). Speed estimation is essential for fault diagnosis in Motor Current Signature Analysis (MCSA). The estimation accuracy is obtained by exploring the noise covariance matrices estimation of the EKF algorithm. The noise covariance matrices are determined using a modified subspace model identification approach. In order to reach this goal, this method compares an estimated model of a deterministic system, derived from available input–output datasets (using voltage–current sensors), with the discrete-time state-space representation used in the Kalman filter equations. This comparison leads to the determination of model uncertainties, which are subsequently represented as noise covariance matrices. Based on the fifth-order nonlinear model of the induction motor, the rotor speed is estimated with the optimized EKF algorithm, and the algorithm is tested experimentally.


Introduction
The induction motor (IM) is by far the most widely used motor in industry [1], as this motor is found in furnaces, conveyors, pumps, and other industrial equipment.Monitoring and controlling induction motor speed is essential because changes or abnormalities in motor speed can indicate potential faults or malfunctions.Furthermore, speed estimation is crucial for fault diagnosis of the IM.Unfortunately, it can be challenging or extremely expensive to use sensors for the speed measurement of IM.In fact, some industrial environments may have unsuitable conditions for sensor implementation such as high temperatures, vibrations, or corrosive substances.To overcome these challenges, alternative methods can be employed for the real-time speed estimation of IM.One commonly used technique consists in estimating the speed from the motor electrical variables only using voltage-current sensors.This is typically achieved using algorithms or observers such as Sliding Mode Observers [2], Model Reference Adaptive Systems [3], or the Extended Kalman Filter [4][5][6][7][8][9].Among all these methods, the EKF method has attracted significant attention due to its good estimation accuracy in the presence of noise.In the literature, there are different studies in which EKF based state/parameter estimation is executed.Those studies can be divided into two groups.The first group is where EKF is applied, and it is considered that no mechanical information is available [4][5][6].The second group of solutions makes use of the rotational speed through the equations of motion [7][8][9].The latter requires knowledge of the mechanical parameters such as load torque, inertia varying with the load coupled to the shaft, and viscous friction.In this paper, we focus on the first group of studies assuming the lack of information about the mechanical parameters.
One key feature of the Kalman filter is the requirement to process and measure the noise covariance matrices.These matrices represent the noise levels in the system and have a direct impact on filter performance.In fact, incorrect or badly adjusted values of Q and R can lead to inaccurate estimation of the system state and filter instability.Furthermore, the parameters of the noise covariance matrices Q and R are usually determined by trialand-error procedures, which may not give accurate results.As the distribution of noise is usually unknown, it is not possible to deduce a generic relationship between the values of the matrix elements and the EKF performance to yield the best speed estimation results.The determination of noise covariance matrices is still an open issue in practice.A significant part of the literature dedicated to Kalman filter tuning is devoted to the development of techniques and algorithms for the determination of these covariance matrices.However, there are a limited number of studies using covariance matrices estimation for the real-time speed estimation of IM.In fact, researchers focus on investigating the optimization of noise covariance matrices for induction motor speed estimation.This investigation can be categorized into two main parts: the first group of studies [10,11] uses artificial intelligence-based methods, which requires expert knowledge and involves a complex design procedure, whereas the second group [12][13][14][15][16][17][18][19] employs adaptive structures to eliminate the adverse effect under operating condition variations.
The main contribution of this study is to design a fifth-order IM model, where the IM speed is included in the model as a state without the help of the equation of motion, and the noise covariance matrices are estimated.Among all of the Kalman filter tuning techniques available in the literature, specific attention is paid herein to the noise covariance matrices' estimation with the modified subspace model identification method [20].The method consists in translating the discrepancy between the identified model (determined from the available input-output datasets) and the discrete-time state-space representation involved in the Kalman filter equations into noise covariance matrices estimates.The model identification method used in [20] was derived from the subspace model identification methods [21][22][23][24] and adapted to estimate a discrete linear time invariant state space model.The main motivation for selecting this class of methods is the strong and inherent link between the subspace identification methods and Kalman filtering [25].
In this paper, a noise covariance matrices estimation with a modified subspace model identification method is employed in order to achieve the best EKF performance in real-time speed estimation.In order to reach this goal, the paper is organized as follows: Section 2 presents the dynamic model of the induction motor and the extended dynamic model of the IM to be used in the EKF.Section 3 details the design of the EKF to estimate the motor speed.Section 4 presents the noise covariance matrices estimation procedure by using a modified subspace model identification method.Section 5 is devoted to the application of the modified subspace model identification method to rotor speed estimation.Section 6 compares the experimental performance of the trial-and-error-process method and the modified subspace model identification method used to determine the noise covariance matrices of the EKF in the case of rotor speed estimation.Finally, Section 7 gives the conclusions.

Dynamic Model of Induction Motor
In order to estimate the real-time motor speed using EKF, the mathematical model of the three-phase induction motor is developed.Because three-phase systems involve complex quantities and calculations, the analysis of the three-phase induction motor is simplified using the Clarke transformation.In this way, the three-phase quantities (a, b, c) are transformed into two-phase quantities (α, β), which are aligned with the stator (stationary reference frame) [26].
Figure 1 shows the equivalent circuit of the IM in the stationary reference frame [27].In this equivalent circuit, R s and L 1s are the stator resistance and inductance, respectively; R r and L 1r are the rotor resistance and inductance referring to the stator side, respectively; L m is the mutual inductance; ω r is the rotor speed; v sα , v sβ are the measured stator voltages, and i sα , i sβ are the stator currents in the stationary reference frame; v rα , v rβ are the rotor voltages, and i rα , i rβ are the rotor currents in the stationary reference frame; λ sα (t), λ sβ (t) are the stator flux, and and λ rα (t), λ rβ (t) are the rotor flux in the stationary reference frame.
Figure 1 shows the electrical and magnetic energy exchanges present in the induction motor, which allow us to derive the mathematical equations.
First, let us introduce a state-space representation of IM dynamics, assuming that the IM speed is a known parameter where x(t) stands for the state vector, y(t) is the output vector, and u(t) is the input vector, with where p is the number of poles, τ r = L r /R r is the rotor time constant, As mentioned above, the rotor speed ω r in Equations (1a) and (1b) is considered as a known parameter.If the speed measurement is not available, the rotor speed has to be estimated.To this end, an extended induction motor model including the rotor speed as state variable is developed [4,5].The rotor speed is then considered both as a state and a parameter, leading to a nonlinear IM model defined as ẋe (t) = f e (x e (t), u(t)), (8a) where f e is the nonlinear function of the states and inputs defined as f e (x e (t), u(t)) = A e x e (t) + B e u(t), with and Because this extended IM model is nonlinear, the EKF algorithm is used in order to estimate the rotor speed.

EKF Algorithm for Rotor Speed Estimation
To estimate the rotor speed in real time with the EKF, the continuous-time state equations developed previously in (8a) and (8b) are discretized with a sampling period T s , using the Euler approximation method [28] as follows. with In order to take into account the uncertainties and discrepancies between the mathematical model and the real system being observed, the process noise w k and measurement noise v k are introduced into the state-space representation as The covariance matrices of the process noise w k and measurement noise v k can be defined as where δ ij is the Kronecker delta function.
Using conventional equations of the EKF algorithm [29], the induction motor speed is estimated as follows where the notations − and + stand for before and after the new measurements, P k is the error covariance matrix, K k is the Kalman filter gain, ŷk is the estimated output, and J k is the Jacobian matrix used in the EKF to handle nonlinearities, defined as with

Noise Covariance Matrices Estimation with a Modified Subspace Model Identification Approach
As mentioned earlier, using the Kalman filter requires defining the process and measurements covariance matrices.These matrices are essential for quantifying the noise levels and model uncertainties.Gererally, the parameters of the noise covariance matrices Q and R are determined by a trial-and-error-process that can be challenging.In fact, improper or poorly calibrated values of Q and R can lead to inaccurate estimations of the system states.
In order to relieve this inconvenience, the noise covariance matrices can be estimated.Among all of the tuning techniques available in the literature, specific attention is paid herein to the noise covariance matrices estimation with a modified subspace model identification approach [20].
The solution proposed in this approach consists of 1.
Identifying state-space matrices A d , B d , C d , and D d and state sequence X f ,N with f , N ∈ N + * from the available input-output data using the subspace model identification method.The identified state sequence X f ,N can be defined as Comparing the identified state-space model with the deterministic part of the model used in the Kalman filter.To this end, both models have to have the same basis.Therefore, we enact a basis change using the transformation matrix T, which can be computed as where Γ f (F, H) is the observability matrix of the model used in the Kalman filter defined as and Γ f (A d , C d ) is the observability matrix of the identified model using the subspace model identification method defined as Once T is estimated with a Moore Penrose pseudo inverse, the state sequence X f ,N can be moved into the "good" state basis as follows 3.
Computing the residuals as where X with f , N ∈ N + * represents the state sequence estimate in the "good" state basis performed with the subspace model identification method, and Q f ,1,N−1 and R f ,1,N−1 are residuals used to estimate the covariance matrices Q and R.

4.
Transforming these discrepancy measurements into covariance matrix estimates.This part will be detailed next.

Subspace Model Identification
According to [30], consider the minimal system with e k as a white-noise sequence that is uncorrelated with u k .By taking the instrumental-variable matrix Z N equal to where U 0,l,N and Y 0,l,N with l, N ∈ N + * are the block Hankel matrices constructed from the input-output data, and by considering the following least-squares problem which is solved by a QR factorization it can be shown [30] that Via the following singular value decomposition we obtain an estimate of the observability matrix as follows As mentioned earlier, the state sequence X f ,N has to be in the "good" state basis corresponding to the state-space realization used in the Kalman filter (F, G, H).Thus, we enact a basis change using Equation (24).
Knowing the estimated state sequence X f ,N , we can quantify the discrepancy between this prior information and the model used in the Kalman filter using Equation (28).

Noise Covariance Matrices Estimation
We can now determine accurate estimates of the covariance matrices Q and R using the residuals computed in Equation ( 28), as follows [21].

Induction Motor Speed Estimation with Noise Covariance Matrices Estimation
As discussed earlier, the speed induction motor estimation using EKF requires a dynamic state space model, as presented in Equations (8a) and (8b).This dynamic model, which includes the rotor speed as the state space, is non-observable.Alternatively, the noise covariance matrices estimation with the modified subspace model identification approach presented previously requires an observable model.
As a solution, we propose to identify only the dynamic model, which does not include the rotor speed as the state variable, as described by Equations (1a) and (1b).This fourthorder model leads to the determination of the covariance matrices Q 1 and R 1 of the system noise and measurement noise, respectively.
In order to determine the covariance matrices of the dynamic model, which is able to estimate the rotor speed, the measurement noise covariance matrix R is the same as the fourth-order model beacause it depends only on the measurements, unlike the system noise covariance matrix, which depends on the estimated states.
Thus, in the new system noise covariance matrix, we only have to adjust the parameter µ as shown below.
q 11 q 12 q 13 q 14 0 q 21 q 22 q 23 q 24 0 q 31 q 32 q 33 q 34 0 q 41 q 42 q 43 q 44 0 0 0 0 0 µ where the parameters q ny with n number of rows and y number of columns are determined with a modified subspace model identification approach.

Results and Discussion
To justify the need for the automated tuning of the EKF, the speed estimation algorithm of the extended Kalman filter tuned by a trial-and-error-process was tested on our test bench, as presented below.

Experimental Setup
The experimental test setup designed to assess the EKF algorithm was composed of a squirrel-cage induction motor, with 4 kW, 220 V, 50 Hz, and two poles.This motor was controlled by an AC drive, coupled to a permanent magnet synchronous generator (PMSG) operating as a generator and producing a resisting torque, thus representing the load (Figure 2).The induction motor parameters were given by the manufacturer as R s = 1.47Ω;R r = 0.78Ω; L 1s = 5.16H; To validate the accurate estimation of the rotor speed using the EKF algorithm, an encoder of 1024 points placed at the end of the machine shaft provided the rotor position at each sampling instant, allowing the measurement of the real-time motor speed.In addition, the system integrated sensors to measure the phase voltages and currents, which represent the inputs and outputs of the motor, respectively.These sensor measurements were crucial for providing the necessary data inputs to the EKF algorithm to iteratively refine and enhance the estimation of the rotor speed.The hardware infrastructure supporting this setup included a DS1104 board as an interface between the physical components of the system and the simulation environment in MATLAB/Simulink2023a.The sampling period was Ts = 10 −3 (s).

Experimental Results
The covariance matrices used in the EKF algorithm, tuned by a trial-and-error method until satisfactory estimation performance was obtained, were with λ = 2 and µ = 20, and the error covariance matrix was initialized as 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 Figures 3 and 4 show the estimated currents is α and is β , respectively, using the trialand-error method, whereas Figure 5 shows the estimated speed of the EKF using the trial-and-error method.
As we can see in the above figure, the estimated speed was very noisy.This can be justified by the µ coefficient, which was very large.
In order to minimize the effect of the noise in the estimated speed, the coefficient µ had to be reduced.However, a smaller value of µ led to the inaccurate estimation of the motor speed.In fact, the process noise covariance matrix Q represents the uncertainty in the system dynamics and reflects the model accuracy in predicting the state evolution of the system.The values of the elements in the process noise covariance matrix determine how much the filter trusts the predicted state versus the measured state.Higher values indicate higher uncertainty in the system, leading to more reliance on the measurements.Furthermore, the error between the estimated and measured speed was more significant in the time interval of 80 ≤ t ≥ 85 s.A second attempt was made to estimate the speed with the same noise covariance matrices used in the first test (Figures 6-8).As shown in Figure 8, the speed estimation using the same covariance matrices was inaccurate in the time interval of 50 ≤ t ≥ 70 s.Therefore, the noise matrices must be modified each time.Consequently, manual tuning of the EKF using trial-and-error-process was proven to be inefficient.It is time-consuming and requires significant effort from an experienced operator.Moreover, it involves the configuration of multiple parameters of the noise covariance matrices.
To overcome this difficulty, the noise covariance matrices were determined using a subspace model identification approach.
Figure 9 gives the block diagram of the experimental setup used to estimate these noise covariance matrices.As shown in the above block diagram, a speed setpoint was provided.Since the model used for estimating the rotor speed is nonlinear, and the subspace model identification method requires a linear time-invariant state-space representation, the nonlinear model was linearized around the known nominal rotor speed.
In addition, system identification requires exciting the inputs and outputs of the system (voltages and currents, respectively).To this end and from the same test bench, a pseudo random binary sequence (PRBS) was applied as the desired speed (Figure 10) and varied around the nominal speed (2920 rpm).Excited voltages and currents were then used to identify a discrete-time linear state space of the system.
The identification efficiency was evaluated by comparing the identified and actual currents (system outputs) as shown in Figures 11 and 12  The best fits obtained by comparing the identified and actual currents were 78.73% for i sα and 79.73% for i sβ .
In fact, mathematical models are often simplified approximations of reality and may not always capture all the details of the system's behavior or take into account the nonlinearities.
The noise covariance matrices were then determined using the modified subspace model identification Using the identified process noise covariance matrix Q and measurement noise covariance matrix R to estimate the rotor speed of the same test bench described before, and by varying the µ coefficient until a satisfactory result was determined, as in the manual tuning method, the resulting estimations are presented in (Figures 13-15).The speed estimation error decreased compared to the trial-and-error process tuning.
We then applied the same noise covariance matrices to the second test (Figures 16-18).As we can see, the identified noise covariance matrices were valid for both tests, unlike the trial-and-error-process method, where the noise covariance matrices had to be set each time.
Furthermore, Figure 19 shows a comparison between the measured speed, the estimated speed using manual tuning, and the estimated speed using the modified subspace identification approach of the first test.As shown, the effect of noise was minimized using automated tuning of the covariance matrices.
Finally, the table below provides a comparison between the mean square error of the estimated speed for both the trial-and-error process method and the automated tuning of the EKF (Table 1).The mean square error between the actual rotor speed and the estimated speed is defined as where n is the number of samples, s is the actual speed, and e is the estimated speed.
It is observed that the estimation significantly improved for both the first and second test.

Performance Evaluations of Covariance Matrices Identification under Varied Speed and Load Conditions
Previously, we proposed identifying the noise matrices using a linearized model around the nominal speed indicated on the nameplate.However, to test the accuracy of this method in measuring the speeds and its limitations, additional experimental trials involving two scenarios were conducted; the first scenario involved varying the speed far from the nominal point, while the second scenario involved varying the load during operation.

First Scenario
We determined the noise covariance matrices by introducing speed variations far from the nominal point.
The rotor speed of both test 1 and 2, presented previously, was then estimated using these noise covariance matrices.
The identification of the noise covariance matrices worked regardless of the excitation protocol used, whether it was near the nominal speed at 2285 rpm or far from it at 1088 rpm, for both tests 1 and 2 (Figures 20-23).However, identifying the covariance matrices around the nominal speed led to better speed estimation.

Second Scenario
The rotor speed of both test 1 and 2 was estimated using the identified noise covariance matrices at the following settings.
Similar to the identification of the covariance matrices using the speed variation far from the nominal speed, identifying covariance matrices using the motor operation at different loads levels yielded poorer results (Figures 24-27).This can be explained by the use of the Kalman filter model based on operation at the nominal point.At full load, the system operates closer to its intended performance, leading to more accurate measurements.
Operating at 40% of the nominal load.

Figure 1 .
Figure 1.Single-phase equivalent circuit in the stationary reference frame.

Figure 6 .Figure 7 .
Figure 6. is α estimation using EKF tuned by a trial and error method-second test.

Figure 8 .
Figure 8. Motor speed estimation using EKF tuned by a trial and error method-second test.

Figure 9 .
Figure 9.The block diagram of the experimental setup for noise covariance matrices estimation.

Figure 10 .
Figure 10.Pseudo random binary sequence exciting the motor voltages and currents used in the subspace model identification. .

Figure 16 .
Figure16. is α estimation with EKF using noise covariance matrices estimation-second test.

Figure 19 .
Figure 19.Estimation speed comparison between manual and automated EKF tuning.

Figure 20 .
Figure 20.IM speed estimation using identified noise covariance matrices, obtained by speed variations around 1088 rpm-first test.

Figure 24 .Figure 25 .
Figure24.Estimation of the speed using the identified noise covariance matrices, acquired during operation at 40% of the load-first test.
Figure17. is β estimation with EKF using noise covariance matrices estimation-second test.IM speed estimation with EKF using noise covariance matrices estimation-second test.

Table 1 .
Mean square error of estimated speed.