Trajectory Tracking Control Design for 4WS Vehicle Based on Particle Swarm Optimization and Phase Plane Analysis

: With the rapid development of today’s society, the traffic environment has become more and more complex. As an essential part of intelligent vehicles, trajectory tracking has attracted significant attention for its stability and safety. It is prone to poor accuracy and instability in extreme working conditions like high speed. In this paper, a trajectory tracking control strategy to ensure lateral stability at a high speed and low attachment limit conditions is proposed for distributed drive vehicles. The model predictive controller (MPC) was used to control the front wheel angle, and the particle swarm optimization (PSO) algorithm was designed to optimize the MPC control parameters adaptively. The sliding mode controller controls the rear wheel angle, and the vehicle instability degree is judged by analyzing the β − . β phase plane. The controllers of different instability degrees are designed herein. Finally, a torque divider is designed to consider the actuation anti-slip. The designed controller is verified by Carsim and MATLAB-Simulink co-simulation. The results show that the trajectory tracking controller designed in this paper effectively improves the tracking accuracy under the premise of ensuring stability.


Introduction
In today's society, with the rapid development of intelligent technology, the automobile industry is also developing rapidly.The number of cars is increasing, and the traffic environment is becoming more and more complex.As one of the critical technologies of autonomous driving, trajectory tracking performance should be superior.However, accuracy and vehicle stability need to be ensured during tracking.When the vehicle is on the ground with low adhesion or high speed, it often appears unstable.Ensuring vehicle stability under extreme conditions is a considerable challenge.
Global scholars have conducted in-depth research on autonomous driving path tracking, such as PID control [1], fuzzy control [2], model predictive control (MPC) [3], sliding mode control (SMC) [4], and other methods, to design a tracking controller to track the reference trajectory and ensure tracking accuracy.
MPC uses the current system state, the existing model, and the future control quantities to predict the future output of the system.MPC can solve the problems caused by the conventional path following control and accurately track the target path while considering the dynamic constraints of the vehicle [5,6].For example, Ye et al. [7] designed a linear model predictive control strategy with soft constraints.The application principle of MPC in vehicle path tracking is to track the target path by establishing a vehicle dynamic model and considering various vehicle dynamic parameters.The front wheel angle or vehicle speed is used as a control variable.The control variables are optimized on a rolling basis, and the feedback correction is kept constant.Although these control algorithms can track the target path, some vehicle dynamic factors are not considered in the controller design process.For example, Tang et al. [8] proposed a trajectory tracking method for uncrewed vehicles that combines model predictive and PID control.Tian et al. [9] designed the MPC control method for the force-driven switching strategy based on the maximum tire lateral force and the zero moment method.
SMC is one of the classical nonlinear control strategies capable of generating discontinuous control and moving the system along a predetermined sliding mode trajectory.Due to the variable structure property of sliding mode control, parameter uncertainties and disturbances do not affect the controller.At the same time, sliding mode control has the advantages of a fast response, a high accuracy, and strong robustness [10].For example, Liu et al. [11] proposed a lateral control system for active front wheel steering (AFS) and direct yaw moment control (DYC) based on second-order sliding mode control of the super-torsion pendulum, which reduces the chattering phenomenon of conventional sliding mode control.In addition, Wu et al. [12] applied the extended disturbance observer to the sliding mode control so that the steering system had the feedforward compensation function.Nayl et al. [13] designed a new type of continuous sliding surface to reduce chattering.Xing et al. [14] designed a non-singular terminal sliding mode control based on a recurrent neural network structure to improve the trajectory tracking performance.
Compared with the traditional front wheel steering vehicle, the four-wheel steering technology has the vehicle's front and rear four wheels participate in the steering motion together, thus improving the handling stability of the vehicle in high-speed steering and the maneuvering flexibility in low-speed turning.Depending on its actuators, four-wheel steering technology can be divided into four-wheel active steering (4WAS) and four-wheel independent steering (4WIS).In these technologies, the driver controls the front wheel steering of 4WS, according to the road conditions, and the rear wheel angle is determined by the vehicle state and the input of the front wheel driver through the controller.However, in 4WAS and 4WIS, the wheel angle is obtained by comprehensive judgment based on the driver's steering input and the vehicle state input to the controller.The first incarnation of 4WS technology dates back to 1980, when it was introduced in Japan.Compared with 4WAS and 4WIS, 4WS is one of the most widely studied and applied technologies, and many control strategies and methods are based on 4WS technology [15][16][17].Chen et al. [18] used a linearization method to simplify the 3-DOF nonlinear vehicle model of 4WS moderately, retaining the coupling characteristics of the vehicle model in terms of driving/braking and the wheel angle, and designed a decoupler of the 4WS vehicle system to realize the decoupling control of the vehicle.Marino [19] designed a dynamic decoupling controller for 4WS vehicles, which is also a simplification of the 3-DOF nonlinear vehicle model.Unlike this, the decoupling controller does not require the observation or estimation of the lateral velocity but implements the decoupling of the yaw velocity and the lateral velocity through the input of additional front wheel angle and rear wheel angle.
In addition, many studies have been conducted by other scholars.Hima S et al. [20] designed a trajectory tracking controller based on horizontal and vertical decoupling.The nonlinear problem in the model is alleviated by PID control with feedback and adaptive control.Y. Jeong et al. [21] and H. Yang [22] et al. designed trajectory tracking controllers for four-wheel steering vehicles, which improved the tracking accuracy compared to front wheel steering vehicles but did not consider the vehicle speed or road conditions.Some other researchers have designed trajectory tracking based on predictive tracking theory and have designed more accurate trajectory tracking simulators by optimizing the preview or direction control [23][24][25].For example, Chen et al. [26] proposed a kind of driver direction control model based on trajectory prediction on the basis of the assumption that the driver has the ability to predict the vehicle trajectory.We have analyzed the literature cited above as shown in Table 1.

Ref. Approach Limitations
Tang [8] The kinematic MPC is used to deal with the road curvature disturbance, the yaw rate PID feedback control is used to eliminate the uncertainty and modeling error, and the vehicle sideslip angle compensator is used to correct the kinematic model prediction.This strategy improves the control accuracy and ensures vehicle stability.
The control parameters, such as Q and R, in the MPC controller are fixed values, therefore, adaptive control cannot be achieved.
Liu [11] A force-driven switched MPC path following the control strategy is proposed to coordinate the active front wheel steering and external yaw torques.This strategy improves the control accuracy and ensures the stability of the vehicle.
This paper only considers the trajectory tracking and stability control under constant speed, however, in practice, the vehicle speed is variable, and the adaptive control of the vehicle speed is not realized.
Chen [18] Quasi-linearization techniques are used to simplify the vehicle model, which preserves the inherent coupling effects between the longitudinal acceleration/braking force, steering angle, and vehicle state.Based on this model, an input-output decoupling controller is proposed.
The complexity of the control strategies might pose challenges in real-world implementation and calibration.
Hima S [20] In this paper, the decoupling design method of the longitudinal and lateral controllers is used.For the longitudinal controller, the proportion containing the feedforward term is used.On the other hand, an adaptive backstepping method is used in the lateral case to deal with the nonlinearity and parameter uncertainty of the model.
The influence of vehicle speed and road conditions on vehicle stability is not considered, and different control strategies should be divided for different stability degrees.
In this paper, a trajectory tracking control algorithm based on distributed driving is designed for 4WS vehicles.Based on the distributed drive stability control strategy, it gives full play to the advantages of the distributed drive chassis system, solves the problem of vehicle trajectory tracking under extreme working conditions, and realizes the design of a trajectory tracking control algorithm for multi-objective coordinated control.The specific contributions are as follows: (1) The particle swarm optimization (PSO) algorithm is used to optimize the MPC controller.Q and R are the primary weight coefficients in the MPC control process.The PSO algorithm is used to optimize and adjust the weighting coefficients, the fitness function is iteratively reduced until the iteration number requirements are met, and the optimization is stopped to realize the goal of adaptive optimization of the MPC control parameters.
(2) In the sliding mode controller of the rear wheel angle, a sliding mode surface referring to the PID controller is designed, and factors such as driving anti-slip are considered in the torque distributor so that the torque distribution of each wheel is more reasonable.
(3) An improved phase plane stability judgment method is designed to judge the instability degree of the vehicle in real-time, and different partition controllers are designed according to the instability degree to control the additional yawing moment.It is verified that the tracking accuracy can be improved while ensuring the vehicle's stability.

2-DOF Vehicle Dynamics Model and Ideal Reference Model
Due to the simplification of the vehicle structure, the 2-DOF dynamics model is widely used to analyze vehicle-related problems.In the 2-DOF model, the left and right wheels of the vehicle are considered as a whole, as shown in Figure 1 below.The distributed drive vehicle can independently control the torque of the four steering wheels to achieve four-wheel steering control.In addition, controlling the direct yaw moment is necessary to ensure stability.Therefore, the 2-DOF model can characterize the lateral motion of the vehicle and is suitable for this study [27].
distributed drive vehicle can independently control the torque of the four steering wheels to achieve four-wheel steering control.In addition, controlling the direct yaw moment is necessary to ensure stability.Therefore, the 2-DOF model can characterize the lateral motion of the vehicle and is suitable for this study [27].Based on the 2-DOF model in the figure, the longitudinal velocity of the car along the x-axis direction is assumed to be constant, and only the lateral motion of the vehicle on the y-axis and the yaw motion around the z-axis are considered.In order to obtain the ideal front wheel angle, the influence of air resistance, suspension, and rear wheel angle is not considered.
The lateral motion of the vehicle is shown in Equation (1).
m( ) cos The yaw motion of the vehicle is shown in Equation (2).
where F yf and F yr are the lateral reaction forces of the ground to the front and rear wheels, respectively.a and b are the distances between the center of the mass of the vehicle and the front and rear axles, respectively.δ f is the front wheel angle; ω is the car's yaw rate; I z is the moment of inertia of the vehicle around the z-axis; and v x and v y are the forward and lateral speeds of the vehicle, respectively.In the classic 2-DOF vehicle model, the longitudinal force of the tire is usually ignored when analyzing the lateral dynamics.However, in the research of MPC trajectory tracking control, the front wheel angle is assumed to be small for calculating the speed, and the influence of the longitudinal force of the tire is also ignored to simplify the model.Therefore, in this paper, the front wheel angle is assumed to be a slight angle, and Equations ( 1) and ( 2) can be deduced.Based on the 2-DOF model in the figure, the longitudinal velocity of the car along the x-axis direction is assumed to be constant, and only the lateral motion of the vehicle on the y-axis and the yaw motion around the z-axis are considered.In order to obtain the ideal front wheel angle, the influence of air resistance, suspension, and rear wheel angle is not considered.
The lateral motion of the vehicle is shown in Equation (1).m( The yaw motion of the vehicle is shown in Equation (2).
where F yf and F yr are the lateral reaction forces of the ground to the front and rear wheels, respectively.a and b are the distances between the center of the mass of the vehicle and the front and rear axles, respectively.δ f is the front wheel angle; ω is the car's yaw rate; I z is the moment of inertia of the vehicle around the z-axis; and v x and v y are the forward and lateral speeds of the vehicle, respectively.In the classic 2-DOF vehicle model, the longitudinal force of the tire is usually ignored when analyzing the lateral dynamics.However, in the research of MPC trajectory tracking control, the front wheel angle is assumed to be small for calculating the speed, and the influence of the longitudinal force of the tire is also ignored to simplify the model.Therefore, in this paper, the front wheel angle is assumed to be a slight angle, and Equations ( 1) and ( 2) can be deduced.
where α f and α r are the lateral deflection angles of the front and rear wheels, respectively; k 1 and k 2 are the lateral deflection stiffness of the front and rear axes.Equation (3) can be rewritten into a differential motion equation after derivation, as shown in Equation (4).m( where β is the lateral deflection angle of the center of mass. The ideal reference model is used to describe the lateral motion of the vehicle at a steady state when the front wheel angle is minimal and can be neglected.In this case, the yaw rate is the ideal yaw rate, and, at the same time, the ideal center of mass lateral angle can be calculated.Since the front wheel angle is ignored, the vehicle is performing a uniform circular motion, therefore, .v y and .ω are zero, and joint Equation (4) can be obtained as follows: The stable yaw rate, with respect to v x and δ f , can be determined as follows: Due to the influence of the road adhesion coefficient µ, the vehicle should meet a y ≤ µg while driving, and the motion state of the vehicle should meet the following requirements: When the vehicle is in steady state, the value of β is negligible, therefore, a y = ω r v x is desirable.Since many influencing factors exist in practice, a 15% stability margin can be processed.Taking the ideal centroid sideslip angle to be zero, the desired ideal yaw rate and centroid sideslip angle can be obtained as follows: where L is the front and rear wheelbase; µ is the road adhesion coefficient; ω r is the actual yaw rate; ω d and β d are the ideal yaw rate and the centroid, respectively; and g is the acceleration of gravity.

Design of Trajectory Tracking Control System
Figure 2 shows a frame diagram of the proposed trajectory tracking control system.The vehicle obtains the target road information and the real-time state parameters of the vehicle through the planning layer, which are input into the MPC, and the ideal front wheel angle is obtained by PSO optimization calculation.At the same time, the ideal yaw rate, the actual yaw rate, and the actual yaw angle are obtained by the ideal reference model as the control input of the sliding mode controller.The stability controller is designed based on the sliding mode control theory, the rear wheel angle is calculated, and the additional yaw moment based on the yaw rate and the yaw angle of the center of mass is obtained.In the stability controller of the phase plane method, the instability degree of the vehicle is identified according to the β − .β phase plane of the vehicle, and the additional yaw moment ∆M is calculated according to the designed partition controller.PID control is used to track the target vehicle speed and solve the driving force F t .Finally, a torque distributor is designed to distribute the torque of the in-wheel motor of each wheel according to ∆M and F t and considering the driving anti-slip and other factors.
is obtained.In the stability controller of the phase plane method, the instability degree of the vehicle is identified according to the β − β ̇ phase plane of the vehicle, and the additional yaw moment ΔM is calculated according to the designed partition controller.PID control is used to track the target vehicle speed and solve the driving force F t .Finally, a torque distributor is designed to distribute the torque of the in-wheel motor of each wheel according to ΔM and F t and considering the driving anti-slip and other factors.

Design of MPC Controller
When tracking the reference path, the vehicle has the following relationship: where φ is the actual heading angle of the vehicle and Y is the lateral position of the vehicle in the geodetic coordinate system.
Combined with Equations ( 4) and ( 9), it can be transformed into the form of state space equation, where the state quantity is x = [v y , ω, φ, Y], the control quantity is μ = δ f , the output quantity is y = [φ, Y], and the state space equation is Equation (10).
x Ax Bu y Cx Du

Design of MPC Controller
When tracking the reference path, the vehicle has the following relationship: .
where φ is the actual heading angle of the vehicle and Y is the lateral position of the vehicle in the geodetic coordinate system.Combined with Equations ( 4) and ( 9), it can be transformed into the form of state space equation, where the state quantity is x = v y , ω, φ, Y , the control quantity is µ = δ f , the output quantity is y = [φ, Y], and the state space equation is Equation (10). . where The optimal control sequence for MPC controllers is solved in the prediction time domain by solving an optimization problem that satisfies the objective function and various constraints.The first element of this control sequence is taken as the actual control quantity of the controlled plant, and the above solution process is repeated to realize the continuous control of the controlled plant.In order to apply the model to the design of the MPC controllers, the state space equations need to be discretized.The change speed of the control variable in the MPC controller dramatically influences the actual controlled system, so it is necessary to restrict the increment of the control quantity and transform Equation (10).
where the new state quantity is ξ k = x k−1 u k , and the change in the control quantity at each time compared with the previous time is called Nx is the number of states; and Nu is the number of control quantities.
The system is assumed to be observable and controllable, and the sequence of control quantities is as follows: The reference point of the reference path is the column vector of Np*1, and the expression is as follows: Assume that the prediction vector Y of MPC is given by the following: The objective function needs to add the deviation of the system state quantity and the size of the control quantity as the optimization objective to ensure that the uncrewed vehicle can track the reference path quickly and smoothly.The objective function is a quadratic optimization problem, which can be expressed as follows: where Q and R are the weight matrices; and Np and Nc are the prediction and control time domains of MPC, respectively.This study mainly considers the control quantity limit constraint and the control increment constraint in the control process, and the control quantity limit constraint is as follows: In this paper, the front wheel angle is constrained, the constraint range is [−0.44,0.44], the incremental constraint range is [−0.005,0.005],and the unit is deg.
The quadratic optimization problem can be solved by finding the front wheel steering angle under the constraints.After calculating the optimal steering angle sequence, only the first output controls the system's next sampling time.The optimization problem is solved recursively within each step.

The Particle Swarm Optimization Algorithm Optimizes the Controller Parameters
Particle swarm optimization (PSO) is an algorithm based on bionics proposed by American scholars Kennedy and Eberhart.The concept of PSO comes from the study of bird foraging behavior.Birds adjust their behavior by sharing their own existing information and combining the information shared by other individuals in the group so that they are in a favorable position to find food and avoid natural enemies.PSO has the advantages of a fast convergence speed, few parameters, and easy implementation (for high-dimensional optimization problems, it converges to the optimal solution faster than other algorithms); however, it also has the problem of falling into local optimal solutions, so it depends on a good initialization.
Assuming a search in a d-dimensional space, particle optimization is equivalent to updating the position and velocity of the individual extreme value and the group extreme value of the particle in each iteration, as shown in Equation (17).
where x = (x 1 , x 2 , . . . ,x n ) represents the position of the particle; v = (v 1 , v 2 , . . . ,v n ) repre- sents the velocity of the particle; ω n is the inertia factor; c 1 , c 2 are the acceleration constant; r 1 and r 2 are random number between 0 and 1; P t is the best position of the particle searched so far; and G t is the optimal position that PSO has searched so far.
The PSO algorithm needs a judgment condition to determine whether the optimal result is achieved.It usually takes the preset maximum number of iterations or the lower limit of the fitness value as the termination condition.The selection of different fitness functions often determines the convergence speed of the PSO and the probability of the optimal solution.Figure 3 shows a flowchart of the optimization process of the PSO algorithm.The commonly used fitness function is as follows: The integral time absolute error (ITAE) criterion is used because the control system designed by the ITAE index has a better dynamic performance and slight overshoot.In this paper, the sum of the ITAE of lateral deviation, heading deviation φ error , and steering input u is applied as the performance index function of PSO MPC, as shown in Equation (18).
where Y error (t), φ error (t) and u(t) represents the lateral deviation, heading deviation, and steering input at time t; and ω 1 , ω 2 and ω 3 are the weighting coefficients of each item, which determine the proportion of ITAE index of Y error (t), φ error (t) and u(t) in the perfor- mance function, respectively.The velocity update of the traditional PSO optimization algorithm is shown in Equation ( 17).The particle swarm will only reach the optimal position if the inertia factor parameter is manageable.They set the inertia factor parameter to be too small, leading to a slow convergence speed.The following improvements will be made to the inertia factor: In the early stage of optimization, choosing a more significant factor can enhance the global search ability of the particle and then find the optimal point position faster.In the later stage of the The velocity update of the traditional PSO optimization algorithm is shown in Equation (17).The particle swarm will only reach the optimal position if the inertia factor parameter is manageable.They set the inertia factor parameter to be too small, leading to a slow convergence speed.The following improvements will be made to the inertia factor: In the early stage of optimization, choosing a more significant factor can enhance the global search ability of the particle and then find the optimal point position faster.In the later stage of the algorithm, a smaller factor is more conducive to improving the convergence speed and local search ability.Therefore, the inertia factor is set as follows in this paper: The PSO algorithm is used to optimize the MPC controller.The primary weight coefficients are in the MPC control process.The PSO algorithm is used to optimize and modify the weighting coefficient, and the iterative optimization is used to reduce the ITAE index.Until the iteration number is satisfied, the optimization is stopped in order to realize the purpose of adaptive optimization of the MPC control parameters.Figure 4 shows the process diagram of the PSO algorithm used to implement the optimal design of the MPC parameters.

Design of the Sliding Controller
When the vehicle is running, the control system can control the steering and longitudinal force of the tire in real time to make the vehicle state meet the ideal reference model.By solving the ideal two-degree-of-freedom model, the center of mass sideslip angle and yaw rate can be used as the control target of stability.Based on Equation (4), the 2-DOF nonlinear model can be obtained as follows [28]: ( 1) Taking the difference between the center of mass sideslip angle and yaw rate and their respective ideal values as the control quantities of the sliding mode control, the control error is as follows: In the particle swarm optimization (PSO) algorithm, the timeliness and the quasicertainty of the optimization results are ensured.The initial population number N is set as 30.The maximum iteration number Maxlter is 100.The position limit is 0.5~2.The speed limit is −0.2~0.2.The acceleration constants c1 and c2 are 0.5 and 0.4, respectively.The inertia factor is given in Equation (19).

Design of the Sliding Controller
When the vehicle is running, the control system can control the steering and longitudinal force of the tire in real time to make the vehicle state meet the ideal reference model.By solving the ideal two-degree-of-freedom model, the center of mass sideslip angle and yaw rate can be used as the control target of stability.Based on Equation (4), the 2-DOF nonlinear model can be obtained as follows [28]: Taking the difference between the center of mass sideslip angle and yaw rate and their respective ideal values as the control quantities of the sliding mode control, the control error is as follows: In order to improve the anti-interference ability and accuracy of the system, this paper designs the sliding mode surface concerning PID control, as shown in Equation (22).
In order to implement the dynamic sliding mode, the exponential reaching rate is used as follows: In the above equation, ε is the sliding mode boundary layer thickness and K is the reaching rate index, where ε 1 , ε 2 , K 1 , and K 2 are all positive numbers.The output variable is U = δ r ∆M , and it can be obtained by simultaneous Equations ( 20)-( 23), as follows: In order to eliminate the possible chattering problem, the continuous function sat(S) is used instead of sgn(S).
Since the phase plane controls the additional yaw moment in this paper, the additional yaw moment obtained in Equation ( 24) is split into the additional yaw moment obtained based on the yaw rate and centroid sideslip angle, as shown in Equation (26). ) By Lyapunov stability in modern control theory, a positive definite scalar function V(x) can be defined, and .V(x) is negative definite.Then, the system is asymptotically stable.We define the Lyapunov function as follows: The derivative of Equation ( 27) can be obtained as follows: Appl.Sci.2024, 14, 3664 We can deduce that when S > 0, • V= −εS − KS 2 < 0; when S = 0, • V= 0; and when S < 0, • V= εS − KS 2 < 0. Therefore, • V ≤ 0 always holds, indicating that the designed system is stable.

Vehicle Instability Judgment and Proportional Controller Allocation Based on the Phase Plane Method
The longitudinal speed, the adhesion coefficient of the ground, and the front wheel angle affect the vehicle's stability during the driving process.The phase plane method is crucial to judge whether the system is stable when these three parameters change.The β − .β phase plane of the vehicle can identify its unsteady condition.The second-order autonomous system shown in Equation ( 29) is the basis for realizing the phase plane. • The slope of each point on the phase diagram trajectory can be obtained from Equation (30).
where z 1 and z 2 are the horizontal and vertical coordinates of the phase diagram, respectively.In Equation (30), given the initial state values z 0 (z 1 (0), z 2 (0)), for any time t, the solution z(t) = (z 1 (t), z 2 (t)) on the system of state equations is a phase trajectory starting at the initial point z 0 .In a time-continuous system, the initial value z 0 is in the local range, such that the phase trajectory satisfies the following: At this point, the total energy of the system decays, and the system is in an asymptotically stable state.If there is no external intervention, the system's momentum gradually reduces to zero, the system is stationary, and the state point of convergence is called the equilibrium point.In the phase plane diagram, the phase trajectories in the stable region will converge to the equilibrium point, and the unstable phase trajectories will diverge.
Equations ( 1) and ( 2) are expressed as second-order autonomous systems, as follows: Under the given longitudinal velocity, the adhesion coefficient of the ground, and the front wheel angle, different initial values are assigned to Equation (32), the phase trajectory of the system is drawn, and the β − .β phase plan is obtained.2, and the simulation, as shown in Figure 5, was carried out in order to establish a relatively complete table look-up database of five parameter values.In addition, the boundary equations of the stable region under each working condition were obtained.Table 3 shows some of the database parameter values obtained with the simulation.

Range of Value
Step Size   (km/h) 60~120 10 µ 0~1.0 0.1   (°) 0~10 0.5 In the β − β ̇ phase plan, the shortest distance between the vehicle state poin stability domain and the boundary of the stability domain is defined as the stability The degree of stability can characterize the degree of stability of the vehicle; moreo state points outside of the boundary of the stability domain are already in an unstab and their stability is 0. The calculation model of stability degree is as follows: ( 1, 2), ( 3,4) min ( 1, 2,3, 4), 1 ( 1, 2), ( 3,4) where i i B =β +A β(i=1,2,3,4) • are the four boundary equations of diamond shap the slope of the equation; and B i is the constant term of the equation.
According to the stability theory of the vehicle, the stability of the vehicle depends on the yaw rate when the sideslip angle of the center of mass is neg

Range of Value
Step Size β phase plan, the shortest distance between the vehicle state point in the stability domain and the boundary of the stability domain is defined as the stability degree.The degree of stability can characterize the degree of stability of the vehicle; moreover, the state points outside of the boundary of the stability domain are already in an unstable state, and their stability is 0. The calculation model of stability degree is as follows: where B i = • β+A i β(i = 1, 2, 3, 4) are the four boundary equations of diamond shape; A i is the slope of the equation; and B i is the constant term of the equation.
According to the stability theory of the vehicle, the stability of the vehicle mainly depends on the yaw rate when the sideslip angle of the center of mass is negligible.Referring to the results found in the literature, the critical value of instability U for the yaw rate deviation is shown in Table 4.According to the β-method theory, the yaw rate cannot effectively characterize the vehicle's stability when the mass center lateral angle is large, and the influence of the mass center lateral angle on the vehicle's stability is dominant.Therefore, the car's instability judgment is carried out according to Figure 6. of the centroid side angle controller should be significant now.Therefor degree can be used to reasonably allocate the controller weight P and be su Equation ( 34) to obtain the weighted yaw moment ΔM, as follows: where H is the distance from the equilibrium point to the vehicle state poin diagram.

Torque Distributor Design
The additional yaw moment obtained through the upper-level con distributed to the four wheels to realize the control of the direct yaw momen load of the wheel is related to the tire adhesion and the road adhesi Assuming a constant value of the road adhesion coefficient, the adhesion f is proportional to the vertical load.Therefore, the side of the vehicle with a In the stability control, the controller's weight should be increased when the center of mass lateral deflection angle is large.The stability affected by the longitudinal velocity, the road adhesion coefficient, and the front wheel angle can effectively characterize this situation, as follows: near the diamond boundary, that is, when the stability is small, one situation is that the center of mass lateral deflection angle is large, then, the weight of the controller should be significant.The other case is that the centroid side angle is slight.However, in this case, the velocity of the centroid side angle is large, and the vehicle is about to enter the state with a large lateral angle of the center of mass, and so the weight of the centroid side angle controller should be significant now.Therefore, the stability degree can be used to reasonably allocate the controller weight P and be substituted into Equation (34) to obtain the weighted yaw moment ∆M, as follows: where H is the distance from the equilibrium point to the vehicle state point on the phase diagram.

Torque Distributor Design
The additional yaw moment obtained through the upper-level controller can be distributed to the four wheels to realize the control of the direct yaw moment.The vertical load of the wheel is related to the tire adhesion and the road adhesion coefficient.Assuming a constant value of the road adhesion coefficient, the adhesion force of the tire is proportional to the vertical load.Therefore, the side of the vehicle with a large axle load can output more longitudinal force, while the side with a small axle load will be relatively passive.The loads of the four tires are as follows: In order to improve the stability of the side of the wheel with a small axle load, the wheel torque can be distributed and controlled according to the ratio of the front and rear axle load, and the front and rear axle load can be obtained as follows: The torque distribution needs to meet the demand of the total driving force.The driving force between each wheel and the driving torque should meet the following relationship: Since the moment of inertia of the wheel is small and the angular velocity of the wheel when the vehicle is stable is small, it can be regarded as zero.According to the dynamic equation I z • ω= T − RF, it can be solved as follows: Furthermore, the driving torque of each wheel can be solved as follows: In vehicle travel, the road environment is complex and changeable, and the road condition of the four wheels is not necessarily the same.Moreover, a single wheel, or part of the wheels, can still slip, so the four-wheel torque distribution scheme constructed above cannot guarantee that the vehicle can exert the maximum road adhesion ability in order to reduce as much as possible the risk of only a single wheel or part of the car wheel slipping.This subsection adds the drive anti-slip function to the wheel drive torque distribution scheme.
Drive anti-slip aims to reduce the slip of the wheel on the low-adhesion road surface, ensure the steering and relief ability of the vehicle, improve driving safety, reduce wheel wear, and improve wheel life.The slip rate of the wheel is calculated with Equation (40), as follows: where λ i is the slip rate of the wheel, ω i is the angular velocity of the wheel, r is the rolling radius of the wheel, and v x is the current longitudinal vehicle speed.When slip occurs, the drive anti-slip function will adjust the wheel torque to control the slip rate of the wheel in the optimal slip rate range.This paper uses PI control to construct a driving anti-slip controller.The controller's input is the deviation value between the expected and actual slip rates.In this paper, the expected slip rate is set to 15%, and the controller's output is the wheel torque adjustment value.
The above design shows a drive anti-slip scheme for a single wheel, but for the whole vehicle if the torque of one side of the wheel is reduced.In contrast, if the torque of the other side is unchanged, an additional yaw moment will be generated so that the actual value of the additional yaw moment is not consistent with the value calculated by the yaw stability control algorithm, which will impact the vehicle's yaw motion.Based on the above reasons, in order to ensure that the additional yawing moment value is not affected, the driving anti-skid function needs to add a multi-wheel coordination mechanism, that is, the left and right wheels need to reduce the same driving anti-skid adjustment torque value; however, if the left and right wheels are sliding, the reduced torque value will be too large, which will affect the vehicle dynamic performance.Therefore, based on balancing power and coordination, this paper takes the maximum value of the driving anti-slip adjusting torque of the left and right wheels as the common driving anti-slip adjusting torque.
Finally, the output of the torque value of each motor is as follows: In the above equation, Fzf and Fzr are the front and rear axle loads, respectively; h is the height of the centroid; a x and a y are the longitudinal acceleration and lateral acceleration, respectively; B f and B r are the front and rear wheel tracks; T ij is the driving torque of the in-wheel motor; ∆T is the driving anti-slip adjustment torque of each wheel, where ff, fr, rf, and rr represent the left front wheel, right front wheel, left rear wheel, and right rear wheel, respectively; and R is the effective rolling radius of the wheel.
In order to verify the effectiveness of the anti-skid strategy proposed in this section, the driving torque of each wheel in the case of not considering anti-skid and considering anti-skid is calculated, respectively, on the double-moving line road with a road adhesion coefficient of 0.3 and a vehicle speed of 60 km/h, as shown in Figure 7.The driving torque of each wheel after considering anti-skid is lower than that without considering anti-skid.It can ensure that the vehicle has stability on the low-adhesion road surface, indicating that the designed torque distributor-considering the anti-skid strategy-is compelling.
the driving torque of each wheel in the case of not considering anti-skid and considering anti-skid is calculated, respectively, on the double-moving line road with a road adhesion coefficient of 0.3 and a vehicle speed of 60 km/h, as shown in Figure 7.The driving torque of each wheel after considering anti-skid is lower than that without considering anti-skid.It can ensure that the vehicle has stability on the low-adhesion road surface, indicating that the designed torque distributor-considering the anti-skid strategy-is compelling.

Results
In order to verify the effectiveness and feasibility of the trajectory tracking strategy proposed in this study, the simulation is carried out on the Carsim-Simulink co-simulation platform.In this study, the double-shift line road, as well as Alt3 from FHWA, are used as the reference path, and the basic parameters of the vehicle are shown in Table 5.In this paper, four groups of control tests are designed, as follows: the first group is the control system (control A), the second group is the MPC control system without particle swarm optimization (control B), the third group is the LQR control system (control C), and the fourth group is the SMC system control (control D).

Results
In order to verify the effectiveness and feasibility of the trajectory tracking strategy proposed in this study, the simulation is carried out on the Carsim-Simulink co-simulation platform.In this study, the double-shift line road, as well as Alt3 from FHWA, are used as the reference path, and the basic parameters of the vehicle are shown in Table 5.In this paper, four groups of control tests are designed, as follows: the first group is the control system (control A), the second group is the MPC control system without particle swarm optimization (control B), the third group is the LQR control system (control C), and the fourth group is the SMC system control (control D).

Simulation Experiment of High-Speed Double-Moving Line Condition
The high-speed double-line-moving condition can simulate the lane-changing action of the vehicle at high speed; moreover, the adhesion coefficient of the road is 0.8, and the speed is 120 km/h.The obtained simulation results are shown in Figures 8 and 9.
According to Figure 8a, the PSO found the optimal ITAE value of 32.5 when approaching 20 iterations in this experiment.According to the phase trajectory diagram shown in Figure 8b, it can be seen that most of the phase trajectories of the control method using LQR are located in the unstable region.In contrast, the phase trajectories of the proposed control system, the MPC control system without PSO optimization, and the SMC control system are located in the stable region.Moreover, it can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the unoptimized MPC, which indicates that the adaptive optimization of the MPC control parameters by PSO proposed in this paper is practical and improves the stability of the car.

Simulation Experiment of High-Speed Double-Moving Line Condition
The high-speed double-line-moving condition can simulate the lane-changing action of the vehicle at high speed; moreover, the adhesion coefficient of the road is 0.8, and the speed is 120 km/h.The obtained simulation results are shown in Figures 8 and 9   According to Figure 8a, the PSO found the optimal ITAE value of 32.5 when approaching 20 iterations in this experiment.According to the phase trajectory diagram shown in Figure 8b, it can be seen that most of the phase trajectories of the control method using LQR are located in the unstable region.In contrast, the phase trajectories of the proposed control system, the MPC control system without PSO optimization, and the SMC control system are located in the stable region.Moreover, it can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the unoptimized As shown in Figure 9a, the value of β of the proposed control system changes gently and tends to be 0, with an average value of 0.00632 deg and a peak value of 0.019656 deg, the minimum values of all of the control systems.The proposed control strategy shown in Figure 9b is evident compared to LQR and MPC optimization without PSO, but it is not as good as the SMC control system.Regarding the tracking accuracy, the average tracking error of the control system proposed in this paper is 0.13 m, which is significantly optimized compared to the SMC and LQR systems.However, the average value of the MPC control system without PSO is 0.103 m, which is slightly inferior.Figure 9e shows each in-wheel motor's wheel driving torque output.The torque distributor distributes the driving and braking torque of the four wheels to make the vehicle achieve differential speed and better maintain body posture.As shown in Figure 9a, the value of β of the proposed control system changes gently and tends to be 0, with an average value of 0.00632 deg and a peak value of 0.019656 deg, the

Simulation Experiment of Low-Attachment Double-Moving Line Condition
The low-adhesion double-line-moving condition can simulate the lane-changing action of the vehicle on rainy and snowy days.The adhesion coefficient of the road is 0.3, and the vehicle speed is 60 km/h.The obtained simulation results are shown in Figures 10 and 11.
the SMC and LQR systems.However, the average value of the MPC control system without PSO is 0.103 m, which is slightly inferior.Figure 9e shows each in-wheel motor's wheel driving torque output.The torque distributor distributes the driving and braking torque of the four wheels to make the vehicle achieve differential speed and better maintain body posture.

Simulation Experiment of Low-Attachment Double-Moving Line Condition
The low-adhesion double-line-moving condition can simulate the lane-changing action of the vehicle on rainy and snowy days.The adhesion coefficient of the road is 0.3, and the vehicle speed is 60 km/h.The obtained simulation results are shown in Figures 10 and 11   According to Figure 10a, the PSO found the optimal ITAE value of 33.5 when approaching 15 iterations in this experiment.According to the phase trajectory diagram shown in Figure 10b, it can be seen that the phase trajectories of the four control systems are located in the stable region.It can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the MPC without optimization, which indicates that the control strategy proposed in this paper improves the stability.According to Figure 10a, the PSO found the optimal ITAE value of 33.5 when approaching 15 iterations in this experiment.According to the phase trajectory diagram shown in Figure 10b, it can be seen that the phase trajectories of the four control systems are located in the stable region.It can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the MPC without optimization, which indicates that the control strategy proposed in this paper improves the stability.
As shown in Figure 11a, the value of β of the proposed control system changes gently and tends to be 0, with an average value of 0.00024 deg and a peak value of 0.002187 deg, the smallest value among all of the control systems.In Figure 11b, the control strategy proposed in this paper is significantly optimized compared to the other three control systems, with an average value of 0.054 deg/s, indicating that the proposed control system changes gently and increases the stability.Regarding the tracking accuracy, the average tracking error of the control system proposed in this paper is 0.055 m, which is significantly optimized compared to the SMC and LQR systems.However, the average value of the MPC control system without PSO is 0.053 m, which is slightly inferior.

Simulation Experiments of Alt3 from FHWA Operating Conditions
In order to verify the adaptability of the control system designed in this paper to different roads, the Alt3 from FHWA is used as the reference path in this experiment.The road adhesion coefficient of the working condition is 0.8, and the vehicle speed is 60 km/h.The received simulation results are shown in Figures 12 and 13  As shown in Figure 11a, the value of β of the proposed control system changes gently and tends to be 0, with an average value of 0.00024 deg and a peak value of 0.002187 deg, the smallest value among all of the control systems.In Figure 11b, the control strategy proposed in this paper is significantly optimized compared to the other three control systems, with an average value of 0.054 deg/s, indicating that the proposed control system changes gently and increases the stability.Regarding the tracking accuracy, the average tracking error of the control system proposed in this paper is 0.055 m, which is significantly optimized compared to the SMC and LQR systems.However, the average value of the MPC control system without PSO is 0.053 m, which is slightly inferior.

Simulation Experiments of Alt3 from FHWA Operating Conditions
In order to verify the adaptability of the control system designed in this paper to different roads, the Alt3 from FHWA is used as the reference path in this experiment.The road adhesion coefficient of the working condition is 0.8, and the vehicle speed is 60 km/h.The received simulation results are shown in Figures 12 and 13  According to Figure 12a, the PSO found the optimal ITAE value of 37.25 when approaching 20 iterations in this experiment.According to the phase trajectory diagram shown in Figure 12b, it can be seen that the phase trajectories of the four control systems are located in the stable region, and it can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the MPC without optimization.Therefore, the control strategy proposed in this paper improves the stability.As shown in Figure 13a, the value of β of the proposed control system changes gently.It tends to be 0, with an average value of 0.00025 deg and a peak value of 0.01044 deg, which is the minimum value among all of the control systems, and the optimization effect is significant.In Figure 13b, the control strategy proposed in this paper has no noticeable difference compared to the other three control systems, and the average value is 0.234 deg/s.Regarding the tracking accuracy, the control system proposed in this paper is more According to Figure 12a, the PSO found the optimal ITAE value of 37.25 when approaching 20 iterations in this experiment.According to the phase trajectory diagram shown in Figure 12b, it can be seen that the phase trajectories of the four control systems are located in the stable region, and it can be seen that the phase trajectory of the MPC optimized by PSO is more concentrated than that of the MPC without optimization.Therefore, the control strategy proposed in this paper improves the stability.

Figure 2 .
Figure 2. Frame diagram of 4WS vehicle trajectory tracking control system based on PSO and phase plane analysis.

Figure 2 .
Figure 2. Frame diagram of 4WS vehicle trajectory tracking control system based on PSO and phase plane analysis.

Figure 4 .
Figure 4.The process diagram of the PSO algorithm used to implement the optimal design of MPC parameters.

Figure 4 .
Figure 4.The process diagram of the PSO algorithm used to implement the optimal design of MPC parameters.

Figure 5
shows the five-parameter diamond phase plan under the condition of v x = 60 km/h, µ = 0.8, and δ f = 0.The five parameter values of the diamond region are the .β values of the upper and lower boundaries, the β values of the left and right boundaries, and the β value of the equilibrium point.We denote such by .+ lim , β − lim , and β e , respectively.The step size was selected under the given range of working conditions shown in Table

Figure 7 .
Figure 7. (a) Considering the driving torque of each wheel for anti-slip; (b) the anti-slip driving torque of each wheel is not considered.

Figure 7 .
Figure 7. (a) Considering the driving torque of each wheel for anti-slip; (b) the anti-slip driving torque of each wheel is not considered.

Table 5 .
Basic parameters of the vehicle.center of mass to the front axle a m 1.015 Distance from the center of mass to the rear axle b m 1.895 Moment of inertia of the vehicle at the z-axis Iz kg• .
Appl.Sci.2024, 14, x FOR PEER REVIEW 19 of 27 MPC, which indicates that the adaptive optimization of the MPC control parameters by PSO proposed in this paper is practical and improves the stability of the car.

Table 1 .
Literature review and analysis.

Table 2 .
Value ranges and step sizes of the three variables.

Table 3 .
Values of some database parameters.

Table 2 .
Value ranges and step sizes of the three variables.

Table 3 .
Values of some database parameters.

Table 4 .
Critical value of yaw rate deviation instability.

Table 5 .
Basic parameters of the vehicle.