Intelligent Two-Step Estimation Approach for Vehicle Mass and Road Grade

Vehicle mass and road grade information is important to improve the control capability and further intellectualization of vehicles. With the aim of real-time estimation of mass and grade without additional sensors, a two-step estimator is proposed in this paper. In the first-step estimator, the recursive least square with dual forgetting factors is used to estimate the vehicle mass with the consideration of the time-varying rolling friction coefficient and system error. In the second-step estimator, the road grade is estimated using an extended Kalman particle filter. Based on the data of CarSim/MATLAB co-simulation, the proposed approach has faster convergence rate and better tracking accuracy on the premise of meeting the real-time requirements by comparison with other estimation algorithms. The performance of the estimator is finally validated by the vehicle road test, and the results show that the mass and grade are estimated with great accuracy and robustness under different road conditions.


I. INTRODUCTION
With the improving demand of the market for vehicle safety and the energy economy, the active safety and intelligent control technology in vehicles have been widely developed and applied [1]. Knowledge of vehicle parameters and road conditions, especially vehicle mass and road grade, is of great significance to achieve optimal control performance [2].
The vehicle mass will change depending on passengers and payload, with variations in the mass of up to 50% for passenger vehicles, and 400% for heavy-duty vehicles [3]. Since the vehicle mass indirectly affects the longitudinal and lateral forces, active safety technologies such as direct yaw control and anti-lock braking systems require mass information to perform the primary system calibration [4]. Moreover, the vehicle mass also significantly influences energy usage, so the accuracy of distance-to-empty predictions without realtime mass estimation cannot be guaranteed [5]. Road grade is another important variable that needs to be estimated in real time, which has a crucial impact on driving safety and energy consumption [6]. The information of mass and grade plays a critical role in transmission shift scheduling and power The associate editor coordinating the review of this manuscript and approving it for publication was Shen Yin. management strategy for hybrid vehicles [7], which can improve power performance and reduce fuel consumption and emissions. As the level of autonomous driving increases, the control authority is gradually transferred from driver to machine, and intelligent vehicles will face the situation of human-machine coordinated control in the next period of time [8]. Its representative Advanced Driver Assistance Systems' control precision will benefit from a reliable and robust estimation of vehicle mass and road grade [9], [10].
There have been a large number of studies in estimating vehicle mass and/or road grade over the last two decades. The early proposed sensor-based methods used the global positioning system (GPS) and additional sensor information to implement the estimation [11]- [13]. However, on account of their limited estimation accuracy, high cost, and sensitivity to environmental noise, the subsequent researches mainly focused on model-based methods. Fathy et al. [14] proposed an online mass estimation approach based on recursive least square (RLS) algorithm and a fuzzy supervisor, which was used to extract parameters of high-frequency components when the vehicle has significant longitudinal motion. Lin et al. [15] considered the system error as an unknown parameter, and it was estimated together with the vehicle mass using RLS. RLS with multiple forgetting factors (RLS-MFF) was adopted in simultaneous estimation of mass and grade to deal with the problem of different change rates for the two parameters [16]. Kalman filter (KF) was first applied in this field in 2002 [17], but it is unable to solve the nonlinear estimation problems [18]. Extended KF (EKF) was used in the estimation of both mass and grade based on the longitudinal dynamic model [19] and in mass estimation based on the lateral model [20]. The EKF inevitably has the linearization error when calculating the Jacobian matrix, while the unscented KF (UKF) can approximately obtain the statistical characteristics of the nonlinear transformation through the unscented transform, so it is more advantageous in the estimation of strongly nonlinear systems [21]. Vehicle mass and other inertial parameters were estimated using a dual UKF [22], [23].
The hybrid algorithms for estimation of mass and grade were proposed to make full use of their strengths. Sun et al. [24] proposed a hybrid algorithm combining EKF and RLS, in which the mass was estimated twice and a weight coefficient was introduced to make a tradeoff. Chu et al. [25] proposed an estimator based on a combined kinematic and dynamic model to eliminate the influence of different frequency noise. Furthermore, two-layer estimation algorithms were proposed to alleviate the coupling effect between the two parameters and improve the computational efficiency [26]- [29]. In the first layer, the mass or grade was estimated, and it was taken as a known parameter in the second layer to estimate the other parameter. Besides, the neural network approach has recently been applied to estimate vehicle mass and road grade [30], which makes it possible to estimate when braking. But a great deal of data from drivers with diverse driving styles are needed to train neural networks.
Recently, particle filter (PF) has been popular in the estimation of vehicle state and parameter owing to its advantages over EKF and UKF in solving the nonlinear estimation problems without the Gaussian distribution assumption of the process and measurement noise [31]- [34]. Based on the Monte Carlo method and recursive Bayesian estimation, a group of discrete weighted random sample points (i.e. particles) in the state space are used to approximate the posterior probability density function of the estimated states. The value and weight of particles are continuously adjusted on the basis of the observation, and finally, the estimated value is represented by the weighted sum. Nevertheless, the standard particle filter has the defect of particle degeneracy [35]. With the increase of iteration times, the weight of most particles decreases to zero, which will lead to the waste of computing resources and the decline of estimation accuracy. The common methods to reduce the impact of particle degradation include the introduction of resampling methods and the selection of appropriate importance density function [36].
A two-step structure approach for vehicle mass and road grade estimation is proposed in this paper. The information of the acceleration sensor in Electronic Stability Program (ESP), which is widely applied in vehicles nowadays, is used to decouple mass and grade in the longitudinal dynamic model. In the first step, vehicle mass is estimated by RLS with forgetting factors, in which the time-varying characteristics of rolling resistance and system error are considered to improve the estimation accuracy. In the second step, with the mass known, the extended Kalman particle filter (EKPF) algorithm is used to estimate the road grade. The validity of the proposed estimator is verified by comparison with RLS-MFF and EKF algorithms, and the real-time performance is analyzed. The effectiveness of the estimator is further verified by vehicle road tests with a small SUV. Two major contributions that clearly distinguish our endeavor from other studies: 1) A twostep estimator structure is designed, and the coupling relationship between mass and slope parameters is canceled by using the longitudinal acceleration sensor information. The mass estimated in the first step is used as the known parameter of grade estimation in the second step. 2) In the mass estimation, an equivalent resistance coefficient is proposed to eliminate the influence of time-varying rolling resistance coefficient and system error, and EKPF is applied to the field of road grade estimation.
The remainder of this paper is structured as follows: Section II introduces the vehicle longitudinal dynamic model. In Section III, the proposed estimator for vehicle mass and road grade is designed. Various simulations and comparisons are provided in Section IV. The results of the vehicle road test are presented in Section V, and the conclusion is summarized in Section VI.

II. VEHICLE LONGITUDINAL DYNAMIC MODEL
The proposed estimator is available for vehicle mass and road grade estimation when the vehicle is in longitudinal motion, which is dominant in the daily driving process. As shown in Fig. 1, driving force and various resistances acting on the vehicle during longitudinal driving, and it is assumed that there is no wheel slip. According to Newton's Second Law, the vehicle longitudinal dynamics equation as: where F drive , F acc, F aero , F roll , F grade are the vehicle's driving force, the inertia force, the aerodynamic drag force, the rolling resistance, the grade resistance, respectively; F err is the system error, which caused by uncertain environment disturbance in longitudinal dynamics [15]. The torque T tq from the engine or driving motor is delivered to the driving wheels through the driveline, generating a circumferential force on the ground. F drive is the reaction force of the ground to the driving wheel, which can be expressed as: where i g is the transmission gear ratio; i 0 is the final drive ratio; η T is the mechanical efficiency of the driveline; r w is the wheel radius. The inertial force during acceleration can be presented as: where m is vehicle mass; v is longitudinal velocity. The aerodynamic drag force can be presented as: where C D is the drag coefficient; A is the frontal area; ρ is the air density. The rolling resistance is related to the road condition and the vertical load of the wheel, which can be expressed as: where g is the acceleration due to gravity; µ is the rolling friction coefficient; β is the road grade angle. The grade resistance is the component force of vehicle gravity along the slope, which can be expressed as:

III. DESIGN OF THE TWO-STEP ESTIMATOR
Based on the model mentioned above, there is a strong coupling relationship between vehicle mass and road grade. Knowing one will facilitate estimation of the other, hence mass and grade are independently estimated by a two-step estimation approach. In the first step, the vehicle mass is estimated by using the acceleration sensor information, and the estimated value is taken as the known parameter in the next step. In the second step, a nonlinear estimator is constructed to estimate the road grade. The structure of the twostep estimator is presented in Fig. 2.
As the proposed estimator is based on longitudinal dynamics, and persistent excitation of the input signal is required like other model-based methods, the following preconditions for estimator activation are established: a) The steering wheel angle does not exceed 15 degrees; b) The brake pedal is not depressed; c) The clutch is fully engaged. When any of the above conditions are not met, the estimator is suspended until all conditions are satisfied again. During this interval, the estimated mass and grade maintain the values at the time before the suspension.

A. VEHICLE MASS ESTIMATOR BASED RLS IN THE FIRST STEP
The measurement a sen_x of the longitudinal acceleration sensor in ESP includes the information of vehicle acceleration and component force of gravity along the slope, and their relationship is: Substituting (2), (3), (4), (5), (6), (7) into (1), equation can be written as: where µ = µ cos β + F err /g, µ is defined as the equivalent resistance coefficient, which contains the information of rolling resistance coefficient and system error.
In the above equation, the vehicle mass will change with the number of passengers and the weight of luggage. For equivalent resistance coefficient, the rolling resistance coefficient is an unknown time-varying parameter, which is usually regarded as a known constant, and its value is related to the road condition, driving speed, and tire parameters. And the existence of system error is mainly due to modeling error and environmental noise. Other data and parameters can be obtained from the controller area network (CAN) Bus or provided by the automobile manufacturer. The equivalent resistance coefficient and vehicle mass are estimated simultaneously by RLS. Equation (8) can be rewritten in the following form: The vehicle mass will not change after the vehicle is started and it can be considered as a constant parameter over the course of a trip, while the equivalent resistance coefficient will change with the vehicle driving situation and road conditions. Therefore, RLS with dual forgetting factors is used to estimate the parameters that change with different rates. The equations of the RLS algorithm can be expressed as [16]: where K (k) is defined as: where λ 1 and λ 2 are forgetting factors for the two parameters respectively; P i (k) is the covariance matrix; K i (k) is the update gain, and in (12) and (13), i = 1, 2.
To make full use of historical data to get an accurate estimation of vehicle mass, the forgetting factor λ 1 is set to 1. In view of the time-varying characteristics of the equivalent resistance coefficient, the forgetting factor λ 2 is set to 0.9.

B. ROAD GRADE ESTIMATOR BASED EKPF IN THE SECOND STEP
Taking the estimated vehicle mass in the first step as a known parameter, the state-space model of the system is established. Longitudinal velocity and road grade are defined as state parameters in the estimating process. To simplify the model to ensure the real-time estimation and avoid introducing new unwanted errors into the second-step estimator, the rolling resistance coefficient is set to a constant value with F err = 0. Since road grade is generally small, it is assumed that sin β ≈ tan β = i, cos β ≈ 1, where i is the road grade. The grade changes slowly, so the derivative of time is approximately zero. The differential equations can be given as: The Euler approximation is used to discretize (14), and the discretized difference equations are expressed as: wherė In this paper, the EKPF algorithm with the introduction of the systematic resampling algorithm is used to estimate road grade. EKPF algorithm is to approximate the optimal importance density function using EKF after the initialization stage of the PF algorithm, which makes the particle distribution closer to the real posterior probability distribution. Then, the generated particles are transferred to the likelihood function to complete the calculation. The systematic resampling algorithm is chosen because of its excellent performance in resampling quality and computational efficiency [37]. To apply the EKPF algorithm, the discrete state space equation is formulated as: where The basic steps of the EKPF algorithm are expressed as follows:

1) INITIALIZATION
A set of particles are generated randomly based on the prior probability distribution p(x 0 ). The number of particles is set to N , and their values x + 0,i , covariance matrix P + 0,i , and weight w + 0,i are initialized.
where the subscript i refers to the i-th particle.

2) UPDATE OF PARTICLES
The value and covariance of each particle are calculated by EKF, and the particle set is updated. Prediction) priori particles x − k,i and their covariance P − k,i are predicted using the particles' value x + k−1,i at instant (k −1) as: where F k−1,i is the Jacobian matrice of the process model.
Correction) According to the observation and Kalman gain K k,i , posteriori particles x + k,i and their covariance P + k,i are updated as: where Then, by sampling from the proposal distribution, particles are updated as: where N (x + k,i , P + k,i ) is a normal distribution with mean x + k,i and variance P + k,i .

3) IMPORTANCE WEIGHT CALCULATION
The importance weight of each particle is calculated.
where p(y k x k,i ) q(x k,i x 0:k,i , y 1:k ) Then, the importance weights are normalized.

4) RESAMPLING
To obtain a new particle setx + k,i , the systematic resampling algorithm [38] is used to copy and eliminate the particles according to the normalization weightw k,i .

5) ESTIMATION
The state estimation is calculated.

IV. VERIFICATION RESULTS OF SIMULATION DATA
The validity of the proposed estimator was first verified by the simulation data based on the vehicle model in CarSim. The estimator was developed in Matlab, and Gaussian noise was added to make the data closer to the actual situation. A docking road and two sloping roads were constructed, and the vehicle was driving in a straight line with a constant throttle control of 0.15.

A. DOCKING ROAD
Since the time-varying rolling resistance coefficient is considered in the first-step estimator, its estimation effect can be verified by the docking road experiment in which the rolling resistance coefficient changes suddenly. A docking road with a grade angle of 0 is constructed, as shown in Fig. 3. The beginning section is a good asphalt pavement, which turns into a dirt road at 20 meters.  In this case, the comparison between the first-step estimator and RLS without µ was conducted. The latter is a similar mass estimator based on acceleration sensor information, but the system error and time-varying rolling resistance coefficient are not considered. As can be seen from Fig. 4, the convergence speed of the first-step estimator is faster than that of RLS without µ , and the first-step estimator is significantly less affected when the road surface changes.

B. SLOPING ROAD 1
Sloping Road 1 includes a flat section and an uphill section with a constant grade, and there is a mild transition section between them. Two widely accepted simultaneous estimation approaches, RLS-MFF and EKF were implemented as a direct comparison of the estimation results to verify the accuracy of the proposed estimator. Fig. 5 shows the mass estimation results and relative errors of RLS-MFF, EKF, RLS without µ , and the firststep estimator in this paper. It can be seen that the estimated mass of all approaches converge quickly, and the errors of mass estimation based on acceleration sensor information are smaller. Moreover, the first-step estimator takes into account the system error and the time-varying characteristics of the rolling resistance coefficient, so it can be adaptive to the system disturbance and show a better estimation effect than RLS without µ .
The grade estimation results and errors of RLS-MFF, EKF, RLS-PF, and the second-step estimator in this paper are  shown in Fig. 6. In RLS-PF, a similar but slightly different two-step estimator, the standard particle filter is used to estimate the grade based on the mass results of the first-step estimator. From the figure, the jump phenomenon is found at the beginning for all approaches, which is caused by the large deviation between the set initial mass value and the actual value. But the estimated grade converges to the actual value in a short time. The second-step estimator shows better performance in the tracking accuracy when the grade changes and has a more stable estimation when the grade becomes constant than other approaches.

C. SLOPING ROAD 2
Sloping Road 2 is a continuous variable grade road to simulate mountainous highways. Fig. 7 and Fig. 8 show the estimated results and errors of vehicle mass and road grade respectively. Due to the continuous change of grade, the estimated mass based on RLS-MFF and EKF fluctuates slightly. The first-step estimator can converge quickly without the influence of grade change and maintain a good estimation level.
For grade estimation, the curve of the second-step estimator is relatively smooth in the whole estimation process compared with other approaches. And the tracking accuracy  is better when the road grade changes greatly, especially at the peak of the curve. So the superiority of the EKPF algorithm in nonlinear system state estimation is proved.
To quantify the estimation accuracy of these approaches, root mean square error (RMSE) and mean absolute error (MAE) are selected as evaluation indexes. RMSE and MAE are calculated by the following equation respectively: whereα i and α i represent the actual value and estimated value at the i-th moment respectively. The RMSE and MAE of vehicle mass and road grade for both sloping roads are shown in the histogram of Fig. 9.

D. ANALYSIS OF PARTICLE NUMBER
Computational complexity has always been a major drawback of the particle filter algorithm. To balance precision and real-time, it is very important to choose the appropriate number of particles. The relationship between the number of particles and the calculation time and estimation error  is analyzed. In this paper, the mean single iteration time is selected as the quantitative evaluation index of the computational burden. The mean single iteration time denotes the average value of the time consumed in a single iteration of state estimation. The simulation was carried out in Matlab R2019b environment on a desktop computer equipped with Intel Xeon (R) silver 4110 processor (2.1GHz).
The calculation results of grade estimation based on PF and EKPF algorithms are listed in Table 1. For PF, if the number of particles is too small, there will be a serious divergence phenomenon caused by the lack of particles. In this study, the divergence phenomenon appeared when the particle number was less than 40. The estimation accuracy of PF and EKPF was improved with the increase of particle number, but the computation time became longer. For EKPF, the estimation accuracy will not be significantly improved when the particle number exceeds 30. Thus, the number of particles is set as 30, and the mean single iteration time is 0.00121s, which meets the real-time requirements of the estimator.

V. VERIFICATION RESULTS OF ROAD TEST DATA
To further verify the feasibility of the proposed estimator, the off-line simulation was carried out based on the data of the vehicle road test. The test vehicle is a small SUV equipped with a seven-speed double-clutch transmission, and experiments were conducted on expressway and mountainous highway to validate the robustness of the estimator under different road conditions.
The data from the CAN Bus were collected using Racelogic VBOX3i through the on-board diagnostics (OBD) interface and stored in a laptop computer. Fig. 10 shows the schematic diagram of the data acquisition of the vehicle road test. Only the data of straight-line driving were collected, including vehicle velocity, longitudinal acceleration, engine torque and speed, transmission gear, and brake master cylinder pressure, etc. The sampling frequency is 100Hz.
A Dual GPS antenna, which has high positional precision using multiple satellites, was installed at the front and rear of the vehicle roof centerline to obtain the relative elevation information [39]. The actual value of road grade was obtained through preprocessing, differential calculating, and removing the abnormal points. And the actual value of vehicle mass is 1812kg, including the weight of one driver, three passengers, and test equipment. Fig. 11 shows the installed test equipment and the test road.
A. EXPERIMENT 1 In Experiment 1, a period of 60 seconds of data in the expressway was selected, and the grade value was small, close to 0. During this driving process, the master cylinder pressure was 0 and the transmission was in 7th gear. Fig. 12 shows part of the data from Experiment 1 and the comparison results of three approaches. The mass estimated by all approaches converge to the actual value within 10s, VOLUME 8, 2020  and there are some deviations after the convergence, among which the proposed estimator is the smallest. In addition, there are some small fluctuations, especially for EKF, which is owing to the sudden drop of engine torque caused by the driver releasing the accelerator pedal to avoid other vehicles when driving on the expressway. The estimated grade begins to converge to the actual value when the mass estimation error is less than 10% (about 2 s). For grade estimation, the proposed estimator shows better tracking and robustness than other approaches as a result of the existence of environmental noise.

B. EXPERIMENT 2
In Experiment 2, a period of 50 seconds of data in the mountainous highway was selected, and the road grade was relatively large, about 9 • . During this driving process, the master cylinder pressure was 0 and the transmission was in 2nd gear.   Fig. 13 shows part of the data from Experiment 2 and the estimation results. The estimated mass also converge within 10s with a relative error of less than 3%, and the proposed estimator shows better convergence stability. As the mass approache the actual value, the grade estimated by all approaches converge rapidly from the initial value of 0 to the actual value. The proposed estimator still performs better, but the advantage is not so prominent as Experiment 1. This is due to the fact that the engine torque remained constant most of the time in this case, while changed greatly when driving on expressway. Table 2 shows the RMSE results of vehicle mass and road grade estimation in two experiments. Since there is a big gap between the initial value and the actual value, the data of the first 2 seconds are ignored. The results show that the proposed estimator has better estimation performance than RLS-MFF and EKF.

C. SENSITIVITY ANALYSIS
Furthermore, the potential defect of the two-step estimator was examined, that is, the sensitivity of the second-step estimator to the first-step estimated results. In this paper, it is the sensitivity of road grade estimation to the error of estimated vehicle mass. The estimated mass with errors of 5% and 10% were introduced into the grade estimator respectively. Table 3 shows the RMSE of grade estimation under different mass estimation errors, and the data of the first 2 seconds are also ignored.
It can be seen from the table that the estimation performance of the second-step estimator will become worse with the errors of the first-step estimator under the two road conditions. The impact of the mass estimation results on grade estimation in mountainous highway is less, compared with the expressway with a small grade. In general, when the relative error of the estimated mass is less than 10%, the accuracy of grade estimation is acceptable.

VI. CONCLUSION
In this paper, a two-step estimator for estimating vehicle mass and road grade was proposed. RLS with forgetting factors was used to firstly estimate vehicle mass along with the equivalent resistance coefficient, which has a great influence on mass estimation. Then, the estimated mass value was used as a known parameter in the second-step estimator to implement the nonlinear estimation of road grade using EKPF. In terms of algorithm verification, the proposed estimator was compared with two commonly used estimation approaches based on simulation data, and the results indicate that it has a better estimation accuracy. Vehicle road tests were carried out on expressways and mountainous highways respectively, and the feasibility of the algorithm is further verified. Moreover, the sensitivity of grade estimation to mass error was analyzed, and it turned out to show a satisfactory performance of the second-step estimator when the error of the first-step estimator is less than 10%.
The information on estimated vehicle mass and road grade can be used for active safety control and power management. And the estimator likely gets a more ideal effect for battery electric vehicles, it is attributed to the precise measurement of motor torque. The proposed estimator will not be activated in the downhill road where the braking operation is dominant, because the braking force cannot be accurately obtained. However, the braking safety of vehicles, especially heavyduty commercial vehicles, is greatly affected by vehicle mass and road grade. Consequently, the estimation of mass and grade on the downhill road as well as the braking control based on the estimated results will be the future research.