# Trajectory-Tracking Control of Unmanned Vehicles Based on Adaptive Variable Parameter MPC
## 4 Adaptive Trajectory-Tracking Controller Design
### Time-Domain Adaptive Design  
As one of the important parameters in the model predictive control algorithm, the prediction time domain \(N_{p}\) and control time domain \(N_{c}\) play a key role in the control accuracy of the algorithm [32]. Therefore, it is necessary to select the corresponding values of \(N_{p}\) and \(N_{c}\) for different controlled objects and different external environments.  
When the unmanned vehicle is traveling on the road under low-adhesion conditions, the body stability of the unmanned vehicle should be considered first, and then a larger value of the prediction time domain \(N_{p}\) should be selected so as to predict the farther body traveling state and road information and make corresponding adjustments in time. On the contrary, when traveling on the road under high-adhesion conditions, a smaller prediction time domain \(N_{p}\) has a better control effect, which can improve the trajectory-tracking accuracy of the unmanned vehicle on the current road. At the same time, the selection of the prediction time domain \(N_{p}\) must also consider the influence of the road curvature, and when the curvature of the path tracked by the front side is high, the length of the prediction time domain should be appropriately reduced to improve the real-time performance of the controller in order to ensure the tracking accuracy. In summary, when the unmanned vehicle is traveling in complex working conditions, the size \(N_{p}\) should be adjusted according to the specific road conditions.  
The road curvature formula based on the definition of curvature is (Mean Road Curvature, MRC)  
\[MRC=\frac{1}{N_{p}}\sum_{i=1}^{N_{p}}\frac{\left|Y_{ref}(X_{i})^{\prime\prime} \right|}{(1+Y_{ref}(X_{i})^{\prime 2})\frac{3}{2}} \tag{33}\]  
where \(Y_{ref}(X_{i})^{\prime}\) and \(Y_{ref}(X_{i})^{\prime\prime}\) are the first-order and second-order derivatives of the pre-sighting point, respectively. In order to ensure the real-time performance of the controller [32], this study is based on the centralized and uniformly varying two-dimensional Gaussian function to design the function of the prediction time domain about the road surface adhesion coefficient and road curvature:  
\[N_{p}=round\Bigg{(}A\exp\Bigg{(}\frac{(\mu-\mu_{\max})^{2}}{\sigma_{1}{}^{2}} +\frac{MRC^{2}}{\sigma_{2}{}^{2}}\Bigg{)}\Bigg{)} \tag{34}\]  
where \(A\) is the upper limit of the prediction time domain, \(\mu_{\max}\) is the upper limit of the road surface attachment coefficient, \(\sigma_{1}\) is the influence factor of the road surface attachment coefficient, and \(\sigma_{2}\) is the influence factor of the road curvature. According to the vehicle characteristics of the calibration parameters, the predicted time domain offline database can be obtained, and its three-dimensional distribution is shown in Figure 7.  
As shown in Figure 8, the solid line is the reference path, with the same basic parameters as the controller; the larger the control time domain \(N_{c}\) is, the higher the control accuracy is, but at the same time, too large \(N_{c}\) will increase the computational burden of the controller. On the contrary, if \(N_{c}\) is too small, the controller will minimize the average error in the prediction time domain, which will lead to poor tracking accuracy at the current position of the unmanned vehicle.  
Figure 7: The 3D response surface in the predicted time domain.  
Therefore, when the MRC is large, \(N_{c}\) can be appropriately increased to provide more time to adjust the control inputs to accommodate the curved paths and improve the control accuracy and stability. Conversely, it is appropriate to decrease \(N_{c}\), which reduces the control system computation [17]. Combined with \(N_{p}\), the control time domain expression is designed as  
\[N_{c}=round\big{(}\gamma N_{p}(1+\xi MRC)\big{)} \tag{35}\]  
where \(\gamma\) is the predicted time domain weight coefficient, \(0<\gamma<0.5\), \(\xi\) is the road curvature gain coefficient, \(1<\xi<10\).