A two-step methodology was used to address the power quality concerns for the PV integrated microgrid system. In the first step, partial shading was included to deal with the real-time issues. The Improved Jelly Fish Algorithm integrated Perturb and Obserb (IJFA-PO) has been proposed to track the Global Maximum Power Point (GMPP). In the second step, the main unit powered by a DC-AC converter is synchronised with the grid. To cope with the wide voltage variation, an auxiliary unit is connected to the main unit in the opposite phase. This study evaluates various switching approaches to determine the optimal solution for achieving the stated goals. It was found that the IJFA-based SHE in 120 օ conduction gives improved results. A novel series compensation technique has been employed to further eliminate harmonics before grid integration. The proposed IJFA has been used to determine the switching angles for the SHEPWM converter. The objective function and novel series compensation work together to determine the harmonics that should be decreased and kept to a minimum. Three switching angles' performance was equivalent to that of nine switching angles. As a result, higher-order harmonics can be minimised with fewer switches, and switching losses can be lowered without compromising efficiency. The THD of the proposed system was 1.32 percent, which is very much within the tolerable limit of IEEE 1547, IEC, and CIGRE WG 36-05 standards. In terms of efficiency, metaheuristics, and convergence, the proposed system outperformed the existing ones. The model was developed in MATLAB/Simulink 2016b. To verify the simulation results, an experimental prototype of grid synchronised PV capacity of 260W was tested under various loading conditions. The present model is reliable and features a simple controller that provides more convenient and adequate performance for practical reasons.