## 2 Description of the PV System  
The typical structure of a PV microinverter is presented in Figure 1, where a first stage performs the MPPT of the PV panel to ensure the maximum power production. Such a first stage is usually designed with a step-up dc/dc converter [4], which boosts the low-voltage provided by the PV panel (\(v_{pv}\)) to the high-voltage required by the second stage (\(v_{o}\)). The second stage is in charge of regulating the average value of \(v_{o}\) to avoid damages caused by excessively high voltages and to avoid the system collapse caused by excessively low voltages [4]. In addition, the second stage is also in charge of the grid connection, which includes the power factor correction and islanding protection [4]; thus, such a second stage is based on a dc/ac converter, where the most commonly adopted structure is the full-bridge inverter [4]. The main perturbation sources affecting the PV microinverter are:  
* Changes in the solar irradiance modify the current vs. voltage (I-V) and power vs. voltage (P-V) relations of the PV panel, thus changing the current (and power) delivered by the panel as it is reported in [2]. * Inverters inject ac power to the grid, but the PV panel produces dc power; thus, the voltage at the inverter input (\(v_{o}\)), which is also the voltage at the first stage output, exhibits voltage oscillations at twice the grid frequency, as reported in [2]. Taking into account that the first stage must ensure the panel operation at the MPP, two control systems are needed, as shown in Figure 1. The first one, named MPPT, is in charge of detecting the optimal voltage of the PV panel for the particular irradiance conditions; thus, it measures both the PV current (\(i_{pv}\)) and voltage (\(v_{pv}\)) to calculate the PV power (\(p_{pv}\)), which is the variable to be maximized. Several MPPT algorithms have been proposed in the literature [4], where the most commonly adopted one is the perturb and observe (P&O) algorithm due to the good compromise between simplicity and efficiency. The second control system, named Controller in Figure 1, is in charge of regulating the panel voltage to follow the optimal reference defined by the MPPT algorithm (\(v_{mpt}\)); thus, this controller must compensate for the perturbations caused by the solar irradiance and inverter operation, providing the control signal \(u\) for the dc/dc converter acting as the first stage of the microinverter. Figure 1: Electrical model of a flyback-based PV system as first the stage of a microinverter. The first stage proposed in this paper is based on the flyback topology, which provides a high voltage conversion ratio without significantly increasing the duty cycle; thus, the controller will have a wide dynamic range for compensating perturbations, which is ideal for microinverter applications due to the large dc voltage required by the inverter. The flyback converter in Figure 1 is represented by both the magnetizing \(L_{m}\) and leakage \(L_{k}\) inductances and uses a transformer with a general turn-ratio \(n\). The flyback converter has a MOSFET connected at the primary side of the transformer, driven by the binary control signal \(u\), and a diode connected at the secondary side of the transformer. The connection between the PV panel and the flyback converter has an intermediate capacitor \(C_{pv}\) to regulate \(v_{pv}\), and the output voltage of the first stage (\(v_{o}\)) is also the input voltage of the second stage. The circuit in Figure 1 represents the second stage of the microinverter using a voltage source, which exhibits a regulated average value due to the control action on the inverter, but it also exhibits sinusoidal perturbations at twice the grid frequency. The design of the PV voltage controller (Controller in Figure 1) requires a mathematical representation of the system, which is obtained by analyzing the differential equations of the state variables of the PV system.