# Trajectory Tracking Control Strategy of 20-Ton Heavy-Duty AGV Considering Load Transfer
## 4 Design of Trajectory Tracking Control Strategy Considering Load Transfer
### Lateral Load Transfer IMPC Control Strategy
#### 4.2.1 Design of Prediction Model  
When designing the prediction model, it is necessary to consider which variables will predict the output. At present, most of the MPC controllers used in trajectory tracking control only consider predicting the tracking error and ignore the influence of load transfer when designing the prediction model. In this paper, the following improvements are made: the lateral acceleration \(a_{y}\) is optimized to reduce the lateral load transfer. In (24), the rotation angle is assumed to be a small angle, \(\delta_{f}-\delta_{r}\) is used to approximately replace \(\tan\!\delta_{f}-\tan\!\delta_{r}\), and the speed \(v\) and the difference between the front and rear rotation angles \(\delta_{f}-\delta_{r}\) are predicted to improve the tracking accuracy of AGV. The adverse effects of load transfer on the vehicle are reduced. In order to apply the linear error model obtained from (14) to the design of the model predictive controller, the forward Euler method is used to discretize Equation (14), and the state space equation of the discrete system is obtained, as shown in Equation (31). \[X_{e}(k+1)=a_{k}X_{e}(k)+b_{k}u_{e}(k) \tag{31}\]  
where \(k\) is a moment, \(T\) is the sampling period, \(a_{k}= \begin{bmatrix}1&0&-Tv_{r}\sin(\theta_{r})\\ 0&1&Tv_{r}\cos(\theta_{r})\\ 0&0&1\end{bmatrix} \), \(b_{k}= \begin{bmatrix}-Tv_{r}\sin(\theta_{r})(1+\tan^{2}\delta_{fr})\\ 2&\frac{-Tv_{r}\sin(\theta_{r})(1+\tan^{2}\delta_{fr})}{2}&T\cos(\theta_{r})\\ \frac{Tv_{r}\cos(\theta_{r})(1+\tan^{2}\delta_{fr})}{2}&\frac{Tv_{r}\cos( \theta_{r})(1+\tan^{2}\delta_{fr})}{2}&T\sin(\theta_{r})\\ \frac{Tv_{r}(1+\tan^{2}\delta_{fr})}{I_{f}+I_{r}}&-\frac{Tv_{r}(1+\tan^{2} \delta_{fr})}{I_{f}+I_{r}}&\frac{T(\tan\delta_{fr}-\tan\delta_{fr})}{I_{f}+I_{ r}}\end{bmatrix} \). To facilitate the constraint of the control increment and optimize the influencing factors \(v\) and \(\delta_{f}-\delta_{r}\) of the lateral acceleration in the objective function, a new state variable \(\xi(k)\) is constructed by combining \(X_{e}(k)\) and \(u_{e}(k-1)\); that is, \(\xi\big{(}k\ =\ [X_{e}(k),u_{e}(k-1\ )\ ]\ ^{T}\). Then, by introducing the coefficient \(C\), the required output variable \(\eta(k)\) is obtained as \(\eta(k)=\left[x(k)-x_{r}(k),y(k)-y_{r}(k),\theta(k)-\theta_{r}(k),\ (\delta_{f}(k-1)-\delta_{fr}(k-1\ ))-(\delta_{r}(k-1)-\delta_{rr}(k-1)),\ v(k-1\ )-v_{r}(k-1) \right]^{T}\). The first three items represent the longitudinal, lateral, and yaw angle errors, respectively, and the last two items are related to the lateral acceleration. The state-space expression is \[ \begin{cases}\xi(k+1)=A_{k}\xi(k)+B_{k}\Delta u(k)\\ \eta(k)=C\xi(k)\end{cases}  \tag{32}\]  
where \(A_{k}= \begin{bmatrix}a_{k}&b_{k}\\ 0_{N_{k}\times N_{k}}&{}_{N_{k}}\end{bmatrix} \), \(B_{k}= \begin{bmatrix}b_{k}\\ I_{N_{k}}\end{bmatrix} \), \(C= \begin{bmatrix}I_{N_{k}}&0_{N_{k}\times N_{k}}\\ 0_{1}\times_{N_{k}}&c_{\xi}\\ 0_{1}\times_{N_{k}}&c_{\eta}\end{bmatrix} \), \(c_{\xi}=[1,-1,0]\), \(c_{\eta}=[0,0,1]\). The future horizon of the system is \(N_{p}\), the control horizon is \(N_{c}\), and the predictive output of each step in the predictive time domain is  
\[Y=\Psi_{g}(k)+\Theta\Delta U \tag{33}\]  
where \(Y= \begin{bmatrix}\eta(k+1)&\eta(k+2)&\cdots&\eta(k+N_{c})&\cdots&\eta\left(k+ N_{p}\right)\end{bmatrix} ^{T}\),  
\[ \begin{split}\Psi=\begin{bmatrix}CA_{k}&CA_{k}^{2}&\cdots&CA_{k} ^{N_{c}}&\cdots&CA_{k}^{N_{p}}\end{bmatrix}^{T},\\ \Delta U=\begin{bmatrix}\Delta u(k)&\Delta u(k+1)&\cdots&\Delta u(k+N_{c}-1) \end{bmatrix}^{T},\\ \Theta=\begin{bmatrix}CB_{k}&0&0&0\\ CA_{k}B_{k}&CB_{k}&0&0\\ \cdots&\cdots&\ddots&\cdots\\ CA_{k}^{N_{c}-1}B_{k}&CA_{k}^{N_{c}-2}B_{k}&\cdots&CB_{k}\\ CA_{k}^{N_{c}}B_{k}&CA_{k}^{N_{c}-1}B_{k}&\cdots&CA_{k}B_{k}\\ \vdots&\vdots&\ddots&\vdots\\ CA_{k}^{N_{p}-1}B_{k}&CA_{k}^{N_{p}-2}B_{k}&\cdots&CA_{k}^{N_{p}-N_{c}-1}B_{k} \end{bmatrix}.\end{split}