## 7 Design Example and Simulation Results
### Circuital Simulations  
The validation of the flyback-based PV system and the designed SMC is performed using detailed circuital simulations implemented in the power electronics simulator PSIM [32]. The PSIM environment allows the implementation of the power circuit described in Figure 1 using accurate models for each element (MOSFET, diode, transformer, etc. ), and the control circuit reported in Figure 5 was implemented using adders, gains, comparators, and other non-linear circuits. Finally, the P&O circuit was implemented using a C-block, which enables the introduction of a C-code, with the P&O algorithm, into the PSIM simulation, thus emulating the classical P&O implementation based on microcontrollers programmed with the same C-code. Figure 8 shows the PSIM implementation of both the power circuit and the control system. Figure 6: \(k_{1}\) and \(\Omega\) calculation to fulfill \(t_{s}\) and \(SR_{f}\) restrictions. (**a**) \(k_{1}\) and \(\Omega\) feasible values for \(t_{s}<1\) ms. (**b**) \(k_{1}\) feasible values with low \(\Omega\). Figure 9 shows the results of the circuital simulations performed in PSIM, where the P&O algorithm provides step changes using the signal \(v_{po}\). Two different PSIM simulations were conducted, where the first one considers a high irradiance (\(S=1000\) W/m\({}^{2}\)) reaching the PV panel, and the second one considers a low irradiance (\(S=200\) W/m\({}^{2}\)) condition; moreover, both conditions assume a PV module temperature of 25 \({}^{\circ}\)C (\(T=25\) \({}^{\circ}\)C). Thus, the PV system is tested under the extreme conditions considered in the design process. In this way, Figure 9a shows the PV voltage \(v_{pv}\) waveform, which has the same dynamic response as the theoretical signal generated with Equation (37) and previously tested in Figure 7. Therefore, the circuital response of the PV voltage has the desired settling time \(t_{s}=0.8\) ms for high-irradiance conditions, as is observed in Figure 9a. Similarly, Figure 9b shows the PV voltage \(v_{pv}\) waveform for a low-irradiance condition, which describes the same dynamic response and settling-time, where the only difference is the smaller switching ripple, which is predicted by Equation (42), due to the lower PV current. In conclusion, the proposed SMC ensures the desired PV voltage response in any irradiance condition, which ensures the correct operation of the P&O algorithm. Figure 7: Time response and \(v_{mppt}\) derivative of Option 1 (high \(\Omega\)) and Option 2 (low \(\Omega\)). (**a**) Time response of Option 1 (high \(\Omega\)): \(\Omega=100\) krad/s, \(k_{1}=0.49\) A/V, \(t_{s}=0.8\) ms. (**b**) Time response of Option 2 (low \(\Omega\)): \(\Omega=9.6\) krad/s, \(k_{1}=0.61\) A/V, \(t_{s}=0.8\) ms. (**c**) Option 1 (high \(\Omega\)) fulfills the \(v_{mppt}\) derivative restrictions for global stability. (**d**) Option 2 (low \(\Omega\)) fulfills the \(v_{mppt}\) derivative restrictions for global stability. Figure 8: Circuittal scheme implemented in PSIM. Figure 9: Circuittal simulation of the PV system. (**a**) PV voltage response at high irradiance (1000 W/m\({}^{2}\)). (**b**) PV voltage response at low irradiance (200 W/m\({}^{2}\)). (**c**) Switching function and control law at high irradiance (1000 W/m\({}^{2}\)). (**d**) Switching function and control law at low irradiance (200 W/m\({}^{2}\)). Figure 9c,d confirms the correct operation of the SMC: the switching function \(\psi_{x}\) defined in (44) produces the correct control signal \(u\), which ensures that \(\psi_{x}\) is always trapped inside the hysteresis band (\(-H<\psi_{x}<+H\)) and that both reachability and equivalent control conditions are fulfilled. Therefore, Figure 9c,d confirms that the SMC provides global stability for any irradiance condition.