Microgrid (MG) technologies assist the power grid in evolving to become more efficient, less polluting, and more resilient by addressing the requirements of energy users. However, several technological issues arise as a result of the unpredictability and difficulty in estimating the efficacy and regulation of the many renewable energy resources (RERs) incorporated in MGs. Two of the most significant of these issues are maintaining system stability and power quality, which necessitate to get better the performance of the MGs. The most difficult challenge, system stability, can be achieved with successful Power Management System (PMS). This paper proposes an effective PMS for an AC MG equipped with a diesel generator (DG), a permanent magnet wind generator (PMWG), and a solar photovoltaic (PV) panel Based on an adaptable Artificial Neural Network (ANN). The ANN weights are properly tuned via the Enhanced Bald Eagle Search (EBES) optimization algorithm to produce a stable system during the whole training period, achieve MG energy balance, reduce the usage of fossil fuel DG and maintain MG voltage stability. In addition, for keeping power quality, an adaptive series shunt compensator (ASSC) is described in this work, along with a developed integrative PID controller, where the latter's controller gains are ideally set utilizing the EBES optimization algorithm to perform adaptably with self-tuning when the operational circumstances of an MG change. various cases are displayed to test the strong of offered ASSC on harmonic mitigation, dynamic voltage stabilization, reactive power control and power factor correction. Moreover, comprehensive case study based on realistic on-site location for Zafarana region, Suez Gulf region of Egypt is proposed. Taking into account The changing nature of weather-related renewable energy, actual loads states and transient faults.INDEX TERMS Photovoltaic (PV), Power Management System (PMS), permanent magnet wind generator (PMWG), Artificial Neural Network (ANN), renewable energy resources (RERs)