## 3 Methodology
### Optimization Method
The fuzzy controller generates three current references for the EV battery, supercapacitor, and OVD. These references are compared with the actual values of the currents of these three components. The resulting values are fed as inputs to a PI controller, which produces the duty cycle to control the switching rate of these components. The switching and energy exchange between the stabilizer, power source, and load collaboratively reduce the ripples in the output voltage and minimize the battery activation frequency to enhance the battery's lifespan. Simulation results affirm the successful minimization of bus voltage ripple through this method. The optimized signals in the output of the fuzzy controller for the three elements of the stabilizer fulfill both objectives. To summarize, the core findings of this paper are as follows:

1. Development of a new PSO-based fuzzy controller designed to minimize the ripple of DC microgrid bus voltage and reduce battery activation frequency. 2. Implementation of energy transfer between the supercapacitor and the battery to minimize ripple and increase battery lifespan. Future work will explore other types of energy resources, such as wind and fuel cells, and provide conditions for droop control. Additionally, implementing state space equations and integrating a linear quadratic tracker to track the reference voltage are noteworthy avenues for further exploration. Conceptualization, H.Z., A.R. and M.D. ; methodology, H.Z. and H.K. ; software, H.Z. and H.K. ; writing--original draft preparation, H.Z. and H.K. ; writing--review and editing, H.Z., H.K., A.R. and M.D. ; visualization, H.Z. ; supervision, A.R. and M.D. All authors have read and agreed to the published version of the manuscript. This research received no external funding. The data and code are available upon request. The authors declare no conflicts of interest. ## References

* [PERSON] (2019) [PERSON]; [PERSON] Integrating and modeling the Vehicle to Grid concept in Micro-Grids. In Proceedings of the 2019 International Conference on ENERGY and ENVIRONMENT (CIEM), Timisoara, Romania, 17-18 October 2019. [CrossRef]
* [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON] Energy management in grid-assisted BESS integrated solar PV-based smart charging station. In Proceedings of the IECON 2019--45 th Annual Conference of the IEEE Industrial Electronics Society, Lisbon, Portugal, 14-17 October 2019. [CrossRef]
* [PERSON] et al. (2023) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] DC microgrids: A propitious smart grid paradigm for Smart Cities. _Smart Cities_**2023**, \(6\), 1690-1718. [CrossRef]
* [PERSON] and F.S. (2021) [PERSON] DC microgrid planning, operation, and control: A comprehensive review. _IEEE Access_**2021**, \(9\), 36154-36172. [CrossRef]
* [PERSON] et al. (2018) [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON] [PERSON] Efficiency optimization of a variable bus voltage DC microgrid. _Energies_**2018**, _11_, 3090. [CrossRef]
* [PERSON] et al. (2020) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] The current state of Distributed Renewable Generation, challenges of interconnection and opportunities for energy conversion based DC microgrids. _J. Clean. Prod._**2020**, _273_, 122777. [CrossRef]
* [PERSON] and Johnson (2022) [PERSON]; [PERSON] A Practical Digital Implementation of Completely Decentralized Ripple Minimization in Parallel-Connected DC-DC Converters. _IEEE Trans. Power Electron._**2022**, _37_, 14422-14433. [CrossRef]
* [PERSON] et al. (2020) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] New analysis framework for transient stability evaluation of DC microgrids. _IEEE Trans. Smart Grid_**2020**, _11_, 2794-2804. [CrossRef]
* [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Enhanced dynamic stability control for low-inertia hybrid AC/DC microgrid with distributed energy storage systems. _IEEE Access_**2019**, \(7\), 91234-91242. [CrossRef]
* [PERSON] et al.