## 3 Design of Trajectory Tracking Control System
### 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]:  
Figure 4: The process diagram of the PSO algorithm used to implement the optimal design of MPC parameters. \[\left\{ \begin{array}{l}\overset{\bullet}{\beta}=\frac{k_{1}+k_{2}}{mv_{x}}\beta+( \frac{ak_{1}-kb_{2}}{mv_{x}^{2}}-1)\omega-\frac{k_{1}}{mv_{x}}\delta_{f}-\frac{ k_{2}}{mv_{x}}\delta_{f}\\ \overset{\bullet}{\omega}=\frac{ak_{1}-bb_{2}}{l_{2}}\beta+\frac{a^{2}k_{1}+b^ {2}k_{2}}{l_{2}v_{x}}\omega-\frac{ak_{1}}{l_{1}}\delta_{f}+\frac{bb_{2}}{l_{2}} \delta_{f}+\frac{1}{l_{2}}\Delta M\end{array} \right. \tag{20}\]  
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:  
\[\mathbf{e}=\left[ \begin{array}{c}e_{1}\\ e_{2}\end{array} \right]=\left[ \begin{array}{c}\beta-\beta_{d}\\ \omega-\omega_{d}\end{array} \right] \tag{21}\]  
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). \[S=\lambda_{1}e+\lambda_{2}\overset{\bullet}{e}+\lambda_{3}\int_{o}^{t}edt= \left[ \begin{array}{c}\lambda_{11}\\ \lambda_{12}\end{array} \right]\left[ \begin{array}{c}e_{1}\\ e_{2}\end{array} \right]+\left[ \begin{array}{c}\lambda_{21}\\ \lambda_{22}\end{array} \right]\left[ \begin{array}{c}\overset{\bullet}{e_{1} }\\ \overset{\bullet}{e_{2}}\end{array} \right]+\left[ \begin{array}{c}\lambda_{3 1}\\ \lambda_{32}\end{array} \right]\left[ \begin{array}{c}\int_{o}^{t}e_{1}dt\\ \int_{o}^{t}e_{2}dt\end{array} \right] \tag{22}\]  
In order to implement the dynamic sliding mode, the exponential reaching rate is used as follows:  
\[\overset{\bullet}{S}=-\varepsilon\text{sgn}(S)-KS=- \begin{bmatrix}e_{1}&0\\ 0&\varepsilon_{2}\end{bmatrix}\begin{bmatrix}\text{sgn}(S_{1})\\ \text{sgn}(S_{2})\end{bmatrix} - \begin{bmatrix}K_{1}&0\\ 0&K_{2}\end{bmatrix}\begin{bmatrix}S_{1}\\ S_{2}\end{bmatrix}  \tag{23}\]  
In the above equation, \(\varepsilon\) is the sliding mode boundary layer thickness and K is the reaching rate index, where \(\varepsilon_{1}\), \(\varepsilon_{2}\), K\({}_{1}\), and K\({}_{2}\) are all positive numbers. The output variable is U = \(\left[ \begin{array}{c}\delta_{\text{r}}\\ \Delta\text{M}\end{array} \right]\), and it can be obtained by simultaneous Equations (20)-(23), as follows:  
\[\left\{ \begin{array}{l}\delta_{r}=\frac{k_{1}+k_{2}}{k_{2}}\beta+(\frac{ak_{1 }-bk_{2}}{mv_{x}^{2}}-1)\frac{mv_{x}\omega}{k_{2}}-\frac{k_{1}}{k_{2}}\delta_{f} -\frac{mv_{x}}{k_{2}}(\frac{-\varepsilon_{1}S_{1}-K_{1}S_{1}}{\lambda_{11}}- \frac{\lambda_{12}}{\lambda_{11}}\varepsilon_{1}^{\bullet\bullet}-\frac{ \lambda_{13}}{\lambda_{11}}\varepsilon_{1}+\overset{\bullet}{\beta_{d}})\\ \Delta M=-(ak_{1}-bk_{2})\beta-\frac{a^{2}k_{1}+b^{2}k_{2}}{v_{x}}\omega+ak_{1} \delta_{f}-bk_{2}\delta_{f}-I_{2}(\frac{-\varepsilon_{2}S_{2}-K_{2}S_{2}}{ \lambda_{21}}-\frac{\lambda_{22}}{\lambda_{21}}\varepsilon_{2}^{\bullet \bullet}-\frac{\lambda_{23}}{\lambda_{21}}\varepsilon_{2}+\overset{\bullet}{ \omega_{d}})\end{array} \right. \tag{24}\]  
In order to eliminate the possible chattering problem, the continuous function sat(S) is used instead of sgn(S). \[sat(S)=\left\{ \begin{array}{l}1S>\Delta\\ \lambda S\Big{|}S\Big{|}\leq\Delta,\ \Delta=\frac{1}{\lambda}\\ -1S<-\Delta\end{array} \right. \tag{25}\]  
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).