# Path Tracking Control Strategy Based on Adaptive MPC for Intelligent Vehicles
## 3 MPC Controller Design Based on Stability Boundary
### Solve MPC Controller  
In the design process of MPC controllers, in addition to incorporating appropriate constraints, it is also necessary to design a suitable objective function. Given that a vehicle dynamics model is employed in this study, and numerous constraints are imposed, there may be instances of infeasible solutions during the computation process. To reduce computational complexity and enhance system operational efficiency, a slack variable is incorporated into the objective function of the MPC controller [35]. The objective function formulated in this study is expressed as follows:  
\[J(\xi(t),\mathbf{u}(t-1),\Delta\mathbf{U}(t))=\sum_{i=1}^{N_{\text{p}}}\parallel\ \mathbf{y}(t+i\ \ |\ \ t)-\mathbf{y}_{\text{ref}}(t+i\ \ |\ \ t)\parallel_{Q}^{2}+\sum_{i=1}^{N_{\text{c}}-1}\parallel\ \Delta\mathbf{u}(t+i\ \ |\ t)\parallel_{R}^{2}+ \rho\epsilon^{2} \tag{15}\]  
where \(\mathbf{Q}\) and \(R\) are the weighting matrices; \(\rho\) is the weight coefficient; and \(\epsilon\) is the relaxation factor. The first term of the objective function represents the discrepancy between the anticipated path and the system output. The second term accounts for the control increment of the system, while the third term serves to enable the controller to adjust the constraint range. The entire objective function is meticulously crafted to guarantee the accuracy, stability and viability of the controller during the path tracking procedure. The deviation between the predicted outputs (\(Y(k)\)) and the reference trajectory (\(y_{\text{ref}}(k)\)) is embedded into Equation (15), enabling the controller to minimize tracking errors while satisfying stability constraints. The controller cannot directly solve the path tracking optimization problem represented by Formula (15). Instead, it is necessary to transform this path tracking optimization problem into a quadratic programming problem that can be directly solved by the controller. Figure 2: \(\dot{\varphi}-\dot{y}\) stability boundary diagram. Note: Axis scales vary with operating conditions; the figure shows qualitative stability boundaries. During the optimization process of the objective function, since the variables to be solved are control increments within the control horizon, the established constraints need to be converted into forms involving control increments or the product of control increments and a transformation matrix. The following relationship exists between the control variable and the control increment of the system:  
\[\mathbf{u}(t+k)=\mathbf{u}(t+k-1)+\Delta\mathbf{u}(t+k)\]  
Therefore, it is set as follows:  
\[\mathbf{U}(t)=\mathbf{I}_{N_{\mathrm{c}}}\otimes\mathbf{u}(k-1)\]  
\[\mathbf{A}=\left( \begin{array}{cccccc}1&0&\cdots&0&0\\ 1&1&0&\cdots&0\\ 1&1&1&\ddots&\vdots\\ \vdots&\vdots&\vdots&\ddots&0\\ 1&1&1&\cdots&1\end{array} \right)\otimes\mathbf{I}_{\mathrm{m}}\]  
In the formula, \(\mathbf{I}_{N_{\mathrm{c}}}\) is a column vector with \(\mathbf{N}_{\mathrm{c}}\) rows; \(\mathbf{I}_{\mathrm{m}}\) is an identity matrix of dimension \(m\); \(\otimes\) denotes the _Kronecker_ product of two matrices; and \(\mathbf{u}(k-1)\) represents the actual control variable in the previous control horizon.