# State Feedback Control Based Seamless Switch Control for Microgrid Inverter
## 3 Proposed Control
### Generalized Control Objective (GCO)  
For conventional switch control, the dual-loop control is generally adopted where the voltage control acts as the outer loop of the inner current loop. In this structure, the inner current loop only has a current state, while the voltage state is not included. After the switch, the voltage state is then added in the voltage loop. This will deteriorate the dynamic performance during the switch process. Hence, in this paper, the state feedback control is designed first as the GCO to improve the nature property of the inverter. As shown in Figure 3, supposing that the line impedance is very small in a small-scale microgrid, then the original state space model of the inverter can be represented as:  
\[\left\{ \begin{array}{c}\ddot{\mathbf{x}}\ =\ \mathbf{A}\mathbf{x}\ +\ \mathbf{B}\mathbf{v}_{c}\ +\ \mathbf{F}\mathbf{w}_{p}\\ \mathbf{u}\ =\ \mathbf{C}_{u}\mathbf{x}\\ \mathbf{i}\ =\ \mathbf{C}_{i}\mathbf{x}\\ \end{array} \right. \tag{1}\]  
where \(\mathbf{x}=[\mathbf{i}\ \mathbf{u}]^{T}=[i_{\alpha}+\dot{j}_{\beta}\ u_{\alpha}+\dot{\mu}_{ \beta}]^{T}\), \(\mathbf{v}_{c}=v_{c\alpha}+\dot{\mathbf{v}}_{c\beta}\), \(\mathbf{w}_{p}=\dot{t}_{\text{fu}}=i_{\text{flu}}+\dot{i}_{\text{flu}\beta}\), and  
\[\mathbf{A}\ =\ \left[ \begin{array}{cc}-R/L&-1/L\\ \\ 1/C&0\\ \end{array} \right] \tag{2}\]  
\[\mathbf{B}\ =\ \left[ \begin{array}{cc}1/L&0\end{array} \right]^{T} \tag{3}\]  
\[\mathbf{C}_{u}\ =\ \left[ \begin{array}{cc}0&1\end{array} \right] \tag{4}\]  
\[\mathbf{C}_{i}\ =\ \left[ \begin{array}{cc}1&0\end{array} \right] \tag{5}\]  
\[\mathbf{F}\ =\ \left[ \begin{array}{cc}0&-1/C\end{array} \right]^{T} \tag{6}\]  
This state space model is simplified by ignoring the dynamic of the grid-side line inductance. In grid-connected mode, this simplification may introduce some uncertainties due to the neglect of the grid-side impedance. This can be addressed by the control parameter design to improve the robustness. Moreover, in the GC mode, the capacitor voltage is clamped by the grid, hence the state of the capacitor voltage is also ignored, and the state feedback of the capacitor voltage can be treated as the voltage feedforward  
Figure 3: The proposed control frame. control. Based on the model, the input-output transfer function of the inverter can be calculated by  
\[G_{opu}\ =\ \frac{\mathbf{u}}{\mathbf{v}_{c}}\ =\ \mathbf{C}_{u}(s\mathbf{I}\ -\ \mathbf{A})^{-1}\mathbf{B} \tag{7}\]  
Generally, the response characteristic of \(G_{opu}\) is completely dependent on the circuit parameters, and the poor performance is often performed just as shown in Figure 4 where \(G_{opu}\) performs a terrible impulse response. Therefore, the full state feedback is employed to correct the nature pole placement so that the response characteristic is able to be improved. The transfer function with state feedback control law \(\mathbf{K}\) can be derived via  
\[G_{GCOu}\ =\ \frac{\mathbf{u}}{\mathbf{v}_{c}}\ =\ \mathbf{C}_{u}(s\mathbf{I}\ -\ \mathbf{A}\ +\ \mathbf{B}\mathbf{K})^{-1}\mathbf{B} \tag{8}\]  
As described in (8), the control law \(\mathbf{K}\) can tune the distribution of poles of the GCO. By tuning control law \(\mathbf{K}\), therefore, the response characteristic could be modified better. The state feedback can be designed by the linear quadratic regulation method [21]. This can be easily realized by the function lqr() in Matlab. Based on the LQR design and the circuit parameters shown in Table 1, the state feedback is designed as \(\mathbf{K}\) = [8.8\(-\)0.7]. Then, as shown in Figure 4, the impulse response of \(G_{GCOu}\) is much better than the original version of \(G_{opu}\). The disturbance-rejection ability is considerably improved. This is why the modified state feedback model is adopted as the GCO. Furthermore, another advantage of adopting the state feedback structure is that it is suitable for designing the control parameters by time-domain based modern optimal control method.