Sensor Fault Diagnosis Observer for an Electric Vehicle Modeled as a Takagi-Sugeno System

Tecnológico Nacional de México (TecNM)/Instituto Tecnológico de Tuxtla Gutiérrez, TURIX Dynamics-Diagnosis and Control Group, Carretera Panam, km 1080, Tuxtla Gutiérrez, CHIS, Mexico Tecnológico Nacional de México (TecNM)/Instituto Tecnológico de Hermosillo, TURIX-Hermosillo, Av. Tecnológico y Periférico Poniente S/N, 83170 Hermosillo, SON, Mexico HSPdigital-CA Mecatrónica, Facultad de Ingeniería Campus San Juan del Río, Universidad Autónoma de Querétaro, Río Moctezuma 249, San Cayetano, 76807 San Juan del Río, QRO, Mexico


Introduction
In recent years, there has been a substantial increase in the number of electric vehicles (EV), due to the increase of pollution by CO 2 emissions to the environment.Recent studies show that currently there are more than 800 million cars circulating every day, which represent a distribution of 400 to 800 vehicles per 1000 inhabitants [1].As a result, vehicles are responsible for a high percentage of global energy consumption and greenhouse gas emissions.This tendency shows an accelerated growth of vehicles per inhabitants, and, while the energy consumption in other sectors decreases, the consumption due to the continuous use of transport vehicles grows [2].On the other hand, new sensor systems and actuators on EV are increasing in complexity, and the probability for a fault taking place is high [3].
For example, recently, a Tesla driver died in a crash while using the autopilot mode because the car's sensor system failed to distinguish a large white 18-wheel truck and trailer crossing the highway.This accident caused a severe crisis in the EV industry.Therefore, safety, reliability, and energysaving optimization systems are a demand of the new growing industry.In line with this demand, this work is dedicated to propose a method to detect and isolate sensor faults in an electric vehicle.
An important stage in the design of the diagnosis system is the mathematical model that represents the dynamic characteristics of the EV, which is expressed by a set of nonlinear differential equations depending on exogenous nonstationary parameters [4], for example, slopes or poor conditions of the road.However, typical models of EV consider a simplified representation given by linear models, in which it is not possible to consider these nonstationary parameters [5][6][7].Nonetheless, it is possible to obtain better representations when nonstationary exogenous parameters, such as the road slope, could be measured online, such that the desired diagnosis system, which also depends on these measurable parameters, is better and less conservative [8].In typical linear time-invariant systems, it is not possible to consider these variations.However, a viable alternative is Takagi-Sugeno models that consider nonlinearities and varying parameters as part of the mathematical modeling [9,10], which increases the physical representativity of a real physical system.
The main advantage of a TS model is its capability of describing nonlinear dynamics through a collection of local linear models that are interpolated by nonlinear functions [11].These functions are known as weighting functions and depend on exogenous variables that can be measurable (e.g., system inputs, outputs, exogenous nonstationary parameters, velocity, and the slope of the terrain) or unmeasurable (e.g., state variables, magnetic flux, and slip angle of the tires) [12,13].In this work, weighting functions are considered measurable.Additionally, an important property of this type of models is that the weighting functions are convex, which allows to extend some of the tools and methods developed for linear systems to TS systems.In particular, it has been shown that a TS dynamic model obtained through the nonlinear sector transformation approach can describe the overall behavior of a highly complex nonlinear system with a high degree of accuracy [11,14].As a result, its applicability in designing controllers, diagnosis systems, and observers, among others, has become of high importance; see, for instance, [15][16][17] and references therein.Applications on vehicles can be found in the literature; for example, in [4], a predictive control strategy using a TS model is presented to control the velocity in an EV, and the authors in [18] proposed a linear parameter varying (LPV) controller in order to control the tracking of the longitudinal velocity and the yaw velocity of the EV.In [19], a TS fuzzy model is used to represent the nonlinear behavior of an electric power steering (EPS) system, and stabilization conditions for nonlinear EPS system with both constrained and saturated control input cases are proposed in terms of linear matrix inequalities.Some works related to fault diagnosis can be consulted in the following references: in [20], an observer design strategy is presented to estimate the lateral dynamics of a vehicle and the curvature of the road.The nonlinear model of vehicle dynamics is transformed into an exact TS model with weighting functions depending on unmeasured states.In [21], a TS observer is designed to detect faults and estimate states in an induction motor, in order to implement a fault-tolerant control.Recently, in [22], an observer was designed to estimate the lateral dynamics of a motorcycle represented as a quasi-LPV system.It is important to note that, in the works reported in [4,18,21], the slope of the road is considered constant or close to zero; nevertheless, in real driving conditions, this parameter is not constant and has a great impact on the vehicle performance and battery consumption.Unlike previous papers, this work considers the slope of the road in order to obtain an improved sensor fault diagnosis system.
In this paper, we propose the design of an observer-based fault diagnosis for an electric vehicle.The main contributions of this paper are listed as follows: (i) a Takagi-Sugeno model is developed, whose weighting functions depend on the longitudinal velocity and the slope of the terrain in order to increase the operation range of the diagnostic system; (ii) sufficient conditions are proposed in order to guarantee the asymptotic convergence of the observer that is deduced through a quadratic Lyapunov function and a set of linear matrix inequalities (LMIs); finally, (iii) a bank of observers based on a generalized observer scheme is proposed to detect and isolate sensor faults.The combination of both techniques results in a scheme for detecting faults in the traveled-distance and speed sensors at different operating and slope conditions.
The paper is organized as follows: in Section 2, the longitudinal model of the electric vehicle is presented; in Section 3, a TS model that uses the velocity and the slope as premise variables is developed; the conditions of the designed observer for the TS model of the EV are formulated in Section 4; the numerical simulation results are presented in Section 5. Finally, conclusions and perspectives of this work are presented in Section 6.

Nonlinear Model of the Electric Vehicle
Figure 1 shows the general scheme of an EV, which is constituted mainly by an energy source (battery bank), a power inverter, an electric motor, and a transmission system coupled to the wheels.Considering Newton's second law and the translational equilibrium principle, the longitudinal dynamics can be represented by (see Figure 2) [2] where η = I m /I bat is the efficiency of the power converter, is the transmission gear ratio, and r w (m) the radius of the wheel.
It is important to note that, for this case, the motor current I m is not available and the battery provides the electric current to generate all the traction power, so that the battery current I bat t is considered as the system input.
The aerodynamic force is given by where ρ a (kg/m 3 ) is the air density (ρ a = 1 225 kg/m 3 under standard conditions), A f (m 2 ) is the frontal area, and C d (-) is the aerodynamic drag coefficient.
The rolling resistance is given by where C r (-) is the rolling resistance coefficient and α t (rad) is the slope of the road that depends on the position of the EV.However, in this work, it is considered time dependent without losing generality.The coefficient of rolling friction is complex and depends on the speed of the vehicle and the conditions of the tires and the terrain.Finally, the gravitational force due to the slope of the road and to the weight of the vehicle is It is important to note that most of the reported work [4,18,21] consider that the vehicle is traveling on a road with a slope equal to zero or constant, which reduces the complexity of the mathematical model due to the fact that F r t and F g t becomes constant.Nonetheless, in real driving conditions, the vehicles have smooth and abrupt slope changes.These changes can be measured with appropriate sensors, for example, using inertial measurement units (IMUs).By considering typical linear models, it is not always possible to include the slope dynamics in the model.However, variation of this parameter makes the nonlinear system a candidate to be represented by a TS model.In this case, the slope dynamics can be included as an exogenous nonstationary parameter, which increases accuracy of the model representation with respect to the real physical system [23].
Substituting ( 2)-( 5) into (1), the differential equation, which represents the longitudinal dynamics, is given by For this mathematical model, the internal frictions, rotational inertias of the power train, and the inertia of the electric motor are neglected because they are small compared to the mass of the vehicle.The vehicle displacement x 1 t can be computed as Finally, the nonlinear model affine to the input is given by where y t is the system output.In the following section, the TS model for the nonlinear model ( 8) is developed.

Takagi-Sugeno Model of the Electric Vehicle
A TS model describes a nonlinear system using a collection of local linear time invariant (LTI) models, which are interpolated by nonlinear functions known as weighting functions.The general form of a TS model is given by where x t ∈ R n , u t ∈ R m , and y t ∈ R p are the state, input, and output vectors, respectively; and C ∈ R p×n are known matrices of appropriated dimensions; and k is the number of local models.
The weighting functions μ i ξ t depend on ξ t , which can represent the system states, measured inputs, or an exogenous measured signal, for example, the slope of the road.The weighting functions satisfy the convex sum: There are three methods for obtaining a TS model.When it is not possible to obtain analytical models by physical principles, the most appropriate method is system identification [24].This method considers a structure of the TS model and its weighting functions.Then, the problem is reduced to identify the parameters of the subsystems defined as local linear models and the parameters of the activation functions using numerical optimization algorithms.However, when the analytical equations of the nonlinear system is available, a TS model can be obtained by linearizing around different selected operation points [25].Nonetheless, the main drawback of this method is that is not easy to find such operating points, which are usually computed by heuristic methods.Finally, the most appropriate method is called the nonlinear sector transformation [26], which is based on the following idea: consider a simple nonlinear system x = f x t , with f 0 = 0, where the goal is to find a global sector such that x = f x t ∈ a 1 , a 2 x t ; see Figure 3(a).This approach guarantees an accurate approximation of the nonlinear system; however, it is difficult to find a global sector to enclose the nonlinear terms, and generally, a local sector is considered.This is reasonable since the variables of the physical system are always bounded. Figure 3(b) shows the local nonlinear sector, where two lines define a local sector between ξ < x t < ξ.The model TS represents the nonlinear system in the local region, given by ξ < x t < ξ.
In order to derive a TS model, the nonlinear model of the EV in ( 8) is represented in matrix format, as follows: Two premise variables are considered, the nonlinear term x 2 t and the slope of the road α t .For x 2 t , a minimum velocity of 0 m/s and a maximum of 16.66 m/s (approximately 60 km/h) are considered; and for α t , the minimum and maximum slopes of −π/9 and π/9 (−20 and 20, resp.) are considered, such that 0 ≤ x 2 t ≤ 16 66, The premise variables are selected as The premise variables are replaced in (11), with the defined dimensions, and the premise variables are limited as follows: These premise variables comply with (10), such that f (x(t))  Journal of Sensors The nonlinear model of the EV represented by the TS approach is expressed as where with 3.1.Validation of the Takagi-Sugeno Model.The model parameters considered in this paper were presented in [27], whose values are displayed in Table 1.Initial conditions x 0 = 0, 6 5 and an input current I bat t as shown in Figure 4 are considered to validate the TS model.The systems responses are displayed in Figure 4.As can be observed, the nonlinear system and the proposed TS model have the same behavior, and the mean square error between the two responses is 1 23 × 10 −21 %, which demonstrates that the TS model represents the dynamic characteristics of the nonlinear system.In the next section, a fault diagnosis method based on a generalized observer scheme is proposed to detect and isolate sensor faults.

Sensor Fault Diagnosis
The fault diagnosis approach proposed in this paper is based on the generalized observer scheme.This method considers a reduced order TS observer for each of the measured outputs as shown in Figure 5.For the particular case of the EV, two TS observers are considered.Both observers consider the same input (the current I bat t ), but each observer is dedicated to estimate only one output.That is, the first observer  5 Journal of Sensors is dedicated to estimate the vehicle displacement y 1 t , and the second observer the EV velocity y 2 t .The main idea is to perform fault diagnosis by the evaluation of two residual signals, which are the difference between the measured and estimated outputs given by the observers.
Each observer has the following form: where x t is the estimated state vector, ŷ t is the estimated output vector, and G i ∈ R n×p are the observer gain matrices to be computed.The design problem is then to find G i such that lim t→0 e t = lim t→0 x t − x t ≈ 0. Furthermore, the observer (20) needs to achieve the wellknown observability conditions.The estimation error between ( 20) and ( 17) is computed as The error dynamics is given by e t = x t − x t 22 Replacing ( 17) and ( 20) in ( 22), the following is obtained: From the above expression, it follows that if the state estimation (23) error converges asymptotically to zero, the estimated state vector converges asymptotically to the real state vector; then, the problem is reduced to find the matrices G i that satisfies condition (23).To achieve this goal, the following theorem is proposed.
Theorem 1.The observer TS (20) asymptotically converges to (17) if there exist matrices P = P T > 0, M i , satisfying the following matrix inequality: The gains of the observer are determined as Proof.The stability conditions for the derivative of the error (23) can be obtained using the quadratic Lyapunov function V x t = e T t Pe t and V t x < 0, where P = P T > 0, whose derivative is and replacing ( 23) into (25) gives As can be observed from (26), it is sufficient that the following expression has to be negative to satisfy the Lyapunov condition: Nonetheless, expression ( 27) contains nonlinear terms PG and P T G.In order to eliminate these terms, it is considered that M i = PG i .Then by substituting this term in (27), the LMI (24) is obtained.This completes the proof.
4.1.Fault Diagnosis Scheme.Note that in order to perform fault diagnosis, two observers need to be designed according to Theorem 1.Then, each observer takes the following form: Two normalized residual signals are computed and evaluated as follows: such that if r p t is less than a predefined threshold, then the system is working under nominal conditions; but if r p > th, then the system is working on faulty conditions.For example, if the fault occurs in sensor 1, the residual r 1 t is insensitive, but r 2 t changes its value.On the other hand, for a fault occurring in sensor 2, the residual r 2 t remains insensitive, but r 1 t changes its values (see Figure 5).This scheme produces a decoupled sensor fault detection and isolation.Nevertheless, it should be noted that it is not possible to detect simultaneous faults, which will be addressed in future contributions by considering a different diagnosis scheme.

Simulation Results
Numerical simulation results are presented in this section in order to illustrate the applicability of the proposed method.
The EV parameters are the same as the ones presented in [27], which are shown in Table 1.Two reduced observers are considered as discussed in the previous sections, whose gains (28) were calculated by solving Theorem 1 in Python with the solver MOSEK [28].
The gains for observer 1 are The gains for observer 2 are 1 6041

31
In order to verify the convergence of both observers, the considered initial conditions are x 0 = 0, 6 5 for the system and x 0 = 0, 0 for the observers.For simulation purposes, variations on the slope of the road are considered as displayed in Figure 6(a).Furthermore, when the vehicle is climbing a slope, the motor requires more power, which is provided by the bank of batteries.This can be measured as an increment on the electrical current, which is displayed in Figure 6(b).
In addition, to illustrate the fault detection and isolation method, different faults are considered to affect the two sensors in different time intervals.Sensor can fail for different reasons.Usually this behavior can be observed as additive bias, for example, offsets or calibration problems.These malfunctions can be described by ramp or step functions in order to represent abrupt or slow variation faults, as described in [29,30].By considering the previous remark, the fault induced to the displacement sensor, denoted as f 1 , is defined in (32), and the fault induced to the velocity sensor, denoted as f 2 , is defined in (33).Both faults are displayed in Figure 7.In this simulation, two types of faults are considered: an abrupt fault in sensor 1 and an incipient fault in sensor 2, defined in (32) and (33), respectively.The normalized residual signals are also shown in Figure 7.In both cases, the fault detection turns out to be successful.The fault identification is done by comparing the fault signature with the incident matrix given in Table 2.For example, for the fault affecting the speed sensor, the residual r 2 presents some changes at t = 120 s, while the residue r 1 remains at zero.This particular signature allows to isolate the fault in the speed sensor.A similar analysis can be

Conclusions
In this work, an observer-based fault detection system was designed for an electric vehicle.The EV is represented by a TS model whose weighting functions depend on the velocity and the slope of the road.This representation is more general compared with that of typical models, which consider a constant slope.Sufficient conditions, which guarantee the convergence of the TS observer, and the observer bank were proposed by a set of linear matrix inequalities.Finally, the detection of fault on the velocity and traveled-distance sensor was demonstrated through simulation by the variation of the residues compared to an incidence matrix.A variable slope was considered in order to increase the range of representativity of the nonlinear dynamics.The result shows that the TS fault diagnosis observer can detect and isolate sensor faults for different driving conditions and different types of faults.However, the model can be improved by measuring the mass of the vehicle in order to be considered as a premise variable.Future work will be done in order to consider simultaneous faults and inexact premise variables.

Figure 2 :
Figure 2: Longitudinal forces acting on an electric vehicle.

Figure 4 :
Figure 4: Comparison between the general nonlinear model and the TS model in response to variations of the input current.

Figure 5 :
Figure 5: General scheme of the observer bank to detect sensor faults.

Figure 6 :
Figure 6: Variation on the slope of the road (α) and the input current (I bat ).

Figure 7 :
Figure 7: Normalized residuals vectors r 1 t , r 2 t and induced fault signals f 1 t , f 2 t .
, 1 (kg) is the total mass of the vehicle, x 2 t (m/s) is the speed of the vehicle, F t t (N) is the traction force on the wheels, F a t (N) is the aerodynamic force, F r t (N) is the rolling resistance, F g t (N) is the slope resistance due to the vehicle's weight and the road slope, and t (s) is the time.The traction force is given by