Stability Based on Hardware-in-the-Loop Test

With the rapid development of the vehicle chassis control and autonomous driving technology, it is more and more urgent to realize the active steering technology of autonomous driving stability control. Under emergency conditions, the adhesion constraints, the model uncertainty, and the strong nonlinearity of vehicle bring great challenges to active steering control. In this paper, a model predictive control method for an active steering system based on a nonlinear vehicle model is proposed to solve the problems of adhesion constraint, model uncertainty, and external disturbance in the active steering system. Based on the real-time measurement of vehicle state, a new optimization method is proposed in this paper, which has good performance in dealing with the uncertainty and nonlinearity of the model. +e control method transforms the constraint problem into quadratic programming and nonlinear programming. In order to ensure the control accuracy when the vehicle enters the nonlinear area, the control model is built with the combination of the nonlinear tire model and the 2DOF model. +e control model is built based on Simulink, and the effectiveness of the controller is the verified joint simulation of Simulink and CarSim.+e hardware-in-the-loop (HIL) test bench based on LabVIEW RT is built and tested in order to verify the feasibility and real effect of the controller. Simulation and HIL test results demonstrate that, compared with PID controller, the model predictive controller can accomplish the driving task well and improve the vehicle handling stability.


Introduction
e vehicle stability can be easily affected by the large lateral winds or other unpredictable conditions when running on a slippery road surface. In this situation, the ordinary driver may operate the vehicle improperly with panic so that vehicle goes into a state of instability. With the rapid development of the vehicle chassis control and autonomous driving technology, it is more and more urgent to realize the active steering technology of autonomous driving stability control [1]. Active front steering (AFS) is one of the main technologies in vehicle active safety and intelligent control systems [2], and it helps the driver to enhance the vehicle stability and maintain the vehicle mobility by generating additional front-wheel angle [3,4]. AFS indirectly controls the vehicle's yaw rate through adjusting the steering wheel angle which can greatly improve the stability of the vehicle. In addition, the correction of the front-wheel angle is a continuous process that will not reduce the ride comfort and can ensure the lateral stability [5].
For AFS control strategies, a large number of relevant studies have been done by many scholars at home and abroad. Classical control theories, modern control theories, and advanced control theories have been applied to the studies on AFS systems one after another. e classical control theory is applied to AFS system for the first time.
Considering the constraints of ground adhesive force, Li and Yu [6] designed the chassis steering and braking integrated controller using fuzzy PID. Chu et al. [3] used PID to implement AFS control and then used genetic algorithm to design the integrated controller for active steering and ESP. Based on the fuzzy PID, Jin et al. [7] devised the AFS controller to enhance the vehicle's stability under varieties of disturbances. ese AFS control systems based on classical control theories can greatly improve the vehicle's operating stability and then the modern control theories are applied to further develop the AFS control. Peng and Chen [8,9] achieved vehicle stability control through four-wheel steering and direct yaw moment control to ensure safe driving. Li et al. [10] designed active disturbance rejection controller to obtain better control effect, improving the route maintenance capacity. Huo et al. [11] proposed a linear steering system based on genetic algorithm to optimize BP neural network. e above researches can significantly enhance the vehicle's handling stability. In order to further improve the anti-interference ability of the controller, robust control theories are applied to the active steering research by more scholars. Wu et al. [12] designed a robust controller to coordinate the contradiction between the performance and stability of the controller. It improved the controller's performance and robustness by compensating vehicle parameter uncertainty. Tan et al. [13] researched the vehicle stability control based on H ∞ control and designed the AFS controller for the driver's lane maintenance. Wang et al. [14] devised the active front steering robust controller applied to the vehicle, and the controller availably resisted external interference, ensuring the system's robustness. Zhao et al. [1] studied the AFS system based on hybrid H 2 /H ∞ control, improving and optimizing the anti-interference capacity of the system. Considering the uncertainty of the model and the influence of external interference, the AFS robust controller is designed to effectively improve the robustness of the controller [15,16]. e above research can improve the stability of the vehicle and ensure the robustness of the system. In order to further solve the control of the restraint system and improve the robustness, the model predictive control of active steering system has been studied by many scholars. Model predictive control (MPC) is an effective control strategy to solve the optimal control of the constraints [17][18][19][20]. e MPC is an optimal control method developed from the Bellman optimal control theories [21]. As it performs well in handling the problems of nonlinearity, uncertainty, and constraints of the vehicle dynamic model, many studies have used MPC control method to solve the AFS problem. Jalali et al. [22] studied the hierarchical control of AFS and differential braking and designed the MPC controller. For the vehicle stability control problems with ground adhesive constraints and motor drive force constraints, Ren et al. [23] designed the MPC controller for hierarchical control of AFS and driving torque. Zhao et al. [24] studied the integration of electric power steering and AFS and developed an AFS system with coupled force and displacement control, achieving the harmonization of the safety and flexibility of vehicles.
Because there is a gap between the steering model used in the algorithm design and the actual steering system, the true effect of the algorithm cannot be verified. erefore, considering the constraints of ground surface adhesion and the influence of model uncertainties, an MPC controller with the desired yaw rate as the tracking target is designed in this paper. Finally, the true control effect is verified on the steering hardware-in-the-loop test bench.
Model predictive control is widely used in the industrial production field. is control method adopts receding horizon optimization to predict the system state of a period of time in the future and obtain the control input that minimizes the objective function. As an effective control method, MPC control solves the constraints problem by converting the constraints into the quadratic programming and nonlinear programming. e contributions of this article are as follows: (1) In this paper, the ground adhesion is regarded as the hard constraints to the control system, and the stability control problem can be described as a limited tracking problem. And the time-varying linear model predictive AFS controller is designed to obtain the optimization solution method for the constrained active steering system. (2) In this paper, the hardware in the ring testbed is built, and the MPC controller is applied to the testbed, and the real control effect is obtained. e experimental results show that the designed active steering controller has a good control effect.

System Modeling and Problem Statement
In order to design a controller for AFS, a nonlinear model based on vehicle dynamics is developed in this section, which consists of vehicle model and tire model. Symbols of the vehicle model are shown in Table 1.

System Modeling for Control Design
In order to facilitate the study of the characteristics of vehicle handling stability, this paper simplifies the vehicle model into a two-degree-of-freedom vehicle model, which only considers the motion state of the vehicle along the horizontal direction of the y-axis and around the z-axis. In this paper, the influence of the longitudinal force of the tire is ignored, and only the influence of the lateral force on the stability of the vehicle is considered, so the longitudinal speed is 0. On the basis of vehicle dynamics theories in [25], a simplified model of vehicle with two degrees of freedom is presented in Figure 1. e model's motion differential equation is where F y,f and F r,f are the lateral force of the front and rear tires, respectively. Considering that the front-wheel angle δ f of the vehicle is relatively small, there is an approximate relation cos δ f � 1.

Tire Model.
In this paper, the influence of tire's longitudinal forces was ignored, and the side forces of tires were calculated by Pacejka tire model in the pure sideslip 2 Mathematical Problems in Engineering condition [26]. e calculation formula of tire lateral force is expressed as follows: where the variable α is the tire sideslip angle; a 0 � 1.5; a 1 � 0; a 2 � 1050; a 3 � 1200; a 4 � 7; a 5 � 0; a 6 � 0.2. e tire sideslip angles and vertical load of the front and rear wheels are written as However, the nonlinear vehicle model is too complex to be written as a state-space form with which the controller can be designed. We simplify the model and deal with tire nonlinearity by the method of local linearization in this paper.
At each sampling moment, the lateral forces of front and rear tires were locally linearized, and the linearized tire force equation was obtained as follows: where i � f, r represents the front and rear wheels; C * i is the cornering stiffness of the tire at the front-wheel slip angle α * i . e data C * i is updated once at each sampling time, and the calculation formula is written as where F * y,i is the lateral force of the current tire side angle α * i . By substituting (3)-(5) into (1), the system of the vehicle dynamics can be expressed as follows: e model is of second order with state vector as X � v y ω r T , with the steering angle U � [δ f ] as control input, and with the yaw rate as output (y � ω). d � d(t) is white Gaussian noise input matrix.G 0 is road irregularity coefficient. e longitudinal velocity of the vehicle is constant because the longitudinal force of the tire is ignored. One has

Nominal Yaw Rate.
e nominal state value of vehicle is also called the expected state value of the vehicle, which is determined by the vehicle predictive model, the driver's input, and the changing driving environment. In order to keep the vehicle stable, the active front steering controller Distance from the center of gravity to front or rear axle C f , C r Cornering stiffness at front or rear each tire In the active front steering controller, the target value of the yaw rate is set to the yaw rate response value of the 2DOF vehicle model [27]. It is shown that After considering the influence of the ground adhesion, formula (8) is modified as When the upper limit is too high, the vehicle may enter the nonlinear zone before reaching the boundary. Further correction for the nominal yaw rate can be written as

Nominal Vehicle Sideslip Angle.
In the research of vehicle active front steering control, there are two kinds to determine the nominal sideslip angle of vehicle. e first point considers that setting the target vehicle sideslip angle to 0 conforms to the driver's expectation; the second point is that the expected sideslip angle is calculated by the linear 2DOF model; that is to say, the response characteristics of the 2DOF model accord with the driver's expectation. If the target vehicle sideslip angle is set to zero, it will cause the controller unnecessary intervention control. e second method of determining the vehicle sideslip angle accords with the actual driving features; therefore, this article uses the second method.
By using the linear 2DOF model, the vehicle sideslip angle is calculated as follows: Similar to the yaw rate, the effect of surface adhesion should be considered to correct the nominal vehicle sideslip angle as follows:

Model Predictive Controller Design
In this section, we present a model predictive controller to solve the above active front steering tracking problem. First, the vehicle control model is discretized. en, the predictive equation is deduced and the predictive output is obtained. Finally, the optimal control sequence is solved. e brief active front steering control scheme is shown in Figure 2.

Discretization of Vehicle Model.
In the practical application, the controller runs at a certain time interval, so the continuous-time system model can be transformed into a discrete-time system model in order to establish the controller. e discrete-time system is obtained as follows: where where T s is the sample time for the system.

Predictive Output Equation and
Optimization. In order to introduce integrals to reduce or eliminate static errors, rewrite (13) in an incremental form. e predictive functions are described as Let the predictive horizon and control horizon be n p and n c , respectively, and n c < n p . To derive the system predictive equation, we need to make the following assumptions: (1) Controlled variables do not change beyond the control horizon: (2) Predictable interferences do not change after time step k: e predictive output of the system is as follows: Mathematical Problems in Engineering Define the predictive output and control input of the system at time step k as According to (13), the predicted outputs of the system in the next n p steps can be formulated as where Model predictive controller Reference model CarSim vehicle model Driver Figure 2: AFS stability control structure.

Mathematical Problems in Engineering
Longitudinal acceleration and lateral acceleration are limited by the ground adhesion and have the following relationships: ������ where a x and a y are longitudinal acceleration and lateral acceleration, respectively. Considering the speed of the vehicle being a constant, (22) can be further simplified as In this paper, the solver will dynamically adjust the constraint condition according to the solution of each control cycle. As shown in a y,min − ε ≤ a y ≤ a y,max + ε, (24) where a y,min and a y,max are the acceleration constraint. Introducing the relaxation factor into the objective function, the formula is depicted as follows: where ρ is the relaxation factor. e reference output is R as follows: where Γ y and Γ u are weighted matrices of output and control inputs, respectively, as follows: Γ y � diag Γ y,1 , Γ y,2 , . . . , Γ y,n p , Optimal control sequence for constrained optimization problems and the incremental form of the sequence can be written as (28) e first sample of u * m can be used to compute the optimal steering angle control law:

Simulation Results and HIL Implementation
In this section, firstly, the control feasibility and effectiveness of the controller are verified by the joint simulation of CarSim and Simulink. en, the hardware-in-the-loop (HIL) was tested on the test bench, and the real control effect of the controller was obtained. e double lance change (DLC) is chosen for the simulation and test conditions.

Simulation Results.
In order to evaluate the performance of the proposed model predictive controller, a simulation of emergency avoidance is carried out. CarSim's parameters are set as follows: A-class car is chosen as the simulation experimental vehicle and the vehicle speed is set to a constant speed of 120 km/h. A vehicle without control means that there is no function of yaw stability. To compare control effects better, the simulation experiments of the model predictive control, PID control, and uncontrolled control are carried out. e comparison of the simulation data is shown as follows. Figure 3 shows the comparison curves of vehicle state parameters under the three control modes. It can be seen from Figures 3(a) and 3(b) that the movement track of the uncontrolled vehicle deviates largely from the target path, and the steering angle exceeded the limit. e vehicle with active front steering controller can follow the target path, but the PID controller overshoot is larger due to the accumulated error. Compared with the PID controller, the MPC controller has better response and stronger anti-interference ability. Figure 3(c) is the comparison curve of the lateral acceleration of the vehicle. It can be clearly seen that the lateral acceleration of the vehicle without the active steering controller cannot converge, which proves that the vehicle is seriously unstable and unable to run normally. e vehicles with active steering controller can drive steadily, while vehicles with MPC controller have smaller overshoot and more stable running. It proves that MPC controller can improve vehicle stability and driving safety very well. In Figure 3(d), the yaw rate of the uncontrolled vehicle has exceeded the 20°/ s during 5 s∼6 s, proving the vehicle has lost its stability. e model predictive controller adjusts the vehicle to stable state during 10 s and holds it. e vehicle with active front steering controller is always in stable state, but the model predictive controller has better effect than PID controller. Because the PID control has little robustness and the external disturbances input may result in violent vibrations of the vehicle at high speed, PID controller's control effect is slightly poorer. Figure 3(e) is the contrast curve of the sideslip angle of the vehicle's center of mass. It can be seen clearly that the vehicle state parameters controlled by MPC controller are smoother, which proves that the vehicle runs smoother and can control the vehicle's rapid stability.

HIL Implementation.
In order to verify the real control effect of the controller, an HIL experimental setup based on LabVIEW is built. By combining the real steering system with the vehicle simulation and road model, the HIL experimental setup is built to evaluate the performance of the designed controller. e deviation between the actual steering angle measured by Bosch sensor and the expected steering angle is taken as the control target and the motor is driven by the driver signal generated by the controller. e controller model is established by Simulink and then  e results show that the uncontrolled steering column angle increases sharply at 5 s and the vehicle loses its lateral stability. e change range of the steering angle with both control strategies is small; however, the experimental data obtained by model predictive controller is better than that of PID. HIL test results show that both the MPC controller and the PID controller can successfully complete the DLC task, and the MPC controller has better path tracking performance. e optimization process of the model predictive control strategy is not conducted offline but repeated and conducted online. In addition, it can take the uncertainties by model mismatch and interference into account and timely make up for them.
Figures 5(c) and 5(d) show the lateral acceleration and yaw rate of the vehicles. It can be seen that, from the diagram, the vehicle's yaw rate without the controller has exceeded the limit and the vehicle has lost its stability. Compared with PID controller, the variable range of vehicle yaw rate of model predictive controller is smaller. e model predictive controller responds faster than the PID controller. Due to the accumulation of errors in PID control, the closed-loop system becomes sluggish and easily to generate vibration; compared with PID, the rolling optimization strategy adopted by the model predictive control can repeatedly correct the prediction deviation online, thus to improve the stability of the system. Figure 5(e) is the comparison of vehicle sideslip angle data. It is obvious that the vehicle sideslip angle overshoot without active steering controller is serious. It breaks through the normal vehicle state value at 4S and cannot return to the normal value. e overshoot of the vehicle sideslip angle controlled by MPC is smaller at the peak value than that of the vehicle controlled by PID, so the MPC controller can improve the vehicle stability better. It can be proved that the control performance of MPC controller is better than that of PID controller. Figure 6 shows the current of motor and root mean square value of motor currents under three control modes. Figure 6(a) shows the motor current data controlled by MPC. It can be clearly seen that the current is within the range of ±15 A and can drive the steering motor to rotate normally and smoothly to assist the driver to control the vehicle. Figure 6(b) is the motor current data controlled by PID. It can be seen that the current is within the range of ± 20 A, and the shaking situation of the steering column when the motor drives affects the operator's operating comfort. Figure 6(c) shows the motor current without control. It can be seen that the current value has exceeded ± 20 A at 6 s, and the motor cannot be normally driven, so that the vehicle is out of control and cannot run normally. Figure 6(d) shows the root mean square value of current under the three control modes, which can reflect the energy  consumed. It can be seen that the MPC controller consumes the least energy, which can ensure the control effect and give consideration to the optimal energy consumption at the same time. PID controller takes second place, although it can achieve the control goal to achieve the requirements of vehicle stability control, but it needs to consume too much energy. e energy consumption without controller is the most, which proves that the steering system has completely lost its maneuverability and the vehicle cannot run normally.

Conclusions
is paper presents and studies a new yaw stability control strategy for active front steering system. e main contributions are as follows: (1) e model predictive control strategy of the active front-wheel steering system is derived by using the linear optimal theory to improve the lateral stability of the vehicle. On this basis, a model predictive controller is designed to deal with multivariable optimization problems with constraints. (2) e HIL experimental device was established based on LabVIEW RT, and the controller was tested on the experimental platform in combination with the hardware to verify the actual control effect. e designed model predictive controller can effectively resist interference and improve the robustness of the controller. It can safely complete the driving task and improve the vehicle's maneuvering stability.
In the future, we will further study and design a vehicle AFS model predictive controller equipped with wirecontrolled steering system and apply it to the actual vehicle test.

Data Availability
No data were used to support this study.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.

Authors' Contributions
Jian Wang and Jian Wu conceived and designed the experiments; Jian Wang wrote the initial paper; Jun Yang and AIjuan Li performed the experiments; Shifu Liu analyzed the experiment data. All authors read and approved the final manuscript.