#### Abstract

To improve the accuracy and timeliness of the trajectory tracking control of the driverless racing car during the race, this paper proposes a track tracking control method that integrates the rear wheel differential drive and the front wheel active steering based on optimal control theory and fuzzy logic method. The model of the lateral track tracking error of the racing car is established. The model is linearized and discretized, and the quadratic optimal steering control problem is constructed. Taking advantage of the differential drive of dual-motor-driven racing car, the dual motors differential drive fuzzy controller is designed and integrated driving with active steering control. Simulation analysis and actual car verification show that this integrated control method can ensure that the car tracks different race tracks well and improve the track tracking control accuracy by nearly 30%.

#### 1. Introduction

The Formula Student Autonomous China has been successfully held for three years and provides an important practical platform for cultivating talents in China's new energy vehicle and driverless industry. Trajectory tracking control is one of the key technologies of driverless car. A lot of related work has been carried out at home and abroad in the research of trajectory tracking and control of driverless car. Abroad, the University of Upper Alsace in France carried out the horizontal and vertical decoupling control of autonomous vehicles. Based on the theory of nonlinear model predictive control, the vehicle control strategy was designed to improve the accuracy and stability of vehicle trajectory tracking control [1]. The University of São Paulo in Brazil proposed a front wheel steering controller based on a dynamic inverse model for front wheel drive vehicles, which can make the car track the reference path under the tire adhesion limit and respond well to the discontinuity of the path curvature [2]. Stanford University in the United States designed a feedback-feedforward steering controller, which not only meets the minimum tracking path deviation, but also ensures the steering stability of the car [3]. The MPC method is used to realize the local trajectory planning and trajectory tracking during the collision avoidance process of the autonomous driving vehicle, which ensures the stability and safety of the autonomous vehicle during the collision avoidance process [4]. The Ford Motor Technology Research Center in the United States designed a linear state feedback controller and used the electric power steering system to realize the avoidance path tracking control of autonomous vehicles [5]. The Tokyo University of Agriculture and Technology in Japan combines the haptic steering torque guidance system and the direct yaw torque control strategy, and the simulation experiment verifies that the algorithm can well improve the vehicle trajectory tracking ability [6]. The University of California proposed a “dual loop” control method. The outer loop uses a nonlinear nonconvex model predictive control method to plan the collision avoidance path, and the inner loop uses linear feedback control to track the desired trajectory. This method’s effectiveness was verified by simulation experiments [7]. The University of Sheffield in the United Kingdom proposed a time-varying optimal controller to solve the problem of uncertain effects of dynamic model parameters and control parameters in the trajectory tracking control process [8].

In China, Tsinghua University proposed a path tracking method based on BP neural network PID controller [9]. An adaptive neural network control method is proposed, which realizes the robust control under the condition of uncertain tire cornering stiffness and unknown disturbance of the system in emergency avoidance conditions of autonomous vehicles [10]. Jilin University has designed a vehicle trajectory tracking controller based on linear model predictive control theory, which solves the trajectory tracking problem of double safety envelopes. Simulation experiments verify that the control method can effectively improve the trajectory tracking accuracy [11]. Beijing Institute of Technology proposes a safety envelope control strategy to ensure that autonomous vehicles can track the expect trajectory effectively [12]. The model predictive control theory is used to design the stability control strategy of the autonomous vehicle during high-speed driving considering the terrain factors of the vehicle [13]. A fuzzy controller is designed to control the preview distance and reduce the trajectory tracking deviation from Hefei University of Technology and verified the effectiveness of the control method through actual car experiments [14]. Dalian University of Technology builds a closed-loop control structure for vehicle trajectory tracking through integral inversion theory and designs a trajectory tracking controller to ensure real-time trajectory tracking and position deviation convergence [15]. Lei Liu et al. proposed an adaptive control method for a class of uncertain nonlinear systems with strict feedback. Finally, a numerical simulation is carried out to further verify the importance and feasibility of the proposed control scheme [16]. The above research methods provide the good references for the trajectory tracking and control of driverless race car.

However, the above research mainly focuses on traditional front wheel drive vehicles and realizes trajectory tracking control by controlling the active steering of the front wheels, and the algorithm based on model prediction has high requirements for the calculation ability of the vehicle controller, which is difficult to apply to the actual car verification. While the dual-motor-driven driverless car is driving on a specific track, it is more curved and complex than other driverless vehicles. Therefore, under this working condition, the racing car takes advantage of the differential drive of dual-motor-driven driverless car, which can significantly improve the tracking accuracy of the driverless racing car.

In this paper, the trajectory tracking of the driverless racing car driven by dual motors on the rear axle independently under track conditions is to ensure that the car has better track tracking accuracy in the track conditions and high real-time tracking. A method of trajectory tracking control is proposed. Firstly, in view of the large amount of calculation of the lateral control model predictive control algorithm, it is proposed to use the LQR control algorithm to improve the real-time performance of tracking. Secondly, in order to improve the accuracy of trajectory tracking, a method of integrating optimal steering control and differential drive control is proposed. Finally, the algorithm is verified through software simulation and actual car test.

#### 2. Tracking Control Strategy of Driverless Racing Car

The integrated control strategy of dual-motor-driven driverless racing car track tracking is shown in Figure 1. It mainly includes the combination of feedforward-feedback steering control and dual-motor differential drive control. The steering control part adopts the optimal control algorithm. Through the lateral tracking error state equation of the driverless racing car, the lateral deviation, lateral deviation change, heading deviation, and heading deviation change between the actual state and the desired tracking trajectory are used as the input and output of the optimal controller. The control amount is the steering wheel angle. The dual-motor-driven part uses the error of the yaw rate to calculate the additional yaw moment through the fuzzy controller based on the fuzzy method, which obtains the differential drive torque according to the torque conversion principle and then obtains the drive torque of the left and right drive wheels based on the torque distribution method. This integrated control method can improve the accuracy and stability of the driverless racing car in the trajectory tracking process.

#### 3. Optimal Steering Control Algorithm

This paper uses the vehicle two-degree-of-freedom model to study the lateral and yaw motion of the vehicle, as shown in Figure 2. Two dynamic degrees of freedom include the lateral position of the car and the racing angle of the car. The lateral position of the car is the distance from the car to the center of rotation. The racing direction angle is between the axis of the Earth coordinate system and the front of the car. The longitudinal speed at the center of mass of the vehicle is represented by .

Ignoring the influence of road slope, along the *y*-axis:

Lateral acceleration is composed of movement acceleration along the *y*-axis and centripetal acceleration :

Combine the two types to get

Find the balance equation by the torque around the *z*-axis, and finally get the vehicle yaw dynamic equation:

According to the tire dynamics characteristics, when the side slip angle is small, the side force of the tire is proportional to the “side slip angle.” From Figure 3, the side slip angle of the driverless racing car tire can be obtained. The front wheel slip angle:

From this, the vehicle lateral tracking error state equation is built. The rear wheel slip angle can be approximately expressed as

Therefore, the lateral force of the front and rear wheels of the driverless racing car can be expressed as

From the geometric characteristics of kinematics:

When the slip angle is small, the approximate angle and abbreviation , and (8) can be abbreviated to as (9).

Finally, the state equation model of the driverless car is shown in (10).

The racing car parameters are shown in Table 1, and Table 2 shows the definition of symbols used in the above expressions.

The lateral control model of the driverless racing car obtained above is mainly realized by controlling the tire rotation angle. For the driver, the steering wheel angle of the racing car can be directly controlled. The tracking error of the desired path direction and distance is the system variable to build a racing dynamics model. Let be the lateral error; that is, it stands for the distance between the center of mass of the car and the desired tracking trajectory, and is the heading error; that is, the difference between the actual heading angle of the car and the desired heading angle. It can be seen that the speed required for the car to turn the desired angle is

The lateral acceleration required for racing is

Therefore, the lateral acceleration error of the car is

The lateral speed error of the car is

Then the heading error of the car is shown in (15):

Combining and simplifying the above formulas (10) to (15), (16) can be obtained:where is the yaw rate in the desired trajectory, . The matrices , , and are .

Since driverless cars are highly complex nonlinear time-varying systems using linear quadratic optimal control methods, the above models must first be linearized and discretized. This paper uses the bilinear transformation discrete method to obtain the state matrix in discrete time, and the discrete time is set to *T* = 0.01s.

Since the lateral control is mainly for the control of the lateral deviation, the rate of change of the lateral deviation, the heading deviation, and the rate of change of the heading deviation, the term in the formula is ignored. The cost function of steering control iswhere is the state weighting matrix, is the control variable weighting matrix, is the final state weighting matrix, is the tracking error state variable, is the control variable, and is the final state tracking error.

The optimal front wheel feedback control angle form for designing a racing car is

Carrying out the convex optimization construction and solving the Riccati equation to (8), the optimal feedback control law can be obtained as

R (*t*) is combined with feedforward steering control. The expected steering wheel angle is

In this formula, is the feedforward control amount of the steering wheel angle.

The weighting matrix selected in this article is

= [300 0 0 0; 0 50 0 0; 0 0 200 0; 0 0 0 50], *R* = [10], *Q*_{N} = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 0].

This section adopts the full-state feedback control of driverless racing car, including the lateral position deviation, lateral position deviation change rate, heading angle deviation, and heading angle deviation change rate during the tracking process. The calculation of the lateral error is shown in Figure 4.

The racing tracking state error model based on the right-hand rule is built in the lateral control of the trajectory tracking of the driverless racing car, so the racing tracking lateral error is composed of the difference between the actual running state of the racing car and the expected trajectory curve. The specific expression is shown as (24).

Among them, is the vehicle yaw rate, which can be obtained by the vehicle body yaw rate sensor on the racing car, and is the expected yaw rate of the racing car, which is obtained by the desired path line fitting and desired tracking trajectory point solution controller.

#### 4. Differential Drive Control Algorithm

The yaw moment of the racing car can increase the side slip angle of the driving wheel and reduce the side slip angle of the steering wheel, thereby indirectly reducing the steering radius of the racing car during high-speed driving, and has the function of assisting steering. In this paper, a fuzzy control method is adopted. The difference between the actual yaw rate and the desired yaw rate and the rate of change of the difference are used as the input of the fuzzy controller to output the additional yaw moment of the car, which is then converted into the differential driving moment of the driving wheels. Under the premise that the total driving torque remains unchanged, the left and right driving wheels are reduced or increased by 1/2 of the driving torque to realize the redistribution of the driving torque of the driving wheels, as shown in Figure 5.

Based on the two-degree-of-freedom vehicle model, the desired yaw rate of the car can be calculated as

In the formula, is the steering stability factor of the car.

Set the ideal side slip angle of the center of mass, namely, , so that the vehicle can track the desired trajectory as much as possible. When calculating the yaw rate, taking into account the limit adhesion coefficient of the road, the range of the car’s yaw rate is

Then the desired yaw rate is

In the formula, is the peak adhesion coefficient between the road and racing tires.

This paper uses the yaw rate error and the rate of change of the error as the input of the fuzzy controller, and the output is the additional yaw moment. Three membership functions are formed by using common triangular membership functions and trapezoidal membership functions. The yaw rate deviation and the rate of change of the deviation are taken as (−1, 1). The range of change is [−3, −2, −1, 0, 1, 2, 3]. Each defines 5 fuzzy subsets, namely, NB (large negative), NS (small negative), ZE (zero), PS (positive small), and PB (positive large). Figure 6 is the membership function of the yaw rate error, and Figure 7 is the membership function of the yaw rate change rate.

The fuzzy control rule table is shown Table 3. According to the fuzzy rules formulated by experts in accordance with the theory of racing dynamics, it includes the control strategy of the controlled yaw moment under different working conditions, which can significantly assist the steering of the car and reduce the trajectory tracking error.

The fuzzy subsets obtained by fuzzy inference based on the fuzzy rule library need to be converted into accurate values. Two clarification methods are commonly used: the maximum membership method and the center of gravity method. The area center of gravity method is used to defuzzify to obtain the accurate value of the inference output. In actual control, the defuzzy output needs to be multiplied by the corresponding scale factor to obtain the final yaw moment for control.

The designed fuzzy controller has two inputs and one output. The difference between the actual yaw rate and the desired yaw rate and the change of the difference are used as the input. The output is the additional yaw moment , and at this moment the differential torque is obtained according to the dual motors independently driving the differential torque, and the method of using the equal division method to increase or decrease the left and right driving wheels by the same driving torque :

In the formula, is the rolling radius of the driving wheel.

In order to ensure that the total expected driving torque of the car remains unchanged, the same torque distribution rule is adopted to rematch the driving torque of the left and right driving wheels, which are

#### 5. Simulation and Experimental Verification Results

Firstly, CarSim and Matlab/Simulink cosimulation was used to simulate and verify the algorithm, and then the actual car was verified on the dual-motor-driven driverless racing car. Therein, the detail simulator is similar to the literatures [17, 18]. Since the width of the track during the race is 3.5 m, and there are many corners and rapid changes in curvature, the low speed of the car in this working condition ensures that it can drive stably. Set two working conditions to verify the algorithm and they are straight-line trajectory tracking and curved trajectory tracking.

##### 5.1. Straight-Line Tracking

The trajectory controller is built in CarSim and Matlab/Simulink, which tracks the desired path. Set the vehicle speed to 3 m/s, and track the desired trajectory under straight-line working conditions. The simulation results of straight-line working conditions are shown in Figures 7–10. The specific analysis is as follows.

It can be seen from Figure 8 that although the initial position is set to a lateral deviation of 0.5 m, the car can track the desired trajectory when driving 3.5 m. At the same time, the tracking error of the longitudinal vehicle speed gradually tends to zero after a short fluctuation, and it is shown as Figure 9. From Figure 10, it can be seen that, during this process, the front wheel steering angle fluctuates relatively a little, and it is basically stable at 2s, which meets the requirements of transient.

##### 5.2. Curve Path Tracking

In curve tracking, the minimum turning radius is set to 3.5 m. The car still tracks the desired trajectory at the speed of 3 m/s. The comparison diagram between the actual tracking trajectory and the expected trajectory curve is shown in Figure 11.

Although the curve of the track is very sharp, it can be seen that the error value is less than 0.2 m from Figure 12, which can track the expected trajectory well. From Figure 13, it can be seen that the total steering is composed of the target rotation angle and the feedback rotation angle. The angle changes smoothly. When there is a lateral tracking error, the feedback corner will correct the target corner, which is the expected trajectory of the racing car. It can be seen from Figure 14 that the racing car tracks the expected speed in 3s, and then a slight fluctuation is added to the expected speed.

##### 5.3. Integrated Control Simulation Verification

Establish a CarSim/Simulink cosimulation control model. The current vehicle speed, total steering wheel angle, and expected drive torque feedback by the racing car are input into the drive torque distribution controller based on the yaw rate, and the drive torque obtained by the left and right driving wheels is calculated. The rotational speed of the driving wheel and the obtained driving torque are input to the corresponding driving motor, and the desired driving torque of the left and right driving wheels is output to the racing model built by CarSim. The simulation results are shown in Figures 15–19.

It can be seen from the simulation diagram of position tracking in Figure 15 and the simulation diagram of lateral position tracking error in Figure 16 that, except for the error of 0.2 m in sharp corners, the other position tracking errors are less than 0.1 m, as can be seen from the simulation diagram of steering wheel angle in Figure 17. It can be seen that the total rotation angle composed of the target rotation angle and the feedback rotation angle changes smoothly and meets the actual steering angle requirements. It can be seen from the simulation diagram of running speed in Figure 18 and the simulation diagram of left and right wheel drive torque in Figure 19 that the initial torque is positive. In an accelerating condition, the additional yaw moment is provided by the differential torque to compensate for the tracking error when understeer occurs at the corner, and the driving torque on both sides is basically the same when it is close to a straight line. Therefore, the addition of the differential assisted steering control strategy trajectory tracking controller not only reduces the tracking error, but also assists the driverless racing car to pass the tight curve track smoothly.

##### 5.4. Actual Car Test Verification

In order to verify the effect of the designed trajectory tracking controller, the actual car test verification analysis is carried out. Using Liaoning University of Technology's dual-motor-driven driverless racing car as an experimental platform, in the open and flat ground, a curve simulation working condition was designed according to the high-speed tracking project in the competition, and the trajectory tracking of the driverless racing car without differential drive was compared. In integrated control strategy for control and trajectory tracking of driverless cars, as shown in Figure 20, the driverless car carries on the actual car test according to the given track. According to the coordinate information of the cone and barrel located by the lidar, camera, and GPS, plan the desired tracking trajectory curve, which is shown by the visualization interface of the ROS system and the desired trajectory curve is shown in Figure 21.

The trajectory tracking control experiment of a driverless car without differential drive assisted steering is carried out. The comparison of actual car experimental data is shown in Figures 22–23.

The built trajectory tracking controller can ensure that the driverless racing car can track the expected trajectory well, except for the fluctuation of the expected trajectory curve curvature, which can be seen from Figures 22 and 23. In addition to the large deviation, the lateral error between the actual tracking trajectory and the expected tracking trajectory is about 15 cm, which fully meets the required tracking accuracy in the actual car verification. It can be seen from the experimental diagram of steering angle in Figure 24 that the target rotation angle and the total input angle formed by the feedback angle are relatively stable at other times except for large changes.

In order to track the desired trajectory as much as possible at large turns, which meets the actual conditions of the car, the feedback angle can always be corrected in time when there is a lateral tracking deviation. The target angle follows the desired trajectory curve.

The actual car test of the trajectory tracking control of the driverless racing car based on the differential assisted steering of the yaw rate is shown in Figures 25–29.

It can be concluded that the strategy which uses additional differential drive torque to assist steering control improves the accuracy of trajectory position tracking of driverless car, and the effect is more effective at big turns from Figures 25 and 26. Obviously, the average error is controlled at about 10 cm, which is less than the tracking error when the differential drive torque control strategy is not added, and the tracking accuracy is improved. It can be seen from Figure 27 that the speed fluctuates up and down the expected speed and finally can keep up with the expected speed. When the car turns to the right, the driving torque of the left rear wheel is greater than the driving torque of the rear wheel. The differential driving torque provides additional yaw moment for the car, which is used to reduce the steering wheel slip angle and understeer tendency and improve the car track accuracy.

It can be seen from Figure 28 that the total input angle of the desired trajectory changes greatly in order to track the desired trajectory as much as possible at a large turn, and the other time is relatively stable. It meets the actual conditions of the car, and when the lateral tracking deviation occurs, the feedback corner can always correct the target corner to track the desired trajectory curve in time. And when the lateral tracking deviation occurs, the feedback angle can always correct the target angle to track the desired trajectory curve in time.

It can be seen from Figure 29 that when the car turns to the right, the driving torque of the left rear wheel is greater than the driving torque of the rear wheel, and the resulting differential driving torque provides additional yaw moment for the car to reduce the steering wheel slip angle and insufficient steering trend improves the accuracy of racing track tracking.

#### 6. Conclusion

(1)Aiming at improving the accuracy of trajectory tracking and the tracking timeliness, the tracking accuracy and tracking targets in the process of trajectory tracking of driverless racing car are analyzed. The optimal control theory is applied to design the LQR active steering controller of the driverless racing car. At the same time, the dual-motor-driven car is introduced to enable differential drive. Based on the fuzzy control theory, the differential drive control method is designed to improve the accuracy of estimating tracking degree.(2)Simulation verification and actual car test verification results show that, under given conditions, the lateral tracking error of the trajectory tracking controller designed in this paper is 0.15 m and it can track quickly when the trajectory deviation occurs. After adding the differential drive control, the trajectory tracking control accuracy is improved by nearly 30% with strong accuracy and timeliness. The developed method can be applied in multiagent system [19] and complex pipeline networks [20] in the future.#### Data Availability

The data used to support the findings of this study are included within the article.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work was supported by the National Science Foundation of China (51675257 and 51305190) and Beijing Key Laboratory of Measurement & Control of Mechanical and Electrical System Technology, Beijing Information Science & Technology University (KF20202223201).