Trajectory Tracking Control in Real-Time of Dual-Motor-Driven Driverless Racing Car Based on Optimal Control Theory and Fuzzy Logic Method

. 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 diﬀerential 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 diﬀerential drive of dual-motor-driven racing car, the dual motors diﬀerential drive fuzzy controller is designed and integrated driving with active steering control. Simulation analysis and actual car veriﬁcation show that this integrated control method can ensure that the car tracks diﬀerent race tracks well and improve the track tracking control accuracy by nearly 30%.


Introduction
e 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].e 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].e 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].e 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].
e 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].
e University of California proposed a "dual loop" control method.e 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. is method's effectiveness was verified by simulation experiments [7].e 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].e 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].e 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.erefore, 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.

Tracking Control Strategy of Driverless
Racing Car e 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.
e steering control part adopts the optimal control algorithm.rough 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.e control amount is the steering wheel angle.
e 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.
is integrated control method can improve the accuracy and stability of the driverless racing car in the trajectory tracking process.

Optimal Steering Control Algorithm
is 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 y of the car and the racing angle φ of the car.e lateral position y of the car is the distance from the car to the center of rotation.e racing direction angle φ is between the X axis of the Earth coordinate system and the front of the car.
e longitudinal speed at the center of mass of the vehicle is represented by V x .
Ignoring the influence of road slope, along the y-axis: Lateral acceleration a y is composed of movement acceleration € y along the y-axis and centripetal acceleration v v _ φ: 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: 2Complexity 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.e front wheel slip angle: From this, the vehicle lateral tracking error state equation is built.
e rear wheel slip angle can be approximately expressed as erefore, 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 v y � _ y, and (8) can be abbreviated to as (9).
Finally, the state equation model of the driverless car is shown in (10).Complexity e racing car parameters are shown in Table 1, and Table 2 shows the definition of symbols used in the above expressions.
e 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.e tracking error of the desired path direction and distance is the system variable to build a racing dynamics model.Let e l 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 e φ 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 e lateral acceleration required for racing is erefore, the lateral acceleration error of the car is e lateral speed error of the car is en the heading error of the car is shown in (15): Combining and simplifying the above formulas ( 10) to ( 15), ( 16) can be obtained: where ω des is the yaw rate in the desired trajectory, e matrices A, B 1 , and B 2 are Since driverless cars are highly complex nonlinear timevarying systems using linear quadratic optimal control methods, the above models must first be linearized and discretized.
is 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 B 2 _ φ qw in the formula is ignored.e cost function J of steering control is where Q is the state weighting matrix, R is the control variable weighting matrix, Q f is the final state weighting matrix, x t is the tracking error state variable, δ t is the control variable, and x N is the final state tracking error.e 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.e expected steering wheel angle is In this formula, δ * (t) is the feedforward control amount of the steering wheel angle.
is 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.e calculation of the lateral error is shown in Figure 4.
e 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.
e specific expression is shown as ( 24). e l � dy cos φ des  − dx sin φ des , Among them, _ φ is the vehicle yaw rate, which can be obtained by the vehicle body yaw rate sensor on the racing car, and _ φ des 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.

Differential Drive Control Algorithm
e 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.e 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 Complexity In the formula, K is the steering stability factor of the car.
Set the ideal side slip angle of the center of mass, namely, X � 0, 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 en the desired yaw rate is In the formula, μ max is the peak adhesion coefficient between the road and racing tires.
is 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.ree membership functions are formed by using common triangular membership functions and trapezoidal membership functions.
e yaw rate deviation and the rate of change of the deviation are taken as (− 1, 1). e 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.e 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.
e 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.
e 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.6 Complexity e designed fuzzy controller has two inputs and one output.e difference between the actual yaw rate and the desired yaw rate and the change of the difference are used as the input.e output is the additional yaw moment M fj , 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 ΔT: In the formula, r tire 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

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.erein, 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.

Straight-Line Tracking.
e 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.e simulation results of straight-line working conditions are shown in Figures 7-10.e 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.

Curve Path Tracking.
In curve tracking, the minimum turning radius is set to 3.5 m. e car still tracks the desired trajectory at the speed of 3 m/s.e 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.e 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.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 8 Complexity the corner, and the driving torque on both sides is basically the same when it is close to a straight line.erefore, 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.

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.e 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  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   Complexity the right, the driving torque of the left rear wheel is greater than the driving torque of the rear wheel.e 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 12 Complexity 14 Complexity 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.

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.e 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.e developed method can be applied in multiagent system [19] and complex pipeline networks [20] in the future.Complexity

Figure 1 :
Figure 1: Integrated control strategy for trajectory tracking of driverless car.

Figure 2 :
Figure 2: Lateral dynamics model of driverless car.

Figure 3 :
Figure 3: Side slip angle of driverless car tires.

Figure 4 :Figure 5 :
Figure 4: Schematic diagram of calculation of lateral error of driverless car.

Figure 19 :
Figure 19: Left and right driving torque simulation diagram.

Table 1 :
Parameters of driverless car.

Table 2 :
Definition of symbols in the lateral tracking model of driverless racing car.

Table 3 :
Fuzzy control rule table.
l � a y − a des