1 Introduction

Accurate acquisition of vehicle state parameters is the basis of high-quality motion control of intelligent vehicles. Vehicle mass is an essential parameter in control system of intelligent vehicles [1], and the accuracy of its estimation directly affects how the control system performs. For example, the strategies of fuel consumption optimization [2], active cruise control [3], and anti-lock braking system control [4] all require the knowledge of vehicle mass. Although the nominal values of the vehicle mass, such as curb mass and gross mass, are usually available, the actual value of the vehicle mass varies greatly when the vehicle carries different loads. However, it is hard to be directly obtained from normal sensors. Therefore, researches focusing on accurate estimation of vehicle mass are carried out. Most of the current vehicle mass estimation methods are based on vehicle dynamic model [511]. Because of the coupling of vehicle mass and road slope in the longitudinal vehicle dynamic model, Zhang et al. [5] used the method of recursive least square (RLS) with forgetting factor to estimate vehicle mass and road slope simultaneously. Seungki et al. [6] used the feature that sensor signal of vehicle acceleration includes road slope information, to realize separate estimation of road slope and vehicle mass. Cai et al. [7] proposed a two-layer structure algorithm, in which the road slope was firstly estimated using RLS, and vehicle mass was then estimated based on extended Kalman filter (EKF). Zhao et al. [8] used fuzzy logic to obtain the confidence factor of vehicle mass estimation algorithm, according to longitudinal speed, longitudinal acceleration and engine torque. Only when the confidence factor exceeded a certain limit, RLS with forgetting factor was applied to estimate vehicle mass. Sun et al. [9] firstly used EKF to estimate road slope, and then used EKF and RLS to estimate vehicle mass respectively, based on the estimated road slope. The final estimate of vehicle mass was the weighted average of the estimates based on two methods with constant weights.

There are also studies on vehicle mass estimation based on frequency domain analysis [10, 11]. Hu et al. [10] derived the amplitude-frequency functions of longitudinal acceleration and wheel angular speed according to longitudinal vehicle dynamic model, and then used the least square method to estimate vehicle mass, but the effect of real vehicle tests still needs to be studied. Chu et al. [11] combined high-frequency information extraction and RLS method to decouple the vehicle mass and road slope, and then realized vehicle mass estimation. In general, dynamics-based methods show fast convergence speed and good stability. However, the performance of dynamics-based methods requires accurate vehicle dynamic model parameters and state parameter measurement. In addition, dynamics-based methods may obtain accurate vehicle mass estimation results when the vehicle is under large and persistent excitation, but the estimation accuracy is difficult to ensure when the vehicle is under small excitation.

In recent years, machine learning (ML) has been widely applied to intelligent driving [12]. However, ML has rarely been used in the research of vehicle mass estimation. Torabi et al. [13] firstly collected the dynamic information of the vehicle under various conditions as the training set, and then trained the feedforward neural network to realize simultaneous estimation of vehicle mass and road slope. Korayem et al. [14] also used a feedforward neural network with 15 fully-connected layers to estimate the mass of a trailer. By learning a large quantity of training data, ML-based method generally shows good accuracy. However, current researches only included the conditions with little change of vehicle speed and road slope, and the estimation effect under conditions of different tire-road friction coefficient was also not verified. Therefore, the application range (variable driving conditions) of this method still needs to be studied. Besides, the comprehensiveness of the dataset and quality of neural network training directly influences the performance of ML-based method. In addition, the relationship learnt by neural network based on dataset cannot be theoretically explained, which may sometimes cause unexpected unsatisfying performance.

Considering the advantages and limitations of the methods above, a vehicle mass estimation method based on fusion of ML and vehicle dynamic model is proposed in this paper in order to improve the estimation effect. The main contributions of this paper are as follows: (1) An ML-based method of mass estimation is designed, with different driving conditions considered. (2) Dynamics-based method of mass estimation using RLS with forgetting factor is proposed. (3) A mass estimation framework based on fusion of ML- and dynamics-based methods is proposed, and a fusion algorithm based on fuzzy logic is designed. (4) Simulation tests under New European Driving Cycle (NEDC) are carried out, with the results validating that the proposed fusion method shows significant improvement with respect to estimation accuracy, stability and robustness compared with each single estimation method.

This paper is organized as follows. Section 2 presents the vehicle mass estimation method based on ML, including the selection of the neural network input signals, generation of the training data set, pre-processing of the data set, structure of the neural network and the procedure of training. The vehicle mass estimation method based on vehicle dynamic model is analyzed in Section 3. In Section 4, the fusion method based on fuzzy logic is presented. The procedures and results of simulation tests are presented and discussed in Section 5. This paper is concluded in Section 6.

2 Vehicle mass estimation based on machine learning

2.1 Selection of the neural network input signals

The selection of neural network input signals directly affects whether it is possible to properly realize the estimation. In this paper, the input signals of the neural network are selected based on the longitudinal vehicle dynamic model. The longitudinal vehicle dynamic model is shown in Fig. 1.

Figure 1
figure 1

Longitudinal vehicle dynamic model

It can be expressed as

$$ Ma = F_{x} - F_{w} - F_{f} - F_{i}, $$
(1)

where M is the vehicle mass; a is the longitudinal acceleration, and its different signs (positive and negative) represent acceleration and deceleration of the vehicle respectively; \(F_{x}\) is driving or braking force, and its different signs (positive and negative) represent driving and braking respectively; \(F_{w}\) is the wind resistance; \(F_{f}\) is the rolling resistance; \(F_{i}\) is the component of gravity in the direction of road slope, and its different signs (positive and negative) represent uphill and downhill respectively. The vehicle longitudinal dynamic model can be expressed in detail as follows:

$$\begin{aligned} Ma =& \frac{T - \sum ( I_{i}\dot{\omega }_{i} )}{r}- \frac{C_{d}A\rho v^{2}}{2} \\ &{} - Mgf\cos \theta - Mg\sin \theta , \end{aligned}$$
(2)

where T is the total driving or braking torque, and its different signs (positive and negative) represent driving and braking respectively; \(I_{i}\) is the moment of inertia of a single wheel; \(\dot{\omega }_{i}\) is the angular acceleration of the wheel, and its different signs (positive and negative) indicate the acceleration and deceleration of the wheel respectively; r is the effective rolling radius of the wheel; \(C_{d}\) is the wind resistance coefficient; A is the frontal area of the vehicle; ρ is the air density; v is the longitudinal speed; g is the gravity acceleration; f is the rolling resistance coefficient; θ is the slope angle of the road, and its different signs (positive and negative) represent uphill and downhill respectively.

It can be seen from Eq. (2) that in order to obtain the vehicle mass, the needed dynamic information should at least include the longitudinal speed, longitudinal acceleration, driving or braking torque, wheel angular acceleration and road slope angle of the current time step, respectively denoted as \(v(k)\), \(a(k)\), \(T(k)\), \(\dot{\omega }_{f}(k)\), \(\dot{\omega }_{r}(k)\) and \(\theta (k)\), where k represents the current time step. Intelligent vehicles are equipped with high-precision sensors, such as global positioning system (GPS), inertial measurement unit (IMU), and wheel speed sensor, which can respectively provide measurement of longitudinal speed, acceleration and wheel angular speed; for connected vehicles, speed and acceleration can also be obtained with the assistance of road-side sensors [15]. The driving or braking torque can be obtained from traction control system (TCS) and anti-lock braking system (ABS) via controller area network (CAN). When the sampling time step is small, the approximate value of the angular acceleration can be derived from the wheel speed of consecutive two steps, denoted as \(\omega _{i}(k)\) and \(\omega _{i}(k - 1)\) respectively, where (\(k - 1\)) represents the last time step. Besides, the road slope angle can be estimated by analyzing speed and acceleration information [6, 16], or by using GPS information [17, 18], which will not be discussed in this paper. Because acceleration is also proved to be the most related state parameter to the vehicle mass [14], the longitudinal acceleration of the last time step is also added to the input signals, denoted as \(a(k - 1)\), to capture the temporal relationship hidden in the data [19].

To sum up, the selected neural network input signals are the longitudinal velocity, longitudinal acceleration, driving or braking torque, front wheel speed, rear wheel speed and road slope angle of the current time step, denoted as \(v(k)\), \(a(k)\), \(T(k)\), \(\omega _{f}(k)\), \(\omega _{r}(k)\) and \(\theta (k)\) respectively, as well as the longitudinal acceleration, front wheel angular speed and rear wheel angular speed of the last time step, denoted as \(a(k - 1)\), \(\omega _{f}(k - 1)\) and \(\omega _{r}(k - 1)\) respectively.

2.2 Acquisition and pre-processing of the dataset

The dataset used for training of the neural network is composed of vehicle state parameters collected in a variety of simulation experiments under different conditions [13]. The conditions are set in the CarSim-Simulink co-simulation platform. Considering the possible mass value of common passenger vehicles, a series of mass values with equal interval are chosen, namely 1200 kg, 1300 kg, 1400 kg, …, 1700 kg, 1800 kg; other parameters of the vehicle are shown in Table 1. Totally 11 different road segments with the slope angle changing in range from −5° to 5°, which covers the range of longitudinal slopes of Chinese highways [20], are shown in Fig. 2. Tire-road peak adhesion coefficient (TRPAC) is chosen from 0.2, 0.5 and 0.8.

Figure 2
figure 2

Height-distance diagram of road segment models used for experiments to get dataset for neural network training

Table 1 Vehicle parameters

In acceleration experiments, the initial speed is set to 0, the maximum speed is set to 120 km/h and the maximum simulation time is set to 100 s. The throttle is chosen from constant values (including 10%, 20%, …, 90%, 100%) and linear changing values (25% to 75%, 25% to 100%, 50% to 100%, 75% to 25%, 100% to 25% or 100% to 50%). In deceleration experiments, the initial speed is set to 120 km/h, the minimum speed is set to 0 and the maximum simulation time is set to 100 s. The brake pedal is chosen from constant values (including 0, 10%, 20%, …, 90%, 100%) and linear changing values (25% to 75%, 25% to 100%, 50% to 100%, 75% to 25%, 100% to 25% or 100% to 50%).

Simulations with every combination of the conditions mentioned above are carried out, with the sampling time step set to 0.01 s. The time series of vehicle state parameters mentioned in Sect. 2.1 collected in each experiment are combined into a dataset, and the actual vehicle mass values in the experiments are used to label the data set. The data set contains 21,732,835 samples collected from experiments under 7623 different conditions.

Because the data of different features in the original dataset have different units and magnitudes, it is necessary to normalize them before they are used for training. The min-max normalization (MMN) is applied to map all data to the range from 0 to 1 [21]. Finally, the normalized data set is randomly divided into training set with 18,000,000 samples and validation set with 3,732,835 samples.

2.3 Construction and training of the neural network

In this study, a feedforward neural network (FFNN) with one input layer, two hidden layers and one output layer is constructed and trained in Pytorch ML framework. The input layer contains 9 neurons corresponding to the 9 selected input signals mentioned above. Two hidden layers contain 1024 and 256 neurons. The output layer has one neuron corresponding to the output signal, namely the ML-based estimate of vehicle mass, denoted as \(\hat{M}_{\mathrm{ML}}\). The structure of the FFNN is shown in Fig. 3.

Figure 3
figure 3

Structure of the feedforward neural network

The method of weight initialization and forward propagation of the FFNN are designed according to [22]. The rectifier linear unit (ReLU) function is chosen as the activation functions of all neurons in hidden layers, with the form as follows:

$$ R(o_{i}) = \textstyle\begin{cases} o_{i},& o_{i} \ge 0, \\ 0,& o_{i} < 0, \end{cases} $$
(3)

where, \(o_{i}\) is the input of the ReLU function in the ith neuron.

The FFNN is trained using the gradient descent algorithm described in [23], with the learning rate of 0.001 and the batch size of 1024. To avoid overfitting, the performance over the validation set is also calculated in training process, and the training ends when the performance starts to turn worse.

Under application conditions, the needed state parameters of the vehicle are collected or calculated, then pre-processed in the same way as that of the training data, and input into the trained FFNN. The ML-based estimate of the vehicle mass, denoted as \(\hat{M}_{\mathrm{ML}}\), can then be calculated and updated.

3 Vehicle mass estimation based on vehicle dynamic model

3.1 Estimation based on RLS with forgetting factor

Vehicle mass estimation using RLS with forgetting factor is based on the longitudinal vehicle dynamic model shown in Fig. 1 and expressed as Eqs. (1)–(2). Equation (2) can be rewritten as:

$$\begin{aligned}& M(a + g\sin \theta + gf\cos \theta ) \\& \quad = \frac{T - \sum ( I_{i}\dot{\omega }_{i} )}{r} - \frac{C_{d}A\rho v^{2}}{2}. \end{aligned}$$
(4)

Equation (4) can then be transformed into the form for RLS:

$$ \textstyle\begin{cases} y = \Phi b, \\ b = M ,\\ \Phi = a + g\sin \theta + gf\cos \theta, \\ y = \frac{T - \sum ( I_{i}\dot{\omega }_{i} )}{r} - \frac{C_{d}A\rho v^{2}}{2}, \end{cases} $$
(5)

where y is the output of the system; Φ is the measurable input of the system; b is the parameter to be identified [8]. The recursive process can be expressed as:

$$ \textstyle\begin{cases} \hat{b}(k) = \hat{b}(k - 1) + L(k) [ y(k) - \Phi (k)\hat{b}(k - 1) ], \\ L(k) = \frac{P(k - 1)\Phi (k)}{\lambda + \Phi (k)P(k - 1)\Phi (k)}, \\ P(k) = \frac{1}{\lambda } [ 1 - L(k)\Phi (k) ]P(k - 1), \end{cases} $$
(6)

where k and (\(k - 1\)) represent the values of the current and the last time step respectively; is the estimated value of the parameter b; L is the gain factor; P is the covariance; λ is the forgetting factor. In this study, λ is set to 0.95, which makes the impact of the previous data gradually diminish.

Under the application conditions, the needed state parameters of the vehicle are collected or calculated in every time step, and input into the RLS algorithm. The dynamics-based estimate of the vehicle mass, denoted as \(\hat{M}_{\mathrm{DM}}\), can then be calculated and updated. It should be noted that only longitudinal dynamic model is considered above. Considering the fact that daily driving condition is mainly composed of direct-line driving, it is reasonable to temporarily stop the estimation and maintain the latest result under conditions with large lateral excitations, such as lane changing and cornering, in order to avoid invalid estimation caused by modelling error [14]. Therefore, these conditions are not discussed in this paper.

4 Fusion-based method of vehicle mass estimation based on fuzzy logic

4.1 Pre-processing of the fusion-based estimator input signals

The framework of fusion-based vehicle mass estimator is shown in Fig. 4, with the input signals including the ML- and dynamics-based vehicle mass estimate of the current time step, and the fusion-based estimate of the last time step, denoted respectively as \(\hat{M}_{\mathrm{ML}}(k)\), \(\hat{M}_{\mathrm{DM}}(k)\) and \(\hat{M}(k - 1)\).

Figure 4
figure 4

Framework of fusion-based vehicle mass estimator

When the absolute value of the longitudinal acceleration is small, the estimation result of ML-based method is greatly affected by the noise of acceleration signal, so the accuracy cannot be guaranteed. This is also the reason why the constant speed conditions are not considered in the experiments for training set. Therefore, the estimated value of the vehicle mass is set to the value of the last time step when the longitudinal acceleration is not large enough.

The dynamics-based estimate is pre-processed by judging whether the RLS algorithm has converged. The variance of the latest several values is calculated and normalized:

$$ \sigma = \sum_{i = 1}^{n} \biggl( \frac{\hat{M}_{\mathrm{DM},i} - \bar{M}_{\mathrm{DM}}}{\bar{M}_{\mathrm{DM}}} \biggr), $$
(7)

where σ is the normalized variance of the latest n estimated values; \(\hat{M}_{\mathrm{DM},i}\) represents the estimate of vehicle mass; \(\bar{M}_{\mathrm{DM}}\) is the average of the latest n estimates. When σ is less than a certain limit (e.g., 0.00001), it is regarded that the algorithm has already converged, and the estimation result is set to the value of the last time step until the next time that the vehicle starts after it stops.

4.2 Design of the fuzzy logic

The design idea of the fusion estimator based on fuzzy logic is to utilize fuzzy logic to derive the weights of the three input signals, namely \(\hat{M}_{\mathrm{DL}}(k)\), \(\hat{M}_{\mathrm{DM}}(k)\) and \(\hat{M}(k - 1)\), according to the driving condition, and then take their weighted average value as the final result, namely \(\hat{M}(k)\). Under the conditions that the reliability of a certain estimation method is high, the corresponding weight is increased; when both of the estimation methods are not so reliable, the weight of the final estimation result in the last time step is increased, so as to improve the accuracy and stability.

The input signals of the fuzzy logic system are the absolute value of the longitudinal speed and acceleration of the current time step, and the absolute value of the difference of longitudinal acceleration between the current time step and the last time step, denoted as \(\vert v(k) \vert \), \(\vert a(k) \vert \) and \(\vert a(k) - a(k - 1) \vert \) respectively; the output signals of the fuzzy logic system are the three weights mentioned above, denoted as \(w_{\mathrm{ML}}(k)\), \(w_{\mathrm{DM}}(k)\) and \(w_{k - 1}(k)\) respectively. The domains of \(\vert v(k) \vert \), \(\vert a(k) \vert \) and \(\vert a(k) - a(k - 1) \vert \) are respectively set to 0–120 km/h, 0–6 m/s2 and 0–0.03 m/s2, with the sampling time step of 0.01 s; the domain of \(w_{\mathrm{ML}}(k)\), \(w_{\mathrm{DM}}(k)\) and \(w_{k - 1}(k)\) are all set to 0–1. The membership functions of the input signals are all divided into 3 levels, namely S, M and B, representing small, medium and big respectively; the membership functions of the output signals are all divided into 5 levels, namely SS, S, M, B and BB, representing very small, small, medium, big and very big respectively. The membership functions of the input and output signals of the fuzzy logic system are shown in Fig. 5.

Figure 5
figure 5

Membership functions of inputs and outputs of the fuzzy logic

The fuzzy rules are designed based on 5 main principles listed as follows:

  • When the speed is small, dynamics-based estimation has not yet converged and the estimation result oscillates greatly, so the value of \(w_{\mathrm{DM}}(k)\) should be reduced.

  • When the acceleration of the vehicle changes rapidly, namely when \(\vert a(k) - a(k - 1) \vert \) is large, the estimation result of ML-based method oscillates greatly, so the value of \(w_{\mathrm{ML}}(k)\) should be reduced.

  • When the vehicle is at medium speed with strong acceleration, the estimation result of ML-based method usually has high accuracy and stability, so the value of \(w_{\mathrm{ML}}(k)\) should be increased.

  • Under the condition of very high speed, the estimation result of ML-based method, which is in real-time updated, is more likely to be influenced by the oscillation of the state parameter signals; the dynamics-based estimation result, which has been maintained since the estimation algorithm converged in vehicle starting process, shows by contrary better stability. Therefore, the value of \(w_{\mathrm{ML}}(k)\) should be reduced while the value of \(w_{\mathrm{DM}}(k)\) should be increased.

  • Under other conditions, the performances of the two methods are similar, so the values of \(w_{\mathrm{ML}}(k)\) and \(w_{\mathrm{DM}}(k)\) should also be set approximately equal.

The designed fuzzy rules based on these principles are shown in Table 2.

Table 2 Fuzzy rules (outputs are \(w_{\mathrm{ML}}(k)\), \(w_{\mathrm{DM}}(k)\) and \(w_{k -1}(k)\) in order)

4.3 Acquisition of the fusion-based estimation result

With ML- and dynamics-based estimates and the weights, the fusion-based estimation result can be obtained by Eq. (8).

$$ \textstyle\begin{cases} \hat{M}(k) = \sum_{i = 1}^{3} ( \hat{M}_{i}w_{i} ) / \sum_{i = 1}^{3} w_{i}, \\ \hat{M}_{1} = \hat{M}_{\mathrm{ML}}(k),\qquad \hat{M}_{2} = \hat{M}_{\mathrm{DM}}(k), \\ \hat{M}_{3} = \hat{M}(k - 1), \\ w_{1} = w_{\mathrm{ML}}(k),\qquad w_{2} = w_{\mathrm{DM}}(k), \\ w_{3} = w_{k - 1}(k). \end{cases} $$
(8)

5 Simulation tests

In order to verify the accuracy and stability of the proposed fusion estimation method, several simulation tests are carried out based on CarSim-Simulink co-simulation. The actual mass of the test vehicle is chosen from the values of 1350 kg and 1750 kg, and other parameters are the same as that of Sect. 2.2. Two models of road segments are generated for the simulation tests (see Fig. 6), with the road slope angles varying in range from −5° to 5°, which is the same as that of the training dataset. The TRPAC of Test Roads 1 and 2 are respectively set to 0.3 and 0.7.

Figure 6
figure 6

Height-distance diagram of road segment models used for simulation tests

The speed profile of the vehicle shown in Fig. 7 is generated based on the complete New European Driving Cycle (NEDC). NEDC simulates the driving process of vehicles in general urban and suburban areas, including multiple acceleration, deceleration, constant speed driving and parking stages, with the speed in range of 0 to 120 km/h. The vehicle speed is controlled to follow the desired speed according to the speed profile using a proportion-integral-differential (PID) controller. In order to simulate the fine-tune behavior of steering wheel angle for lane keeping, gaussian noise is applied as steering wheel angle input [24]. In total, 4 tests are made under the conditions as follows:

  • Test 1: vehicle of 1350 kg driving on Test Road 1.

  • Test 2: vehicle of 1350 kg driving on Test Road 2.

  • Test 3: vehicle of 1750 kg driving on Test Road 1.

  • Test 4: vehicle of 1750 kg driving on Test Road 2.

Figure 7
figure 7

Speed profile of New European Driving Cycle (NEDC)

The estimation results of the tests are shown in Fig. 8 and Table 3.

Figure 8
figure 8

Simulation result

Table 3 Simulation result

As can be seen in Table 3, the average relative estimation error of fusion-based estimation method is lower than that of each single estimation method. It should be noticed that compared with each single estimation method, the time of fusion-based method in which the error is within 5% is much longer (with the value of 80%–90%), verifying the significant advantage of robustness to various driving conditions of the fusion method. As can be seen from Fig. 8, the ML-based estimate of vehicle mass shows generally good accuracy of around 95%, but most of the time keeps oscillating, especially when the acceleration of the vehicle suddenly changes, which is especially negative for the application to control systems [25]. The dynamics-based estimate, on the contrary, shows generally better stability (except the significant oscillations when vehicle starts). This is because the estimation converges every time after the vehicle starting process and the estimation result is maintained until the next vehicle starting, so it cannot be affected by the disturbances and noises of the vehicle state parameter signals most of the time. However, the accuracy of the convergence value is not always guaranteed, depending on the excitation in starting process. In comparison, the fusion method generally shows better accuracy, stability and robustness to variable driving conditions. Compared with each single estimation method, the error is reduced by up to 3 percentage points, and the percentage of time in which the error is within 5% is increased by more than 10 percentage points. This is because it fuses ML- and dynamics-based estimation result properly, places larger weight on more reliable results and makes them complementary to each other.

6 Conclusion

In this paper, a vehicle mass estimation method based on fusion of machine learning and vehicle dynamic model is proposed for intelligent vehicles.

  1. (1)

    By constructing and training a feedforward neural network using data collected from a series of simulation experiments under variable driving conditions, the mapping relationship between vehicle mass and other vehicle state parameters is learnt, and ML-based vehicle mass estimation is realized.

  2. (2)

    The longitudinal vehicle model is established and method of recursive least square with forgetting factor is designed on the basis of this. The dynamics-based estimate of vehicle mass is then obtained.

  3. (3)

    The framework of fusion-based vehicle mass estimator is proposed. By judging the current driving condition based on vehicle state parameters, a fuzzy logic system is designed to fuse ML- and dynamics-based estimate of vehicle mass into the final estimation result.

  4. (4)

    Simulation tests with various driving conditions are carried out based on CarSim-Simulink co-simulation platform, to validate the effect of the proposed fusion-based vehicle mass estimation method. The results show that the accuracy of the fusion-based method reaches 97% (relative error of 3%). Compared with each single estimation methods, the fusion-based method shows better accuracy, stability and robustness to driving conditions. The relative error is reduced by up to 3 percentage points, and the percentage of time in which the error is within 5% is increased by more than 10 percentage points.