Coordinated Path Following Control of 4WID-EV Based on Backstepping and Model Predictive Control

: A path following control strategy for a four-wheel-independent-drive electrical vehicle (4WID-EV) based on backstepping and model predictive control is presented, which can ensure the accuracy of path following and maintain vehicle stability simultaneously. Firstly, a 2-DOF vehicle dynamic model and a path following error model are built and the desired yaw rate is obtained through backstepping. Then, a model predictive controller is adopted to track the desired yaw rate and obtain the optimal front wheel steering and external yaw moment. Meanwhile, an optimal torque distribution algorithm is carried out to allocate it to each tire. Finally, the effectiveness and superiority of the strategy is validated via CarSim–Simulink joint simulation. Results show that the strategy has higher following accuracy, smaller sideslip angle, and better yaw rate tracking.


Introduction
Autonomous vehicles [1], also known as unmanned vehicles, or intelligent vehicles are a major part of outdoor mobile robots in transportation.With sensing, signal processing, communicating and computer technologies, autonomous vehicles can identify the vehicle's situation and status by combining vision, radar, GPS, lidar, odometer, magnetic compass, and ultrasonic and on-board sensors.Then, it makes an analysis and judgment [2] according to the information from the road, vehicle position, traffic, and obstacles.Finally, the main controller receives the control request and controls the vehicle's steering and speed.
In recent decades, much research has been undertaken on a type of autonomous vehicle powered by four in-wheel-motors: the four-wheel-independent-drive electrical vehicle (4WID-EV).The advantage of 4WID-EV [3,4] is that its driving torque can be controlled independently.Path following can usually be designed based on a kinematic or dynamic model.Path following algorithms based on kinematics include pure pursuit, Stanley, and rear wheel feedback.In these algorithms, the steering angle is calculated via controlling the errors of heading angle and lateral offset.However, these algorithms are only suitable for the driving conditions that ignore vehicle dynamics.In recent years, some improved algorithms based on a kinematic model combing fuzzy control, adaptive control, or particle swarm optimization are proposed [5,6].However, the reliability and robustness of the controller will be reduced if we consider complex driving conditions.Therefore, we need to introduce algorithms based on dynamic models.The control algorithms based on vehicle dynamic models mainly include linear quadratic regulator (LQR), sliding mode control, model predictive control (MPC), and active disturbance rejection control.Simulations with LQR combined with feedforward control or adaptive preview control [7,8] show the efficiency and reliability of the proposed controllers.An automatic path-tracking controller of a four-wheel steering vehicle was designed on basis of the sliding mode control theory [9,10].A controller based on nonsingular terminal sliding and active disturbance rejection control performs well in different driving conditions [11].Several studies have applied MPC into accurate path following.For instance, a learning-based nonlinear MPC algorithm, which was based on a simple vehicle model and a learned disturbance model, was introduced to achieve efficient path tracking in dangerous off-road terrains through learning [12].However, these studies are focused on conventional vehicles.For path following of 4WID-EV, the hierarchical control structure is often adopted, which includes two controllers, i.e., upper and lower controllers.The upper controller is commonly used to obtain the steering angle and additional yaw moment.There are different control strategies applied to the upper controller, especially the model-based control method, including LQR, MPC, SMC, Hamilton energy function, and linear matrix inequality (LMI).In [13], an adaptive LQR controller for 4WIS-4WID EV is proposed, which automatically adjusts the weight matrices Q and R adapting to vehicle speed, adhesion coefficient, and phase plane.Taking the actuator saturation into account, Chen et al. [14] present a simultaneous path following and lateral stability control method for a 4WD-4WS autonomous electric vehicle.The designed upper controller based on the Hamilton energy function achieves the stability control of the vehicle.In the study by Liang et al. [15], a yaw rate tracking-based path following controller for 4WIS-4WID EV was designed using linear matrix inequality theory.Then, the generalized tracking forces are calculated by the upper controller.It is worth mentioning that various MPC theories have been adopted by researchers on path following for 4WID-EV.In [16][17][18][19], these control strategies associated with MPC are presented, including the sliding mode prediction control strategy, the robust MPC with the finite time horizon, the MPC with two sliding surfaces, and MPC combined with SMC.Among various control techniques, MPC has numerous benefits, such as consideration of complex control goals, simple control policy for complex systems, and the optimal solution obtained in receding horizon.Therefore, the MPC control strategy is adopted in our study.As for the lower controller, there are three different torque distribution methods, including the average distribution, tire-dynamic-load distribution, and optimal distribution [20].
However, most literature about path following focuses on guaranteeing tracking accuracy.In path following, especially when the vehicle passes at high speed through a bend with large curvature, it is prone to sideslipping.Thus, we must design a control strategy that takes into account both tracking accuracy and lateral stability.In this paper, we also adopt the control strategy of hierarchical structure.In the upper controller, to achieve the high accuracy path following and maintain the vehicle lateral stability, the path following problem is transformed into the yaw rate tracking problem utilizing the backstepping method and combing the 2-DOF bicycle model with the path following error model.Then, the MPC controller is developed to generate the steering angle and additional yaw moment.In the lower controller, the optimal torque distributor is developed to distribute external yaw moment to each tire.
The remainder of this paper is structured as follows.A 2-degree-of-freedom (DOF) vehicle dynamic model and a path following error model are presented in Section 2. In Section 3, the desired yaw rate is obtained via backstepping.In Section 4, the MPC and the optimal torque allocation algorithm are designed.The proposed controller and algorithm are evaluated via a joint simulation of Carsim and Matlab-/Simulink in Section 5.

The 2-DOF Model
A 2-DOF bicycle model [21] is adopted (Figure 1) for simulation and controller design.The model is simplified under three assumptions: (1) Small steering angle; (2) Constant longitudinal speed; (3) Ignores the influence of the shift of the longitudinal axle load.
The dynamic equations for the bicycle model are expressed as ( ̇+ ) =   +   (2) where z I is the moment of inertia through the center of gravity (CG) about the yaw axis, r is the yaw rate,   and   are the distances from CG to the front and rear axles, respectively, ∆  is an exteral yaw moment used to achieve the desired yaw rate,  is the vehicle sideslip angle, m is the total mass of the vehicle,   and   are the x-and y-axis velocities, respectively;   and   are the traction forces on the rear and front wheels in parallel to the x-axis of the vehicle body, respectively.∆  can be given as follows: where   is the half of the wheelbase,   is the front steering angle, and   is the longitudinal tire force of tire i.   and   are related with the front and rear tire sideslip angles,   and   , respectively: =     (5) where   and   are the rear and front tire cornering stiffness, respectively.  and   can be further given as Substituting Equations ( 4)- (7) into Equations ( 1) and ( 2), we have: Let x = [β r] T be a state variable, and u = [δf Mz] T and y be the input and output, respectively.Therefore, the state equation can be represented as follows: where

Path following Model
The path following error model [22] is shown in Figure 2, where the dashed line is the desired path for autonomous vehicles and the solid line is the reference path.In the Serret-Frenet coordinate system [23], the dynamic model of path following error for an 4WID-EV is expressed as follows where e is lateral deviation distance from the CG of a vehicle to the closest point on the ideal path,  is the error between the actual heading angle of the vehicle and the tangential direction of the ideal path, and ρ is the curvature of the ideal path.The path following aims to make e and  stabilize asymptotically with optimal inputs   and Δ  produced by MPC.Definitely, vehicle stability must be guaranteed.In other words, the sideslip angle  and yaw rate   shall track the desired value correctly.
Remark 1.On the Serret-Frenet frame [22], the lateral error can be expressed as Noticeably,  shall not be ignored when the vehicle travels at high speed.

Desired Yaw Rate
The desired yaw rate can be determined using the backstepping method [22,24]: Step 1: Define a new error variable  1 = ℎ.where  is a positive real number.The first Lyapunov function is shown as The derivative of Equation ( 14) is i.e., where ψ is a virtual control variable,  1ℎ = − 1  1 and z 2h =  −  1ℎ .Then, Equation ( 16) can be rewritten as If  2ℎ = 0, the derivative of  1ℎ is negative.When  goes to zero, then  1 = ℎ approaches zero.Then e goes to zero.
Step 2: Define the second Lyapunov function where  1 = 1/ 1 2 .The derivative of  2ℎ can be expressed as Define  2ℎ = − 2  2ℎ ℎ, where  2 is a constant and is larger than or equal to  1   .The derivative of  2ℎ can be given as If we rearrange Equation ( 20), the derivative of  2ℎ can be expressed as follows: Step 3: Define z 3h =  −   −  2ℎ ; if  3ℎ = 0, Equation ( 20) can be simplified as: In Equation ( 21), when ,  2ℎ and  1ℎ converge to zero, ψ will go to zero.
Let  3ℎ = 0, we can obtain the desired yaw rate Substituting α 2h = − 2  2ℎ ℎ ,  2ℎ =  −  1ℎ , α 1h = − 1  1 and  1 = ℎ to Equation (10), we can express r as When ke is very small, ℎ and ℎ will be approximately equal to ke and 1, respectively.Equation ( 24) can be given as The desired yaw rate is not independent, i.e., it depends on the current vehicle state and the path following error.
Remark 2. Noticeably, Equation ( 24) is derived using the vehicle kinematic model.In vehicle dynamics [25], the yaw rate and sideslip angle shall satisfy the following relationship where  is the tire-road friction coefficient and g is the gravitational acceleration.
Remark 3. The main reason for not using the standard backstepping method is that it will cause large output overshoot and complex control law expression [26].

Controller Design
The overall structure of 4WID-EV for path following is shown in Figure 3.Our control strategy is aimed to improve path-tracing accuracy while maintaining vehicle stability.Therefore, we need to determine the expected yaw rate and sideslip angle at each moment.First, we obtain the desired yaw rate from backstepping by utilizing   , φ, , and .Due to the small sideslip angle, the desired sideslip angle is assumed to be 0. MPC is designed to minimize the yaw rate error and sideslip angle error and to optimize the external yaw moment and steering angle.The optimal torque distribution block is applied to distribute the external yaw moment and generate four optimal tire forces. where and T is the sampling period.
We reconstruct the state vector , so the new state space representation is: where

 =  
,  ˜ = [  0], n and m are the dimensions of the state vector and the control vector, respectively.
After derivation, the predictive output vector can be represented as Δ = [Δ() Δ( + 1) ⋯ Δ( +  c )] T ;   and Nc represent the output prediction horizon and the control horizon, respectively.From Equation (30), it is clear that states and outputs in the predictive horizon can be calculated with the current state () and control increment Δ in the control horizon: the implementation of the predictive function in MPC.

We define the reference output vector 𝑌 ref (𝑘) = [𝜂 ref (𝑘 + 1), ⋯ , 𝜂 ref (𝑘 + 𝑁 p )]
T , so the cost function can be described as: where Q and R are weighting matrices,  is a weight coefficient, and  is a slack variable.Noticeably, the variable to be solved is the control increment.We need to translate it into a standard quadratic programming problem associated with control increment.The cost function can be transformed to the following optimal problem: ((), ( − 1), Δ()) = [Δ()   where ⊗   , ⊗ denotes Kronecker product,   is the tracking error in prediction horizon,   and   are the maximum values of input and output; ∆  and ∆  are the minimum and maximum input increment, respectively.By solving the optimal problem using Matlab function, i.e., quadprog, in each control period, we can obtain the sequence of control increment: We only take the first element of ∆  * at time t as the incremental control:

Optimal External Yaw Moment Distribution
The external yaw moment obtained from MPC will be distributed to four respective tires.There are three commonly used strategies [20,27], including the average distribution strategy, tire-dynamic-load-based distribution strategy, and the optimal distribution strategy that is adopted here.
The output torque of a motor can control the longitudinal tire force on each tire: where   is the rolling radius of the wheel.We combine Equations ( 3) and (37) and assume that   is very small.Consequently,   and   can be expressed as follows: We change   and   into the following matrix form: where According to the friction circle theory, the following relationship between tire force and vertical load can be used: where   is longitudinal rolling friction coefficient and   denotes the vertical load on each tire.Thus, the constraint condition of   is expressed as: Define tire load rate   [20,28] In Equation ( 43), the longitudinal force   is much smaller than lateral force   and thus can be omitted.Therefore, Equation (43) can be simplified as We combine Equations ( 38), (39), and (44) and define the following objective function: where   is the nonsingular weight matrix and W  =diag( ( ).
The objective function satisfies the following constraints: Combining Equation (45) with Equation ( 46) and introducing a weight coefficient , we can obtain the weighted least squares problem: Equation ( 47) can be further simplified as follows: The above optimization problems, i.e., the optimal external yaw moment distribution, can be solved using the active set method.

Simulation and Discussion
The new control strategy was established in Simulink and the high-fidelity vehicle model was provided by Carsim.To investigate the path following performance of the control strategy, we executed a double lane change maneuver in simulation.In this maneuver, the reference path composed of the lateral reference position   and reference yaw angle   can be expressed as follows [29]: Before the simulation, we need to set the vehicle parameters in Carsim (Table 1).In the simulation, the E-class Suv vehicle model is chosen, because it can be easily modified to 4WID-EV.Furthermore, the gains in the desired yaw generation are set as follows:  Two cases were implemented in the simulation.One case is used to test the effectiveness of the new controller brought by backstepping.The other case is used to verify the superiority and improvement of the controller.The total simulation time is 10 s.

Case One
In this case, the vehicle moves on a road at a low speed (40 km/h) with a high tireroad friction coefficient (0.9), i.e., dry asphalt surface.The LQR and MPC controllers are used to make the vehicle track a path of double-lane-change.The simulated lateral and heading errors are shown in Figure 5a,b.To test the path following accuracy of the two controllers, we introduce the maximum error and root mean square error [30] as follows: where N is the sample number.The maximum lateral errors of LQR and MPC are 0.0174 and 0.011 m, respectively, and their root mean square errors are 3.13 × 10 −4 and 7.73 × 10 −5 , respectively.Thus, the two errors of MPC are both less than those of LQR, indicating the MPC controller is better.
The simulated yaw rate and sideslip angle are shown in Figure 5c,d.Clearly, there is little difference between these two controllers.To maintain the vehicle stability, the yaw rate shall be less than 0.75 rad/s according to Equation ( 26) and the sideslip angle less than 0.035 rad [31].As shown in Figure 5c,d, they are both maintained in reasonable ranges, suggesting the vehicle is stable throughout the path following.In addition, a small shock occurred at the beginning, but was converged quickly.
The results of path following simulation are presented in Figure 5e.Clearly, both controllers track the desired path perfectly, but the performance of the MPC controller is better, which indicates the effectiveness of the new control strategy.
Figure 5f shows the steering wheel angle in simulation.A small shock occurred at the beginning but converged to zero at the end of the double lane change maneuver.Moreover, the steering wheel output is smooth throughout the maneuver.
Figure 5g shows the simulation result of external yaw moment.The external yaw moment of LQR shows a small shock at the beginning (Figure 5g), which does not occur with MPC.The external yaw moment of MPC is smoother during the simulation.The external yaw moment using MPC and LQR varies from −211.6 to 90.4 N•m and from −242.2 to 215.5, respectively, in the process of the double-lane-change maneuver (Figure 5g).From the energy-saving perspective, MPC is more efficient than LQR.The allocations of external longitudinal tire force are shown in Figure 5h, where superscripts L and M represent LQR and MPC, respectively.Clearly, the data are maintained in reasonable ranges using the new optimal allocation method.For the tire force allocation, it is reasonable that the tire force of outer-right wheel is maximum, and that of front-left wheel is minimal (Figure 5h).The external yaw moment is generated by differential tire forces, which indicates the effectiveness of the optimal tire force allocation strategy.
The simulation results suggest that both methods can maintain vehicle stability and MPC is superior to LQR in path following accuracy and energy-saving when the vehicle travels at low speed on a high tire-road friction coefficient road.

Case Two
This case is mainly aimed to assess the behaviors of the new control scheme under extreme conditions.In this case, we make the vehicle drive at high speed (20 m/s) on a road with low tire-road friction coefficient (0.5), i.e., on a wet asphalt surface.
The maximum positive lateral errors of LQR and MPC are 0.4964 and 0.2820 m, respectively, and their maximum negative lateral errors are 0.5419 and 0.5157 m, respectively (Figure 6a).Moreover, the maximum heading angles of LQR and MPC are 3.6 and 2.2 degrees, respectively (Figure 6b).Therefore, the accuracy of the MPC controller is superior over that of the LQR controller.Figure 6c,d demonstrates the simulation results of yaw rate and sideslip angle in this case.To maintain the vehicle stability during the path following, we shall limit the slip angle and yaw rate within [−5,5]° and [−0.22,0.22], respectively, according to Equation (26).The yaw rates of MPC and LQR vary from −0.15 to 0.19 rad/s and from −0.22 to 0.22 rad/s, respectively (Figure 6c), which are in the reasonable region and a little larger than the maximum yaw rate, respectively.As for the sideslip angle, it is maintained in the reasonable region for two controllers.Noticeably, both yaw rate and sideslip angle show transient abrupt change with LQR between 2 and 4 s, which is because of some requirements for the control input.In fact, the vehicle is turning from one lane to another.In comparison, there is only a small abrupt change between 2 and 4 s for MPC.In addition, the yaw rate and sideslip angle in Case 2 are significantly larger than those in Case 1.In conclusion, MPC much outperforms LQR in terms of yaw rate and sideslip angle at high speed.
Figure 6e shows the path following results.A double lane change object was completed.Noticeably, the backstepping method can effectively reduce the bound of the lateral offset.The details of hyperbolic projection can be found in [23].As shown in Figure 6e, the maximum lateral error occurs at a longitudinal distance of 90 m and the path following accuracy of MPC is higher than that of LQR.However, compared with Figure 5e, the path following accuracy of the two techniques in Case 2 is significantly reduced.The main reason is that when the vehicle turns sharply with an increase in speed or a decrease in tire-road friction coefficient, the tires of the vehicle easily enter the nonlinear region, resulting in an increase in vehicle modeling error.
Figure 6f,g depicts the simulation results of control inputs viz.steering angle and external longitudinal force.The control inputs for the two techniques are kept in reasonable ranges.The control inputs for MPC are both smaller than those for LQR.The steering wheel angle for MPC changes smoothly throughout.

Conclusions
The path following problem for 4WID-EV was addressed by considering the optimal tire force allocation.A control strategy based on backstepping and MPC was designed.The backstepping was used to generate the desired yaw rate, which is related to both vehicle state and path following errors.The MPC can acquire the steering angle and external yaw moment and keep lateral vehicle stability.Finally, the external yaw moment was assigned to each tire utilizing the optimal allocation method.The performance of the new controller was validated using a double lane change maneuver on the Simulink-CarSim platform.Simulations show the performance of MPC is improved greatly compared with the LQR controller, and the path following accuracy is weakened with an increase in speed and a decrease in tire-road friction coefficient.Nevertheless, during the controller design based on backstepping and MPC, the influences of unknown disturbance and model parameter uncertainties are ignored, which are left for our next study.

Figure 2 .
Figure 2. The path following error model.

Figure 3 .
Figure 3. Overall structure of 4WID EV for path following.