## 5 Numerical Simulation
The inverter control system uses three control loops: a first loop which regulates DC link PV voltage to 154 V, a second loop which regulates the grid current to its desired reference which synchronized to the grid voltage. The reference for the grid current is the output of the PV DC voltage external controller. The output of the grid current controller (a type-III controller) is first limited to an upper bound of about \(I_{\rm lim}=50\) A to avoid inrush current during startup. A ramp compensator is added to the sensed voltage \(R_{sL}(i_{1}-i_{2})\) and the result is used as one of the inputs to the comparator. The calculated minimum value needed for avoiding subharmonic oscillation is \(V_{M}=3.5\) V. Here, to play it safe, a larger value of \(V_{M}=5\) V is used. The other input is the grid current reference converted to voltage by multiplying it by the current sensor gain \(R_{sL}\). The output of the comparator is connected to the Reset of a flip-flop and a 50 kHz periodic clock signal is connected to its Set input. The driving signal \(u\) for the switches Q\({}_{2}\) and Q\({}_{4}\) and \(1-u\) for Q\({}_{1}\) and Q\({}_{3}\) are the outputs Q and \(\overline{\rm Q}\) of the flip-flop. The inverter control system uses three control loops: a first loop which regulates DC link PV voltage to 154 V, a second loop which regulates the grid current to its desired reference which synchronized to the grid voltage. The reference for the grid current is the output of the PV DC voltage external controller. The output of the grid current controller (a type-III controller) is first limited to an upper bound of about \(I_{\rm lim}=50\) A to avoid inrush current during startup. A ramp compensator with amplitude \(V_{M}=5\) V is added to the sensed voltage \(R_{sL}(i_{1}-i_{2})\) and the result is used as one of the input to the comparator. The calculated minimum value needed for avoiding subharmonic oscillation is \(V_{M}=3.5\) V. Here, to pay it safe, a larger value of \(V_{M}\) was used. The other input is the grid current reference is converted to voltage by multiplying it by the current sensor gain \(R_{sL}\). The output of the comparator is connected to the Reset pin of a flip-flop and a 50 kHz periodic clock signal is connected to its Set input. The driving signals \(u\) for the switches Q\({}_{2}\) and Q\({}_{4}\) and \(1-u\) for Q\({}_{1}\) and Q\({}_{3}\) are the outputs Q and \(\overline{\rm Q}\) of the flip-flop. The simulation starts with temperature \(\Theta=25\)\({}^{\circ}\)C and irradiance \(S=\)1000 W/m\({}^{2}\). The time-domain response of the complete system starting from zero initial conditions is depicted in Figure 10. From \(t=0\) s to \(t=1\) s, the inverter is operated with constant reference voltage 100 V and the MPPT control is blocked. The irradiance level is started at \(S=500\) W/m\({}^{2}\) and the corresponding maximum power is 670 W. It can be observed that during this period, the voltage is well regulated to its reference value 100 V and since MPPT control is not used, the extracted power is less than what the PV generator can deliver. At \(t=1\) s, the MPPT is enabled and the irradiance starts increasing. It can be observed that after a short transient, the DC link PV voltage is regulated at \(V_{\rm dc}\)=154 V and the extracted power is very close to the maximum power corresponding to the irradiance level profile. At \(t=2\) s, the MPPT is still enabled and the irradiance is maintained at 1000 W/m\({}^{2}\). The PV array output power is about 1.4 kW (see \(p_{\rm PV}\) plot on the left panel in Figure 10) whereas specified maximum power with a 1000 W/m\({}^{2}\) irradiance is 1.4 kW. Maximum power (1.4 kW) is obtained when the voltage reference provided by the MPPT controller is 154 V.  
At \(t=3\) s, the irradiance is ramped down from 1000 W/m\({}^{2}\) to 500 W/m\({}^{2}\) and consequently the maximum power decreases. The PV voltage is still regulated and the power extracted by the inverter follows the maximum power delivered by the PV generator during all the time.