## 1 Introduction
The components of the \(dq\) axes were controlled with a sliding-mode controller (SMC). The \(q\) axis component was used to control the active power, and the \(d\) axis was used to control the reactive power. Furthermore, in [8], a control strategy for active and reactive power was proposed for a renewable energy system with an on-grid inverter. The main objective was always to inject the greatest amount of active power and generate sufficient reactive power to maintain stability in the grid. This was achieved with a \(dq\) transformation and by determining the current amplitude \(\mathrm{Iq}\), which was translated into the amount of reactive power that defined the angle between the voltage and the current of the grid. More recent research, such as that of [9; 10; 11], addressed the application of techniques based on the \(dq\) transform. The authors of [9] proposed an intelligent controller that used a radial basis function artificial neural network in a single-phase direct quadrant \(dq\) frame to control the active and reactive power generated by a nine-level packed E-cell (PEC9) inverter. In [10], simulation results that considered high-power solar and wind generation systems were presented to validate the proposed control. This allowed the regulation of power, voltage, and frequency, as well as the coordination of multiple generation units in microgrids. In [11], a novel \(dq\) droop control technique was discussed, which applied DC techniques to AC microgrids based on fixed-frequency inverters usingthe \(dq\) transformation. This control technique allowed accurate active and reactive power sharing without alteration of the frequency of the microgrid. Simulations and hardware in the loop (HIL) were used to demonstrate the effectiveness of the control. On the other hand, an investigation carried out with a microinverter from Texas Instruments (TI) is found in [12]. In this research, a computational model was made and a description of the microinverter's hardware was provided, in addition to the calculations used by the flyback and dual-buck controllers. Additionally, some investigations, such as those of [13; 14; 15], were based on using an active clamp flyback converter in the DC-DC stage and a dual-buck inverter in the DC-AC stage of the TI microinverter. In [13], the main features were presented, and the performance of the active clamp flyback converter was analyzed; this also showed that this converter could provide zero-voltage switching (ZVS). In [14], problems with the dual-buck inverter were discussed, such as the use of more inductors than in a traditional full-bridge inverter, the decreased power density, and the increased system cost. For this reason, a modified cascade full-bridge dual-buck inverter was proposed. In [15], a new circuit structure and a control method were proposed for a high-power interleaved dual-buck inverter, where zero-cross distortion was eliminated, the current stress of the switch was reduced, and the total harmonic distortion at low output power was decreased. In this research, a control strategy for managing active and reactive power is implemented based on the \(dq\) transformation. The modeling and simulation of the complete system were carried out in MATLAB, and the necessary controllers for the two stages of the microinverter were designed. In the DC-DC stage, the maximum power point of the solar panels is monitored, together with the generation of the current reference, which is given by the incremental conductance algorithm and regulated by a 2P2Z control. In the DC-AC stage, an anti-windup PI controller is implemented for the DC bus voltage, which follows the desired reference and regulates the active power supplied by the microinverter. Then, a phase-locked loop based on a generalized second-order integrator is used, which is fundamental for calculating the P and Q control. In addition, a 3P3Z current controller is proposed, which follows the reference given by the P and Q control.