# Design of a Partially Grid-Connected Photovoltaic Microgrid Using IoT Technology
## 5 Results and Discussion  
We used Matlab/Simulink software 2020a edition, equipped with a powerful toolbox for designing and simulating microgrid components utilizing specialized power systems libraries. In this section, we explore the most important results of the above-mentioned microgrid design, starting with the PV array and its power tracking unit. The MPPT circuit is tested in both conditions: the transient and steady-state change in the irradiance. The simulated PV output power (\(P_{PV}\)), voltage (\(V_{PV}\)), and current (\(I_{PV}\)) waveforms are shown in Figure 15a. The system performance was initially tested at a sudden reduction in the solar irradiance from 1000 to 200 W/m\({}^{2}\) in three steps and then suddenly raised from 200 to 1000 W/m\({}^{2}\) in one step. The results show that the designed tracking circuit exhibits a high tracking efficiency, \(TE\), that reached 99.5% at \(P_{PV}\) = 100 kW in addition to a fast response that is less than 25 ms to reach the steady-state conditions. At these abrupt changes in the irradiance, the simulation results proved that the system achieved minimal fluctuations in tracked \(P_{PV}\) that is less than 4% in the worst case. Moreover, regardless of the irradiance level, the output power fluctuations are mostly eliminated at the steady-state operating point. In most applications, the progressive increase or decrease of irradiation is the practical condition. Therefore, the tracking performance of the designed MPPT circuit was also tested for gradual change in the irradiance as shown in Figure 15b. The irradiance was gradually reduced from 1000 to 200 W/m\({}^{2}\) and then increased from 200 to 1000 W/m\({}^{2}\) with raising and falling rates of +1600 and 800 W/m\({}^{2}\)/s, respectively. As a result, the designed controller clearly accomplished the slow variations of the irradiance with a considerable tracking accuracy in a short period of time, of less than 25 ms, with a minimal fluctuated power, that is less than 2.5% in the worst case. Owing to using many power electronic switches in the power conditioning units within the microgrid, harmonic distortion commonly occurs. The total harmonic distortion (THD) is a critical issue in power systems, especially microgrids operating in islanded and partially grid-connected modes. Therefore, THD must be kept to a minimum to be less than 5% in order to meet the standards. Reduced THD in microgrids results in a greater power factor and lower electricity expenditures, resulting in improved power conversion efficiency. It is worth it here to figure out how much harmonic distortion is present in the  
Figure 15: Variation of PV power, voltage, and current in cases of (**a**) abrupt and (**b**) progressive variations of solar irradiance. designed system. Figure 16 depicts waveforms of instantaneous voltage and current of the AC-bus of an islanded microgrid at a load power of 100 kW. The waveforms indicate nearly pure sinusoidal with low harmonic distortion. The FFT analyzer was used to do the THD analysis, as depicted in Figure 16b,c. The analysis revealed that the THD of the voltage and current waveforms were computed to be 1.24% and 1.27%, respectively. This implies the good performance of the inverter controller and its related design parameters. Figure 17a depicts the variation of PV power, SOC, and battery power when changing of load power computed at different irradiance levels. At higher irradiance levels (\(1000\) W/m\({}^{2}\)) and lower power consumption by the loads, PV power is maximized to 100 kW, while the battery power is negative indicating the charging state of the batteries. When the load power increases and at the same time the irradiance level decreases, the power delivered from the PV array is reduced and compensated by the batteries. At a very low irradiance level and full load, most of the power is delivered from the batteries and its state is mainly discharging.