## 3 Design of IPFC Controller
### Improved PFC (IPFC) Control Algorithm
\tag{43}\]  
Converting Equation (31) into vector form, we can get:  
\[J=k_{i}e^{T}e+k_{p}(\Delta e)^{T}\Delta e+k_{d}\left(\Delta^{2}e\right)^{T} \Delta^{2}e+\beta(\Delta u)^{T}\Delta u \tag{44}\]  
Because the value of \(\beta(\Delta u)^{T}\Delta u\) is relatively small, and its existence is to make the input \(u\) more accurate, and the main research in this paper is on the control effect, so the influence of this is not considered. To simplify the calculation, the objective function formula can be omitted as follows:  
\[J=k_{i}e^{T}e+k_{p}(\Delta e)^{T}\Delta e+k_{d}\left(\Delta^{2}e\right)^{T} \Delta^{2}e \tag{45}\]  
By substituting Equation (43) into the above equation, we get:  
\[ \begin{array}{l}J=k_{i}(\mu g-d)^{T}(\mu g-d)+k_{p}(\Delta\mu\Delta g- \Delta d)^{T}(\Delta\mu\Delta g-\Delta d)\\ +k_{d}\left(\Delta^{2}\mu\Delta^{2}g-\Delta^{2}d\right)^{T}\left(\Delta^{2} \mu\Delta^{2}g-\Delta^{2}d\right)\\ =k_{i}(g^{T}\mu^{T}-d^{T})(g\mu-d)+k_{p}\left(\Delta g^{T}\Delta\mu^{T}-\Delta d ^{T}\right)(\Delta\mu\Delta g-\Delta d)\\ +k_{d}\left(\Delta^{2}g^{T}\Delta^{2}\mu^{T}-\Delta^{2}d^{T}\right)\left( \Delta^{2}\mu\Delta^{2}g-\Delta^{2}d\right)\\ =k_{i}\left(g^{T}\mu^{T}\mu g-g^{T}\mu^{T}d-d^{T}\mu g+d^{T}d\right)\\ +k_{i}\left(g^{T}\mu^{T}\mu g-g^{T}\mu^{T}d-d^{T}\mu g+d^{T}d\right)\\ +k_{d}\left(\Delta^{2}g^{T}\mu^{T}\Delta^{2}\mu^{2}\Delta^{2}g-\Delta^{2}g^{T }\Delta^{2}\mu^{T}\Delta^{2}g-\Delta^{2}d^{T}\Delta^{2}\mu\Delta^{2}g+\Delta ^{2}d^{T}\Delta^{2}d\right)\\ =k_{i}(g^{T}\mu^{T}\mu g-g^{T}\mu^{T}d-d^{T}\mu g+d^{T}d)\\ +k_{p}\left[\Delta g^{T}\left(1-q^{-1}\right)\mu^{T}\left(1-q^{-1}\right)\mu \Delta g-\Delta g^{T}\left(1-q^{-1}\right)\mu^{T}\Delta d-\Delta d^{T}\left(1-q ^{-1}\right)\mu\Delta g+\Delta d^{T}\Delta d\right]\\ +k_{d}\left[\begin{array}{l}\Delta^{2}g^{T}\left(1-2q^{-1}+q^{-2}\right)\mu^ {T}\left(1-2q^{-1}+q^{-2}\right)\mu\Delta^{2}g-\Delta^{2}g^{T}\left(1-2q^{-1 }+q^{-2}\right)\mu^{T}\Delta^{2}d\end{array}\right]\\ -\Delta^{2}d^{T}\left(1-2q^{-1}+q^{-2}\right)\mu\Delta^{2}g+\Delta^{2}d^{T} \Delta^{2}d\end{array}  \tag{46}\]The purpose of objective function optimization is to obtain a set of optimal coefficients and then calculate the optimal control input so that \(J\) obtains a minimum value. When \(\partial/\partial\mu=0\), the control input can be:  
\[ \begin{array}{l}k_{i}\big{(}g^{T}2\mu g-g^{T}d-d^{T}g\big{)}\\ +k_{p}\big{[}\Delta g^{T}\big{(}1-q^{-1}\big{)}\big{(}1-q^{-1}\big{)}2\mu\Delta g -\Delta g^{T}\big{(}1-q^{-1}\big{)}\Delta d-\Delta d^{T}\big{(}1-q^{-1}\big{)} \Delta g\big{]}\\ +k_{d}\bigg{[}\begin{array}{c}\Delta^{2}g^{T}\big{(}1-2q^{-1}+q^{-2}\big{)} \big{(}1-2q^{-1}+q^{-2}\big{)}2\mu\Delta^{2}g\\ -\Delta^{2}g^{T}\big{(}1-2q^{-1}+q^{-2}\big{)}\Delta^{2}d-\Delta^{2}d^{T}\big{(} 1-2q^{-1}+q^{-2}\big{)}\Delta^{2}g\end{array}\bigg{]}=0\end{array}  \tag{47}\]  
The formula can be simplified as follows:  
\[ \begin{array}{l}2k_{i}g^{T}\mu g+2\big{(}1-q^{-1}\big{)}^{4}k_{p}g^{T}\mu g +2\big{(}1-2q^{-1}+q^{-2}\big{)}^{4}k_{d}g^{T}\mu g\\ =k_{i}\big{(}g^{T}d+d^{T}g\big{)}+k_{p}\big{(}1-q^{-1}\big{)}^{3}\big{(}g^{T}d +d^{T}g\big{)}+k_{d}\big{(}1-2q^{-1}+q^{-2}\big{)}^{3}\big{(}g^{T}d+d^{T}g \big{)}\end{array}  \tag{48}\]  
In this case, the linear weighting coefficient \(\mu\) is:  
\[ \begin{array}{l}\mu=\frac{k_{i}\big{(}g^{T}d+d^{T}g\big{)}+k_{p}\big{(}1-q^ {-1}\big{)}^{3}\big{(}g^{T}d+d^{T}g\big{)}+k_{d}\big{(}1-2q^{-1}+q^{-2}\big{)} ^{3}\big{(}g^{T}d+d^{T}g\big{)}}{2k_{i}g^{T}g+2\big{(}1-q^{-1}\big{)}^{4}k_{p} g^{T}g+2\big{(}1-2q^{-1}+q^{-2}\big{)}^{4}k_{d}g^{T}g}\\ =\frac{\big{[}k_{i}+k_{p}\big{(}1-q^{-1}\big{)}^{3}+k_{d}\big{(}1-2q^{-1}+q^{ -2}\big{)}^{3}\big{]}\big{(}g^{T}d+d^{T}g\big{)}}{2g^{T}g\big{[}k_{i}+\big{(}1 -q^{-1}\big{)}^{4}k_{p}+\big{(}1-2q^{-1}+q^{-2}\big{)}^{4}k_{d}\big{]}}\end{array}