Huber-Based Robust Unscented Kalman Filter Distributed Drive Electric Vehicle State Observation

: Accurate and real-time acquisition of vehicle state parameters is key to improving the performance of vehicle control systems. To improve the accuracy of state parameter estimation for distributed drive electric vehicles, an unscented Kalman ﬁlter (UKF) algorithm combined with the Huber method is proposed. In this paper, we introduce the nonlinear modiﬁed Dugoff tire model, build a nonlinear three-degrees-of-freedom time-varying parametric vehicle dynamics model, and extend the vehicle mass, the height of the center of gravity, and the yaw moment of inertia, which are signiﬁcantly inﬂuenced by the driving state, into the vehicle state vector. The vehicle state parameter observer was designed using an unscented Kalman ﬁlter framework. The Huber cost function was introduced to correct the measured noise and state covariance in real-time to improve the robustness of the observer. The simulation veriﬁcation of a double-lane change and straight-line driving conditions at constant speed was carried out using the Simulink/Carsim platform. The results show that observation using the Huber-based robust unscented Kalman ﬁlter (HRUKF) more realistically reﬂects the vehicle state in real-time, effectively suppresses the inﬂuence of abnormal error and noise, and obtains high observation accuracy. of the wheels on the dynamics of the vehicle is ignored. This is the state parameter required for vehicle stability control. We established a three-degrees-of-freedom dynamic model of a distributed drive electric vehicle with nonlinear time-varying parameters including yaw, longitudinal, and lateral motion [19]. The vehicle dynamics equations are as follows.


Introduction
Due to the development of vehicle intelligence in recent years, an increasing number of active safety control systems have been widely used in vehicles, including electronic body stability systems, electronic brake-force distribution systems, drive anti-skid systems, and active steering systems. However, a stable and reliable control system does not only lie in the robustness of the control algorithm, but also relies on the accurate acquisition of key vehicle dynamic state parameters. Unlike conventional vehicles, distributed-drive electric vehicles are driven independently by four motors, and changes in the vehicle mass, the yaw moment of inertia, and the height of the center of gravity directly affect the vehicle driving state; for example, changes in the vehicle mass directly affect the vehicle's economy and handling stability, and a change in the height of the center of mass has a significant impact on the vehicle's roll stability. The amount of lateral load transfer is also affected by changes in the vehicle mass and the height of the center of gravity, thus affecting the vehicle driving state vector, and the MAP characteristics of the vehicle drive motor efficiency are related to the motor speed and torque. Therefore, for the characteristics of distributed drive electric vehicles, more accurate state parameters must be obtained, and the estimation and identification of these state parameters are particularly important. Estimation of vehicle condition parameters is necessary, because many condition parameters are not directly measured or obtained by sensors due to show that the substitution of the Huber method into the UKF framework can effectively improve the robustness of the algorithm [14]. Currently, the Huber method is often used in the CKF framework and is widely used in battery SOC, power grid system state estimation, combined INS/DVL navigation, and target tracking. However, it has not yet been used in distributed drive electric vehicle (EV) state parameter estimation [15][16][17][18]. In this study, the Huber method is introduced into the UKF vehicle state parameter estimation framework to correct for the measured noise and state covariance in real-time, which reduces the convergence time and improves the robustness and estimation accuracy of the algorithm. This study used distributed drive electric vehicles as the research object. The main stages were to consider the variation caused by the interaction of vehicle mass, height of the center of gravity, and yaw moment of inertia; expand the above vehicle parameters into the vehicle state vector; design an observer that can simultaneously estimate the vehicle state and parameters; and introduce the Huber method into the UKF vehicle state parameter estimation framework to correct the measurement noise and state covariance in real-time. The result was to reduce the convergence time and improve the robustness and estimation accuracy of the algorithm.

Vehicle Model
The parameters of the vehicle during the driving process, including the height of the center of mass and the moment of inertia, are affected by the driving state of the vehicle and the vehicle load. The change of the height of the center of gravity of the vehicle is particularly important for the vehicle's stability control. The vehicle dynamics model studied in this paper is shown in Figure 1. The origin of the defined vehicle coordinate system is located at the center of gravity (CG), and the forward direction of the vehicle is defined as the positive axis direction; the left side is the positive direction of the y-axis, and the positive direction of the z-axis is perpendicular to the ground. It is assumed that the pitch, vertical, and roll motions of the vehicle are ignored, and the influence of the suspension system is ignored. Furthermore, the influence of the camber angle and the return torque of the wheels on the dynamics of the vehicle is ignored. This is the state parameter required for vehicle stability control. We established a three-degrees-offreedom dynamic model of a distributed drive electric vehicle with nonlinear time-varying parameters including yaw, longitudinal, and lateral motion [19]. The vehicle dynamics equations are as follows.
operation [13]. Lu Xiong et al. designed an algorithm for the autonomous underwater ve hicle (AUV) terrain matching problem based on the Huber method in combination with UKF, and the results show that the substitution of the Huber method into the UKF frame work can effectively improve the robustness of the algorithm [14]. Currently, the Hube method is often used in the CKF framework and is widely used in battery SOC, powe grid system state estimation, combined INS/DVL navigation, and target tracking. How ever, it has not yet been used in distributed drive electric vehicle (EV) state paramete estimation [15][16][17][18]. In this study, the Huber method is introduced into the UKF vehicl state parameter estimation framework to correct for the measured noise and state covari ance in real-time, which reduces the convergence time and improves the robustness and estimation accuracy of the algorithm. This study used distributed drive electric vehicle as the research object. The main stages were to consider the variation caused by the inter action of vehicle mass, height of the center of gravity, and yaw moment of inertia; expand the above vehicle parameters into the vehicle state vector; design an observer that can simultaneously estimate the vehicle state and parameters; and introduce the Hube method into the UKF vehicle state parameter estimation framework to correct the meas urement noise and state covariance in real-time. The result was to reduce the convergenc time and improve the robustness and estimation accuracy of the algorithm.

Vehicle Model
The parameters of the vehicle during the driving process, including the height of th center of mass and the moment of inertia, are affected by the driving state of the vehicl and the vehicle load. The change of the height of the center of gravity of the vehicle i particularly important for the vehicle's stability control. The vehicle dynamics mode studied in this paper is shown in Figure 1. The origin of the defined vehicle coordinat system is located at the center of gravity (CG), and the forward direction of the vehicle i defined as the positive axis direction; the left side is the positive direction of the y-axis and the positive direction of the z-axis is perpendicular to the ground. It is assumed tha the pitch, vertical, and roll motions of the vehicle are ignored, and the influence of th suspension system is ignored. Furthermore, the influence of the camber angle and th return torque of the wheels on the dynamics of the vehicle is ignored. This is the stat parameter required for vehicle stability control. We established a three-degrees-of-free dom dynamic model of a distributed drive electric vehicle with nonlinear time-varying parameters including yaw, longitudinal, and lateral motion [19]. The vehicle dynamic equations are as follows.
The equation of the lateral motion is: The equation of the yaw motion is: where V x , V y are the longitudinal and lateral velocities; . ψ is the yaw rate of the vehicle; a x and a y are longitudinal acceleration and lateral acceleration, respectively; F xij and F yij are longitudinal and lateral forces of the four wheels, respectively, where ij is 11, 12, 21, and 22, which represent the front left, front right, rear left, and rear right wheel, respectively. M z represents the yaw moment of the vehicle; m is the vehicle mass; w is the track width; a and b are the distances from the gravity center to the front and the rear axles, respectively; L is the wheelbase; I zz is the moment of inertia of the vehicle around the axis; and δ 11 and δ 12 are the steering angles of the left and right front wheels, respectively.
When the vehicle is turned, the longitudinal force and the lateral force of the tire are affected by the transfer of the vertical load by the following equation: where h g is the height of the center of gravity, and F z1j and F z2j are the vertical load of the left front wheel and the right front wheel, respectively. The sideslip angle of the tire is calculated as follows: where α 1j and α 2j are the sideslip angle of the front tire and the rear tires, respectively.

Tire Model
As a typical component of a ground vehicle, tires transfer the vehicle forces and torques to the road through the tire's grounding area, and their performance directly affects the vehicle dynamic characteristics. In the current theoretical research, the Magic Formula tire model and the Dugoff tire model are mainly used. However, the Dugoff tire model was chosen in this study because the MF model requires a large number of tests to obtain the empirical parameters. The Dugoff tire model has no peak point, and the maximum value is smaller than the maximum value of the MF model. As the slip rate increases, the difference between the longitudinal forces of the Dugoff tire model and the MF model increases, and as the tire slip angle increases, the difference between the lateral forces of the two models also increases [20,21]. In view of the above points, the modified Dugoff tire model was used for modeling, and can be described by: where C xij and C yij are the longitudinal and lateral stiffness of the four tires, respectively; µ ijmax is the pavement peak adhesion coefficient; φ xij and φ yij are the longitudinal and lateral correction coefficients of the tires, respectively; and λ ij is the slip rate.

Huber-Based Robust Unscented Kalman Filter (HRUKF)
To design a Huber-based robust unscented Kalman filter state observer, the corresponding state and observation quantities were selected, the state and observation equations of the nonlinear observer were constructed, and the Huber method was substituted into the UKF framework. The corresponding technical flow chart is shown in Figure 2.

System Equations and Observation Equations
Parameters such as mass, the moment of inertia, and the height of the center of mass are susceptible to changes in force while the vehicle is in motion, which changes the re-

System Equations and Observation Equations
Parameters such as mass, the moment of inertia, and the height of the center of mass are susceptible to changes in force while the vehicle is in motion, which changes the response of the vehicle dynamic system. The vehicle's own structural parameters, including track width and wheelbase, are not susceptible to large changes due to external influences. In this paper, three vehicle parameters, namely, the vehicle mass m, the Yaw moment of inertia I zz , and the height of the center of gravity h g , are extended to the vehicle state vector using the above nonlinear time-varying vehicle dynamics model.
The state variables of the vehicle system equation are as follows: Equations (1)-(16) can be combined to the obtain vehicle system model: . where: The vehicle longitudinal and lateral acceleration and yaw rate are easily obtained by the distributed drive electric vehicle's own sensors, and so are used as observables: The system input is: where ω ij is the angular velocity of wheel rotation, obtained from the wheel speed sensor, and δ is the steering wheel angle. Following the establishment of initial values, the UKF observation system was designed.

Unscented Kalman Filter Framework
To extend the Huber method from the linear to the nonlinear case, the UKF algorithm using the UT combined with the standard Kalman filter applied to the nonlinear vehicle dynamics equations, the equation of state and observation for a nonlinear vehicle discrete system are as follows: x where f (·) and h(·) represent the non-linear transition function and observation function.
The contained variables are the state vector and the observation vector of the vehicle, as shown in Section 3.1. Among these, the value ranges of state noise ω k and measurement noise v k are ω k ∼ N(0, Q k−1 ) and v k ∼ N(0, R k−1 ), respectively. The sigma point set and the corresponding weights are calculated as follows: Energies 2021, 14, 750 where χ k is the sigma point ofx k|k ; ( (n + λ)P k|k ) i is the ith column of the square root of the matrix; λ is the scaling factor; λ = α(n + k) − n, α affects the distribution of the sigma point around the mean value of the state, generally taking (1 ≤ α ≤ 10 −4 ); k is the quadratic scaling factor, which generally equals 0; β contains the x priori estimate of the state, β = 2 is optimal for the case where the mean values of the state and the updated estimate are Gaussian; ω i represent the distribution of the mean values of the state and the updated estimate. Statistical weights were estimated for the covariance. Based on the vehicle system derived above, the observation equations, and the principle of UT, the unscented Kalman filter procedure is as follows [21][22][23][24][25][26]: Sigma point calculation and time update: Measurement update: where Q k and R k are the variance of system noise and measured noise, respectively.

HRUKF Algorithm Derivation
Based on the above UKF derivation process, by applying the Huber method to the UKF framework, a nonlinear regression model is constructed as follows: wherex k+1|k is the state prediction and its covariance is P k+1|k ; δ k+1|k is the error between the true state and the state prediction. The correlation quantity is defined as follows: It can be seen from the above formula that ξ k+1 is an identity matrix, and the above equations can be integrated to obtain: Define Huber cost function: where residual vector e k+1 = z k+1 − g(x k+1 ); e k+1,i is the ith column of the residual vector e k+1 ; γ is the tuning factor, generally γ = 1.345. For the smaller τ, the Huber function has the characteristic of l 2 norm, so the estimation accuracy under Gaussian noise is guaranteed; for the larger τ, the Huber function grows slowly and can suppress the influence of outliers and noise. The Huber cost function combines the advantages of l 1 and l 2 norms, and its algorithm is more robust [16,17]. Defining Θ( e k+1,i ) =; ( e k+1,i ), the partial derivative of the residual vector can be found to determine the minimum value of the above formula: Definition ϑ( e k+1,i ) = Θ( e k+1,i )/ e k+1,i : Let ϑ= diag[ϑ( e k+1,i )], and then use ϑ to recalculate the measurement information. In this study, the weighted residual covariance matrix was recalculated based on the residual value, and the following method was used to update the measurement information: where S k+1 represents the modified covariance matrix, δ k+1|k is 0. The state vector corresponding to S k+1 and S k+1 remains unchanged; at this time: The modified measurement covariance matrix R k+1 is calculated as follows: The derivation from UKF to HRUKF is completed by introducing the above non-linear regression problem between the predicted state and the observations into the standard UKF, i.e., the resulting R k substitution R k into the standard UKF measurement update process. This completes the design of the observation system.

Simulation Results and Analysis
To verify the feasibility and effectiveness of the HRUKF algorithm in vehicle state observation, a Simulink-Carsim co-simulation platform for distributed driving electric vehicle state estimation was built in the MATLAB/Simulink environment. Carsim, which is professional vehicle dynamics software, retains the actual vehicle dynamics characteristics. The vehicle dynamics model provided in the software contains the body, tires, suspension, powertrain, and aerodynamic system. However, Carsim does not yet include a distributed drive-related power source system; hence, the distributed drive system of the electric vehicle was built in the form of an external interface. The HRUKF observer system was built in MATLAB/Simulink, and Carsim interacted with Simulink through the Carsim-Sfunction interface. In this study, the B-Class, Hatchback model in Carsim version 8.02 was selected for simulation, and the parameters of the vehicle model used are shown in Table 1. In the simulation experiments, the effect of the HRUKF state observer was compared with the standard UKF observer, and the input parameters were maintained the same as those of the vehicle model to evaluate the effect of both observers under the same working conditions. The initial speed of the vehicle was set to 60 km/h, and the pavement adhesion coefficient was 0.85 for asphalt pavement.

Simulation of Double-Lane Change Conditions
To evaluate the observation effect of the HRUKF observer on the vehicle state parameters, the steering condition was adopted as the double-lane change condition with more intense driving; the vehicle front wheel angle is shown in Figure 3. The wheel angle and the angular velocity of four wheels were taken as the inputs of the observer system, and the simulation results of the corresponding UKF algorithm and HRUKF algorithm were compared, as shown in Figures 4 and 5.

Simulation of Double-Lane Change Conditions
To evaluate the observation effect of the HRUKF observer on the vehicle state par eters, the steering condition was adopted as the double-lane change condition with m intense driving; the vehicle front wheel angle is shown in Figure 3. The wheel angle the angular velocity of four wheels were taken as the inputs of the observer system, the simulation results of the corresponding UKF algorithm and HRUKF algorithm w compared, as shown in Figures 4 and 5.   Figure3. Front-wheel angle.  It can be seen from the observations of longitudinal and lateral velocity, yaw ra and sideslip angle that HRUKF can closely approximate the true value of the state outp by Carsim, and HRUKF does not show large deviations in the entire double-lane chan simulation. In the observations of lateral velocity, yaw, and vehicle sideslip angle, a d crete increase in the error occurred at 0-1 s. HRUKF suppressed the influence of this err and the algorithm showed good robustness. The measurement noise of the UKF algorith is initially set at a fixed value and cannot be updated in real-time, so the traditional U is less resistant to noise than the HRUKF algorithm. The reason for the error of the late velocity and the vehicle sideslip angle compared with Carsim is that the vehicle math matical model is simplified compared with the simulated dynamics model, ignoring t influence of the suspension on the vehicle motion state and not considering the influen of the roll on the whole vehicle. Furthermore, the vehicle steering angle is larger und the high-speed operating conditions of the double-lane change, and there is load transf and the suspension has an important role in resisting load transfer. Therefore, the simp fied model leads to the error of simulation results, and the accuracy of tire modeling a  It can be seen from the observations of longitudinal and lateral velocity, yaw rate, and sideslip angle that HRUKF can closely approximate the true value of the state output by Carsim, and HRUKF does not show large deviations in the entire double-lane change simulation. In the observations of lateral velocity, yaw, and vehicle sideslip angle, a discrete increase in the error occurred at 0-1 s. HRUKF suppressed the influence of this error, and the algorithm showed good robustness. The measurement noise of the UKF algorithm is initially set at a fixed value and cannot be updated in real-time, so the traditional UKF is less resistant to noise than the HRUKF algorithm. The reason for the error of the lateral velocity and the vehicle sideslip angle compared with Carsim is that the vehicle mathematical model is simplified compared with the simulated dynamics model, ignoring the influence of the suspension on the vehicle motion state and not considering the influence of the roll on the whole vehicle. Furthermore, the vehicle steering angle is larger under the high-speed operating conditions of the double-lane change, and there is load transfer, and the suspension has an important role in resisting load transfer. Therefore, the simplified model leads to the error of simulation results, and the accuracy of tire modeling also has an impact on the result. According to the observation results in Figure 5, in the mass observation, the HRUKF algorithm converges to a steady-state in about 0.5 s and can estimate the true mass of the vehicle. By comparison, the UKF algorithm gradually deviates, with a mass error of about 3 kg at the end of the double-lane change condition. In Figure 5, the percentage error of the UKF algorithm in the observation of mass center height is about 280%, which does not reflect the real vehicle condition; by comparison, the HRUKF algorithm controls the error to about 10%, which better reflects the mass center height of the vehicle. Both the UKF and HRUKF algorithms can better observe the variation of inertia in the transverse pendulum rotation, and the HRUKF algorithm is closer to the true value than the UKF algorithm. To further evaluate the estimation effect of the two algorithms, the root mean square error (RMSE) was used for quantitative analysis, and was calculated as follows: The calculated RMSE indicators under the double-lane change condition are shown in Table 2.

Simulation of Straight-Line Driving Condition at Constant Speed Condition
To further evaluate the observation effect of the HRUKF observer when the vehicle is driven under multiple working conditions, a 60 km/h uniform velocity driving condition was used for evaluation, with the front wheel angle constant at 0. The HRUKF and UKF algorithms are compared with the real value of the Carsim output, and the corresponding simulation results are shown in Figures 6 and 7.

Simulation of Straight-Line Driving Condition at Constant Speed Con
To further evaluate the observation effect of the HRUKF observer whe driven under multiple working conditions, a 60 km/h uniform velocity dri was used for evaluation, with the front wheel angle constant at 0. The HR algorithms are compared with the real value of the Carsim output, and the simulation results are shown in Figures 6 and 7. As shown in Figure 6, both the UKF and HRUKF algorithms experien ative to the real value of the Carsim output at the beginning of the sim straight-line driving condition at constant speed. However, the HRUKF ha ror than the UKF and converged quickly to the real value of the Carsim o 2.5 s, whereas the UKF algorithm converged to a certain error relative to Thus, the HRUKF algorithm can better reflect the real longitudinal speed under this working condition. The observation results of lateral velocity, v As shown in Figure 6, both the UKF and HRUKF algorithms experienced errors relative to the real value of the Carsim output at the beginning of the simulation in the straight-line driving condition at constant speed. However, the HRUKF had a smaller error than the UKF and converged quickly to the real value of the Carsim output in about 2.5 s, whereas the UKF algorithm converged to a certain error relative to the real value. Thus, the HRUKF algorithm can better reflect the real longitudinal speed of the vehicle under this working condition. The observation results of lateral velocity, vehicle sideslip angle, and yaw rate show that the three values of Carsim output are constant at 0 because of the uniform linear driving condition. The UKF and HRUKF incurred errors due to the influence of observation noise, and the UKF algorithm generated more errors than the HRUKF algorithm in the first 0-1 s of operation. The maximum error was more than 200%, and the HRUKF observer showed better robustness because the Huber cost function suppresses the errors generated by noise.
As shown in Figure 7, the vehicle mass observation result of the UKF algorithm gradually shifts the real value under the uniform linear driving condition. By comparison, the HRUKF algorithm converges to near the real value in about 0.5 s, and the absolute error value is about 0.5 kg, which is the same as that under the double-lane change condition. In addition, the height of the center of gravity and the yaw moment inertia observations show that the HRUKF algorithm still suppresses the outliers better with the same initial values, whereas the UKF algorithm is affected by the outlier divergence. This is particularly obvious in the height of the center of gravity observations. The results show that the Huber cost function can suppress the errors well, and HRUKF has better robustness. Similarly, to quantitatively analyze the estimation effects of the two algorithms, the RMSE indicator was used for evaluation, and the results are shown in Table 3. According to the above indexes, the Huber-based robust unscented Kalman filter can well observe the state vector and the parameters of the vehicle mass, the height of the center of gravity, and the yaw moment inertia during the vehicle driving process under double-lane change and uniform velocity driving conditions.

Conclusions
To improve the accuracy and robustness of state observation for distributed drive electric vehicles with time-varying parameters, a robust unscented Kalman filter state observer based on the Huber method is proposed in this paper. The UKF algorithm is used to estimate all vehicle state parameters, and the Huber method is introduced to simultaneously correct for the measurement noise covariance to reduce the effect of noise uncertainty. A co-simulation using MATLAB/Simulink and Carsim was used to validate the observer for the double-lane change and straight-line driving conditions at constant speed. The HRUKF algorithm provides a good approximation of the true value of the Carsim output for longitudinal, lateral velocity, and yaw rate observations. In the observation of vehicle parameters, HRUKF quickly converges to near the true value of Carsim, and the absolute error is smaller than that of the conventional UKF algorithm. The Huber cost function can suppress the influence of outliers and noise in the case of large errors and is consistent with the UKF observations in the case of small errors, i.e., the algorithm has good robustness in both operating conditions. The results show that the HRUKF algorithm is capable of estimating vehicle state vectors and parameters, and effectively reduces the influence of anomaly errors and noise, providing more reliable observation information for vehicle stability control systems. Therefore, future research will involve building a hardware-in-the-loop vehicle state observation simulation platform to study the effect of the method on state parameter estimation for vehicle models with more degrees of freedom, and to further verify the practical effect of the algorithm through hardware-in-the-loop simulation and real vehicle tests.
Author Contributions: W.W. conceived this paper, designed the experiments, and analyzed the data; J.F. revised the paper and provided some valuable suggestions; B.S. did the investigation; X.L. has done support in software. All authors have read and agreed to the published version of the manuscript.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.