## 4 Control Strategies
### Control of the Microgrid Inverter
For this reason, it is generally preferred to calculate the reference current vector using the positive-sequence fundamental-frequency (FFPS) vector component of \(\overset{\rightarrow}{v}_{BUS}\):  
\[\overset{\rightarrow}{i}^{*}=P_{INV\_out}^{*}\frac{\overset{\rightarrow}{v }_{BUS}^{+1}}{\left|\overset{\rightarrow}{v}_{BUS}\right|^{2}}. \tag{19}\]  
Using (19), the active and reactive powers delivered to the microgrid AC bus might contain oscillations, but their mean values correspond to the reference components. Furthermore, the inverter output phase currents will be balanced and sinusoidal. Finally, to ensure the inverter's desired behavior, inner control loops regulate the inverter \(\alpha\) and \(\beta\) current components. The inverter is connected to the microgrid AC bus through an inductive filter, modeled as an LR circuit where L and R are the filter inductance and internal resistance. The following vector equation expresses the relationship between the filter voltages and current in the stationary \(\alpha\beta\) reference frame:  
\[\overrightarrow{v}_{INV}-\overrightarrow{v}_{BUS}=R\overset{\rightarrow}{ \mathrm{i}}+L\frac{d\overset{\rightarrow}{i}}{dt}. \tag{20}\]  
Thus, the inverter output voltage vector \(\overrightarrow{v}_{INV}\) can be used to regulate the current vector \(\overset{\rightarrow}{\mathrm{i}}\). In this case, the microgrid AC voltage vector \(\overrightarrow{v}_{BUS}\) is a known disturbance (since it is necessarily measured for computing the current reference), allowing a feedforward compensation. In [13; 14], several current controllers used in grid-connected converters are described and compared. Advanced control techniques are necessary whenever the voltage at the grid point of common coupling (PCC) contains harmonic components and/or unbalance once the controller is required to reject these disturbances. In these cases, the most popular control strategies recommend using PI controllers in multiple DQ reference frames [15], second-order PR controllers in parallel [16], PI controllers with resonant controllers in a rotating DQ reference frame [17], stationary-frame controllers using the space-vector Fourier transform [18], or repetitive controllers (in a real domain [19] or a complex domain [20; 21; 22]). This work used a proportional action and some resonant controllers in parallel due to the acceptable performance and relatively simple implementation. The external loop of the inverter control scheme is shown in Figure 9. If the internal controller is designed to be considerably faster than the external one, then the external controller can be designed neglecting the internal dynamics, i.e., considering \(\overset{\rightarrow}{i}/\overset{\rightarrow}{i}^{\ast\ast}=1\). The block diagram of the described internal control loop (\(\alpha\) and \(\beta\) current controllers) is presented in Figure 10.  
The internal current control loop must have a high bandwidth and high gains at the fundamental frequency and the harmonic frequencies corresponding to typical harmonic disturbances of the grid. These specifications can be met using proportional action and  
Figure 10: Simplified block diagram of the internal current control loop of the microgrid inverter. Figure 9: Simplified block diagram of the microgrid inverter’s external control loop. second-order sinusoidal integrators (SSIs) as resonant controllers in parallel. The selection of the appropriate proportional gain enables the imposition of the desired dynamic response to the system, while the resonant terms, implemented in parallel, guarantee a low steady-state error. A resonant term is included at the fundamental frequency to track the FFPS reference current with a low steady-state error. Resonant terms are also implemented in the low-order harmonic frequencies (3 rd, 5 th, 7 th, and 9 th), considering that these are usual components of disturbances in the voltage. In this context, when selecting the maximum harmonic component h = 9, the minimum 0 dB crossover frequency (fPM) required is 540 Hz (an fPM around 1500 Hz was adopted).