## 3 Design of Trajectory Tracking Control System
### 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:  
\[\left\{ \begin{array}{l}F_{2 ff}=\frac{mgb}{2(a+b)}-\frac{ma_{a}h}{2(a+b)}- \frac{ma_{a}bh}{2B_{f}(a+b)}\\ F_{2 ft}=\frac{mgb}{2(a+b)}-\frac{ma_{a}h}{2(a+b)}+\frac{ma_{a}bh}{2B_{f}(a+b)}\\ F_{2 ft}=\frac{mga}{2(a+b)}+\frac{ma_{a}h}{2(a+b)}-\frac{ma_{a}bh}{2B_{f}(a+b)}\\ F_{2 rr}=\frac{mga}{2(a+b)}+\frac{ma_{a}h}{2(a+b)}+\frac{ma_{a}bh}{2B_{f}(a+b)} \end{array} \right. \tag{35}\]  
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:  
\[\left\{ \begin{array}{l}Fzf=G(\frac{b}{L}-\frac{a_{a}h}{L})\\ Fzr=G(\frac{a}{L}+\frac{a_{a}h}{L})\end{array} \right. \tag{36}\]  
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:  
\[\left\{ \begin{array}{l}\frac{(Fx_{ff}+Fx_{ff})}{Fz_{ff}}=\frac{(Fx_{4f}+Fx_{ rr})}{Fx_{rr}}\\ \frac{B(Fx_{ff}-Fx_{ff})}{2 Fz_{ff}}=\frac{B(Fx_{7r}-Fx_{4r})}{2 Fzr}\\ T_{fl}+T_{fr}+T_{rt}+T_{rr}=F_{t,des}*R\\ (Fx_{fr}-Fx_{ff})\frac{B}{2}+(Fx_{rr}-Fx_{rt})\frac{B}{2}=\Delta M^{*}\end{array} \right. \tag{37}\]  
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\({}_{2}^{\bullet}\)U\(=\) T - RF, it can be solved as follows:  
\[T_{ij}=RF_{ij}(ij=fl,fr,rl,rr) \tag{38}\]  
Furthermore, the driving torque of each wheel can be solved as follows:  
\[\left\{ \begin{array}{l}T_{ff}=\frac{Fz_{ff}}{(Fz_{ff}+Fz_{ff}+Fz_{2 rf})}*(T -\frac{\Delta M+R}{2B_{f}})\\ T_{fr}=\frac{Fz_{ff}}{(Fz_{ff}+Fz_{ff}+Fz_{2 rf})}*(T+\frac{\Delta M+R}{2B_{f}}) \\ T_{rf}=\frac{Fz_{ff}}{(Fz_{ff}+Fz_{ff}+Fz_{2 rf})}*(T-\frac{\Delta M+R}{2B_{r}}) \\ T_{rr}=\frac{Fz_{rr}}{(Fz_{ff}+Fz_{rf}+Fz_{2 rf})}*(T+\frac{\Delta M+R}{2B_{r}}) \end{array} \right. \tag{39}\]  
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 wheelwear, and improve wheel life. The slip rate of the wheel is calculated with Equation (40), as follows:  
\[\lambda_{\rm i}=\frac{\omega_{\rm i}r-v_{x}}{\omega_{\rm i}}\times 100\% \tag{40}\]  
where \(\lambda_{\rm i}\) is the slip rate of the wheel, \(\omega_{\rm i}\) is the angular velocity of the wheel, \(\rm r\) is the rolling radius of the wheel, and \(\rm 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.