## 4 Improved Implicit GPC Time-Delay Compensation Algorithm
### Improved Implicit GPC  
Scroll the optimization to make the objective function minimum:  
\[J=E\{\sum_{j=1}^{P}[y(k+j)-y_{r}(k+j)]^{2}\ +\sum_{j=1}^{M}\lambda[\Delta u(k+j-1)^{2}]\} \tag{18}\]  
In the equation, \(E\) is the mathematical expectation, \(P\) is the maximum prediction length, \(M\) is the control length, \(M\leq P\), \(\lambda\) are the weighting coefficients, \(\Delta u(k+j-1)\) is the control increment and \(y_{r}(k+j)\) is the input reference trajectory. The GPC algorithm calculates \(y(k+j)\), needed to solve the Diophantine equation. To avoid complex calculation, an improved implicit GPC algorithm is presented in this paper. This algorithm directly identifies the controller parameters and does not need to solve the inverse matrix of the GPC algorithm. The algorithm, given the \(d_{{}_{th}}\) optimal prediction value, is:  
\[y(k+d\mid k)=X(k)w(k) \tag{5}\]  
\[X(k)=[\Delta u(k),\Delta u(k+1),\cdots,\Delta u(k+d-1),[]] \tag{20}\]  
\[w(k)=[g_{d-1},g_{d-2},\cdots g_{0},f(k+d)]^{T} \tag{21}\]  
Define the input soft coefficient \(\beta\) as:  
\[\Delta u(k+n)=(1+\sum_{i=1}^{n}\beta)\Delta u(k)\ \ (n=1\!\Rewrite Equation (18) of the performance index as the vector form:  
\[J=(Y-Y_{r})^{T}(Y-Y_{r})+\lambda\Delta U^{T}\Delta U \tag{24}\]  
Set \(\partial I/\partial\Delta U=0\) ; then, Equations (25) and (26) can be obtained:  
\[\Delta u(k)= [(GQ)^{T}(GQ)+\lambda Q^{T}Q]^{-1}(GQ)^{T}[W-F_{k}y(k)-H_{k} \Delta u(k-1)] \tag{25}\] \[u(k)= u(k-1)+\Delta u(k) \tag{26}\]  
In the above equations:  
\[Q= \begin{bmatrix}1&0&0&0&\cdots&0\\ 0&-a_{2}&-a_{3}&-a_{4}&\cdots&-a_{n}\\ 0&0&-a_{3}&-a_{4}&\cdots&-a_{n}\\.&.&.&.&.&.\\ 0&0&0&0&\cdots&-a_{n}\end{bmatrix}  \tag{27}\] \[F_{k}= \begin{bmatrix}-a_{1}&-a_{2}&-a_{3}&-a_{4}&\cdots&-a_{n}\\ -a_{2}&0&-a_{3}&-a_{4}&\cdots&-a_{n}\\ -a_{3}&0&0&-a_{4}&\cdots&-a_{n}\\.&.&.&.&.&.\\ -a_{n}&0&0&0&\cdots&-a_{n}\end{bmatrix} \] (28) \[G= \begin{bmatrix}g_{0}&&&0\\ g_{1}&g_{0}&&\\ &&O&\\ g_{N-1}&g_{N-2}&g_{0}\end{bmatrix} \] (29) \[H_{k}= \begin{bmatrix}b_{2}&b_{3}&b_{4}&\cdots&b_{n}\\ 0&b_{3}&b_{4}&\cdots&b_{n}\\.&.&.&\cdots&.\\ 0&0&0&\cdots&0\end{bmatrix}  \tag{30}\]  
Due to the existence of the soft change matrix, it can be seen that no matter how the length of the predictive domain changed, the control value always is \(\Delta u(k)\). Secondly, the calculation of the inverse matrix is avoided, greatly reducing the calculation time and ensuring the speediness of the system. However, the algorithm still retains the basic characteristics of the generalized predictive control. In order to accelerate the response speed of the system and to restrain overshooting, this paper proposed an improved implicit GPC algorithm. The next step control increment value is used for the compensation of Equation (26), and the real control value can be obtained as:  
\[u(k)= u(k)+\partial\Delta u(k+1),\ \partial\in(0,1) \tag{31}\]  
The above equation is equivalent to an increase of the differential effects on control system; it will accelerate the response speed of the system. Since the improved implicit GPC algorithm is used in the controller, so the control value sequence of the future \(N\) cycles (\(N\) is the length of the control sequence) at time \(k\) can be calculated, but the specific use of the control sequence that acts on the actuator can be determined according to the relationship between the time delay and the sampling period. Assuming that the system sampling period is \(T\), the time delay of the current control cycle is \(\tau\). Let:  
\[n= \begin{cases}\left[\tau/T\right],&\text{if $\tau/T$ is an integer}\\ \left[\tau/T\right]+1,&\text{if $\tau/T$ is not an integer}\end{cases}  \tag{32}\]  
Select \(u(k+n\,|\,k)\) as the current control value. Therefore, after a delay of \(\tau\), the control value is acting on the controlled object at the \(k+n\) moment; the control system with time delay is transformed into a control system without time delay. The improved implicit GPC time-delay compensation steps of this paper can be expressed as follows:  
Step 1: Set the initial value.