## 3 Proposed LQRC and LQRIC for _Lc_-Hapf  
### Linear Quadratic Regulator Control (LQRC) for LC-Hapf  
#### 3.1.1 State-Space Model for LQRC-Controlled LC-HAPF  
Based on (4), the small-signal state-space model is proposed for the LQRC, and the detail derivation is given as follows. In order to extract the reactive power and harmonics from the three-phase power grid, the _d-q-0_ synchronous rotating coordinate system is applied. Through the _a-b-c_ to _d-q-0_ conversion, the active power, harmonics, reactive power and three-phase unbalance convert into _d_-axis DC component, _d_-axis AC component, _q_-axis and _0_-axis, respectively. The _a-b-c_ to _d-q-0_ conversion is achieved by the Park transform matrix H given in (5). After the reference current calculation in the _d-q-0_ coordinate, the calculated reference compensation current will convert back to an _a-b-c_ coordinate by inverse Park transform H\({}^{-1}\). \[\mathrm{H}=\frac{2}{3} \begin{bmatrix}\cos(\omega_{1}t)&\cos(\omega_{1}t-120^{ \circ})&\cos(\omega_{1}t+120^{\circ})\\ -\sin(\omega_{1}t)&-\sin(\omega_{1}t-120^{\circ})&-\sin(\omega_{1}t+120^{\circ} )\\ \frac{1}{2}&\frac{1}{2}&\frac{1}{2}\end{bmatrix}  \tag{5}\]where \(\omega_{1}t\) is the fundamental phase angle and is obtained by phase locked loop (PLL). With the help of (5), \(i_{\rm cr}\), \(v_{\rm invx}\), \(v_{\rm x}\) and \(v_{\rm cx}\) in the \(d\)-\(q\)-\(0\) coordinate can be obtained. They are shown as:  
\[\left\{ \begin{array}{l}\left[\begin{array}{ccc}i_{cd}&i_{cq}&i_{c0}\\ \end{array}\right]^{T}=\mathrm{H}\big{[}\begin{array}{ccc}i_{ca}&i_{cb}&i_{ cc}\\ \end{array}\right]^{T}\\ \left[\begin{array}{ccc}v_{\rm invd}&v_{\rm invq}&v_{\rm inv0}\\ \end{array}\right]^{T}=\mathrm{H}\big{[}\begin{array}{ccc}v_{\rm invn}&v_{ \rm invb}&v_{\rm invc}\\ \end{array}\right]^{T}\\ \left[\begin{array}{ccc}v_{d}&v_{q}&v_{0}\\ \end{array}\right]^{T}=\mathrm{H}\big{[}\begin{array}{ccc}v_{a}&v_{b}&v_{c }\\ \end{array}\right]^{T}\\ \left[\begin{array}{ccc}v_{cd}&v_{cq}&v_{c0}\\ \end{array}\right]^{T}=\mathrm{H}\big{[}\begin{array}{ccc}v_{ca}&v_{cb}&v_{ cc}\\ \end{array}\big{]}^{T}\end{array}  \tag{6}\]  
From (1), (2), (5) and (6), the state differential equations for the \(LC\)-HAPF in \(d\)-\(q\)-\(0\) coordinate are given by (7), and the outputs of the \(LC\)-HAPF in the \(d\)-\(q\)-\(0\) coordinate are given by (8). \[\left\{\begin{array}{l}\frac{d_{\rm cl}}{dt}=-\frac{R_{\rm cx}}{L_{\rm cr}}i_ {\rm cl}+\omega_{1}i_{cq}+\frac{1}{L_{\rm cx}}v_{\rm invd}-\frac{1}{L_{\rm cx}} (v_{d}-v_{cd})\\ \frac{d_{\rm cl}}{dt}=-\omega_{1}i_{\rm cl}-\frac{R_{\rm cx}}{L_{\rm cx}}i_{ \rm cl}+\frac{1}{L_{\rm cx}}v_{\rm invq}-\frac{1}{L_{\rm cx}}(v_{q}-v_{cq})\\ \frac{d_{\rm cl}}{dt}=-\frac{R_{\rm cx}}{L_{\rm cx}}i_{\rm cl}+\frac{1}{L_{\rm cx }}v_{\rm inv0}-\frac{1}{L_{\rm cx}}(v_{0}-v_{\rm c0})\\ \left\{ \begin{array}{l}y_{d}=i_{cd}\\ y_{q}=i_{cd}\\ y_{0}=i_{c0}\\ \end{array} \right. \tag{8}\]  
For the steady state system in (7), overlaying perturbations \(\widetilde{i}_{\rm ch}\), \(\widetilde{v}_{\rm invn}\), \(\widetilde{v}_{h}\) and \(\widetilde{v}_{\rm ch}\) are given by (9), where the subscript \(h\) indicates the phase \(d\), \(q\) and \(0\). [16] and the '\(\sim\)' denotes the perturbation value. \[\left\{ \begin{array}{l}i_{\rm ch}=I_{\rm ch}+\widetilde{i}_{\rm ch},\\ v_{\rm invn}=V_{\rm invn}+\widetilde{v}_{\rm invn},\\ v_{h}=V_{h}+\widetilde{v}_{h},\\ v_{ch}=V_{ch}+\widetilde{v}_{\rm ch}.\end{array} \right. \tag{9}\]  
where \(I_{\rm ch}\), \(V_{\rm invn}\), \(V_{h}\) and \(V_{\rm ch}\) are the steady state values of compensation current, inverter voltage, PCC voltage and compensation capacitor voltage. Based on (7)-(9), the small-signal state-space model of the \(LC\)-HAPF with LQRC-controlled is then set up and shown in (10). \[\left\{ \begin{array}{l}\frac{d}{dt}\widetilde{\rm e}=A\widetilde{\rm e}+B \widetilde{\rm u}+E\widetilde{\rm z}\\ \widetilde{\rm y}=C\widetilde{\rm e}+D\widetilde{\rm u}\end{array} \right.