## 3 Design of Trajectory Tracking Control System
### Design of MPC Controller  
When tracking the reference path, the vehicle has the following relationship:  
\[\left\{ \begin{array}{l}\dot{\varphi}=\omega\\ \dot{Y}=v_{x}\varphi+v_{y}\end{array} \right. \tag{9}\]  
where \(\varphi\) is the actual heading angle of the vehicle and Y is the lateral position of the vehicle in the geodetic coordinate system. Combined with Equations (4) and (9), it can be transformed into the form of state space equation, where the state quantity is \(\mathrm{x}=\left[\mathrm{v}_{y},\omega,\varphi,\mathrm{Y}\right]\), the control quantity is \(\mathrm{\mu}=\delta_{\mathrm{f}}\), the output quantity is \(\mathrm{y}=\left[\varphi,\mathrm{Y}\right]\), and the state space equation is Equation (10). \[\left\{ \begin{array}{l}\dot{x}=Ax+Bu\\ y=Cx+Du\end{array} \right. \tag{10}\]  
\[\mathrm{where\ A=\left[ \begin{array}{ccc}\frac{\mathrm{k}_{1}+\mathrm{k}_{2}} {\mathrm{mv}_{\mathrm{x}}}&\frac{(\mathrm{ak}_{1}-\mathrm{b}\mathrm{k}_{2})}{ \mathrm{mv}_{\mathrm{x}}}-\mathrm{v}_{\mathrm{x}}&0&0\\ \frac{(\mathrm{ak}_{1}-\mathrm{b}\mathrm{k}_{2})}{\mathrm{l}_{2}\mathrm{v}_{ \mathrm{x}}}&\frac{(\mathrm{a}^{2}\mathrm{k}_{1}+\mathrm{b}^{2}\mathrm{k}_{2})} {\mathrm{l}_{2}\mathrm{v}_{\mathrm{x}}}&0&0\\ 0&1&0&0\\ 1&0&\mathrm{v}_{\mathrm{x}}&0\end{array} \right]\mathrm{;\ B=\left[ \begin{array} []{ccc}-\frac{\mathrm{k}_{1}}{\mathrm{m}}\\ -\frac{\mathrm{ak}_{1}}{\mathrm{k}_{2}}\\ 0\end{array} \right]\mathrm{;\ C=\left[\begin{array}  
variable in the MPC controller dramatically influences the actual controlled system, so it is necessary to restrict the increment of the control quantity and transform Equation (10). \[\left\{ \begin{array}{l}\zeta_{k+1}=A_{1}\xi_{k}+B_{1}\Delta U_{k}\\ \eta_{k}=C_{1}\xi_{k}\end{array} \right. \tag{11}\]  
where the new state quantity is \(\xi_{k}=\left[ \begin{array}{c}\widetilde{\mathrm{x}}_{\mathrm{k-1}}\\ \widetilde{\mathrm{u}}_{\mathrm{k}}\end{array} \right]\), and the change in the control quantity at each time compared with the previous time is called \(\Delta U_{k}\), \(\mathrm{A}_{1}= \begin{bmatrix}\mathrm{A}&\mathrm{B}\\ 0_{\mathrm{Nu*Nx}}&\mathrm{I}_{\mathrm{Nu*Nx}}\end{bmatrix} \); \(\mathrm{B}_{1}=\left[ \begin{array}{c}\mathrm{B}\\ \mathrm{I}_{\mathrm{Nu*Nu}}\end{array} \right]\); \(\mathrm{C}_{1}=\left[\mathrm{I}_{\mathrm{Nx*Nx}^{\prime}}0_{\mathrm{Nx*Nu}}\right]\); \(Nx\) is the number of states; and \(Nu\) is the number of control quantities. The system is assumed to be observable and controllable, and the sequence of control quantities is as follows:  
\[\Delta U=\left[\Delta u(k),\Delta u(k+1),\ldots,\Delta u(k+Nc-1)\right]^{T} \tag{12}\]  
The reference point of the reference path is the column vector of Np*1, and the expression is as follows:  
\[Y_{ref}=\left[y_{ref}(k+1),y_{ref}(k+2),\ldots,y_{ref}(k+Np)\right]^{T} \tag{13}\]  
Assume that the prediction vector Y of MPC is given by the following:  
\[Y=\left[X(k+1),X(k+2),\ldots,X(k+Np)\right]^{T} \tag{14}\]  
The objective function needs to add the deviation of the system state quantity and the size of the control quantity as the optimization objective to ensure that the uncrewed vehicle can track the reference path quickly and smoothly. The objective function is a quadratic optimization problem, which can be expressed as follows:  
\[J=(Y-Y_{ref})^{T}\mathrm{Q}(Y-Y_{ref})+\Delta\mathrm{U}^{T}R\Delta\mathrm{U} \tag{15}\]  
where Q and R are the weight matrices; and Np and Nc are the prediction and control time domains of MPC, respectively. This study mainly considers the control quantity limit constraint and the control increment constraint in the control process, and the control quantity limit constraint is as follows:  
\[\left\{ \begin{array}{l}u_{\min}(t+k)\leq u(t+k)\leq u_{\max}(t+k),k=0,1, \ldots,Nc-1\\ \Delta u_{\min}(t+k)\leq\Delta u(t+k)\leq\Delta u_{\max}(t+k),k=0,1,\ldots,Nc- 1\end{array} \right. \tag{16}\]  
In this paper, the front wheel angle is constrained, the constraint range is \([-0.44,0.44]\), the incremental constraint range is \([-0.005,0.005]\), and the unit is deg.