This paper will study a trajectory tracking control algorithm for electric vehicles based on a terminal sliding mode controller. First, a 3 degrees of freedom nonlinear vehicle model and a controller-oriented 2 degrees of freedom vehicle model are established. The preview time is adaptively adjusted based on the preview model. Then, the vehicle trajectory tracking controller, which uses the terminal sliding mode algorithm, is designed. The radial basis function (RBF) neural network algorithm is used to approximate the system variable parameters in the control model online. At the same time, fuzzy logic is used to control the gain parameters of the controller to reduce the chattering of the control system. Finally, the designed controller is verified by simulation. The maximum deviation of path tracking under different speeds is 0.6

In recent years, autonomous technology has become the critical research direction of vehicle technology. One of its core technologies is to control technology. The control system determines all the actions of autonomous vehicles, and the excellent performance controller is the basis for autonomous technology. Trajectory tracking is an integral part of the autonomous vehicle, and better tracking capabilities are the basic needs of autonomous vehicles (Gonzalo et al., 2020; Xiong et al., 2020). However, because the vehicle system has the characteristics of strong nonlinearity and high coupling, its dynamic model is very complex and cannot be accurately represented. Therefore, trajectory tracking control is always a major difficulty in realizing autonomous driving technology.

The trajectory tracking of autonomous vehicles attracts a wide range of attention from many scholars and proposes several control methods to achieve trajectory tracking. Abatari and Tafti (2013) designed a fuzzy proportional–integral–derivative (PID) controller for the path following of car-like mobile robots. Zhang et al. (2019) used the Takagi–Sugeno fuzzy control method to study the steering control problem of vehicle trajectory tracking with uncertain parameters. Boumediene et al. (2020) carried out tracking control on the established 3 DOF (degrees of freedom) model by combining the adaptive neural fuzzy reasoning system and particle swarm optimization algorithm. To improve the stability of autonomous vehicles, Yuan et al. (2019) track the trajectory based on the model predictive control algorithm by increasing the dynamic constraints of the center of mass, acceleration, and tire side angle. Liang et al. (2017) applied model predictive control to deal with low-speed trajectory tracking to ensure the reasonable safety of autonomous vehicles. Zhou et al. (2019) designed the electromechanical coupling dynamic trajectory tracking controller based on the model predictive control algorithm. Li et al. (2020) proposed a linear predictive lateral control method. The lateral force of the front tire was selected as the control input. The friction between the front and rear tires was used as the safety constraint of the predictive controller for the stability control of vehicle path tracking at high speed. Wang et al. (2018) proposed a new model predictive control strategy based on the adaptive cost function, which reflects different requirements under different road classes and friction coefficients. The strategy is applied to the longitudinal control of intelligent vehicles.

The sliding mode control (SMC) algorithm is widely used in nonlinear control systems due to its characteristics. SMC has strong robustness to strong nonlinearity, external disturbance, and parameter uncertainty and disturbance caused by complex driving conditions of autonomous vehicles (Wu et al., 2019). In addition, the SMC controller allows the vehicle to converge quickly to the path (Sun et al., 2019). Martin et al. (2013) designed a trajectory tracking controller using a sliding mode control algorithm based on the kinematic model. Based on the 2 DOF vehicle model, Norouzi et al. (2019) combined the sliding mode controller with the back-stepping controller to control the steering. Cao et al. (2017) designed a robust sliding mode control steering controller with an adaptive preview time strategy, which can carry out path tracking and avoid significant acceleration caused by adaptive preview time strategy during trajectory tracking. The most critical sliding mode control problem is the chattering caused by the sliding surface switching. In recent years, many methods have been proposed to eliminate chattering. However, reducing or eliminating chattering is still the key to the design of a sliding mode controller (Tagne et al., 2014; Guo et al., 2017; Taghavifar and Rakheja, 2019).

The objective of this paper is the trajectory tracking control of vehicles. The contribution of this paper is as follows: (1) an autonomous vehicle trajectory tracking controller based on the terminal sliding mode control is designed. (2) Because the control system contains state-dependent, time-varying parameters which cannot be known in advance, it is necessary to approximate them, and the approximation value is used as the design basis of the controller. The radial basis function (RBF) neural network controller is designed to approximate the time-varying parameters. (3) To reduce the chattering of the controller, the fuzzy algorithm is used to control the gain of symbol function control. (4) The simulation analysis of the designed controller is carried out under the double lane-shifting condition to verify its effectiveness, and the influence of different vehicle speeds and different road adhesion coefficients on the controller is studied. The structure design of this paper is as follows. Section 1 introduces the current research status of scholars and the research content of this paper. Section 2 establishes the vehicle dynamics model and tire model. Section 3 establishes the driver preview model, designs the controller, and conducts stability analysis for the designed controller. Section 4 carries out the simulation analysis of the controller, conducts the simulation verification of the controller designed in this paper under the condition of the double line change, and compares the control effect between the controller designed in this paper and the traditional terminal sliding mode controller. Section 5 is the conclusion of this paper.

An accurate vehicle dynamics model can accurately reflect the kinematic and dynamic characteristics of the vehicle, which is the basis of vehicle controller design. In this paper, from the realization of the control goal of autonomous vehicle steering, a dynamic model that can reflect the lateral characteristics of the vehicle is established. The established model needs to ensure that the response of the vehicle model can be similar to or consistent with the actual vehicle and meet the requirements of the trajectory tracking lateral controller designed in this paper. Therefore, this section established the vehicle model with 3 DOF, the controller-oriented model with 2 DOF, and the Dugoff tire model (Dugoff et al., 1970).

Various SMC techniques for trajectory tracking and their control strategies.

In this paper, a 3 DOF nonlinear model including longitudinal, lateral, and yaw motion is established by using a simplified model. The 3 DOF nonlinear model is shown in Fig. 1.

Vehicle model with 3 DOF.

Meanwhile, the following assumptions are made: (1) ignoring the influence of the steering operating mechanism, the front wheel angle is directly taken
as input, and the left and right front wheel angles are assumed to be equal. (2) The effect of the suspension system is not considered, only the
translational motion of the vehicle along the

In this paper, the Dugoff tire model (Dugoff et al., 1970) is used to calculate the longitudinal and lateral forces of the tire. For each wheel, the longitudinal and lateral forces acting on the tire can be expressed as follows:

The following formula calculates each tire sideslip angle, vertical load, and slip rate (Feng et al., 2020):

Since the lateral and yaw motions are mainly involved in the path-tracking control process, to reduce the calculation amount, a single wheel is used
to replace the two wheels on the axle, so as to simplify the four-wheel vehicle into a monorail vehicle model. At the same time, it is assumed that
the relationship between the tire sideslip force and the sideslip angle is linear. The 2 DOF vehicle dynamics model is shown in Fig. 2, and the
dynamic equation is as follows (Feng et al., 2020):

Vehicle model with 2 DOF.

Equation (

The structure of the controller is shown in Fig. 3. First, the optimal preview time is obtained according to the preview time adaptive algorithm, and the optimal preview distance and expected yaw rate are calculated. Then, the yaw rate error is taken as the control input, and the steering wheel angle output by the controller is input into the 3 DOF vehicle model. Finally, the vehicle model feeds back the vehicle state parameters such as yaw rate and yaw velocity to the controller to achieve the closed-loop control.

Controller structure in this paper.

The vehicle will encounter a variety of emergencies in the running process. Therefore, in the process of vehicle driving, the path ahead can be assessed, and the corresponding decision can be made in advance, so that the vehicle can better track the desired trajectory. The trajectory tracking control method proposed by Macadam (2003) has been widely applied in the longitudinal and lateral control of automobiles. The basic idea of the optimal preview driver model is to establish the optimal index function according to the position of the road ahead, the vehicle state, and the lateral position deviation in the preview time, and the optimal steering angle is obtained to control the vehicle to track the ideal trajectory.

In general driver models, the preview time is set as a fixed value, but under the conditions of high speed, complex trajectory, and road width
constraints, driver models with fixed preview time often find it challenging to complete driving tasks. Therefore, to improve the adaptability of the
driver model, the preview time is adaptively controlled. A different preview time

Trajectory deviation optimization function:

Boundary position optimization function:

Yaw angle deviation optimization function:

Dynamic response time optimization function:

The trajectory deviation optimization function calculates the trajectory deviation within the preview time. The longer the preview time, the
greater the trajectory deviation. The purpose of the boundary position optimization function is to constrain the vehicle at a position far from the
road boundary through the optimization function to ensure the safe passage of the vehicle. By calculating the deviation between the yaw angle and the
target heading angle at the current moment, the yaw angle deviation optimization function ensures that the difference between the vehicle direction, and the target trajectory tangent direction at the beginning of the next stage is slight. This reduces the difficulty of steering control in the next stage. The longer the preview time, the easier it is for the vehicle to maintain stability in a particular range, but the prediction accuracy will
deteriorate. The dynamic response time optimization function calculates the difference between the preview time and the vehicle steering response
time, ensuring calculation accuracy while optimizing the preview time. According to Eqs. (11)–(14), the optimization objective function is as
follows:

According to Eq. (

The control input is the yaw rate error, which can be expressed as follows:

Combining the above equation, the control law can be designed as follows:

In Eq. (

For the RBF network in this paper, we take the control input

The RBF network for online approximation of time-varying parameters as shown in Fig. 4.

Comparison between actual value and approximate value.

Figure 4 shows that the RBF neural network designed in this paper is effective in approximating time-varying parameters, and the error between the
approximation value and the actual value is small, which can be used for controller design. By substituting the designed RBF network output

The chattering of the SMC is mainly caused by the sign function

In-plane sliding mode state point movement.

Input membership function.

Output membership function.

The actual sliding mode movement trend is shown in Fig. 5. According to the figure, the fuzzy rule can be set as follows: (1) when

The fuzzy rules are designed as follows:

Rule 1 – if

Rule 2 – if

Rule 3 – if

Rule 4 – if

Rule 5 – if

Figure 8 shows the effect of the fuzzy logic control algorithm on reducing chattering. It can be seen from Fig. 8 that the fuzzy logic algorithm has a pronounced effect on the elimination of chattering. In the whole control process, the control input chattering of the controller with the fuzzy logic algorithm is much smaller than that of the controller without the fuzzy logic algorithm. It is proved that the fuzzy logic controller designed in this paper is effective at eliminating chattering of the sliding mode controllers.

The effect of fuzzy logic control algorithm on reducing chattering.

So far, the design of the fuzzy RBF neural network terminal sliding mode controller is completed. The control law of the controller designed in this
paper is summarized as follows:

According to Eq. (

We then substitute Eq. (

The Lyapunov function is designed as follows:

Taking the derivative of this equation, we have the following:

It can be obtained by substituting Eq. (

In order to verify the effectiveness of the designed terminal sliding mode controller, trajectory tracking control under different speeds and limit conditions and different control methods are compared and simulated. Part of the relevant parameters of the vehicle model and controller are shown in Table 1. The route of the double shift line condition is selected for the prescribed route.

First, the influence of speed on the designed sliding mode controller was observed, and the car was allowed to track the specified double line
movement condition at the speed of 10, 15, and 20

Vehicle model parameters and controller parameters.

Trajectory tracking at different speeds.

Acceleration at different speeds.

Steering angle at different speeds.

Yaw rate at different speeds.

It can be seen from Fig. 9 that, under three different speed conditions, the designed controller can ensure good tracking of the pre-set track at three different speed conditions. With the increase in speed, the lateral deviation of the vehicle increases gradually, but it can still guarantee the basic consistency with the pre-set track direction. With the increase in vehicle speed, the trend of vehicle lateral acceleration, steering wheel angle, and yaw rate is basically similar, with only a numerical increase. Although there is some chattering, the fluctuation is slight, which meets the lateral control requirements of the vehicle. The above simulation results can verify that the designed controller can meet the requirements of vehicle trajectory tracking and lateral control at different speeds.

In order to verify the effectiveness of the controller under low road friction coefficient, the speed was set to 20

Trajectory tracking of different friction coefficients.

Acceleration of different friction coefficients.

Steering angle of different friction coefficients.

Yaw rate of different friction coefficients.

As shown in Figs. 13–16, the controller's accuracy decreases with the decrease in the road friction coefficient. After turning back to the front, the vehicle has a specific deviation, but it can also keep on the prescribed track. According to the variation law of lateral acceleration and yaw rate, the lateral acceleration and yaw rate decrease and have certain fluctuations when the road friction coefficient decreases. This may be due to the tires not providing enough lateral force. Although the control effect is slightly chattering, the chattering amplitude is small, and the lateral deviation does not increase significantly. Therefore, the designed controller can effectively track and control the vehicle lateral when a low road friction coefficient is present.

In order to verify the difference in the control effect between the designed fuzzy RBF neural network terminal sliding mode controller and other
controllers, this paper compares the control effect between traditional PID controller, the terminal sliding mode controller(T-SMC), and fuzzy RBF
neural network terminal sliding mode controller(T-Fuzzy-RBF-SMC). The speed is set to 15

Trajectory tracking of different controllers.

Acceleration of different controllers.

Steering angle of different controllers.

Yaw rate of different controllers.

Figures 17–20 show that the three control methods effectively carry out vehicle trajectory tracking and lateral control. The controller designed in this paper has a better control effect than the traditional PID in trajectory tracking. It shows that the controller designed in this paper has a specific optimization in the control effect. Compared with the controller designed in this paper, the control effect of T-Fuzzy-RBF-SMC is better than that of T-SMC. The control variables of acceleration, steering wheel angle, and yaw rate are optimized, as compared with the T-SMC algorithm. Therefore, the fuzzy RBF neural network terminal sliding mode controller designed in this paper has a better control effect than the other two controllers.

This paper proposes a fuzzy RBF neural network terminal sliding mode controller for trajectory tracking control and lateral control of electric vehicles. A terminal sliding mode controller is used to design the controller, and the RBF neural network method is used to adaptive approximation of system parameters. In order to eliminate chattering, a fuzzy algorithm is designed for fuzzy control of control gain. The designed controller is verified by simulation. The simulation of different speeds, different road friction coefficients, and different controllers verified that the controller designed in this paper could effectively carry out trajectory tracking and lateral control of electric vehicles and eliminate chattering to a certain extent. In future research, we hope to improve the control algorithm and consider more uncertain parameters such as road conditions, changes in the centroid position caused by changes in vehicle quality, etc. At the same time, we also need to verify the algorithm designed in this paper on the test bench and the actual vehicle to ensure its timeliness.

The code and data included in this article can be made available by the corresponding author upon reasonable request. With respect to future applications, please note that the data and codes are confidential and cannot be made publicly available.

BW, YL, YF and XG designed research, performed research, analyzed data, and wrote the paper.

The contact author has declared that none of the authors has any competing interests.

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

The authors would like to thank the 13th Five-Year Science and Technology Project of Education Department of Jilin Province (grant no. JJKH20200957KJ) and Regional Innovation Co-operation Project of Department of Science and Technology of Sichuan Province (grant no. 2021YFQ0052).

This research has been funded by the 13th Five-Year Science and Technology Project of Education Department of Jilin Province (grant no. JJKH20200957KJ) and Regional Innovation Co-operation Project of Department of Science and Technology of Sichuan Province (grant no. 2021YFQ0052).

This paper was edited by Peng Yan and reviewed by two anonymous referees.