## 3 Results
### Simulation Results
#### 3.1.1 Active and Reactive Power Control  
To analyze the process of integrating the inverter with the electrical grid and the active and reactive power control, \(P_{ref}\) was established as the power obtained with the MPPT algorithm, and \(Q_{ref}\) was set with values of 0, 165, 100, \(-\)100, and 50 VAR; the DC bus voltage reference \(V_{ref}\) was set to 250 V and was simulated with an irradiance reference of 1000 W/m\({}^{2}\). In addition, a Simulink dynamic load block (single-phase dynamic load) was used, with 280 W and 100 VAR of active and reactive power, respectively.  
The maximum possible power was always injected into the grid when \(P_{ref}=P_{max}\). In Figure 29, it can be observed that the micron inverter was capable of delivering almost all of the power consumed by the load. Therefore, the active power consumption in the grid was reduced to values close to zero. Figure 30 shows the reactive power injected by the micron inverter, the reference \(Q_{ref}\), the reactive power from the grid, and the reactive power demanded by the load. The P and Q control managed to follow the reference satisfactorily and allowed the generation of both capacitive and inductive reactive power.  
Figure 28: Measured and filtered voltage in the DC bus.  
Figure 27: Currents of the main inductor and output of the LCL filter.  
Figure 31 shows the phase change of the current with respect to the voltage at the instant in which \(Q_{ref}\) changed from 0 to 165 VAR (the power factor changed approximately from 1 to 0.85). It was observed that during the phase shift, there were some oscillations.  
In this case, the efficiency and the \(THD_{i}\) were calculated to evaluate the performance of the microinverter. The combined efficiency of the DC-DC and DC-AC stages was, on  
Figure 31: Current and voltage injected into the grid during the change in \(Q_{ref}\) from 0 to 165 VAR.  
Figure 29: Active power delivered by the microinverter, active power supplied by the electrical grid, and active power consumed by the load. Reference value: \(V_{ref}=250\) V.  
average, 92 %, which was similar to the efficiency found in [19] and in the experimental results. The minimum \(THD_{i}\) was 2% when \(Q_{ref}=0\) VAR, and the maximum \(THD_{i}\) was 5% when \(Q_{ref}=165\) VAR (Figure 32). According to the IEEE 1547 standard, the current total harmonic distortion limit for distributed generators is 5% [31]. Therefore, the \(THD_{i}\) values found above were within the suggested range. Furthermore, Figure 33 shows the power factor and the efficiency over time.  
On the other hand, it was found that, to guarantee the integrity of the components of the microinverter and maintain the appropriate limits of harmonic distortion, the reactive power reference values must be established within the area shown in Figure 34 with a minimum power factor of \(\pm 0.85\) or \(\pm 53\%\) of the total reactive power.  
Figure 33: Power factor and efficiency during the changes in \(Q_{ref}\).  
Figure 32: FFT analysis; output current THD of the microinverter.  
As these are simulation results, it is possible to define the reactive power reference \(Q_{ref}\) that is equal to the measured reactive power of the load to supply the total power demand, as long as it is within the limits defined above. Therefore, the reactive power consumed from the grid is set to zero (Figure 35).