## 7 Conclusions  
This paper comprehensively evaluates two cascading controllers, the PI-PI controller and the FOPI-FOPI controller, which enhance the performance of DSTATCOMs integrated into a hybrid microgrid. A novel hybrid algorithm, WSO-WOA, was developed to optimize controller parameters across various scenarios. This hybrid microgrid features a combination of a PV system and a PEMFC, which supplies power to EV charging stations--factors that significantly impact the overall power quality of the microgrid. The proposed WSO-WOA algorithm's performance was rigorously compared against other optimization techniques, including WSO, WOA, GWO, and SCA. Various case studies were conducted to assess the effectiveness of these controllers under different power quality disturbances, such as three-phase balanced voltage swells, sags, and three-phase-to-ground faults. The results obtained from this study confirmed the superiority of the WSO-WOA algorithm in achieving optimal solutions compared to other optimization algorithms. Specifically, the WSO-WOA algorithm demonstrated a notable improvement in accuracy, surpassing the other algorithms by approximately 7.29% to 14.1% in the tuning of the PI-PI controller. Furthermore, when applied to the FOPI-FOPI controller, the WSO-WOA algorithm outperformed the other methods by about 8.5% to 21.2%. This significant performance enhancement highlights the WSO-WOA algorithm's effectiveness in fine-tuning both PI-PI and FOPI-FOPI controllers, showcasing its superior capability in optimizing controller parameters for improved system stability and performance. The results revealed a notable trade-off associated with the WSO-WOA algorithm: it required more time to converge to the optimal solution than the other algorithms. Specifically, the WSO-WOA algorithm took approximately 1.68 to 2.12 times longer to reach convergence than its counterparts. This extended convergence time is critical, particularly in scenarios where real-time or near-real-time optimization is crucial. However, it is important to note that the tuning process in this context is offline optimization. This means that the extended computation time does not impact the system's real-time operation, as the optimization is performed in advance and applied to the system's configuration before deployment. Consequently, while the WSO-WOA algorithm may exhibit slower convergence, its superior accuracy and effectiveness in finding optimal solutions make it valuable for offline optimization tasks where precision outweighs the need for rapid convergence. The performance of the FOPI-FOPI and PI-PI controllers was evaluated across various case studies to assess their effectiveness under different operating conditions. The results demonstrated a significant improvement in the settling time of the regulated signal for the FOPI-FOPI controller compared to the PI-PI controller. The FOPI-FOPI controller reduced the settling time by about 30.5-56.1%. This improvement highlights the superior efficiency of the FOPI-FOPI controller in quickly stabilizing the regulated signal, which is crucial for maintaining optimal performance in dynamic environments. The problem under investigation was designed by [PERSON] and [PERSON]. Simulations were conducted and results were obtained by [PERSON] and [PERSON]. The analysis of these results was carried out by [PERSON] and [PERSON]. The manuscript was written by [PERSON] and [PERSON] and subsequently reviewed by [PERSON], [PERSON] and [PERSON]. All authors have read and agreed to the published version of the manuscript. This research was funded by Prince Sattam bin Abdulaziz University grant number PSAU/2024/01/29483. Data Availability Statement: Data are available on request from the authors. **Acknowledgments:** The authors extend their appreciation to Prince Sattam bin Abdulaziz University for funding this research work through the project number PSAU/2024/01/29483. **Conflicts of Interest:** The authors declare no conflicts of interest.