## 3 Design of IPFC Controller
### Improved PFC (IPFC) Control Algorithm  
The predictive functional control algorithm has good tracking ability and strong robustness for time-delay system control. PID control has a strong anti-interference ability. To control the system better, the structural features of proportional, integral, and differential in the PID control algorithm are added to the optimal objective function of the PFC, so that the improved controller has the advantages of both predictive functional control and PID control. From Equations (26) and (30), the PID-based PFC optimization function can be expressed as:  
\[ \begin{array}{l}J=\underset{i=1}{\overset{H}{\sum}}\Big{\{}k_{p}\times[ \Delta e(k+i)]^{2}+k_{i}\times[e(k+i)]^{2}+k_{d}\times\big{[}\Delta^{2}e(k+i) \big{]}^{2}\Big{\}}\\ +\beta\underset{i=1}{\overset{H-1}{\sum}}[\Delta u(k+i)]^{2}\end{array}  \tag{31}\]Make:  
\[\left\{ \begin{array}{l}e=\left[e(k+1)e(k+2)\cdots e(k+H)\right]^{T}\\ \Delta e=\left[\Delta e(k+1)\Delta e(k+2)\cdots\Delta e(k+H)\right]^{T}\\ \Delta^{2}e=\left[\Delta^{2}e(k+1)\Delta^{2}e(k+2)\cdots\Delta^{2}e(k+H) \right]^{T}\\ \Delta u=\left[\Delta u(k)\Delta u(k+1)\cdots\Delta u(k+H-1)\right]^{T}\\ \end{array} \right. \tag{32}\]  
From Equation (27) to Equation (30), we can get:  
\[ \begin{array}{l}y(k+i)-y_{r}(k+i)=\mu^{T}(k)g_{k}(i)+\\ \left\{(1-\beta^{i})y(k)-y_{c}(k+i)+\beta^{i}y_{c}(k)+C_{m}\big{(}A_{m}^{i}-I \big{)}X_{m}(k)\right\}\end{array}  \tag{33}\]  
Make:  
\[d(k+i)=\left\{\Big{(}1-\beta^{i}\Big{)}y(k)-y_{c}(k+i)+\beta^{i}y_{c}(k)+C_{m} \Big{(}A_{m}^{i}-I\Big{)}X_{m}(k)\right\} \tag{34}\]  
So:  
\[e(k+i)=y(k+i)-y_{r}(k+i)=\mu^{T}(k)g_{k}(i)+d(k+i) \tag{35}\]  
Make:  
\[\left\{ \begin{array}{l}g_{k}=\left[g_{k}(1)g_{k}(2)\cdots g_{k}(H)\right]^{ T}=\begin{bmatrix}g_{k1}(1)&g_{k1}(2)&\cdots&g_{k1}(H)\\ g_{k2}(1)&g_{k2}(2)&\cdots&g_{k2}(H)\\ \vdots&\vdots&\vdots&\vdots\\ g_{kN}(1)&g_{kN}(2)&\cdots&g_{kN}(H)\end{bmatrix}\\ \\ d=\begin{bmatrix}d(k+1)\\ d(k+2)\\ \vdots\\ d(k+H)\end{bmatrix}=\begin{bmatrix}d(k+1)-d(k)\\ d(k+2)-d(k+1)\\ \vdots\\ d(k+H)-d(k+H-1)\end{bmatrix}\\ \\ \Delta^{2}d=\begin{bmatrix}\Delta^{2}d(k+1)\\ \Delta^{2}d(k+2)\\ \vdots\\ \Delta^{2}d(k+H)\end{bmatrix}=\begin{bmatrix}\Delta d(k+1)-\Delta d(k)\\ \Delta d(k+2)-\Delta d(k+1)\\ \vdots\\ \Delta d(k+H)-\Delta d(k+H-1)\end{bmatrix}\end{array} \right. \tag{36}\]  
So there are:  
\[\left\{ \begin{array}{l}e=\left[\begin{array}{l}e(k+1)\\ e(k+2)\\ \vdots\\ e(k+H)\end{array}\right]=\left[\begin{array}{l}g_{k1}(1)&g_{k2}(1)&\cdots&g_{ kN}(1)\\ g_{k1}(2)&g_{k2}(2)&\cdots&g_{kN}(2)\\ \vdots&\vdots&\vdots&\vdots\\ g_{k1}(H)&g_{k2}(H)&\cdots&g_{kN}(H)\end{array}\right]\left[\begin{array}{l} \mu_{1}(k)\\ \mu_{2}(k)\\ \vdots\\ \mu_{N}(k)\end{array}\right]-\left[\begin{array}{l}d(k+1)\\ d(k+2)\\ \vdots\\ d(k+H)\end{array}\right]\\ =\Delta g_{k}^{T}\mu(k)-\Delta d\\ \\ \Delta^{2}e=\left[\begin{array}{l}\Delta^{2}(k+1)\\ \Delta e^{2}(k+2)\\ \vdots\\ \Delta e^{2}(k+H)\end{array}\right]\\ =\Delta^{2}g_{k}^{T}\mu(k)-\Delta^{2}de\\ \end{array} \right. \tag{37}\]Vectors and matrices are introduced here for easy derivation:  
\[\mu=\mu^{T}(k) \tag{38}\]  
Introduce the shift operator, then:  
\[\Delta\mu=\mu(k)-\mu(k-1)=\mu(k)-q^{-1}\mu(k)=\left(1-q^{-1}\right)\mu \tag{39}\]  
The same can be said for:  
\[ \begin{array}{l}\Delta^{2}\mu=\Delta\mu(k)-\Delta\mu(k-1)\\ =\left[\mu(k)-\mu(k-1)\right]-\left[\mu(k-1)-\mu(k-2)\right]\\ =\mu(k)-\mu(k-1)-\mu(k-1)+\mu(k-2)\\ =\mu(k)-2q^{-1}\mu(k)+q^{-2}\mu(k)\\ =\left(1-2q^{-1}+q^{-2}\right)\mu\end{array}  \tag{40}\]  
\[\left\{ \begin{array}{l}g=g_{k}(i)\\ \Delta g=\left(1-q^{-1}\right)g\\ \Delta^{2}g=\left(1-2q^{-1}+q^{-2}\right)g\\ \end{array} \right. \tag{41}\]  
\[\left\{ \begin{array}{l}d=d(k+i)\\ \Delta d=\left(1-q^{-1}\right)d\\ \Delta^{2}d=\left(1-2q^{-1}+q^{-2}\right)d\end{array} \right. \tag{42}\]  
\[\left\{ \begin{array}{l}e=\mu g-d\\ \Delta e=\Delta\mu\Delta g-\Delta d\\ \Delta^{2}e=\Delta^{2}\mu\Delta^{2}g-\Delta^{2}d\end{array} \right.