Skip to Content
  • Article
  • Open Access

25 August 2026

42 Pages

Artificial Intelligence-Based Energy Management and Control Strategies for Renewable-Powered Smart Microgrids Under Dynamic Operating Conditions

and
Department of Electrical Power Engineering, Durban University of Technology, Durban 4001, South Africa
*
Author to whom correspondence should be addressed.

Abstract

This paper presents an artificial intelligence (AI)-based energy management and control framework for renewable-powered smart microgrids operating under dynamic conditions. The proposed system integrates photovoltaic (PV) generation, battery energy storage, and grid interaction within a MATLAB/Simulink-R2024B environment to improve operational reliability, energy efficiency, and renewable energy utilization. Seven control scenarios were investigated, including baseline operation, Rule-Based Energy Management System (EMS), Proportional–Integral–Derivative (PID), Model Predictive Control (MPC), Fuzzy Logic Control (FLC), Artificial Neural Network (ANN)-assisted forecasting, and Reinforcement Learning (RL)-based optimization. Comparative results demonstrate progressive performance improvements with increasing controller intelligence. The RL-based EMS achieved the highest operational cost reduction (95%), voltage regulation performance (95%), battery state-of-charge management (95%), renewable energy utilization (92%), grid dependency reduction (92%), overall system efficiency (95%), and an overall performance score of 95.4%. The ANN forecasting model attained a forecasting accuracy of 96.2%, corresponding to a Mean Absolute Percentage Error (MAPE) of 3.8%, while achieving a Mean Absolute Error (MAE) of 1.84 kW, Root Mean Square Error (RMSE) of 2.37 kW, and coefficient of determination ( R 2 ) of 0.982. For voltage regulation, the RL controller reduced the RMSE, settling time, and overshoot to 1.50 V, 1.8 s, and 0.5%, respectively, compared with 20.0 V, 15.0 s, and 10.0% for the baseline case. Ultimately, the results demonstrate that AI-driven control strategies substantially enhance microgrid stability, battery utilization, renewable energy penetration, and operational efficiency, providing a practical and scalable solution for next-generation intelligent microgrids.

1. Introduction

The global transition toward sustainable energy systems has accelerated the deployment of renewable energy technologies such as solar photovoltaic (PV) and wind power. Driven by increasing electricity demand, environmental concerns, and the need to reduce greenhouse gas emissions, renewable energy sources are becoming integral components of modern power systems. Their distributed nature and declining installation costs have encouraged widespread integration at the distribution-network level, enabling cleaner and more resilient electricity generation. However, the intermittent and stochastic behavior of renewable sources introduces significant operational challenges, including voltage instability, frequency deviations, power imbalance, and reduced power quality. These issues are particularly pronounced in decentralized energy systems where generation and demand fluctuate continuously under changing environmental and load conditions [1,2]. Smart microgrids have emerged as a promising solution to address these challenges. A smart microgrid is a localized energy system that integrates distributed energy resources (DERs), energy storage systems (ESS), controllable loads, and advanced communication and control technologies within a defined electrical boundary. Unlike conventional centralized grids, smart microgrids can operate in both grid-connected and islanded modes, enhancing system reliability and resilience during grid disturbances or outages. By coordinating local generation, storage, and demand in real time, microgrids improve energy efficiency, reduce dependence on the utility grid, and support the broader transition toward decentralized and sustainable power systems [3,4].
Among the various smart microgrid configurations, hybrid solar–battery systems have gained particular attention due to their practical viability and operational flexibility. In these systems, PV generation serves as the primary renewable source, while battery energy storage compensates for generation variability by storing excess energy and supplying power during deficits. The coordinated operation of PV arrays, batteries, inverters, and loads requires an effective Energy Management System (EMS) capable of maintaining voltage stability, regulating battery state-of-charge (SOC), and minimizing grid power import under dynamically changing conditions. Traditional control strategies such as Proportional–Integral–Derivative (PID) control and rule-based EMS have been widely adopted because of their simplicity and ease of implementation. PID controllers provide fast corrective action for voltage and frequency regulation, while rule-based methods prioritize renewable utilization and battery charging/discharging using predefined heuristics. Nevertheless, these approaches suffer from important limitations in renewable-powered microgrids. Fixed PID gains often require retuning as system dynamics change, and rule-based strategies lack the adaptability needed to handle nonlinearities, uncertainties, and rapidly varying operating conditions. Even advanced model-based methods such as Model Predictive Control (MPC), although capable of predictive optimization, depend heavily on accurate system models and may impose substantial computational burdens for real-time applications [5,6].
To overcome these limitations, intelligent and data-driven control techniques have attracted increasing research interest. Artificial Intelligence (AI) methods offer adaptability, predictive capability, and self-learning features that are well suited to the uncertain and nonlinear nature of renewable microgrids. Fuzzy Logic Control (FLC) can emulate human reasoning to regulate voltage and battery operation without requiring precise mathematical models. Artificial Neural Networks (ANNs) enable accurate forecasting of solar generation and load demand from historical data, supporting proactive energy scheduling. Reinforcement Learning (RL) extends this capability further by allowing the control system to learn optimal charging and discharging policies through interaction with the environment, without relying on explicit system models. These AI-based approaches have demonstrated strong potential for enhancing renewable energy utilization, reducing operational costs, and improving system resilience [7,8]. Despite significant progress, several gaps remain in the practical deployment of intelligent EMS frameworks. Many studies focus on a single control technique or a single optimization objective, while real-world microgrids require coordinated multi-objective management involving voltage stability, battery health, renewable utilization, and grid interaction simultaneously. In addition, the integration of forecasting, adaptive control, and learning-based optimization into a unified framework remains limited, and comparative evaluations against conventional controllers under realistic dynamic conditions are still needed [9,10].
Motivated by these challenges, this study proposes an Artificial Intelligence-Based Energy Management and Control Framework for Renewable-Powered Smart Microgrids Under Dynamic Operating Conditions. The framework integrates conventional control methods (PID and MPC) with intelligent techniques including FLC, ANN, and RL within a unified MATLAB/Simulink-R2024B-based EMS architecture. ANN modules are employed for solar and load forecasting, FLC is used for adaptive voltage and SOC regulation, and RL optimizes long-term battery scheduling and energy dispatch. The proposed approach is evaluated under varying solar irradiance and dynamic load profiles to assess its ability to maintain voltage stability, improve renewable energy utilization, reduce grid dependency, and enhance overall operational reliability [11]. The main contributions of this work are summarized as follows:
  • Development of an AI-driven EMS that combines predictive, adaptive, and learning-based control mechanisms for solar–battery smart microgrids.
  • Comparative evaluation of conventional controllers (PID and MPC) against intelligent approaches (FLC, ANN, and RL) under dynamic operating conditions.
  • Implementation of an integrated MATLAB/Simulink R2024B simulation framework for realistic modeling of PV generation, battery storage, inverter control, and variable loads.
  • Demonstration of improved voltage regulation, battery SOC management, renewable energy utilization, and reduced grid import through coordinated AI-based control.
The remainder of this paper is organized as follows. Section 2 discusses materials and methods, describes the hybrid solar–battery microgrid architecture and MATLAB/Simulink modeling framework, and presents the proposed AI-based control and EMS methodology. Section 3 discusses simulation scenarios and performance evaluation, analyzes the results and compares the proposed approach with conventional methods, Section 4 presents the discussion of the results and Section 5 concludes the paper with recommendations for future research.

1.1. Context and Literature Review

The rapid integration of distributed energy resources (DERs), including photovoltaic (PV) systems, wind turbines, and battery energy storage systems (BESS), into localized smart microgrids has significantly transformed the structure and operation of modern power systems. While these technologies offer environmental and economic benefits, they also introduce considerable complexity in maintaining system stability and operational efficiency. The intermittent nature of renewable energy sources, coupled with the variability of load demand, creates challenges in sustaining voltage and frequency within acceptable limits. Moreover, the decentralized configuration of microgrids requires coordinated control of multiple interconnected components, making traditional centralized control approaches less effective. Conventional control strategies, such as Proportional–Integral–Derivative (PID) controllers and rule-based energy management systems (EMS), have been widely applied due to their simplicity and ease of implementation. However, these approaches often struggle to cope with the nonlinearities, uncertainties, and time-varying characteristics inherent in renewable-based microgrids. For instance, rule-based EMS typically relies on predefined heuristics that may not adapt well to changing operating conditions, while PID controllers require frequent tuning to maintain performance. As a result, these methods may lead to suboptimal energy utilization, increased operational costs, and reduced system reliability under dynamic conditions [12,13].
To overcome these limitations, recent research has increasingly focused on intelligent and adaptive control techniques. Approaches such as Fuzzy Logic Control (FLC), Model Predictive Control (MPC), Artificial Neural Networks (ANN), and multi-agent systems have been proposed to enhance the flexibility and responsiveness of microgrid operation. FLC offers robustness in handling uncertainties without requiring precise system models, while MPC introduces predictive optimization capabilities for managing multi-variable systems under constraints. ANN-based methods provide accurate forecasting of renewable generation and load demand, enabling proactive decision-making. Additionally, multi-agent systems facilitate decentralized control by allowing individual components of the microgrid to operate autonomously while coordinating with each other to achieve global objectives. Energy management strategies have also evolved to emphasize coordinated scheduling and optimization of generation, storage, and load resources. Modern EMS frameworks are designed to achieve multiple objectives simultaneously, including minimizing operational costs, maximizing renewable energy utilization, and maintaining system reliability [14]. These strategies account for uncertainties in renewable output, battery state-of-charge (SOC), and market conditions, often incorporating forecasting and optimization techniques to improve decision-making. The integration of predictive and adaptive modules further enhances the ability of microgrids to respond effectively to real-time changes. MATLAB/Simulink has emerged as a widely used platform for the modeling, simulation, and validation of microgrid control and energy management systems. Its flexible environment allows researchers and engineers to develop detailed system models, implement advanced control algorithms, and evaluate performance under various operating scenarios. Furthermore, MATLAB/Simulink supports real-time simulation and hardware-in-the-loop (HIL) testing, enabling the transition from theoretical designs to practical implementations. This capability helps bridge the gap between academic research and real-world deployment. Hence, the existing literature highlights the growing importance of intelligent and data-driven EMS frameworks in addressing the challenges of modern microgrids. Despite significant advancements, gaps remain in terms of real-world applicability, scalability, and the integration of multi-objective optimization with adaptive control. Addressing these challenges is essential for developing resilient, efficient, and sustainable smart microgrid systems [1,5].

1.2. Related Works

The growing complexity of renewable-based microgrids has led to extensive research on advanced control and energy management strategies aimed at improving system stability, efficiency, and reliability. Early studies primarily focused on conventional control techniques such as Proportional–Integral–Derivative (PID) and rule-based energy management systems due to their simplicity and ease of implementation. However, these approaches have been shown to perform inadequately under highly dynamic and uncertain conditions associated with renewable energy integration. Ahmad et al. [1] highlighted that traditional control methods lack the adaptability required to manage the stochastic behavior of distributed energy resources (DERs), leading to suboptimal performance in modern microgrids. To address these limitations, researchers have increasingly explored intelligent and optimization-based approaches. Artificial intelligence (AI) techniques, including Artificial Neural Networks (ANN), Fuzzy Logic Control (FLC), and Reinforcement Learning (RL), have gained significant attention due to their ability to handle nonlinearities and uncertainties. According to Khan et al. [5], ANN-based models have demonstrated strong capability in forecasting renewable generation and load demand, thereby enabling proactive energy scheduling and improved operational efficiency. Similarly, FLC has been widely applied for voltage and frequency regulation due to its robustness and ability to operate without precise mathematical models.
In addition, optimization-based frameworks such as Model Predictive Control (MPC) and metaheuristic algorithms have been proposed to enhance decision-making in microgrid energy management. Arévalo et al. [12] emphasized that MPC-based approaches provide effective multi-objective optimization by considering system constraints and future predictions. However, their computational complexity and reliance on accurate system models remain significant challenges. To overcome these issues, hybrid approaches that combine AI with optimization techniques have been introduced, offering improved performance and adaptability. Recent studies have also explored decentralized and multi-agent control architectures for microgrids. These approaches enable individual components, such as generators, storage systems, and loads, to operate autonomously while coordinating with each other to achieve global objectives. Akbulut et al. [15] demonstrated that integrating rule-based control with deep learning techniques enhances system resilience and scalability, particularly in large and complex microgrid networks. Furthermore, game-theoretic and transactive energy frameworks have been proposed to facilitate efficient energy trading and resource allocation among prosumers, improving both economic and operational performance. Despite these advancements, several challenges remain in the practical implementation of intelligent energy management systems. Issues such as real-time computational requirements, data availability, model generalization, and system scalability continue to limit widespread deployment. Nevertheless, the literature consistently indicates that intelligent, data-driven, and hybrid control strategies represent a promising direction for the future development of smart microgrids, enabling more resilient, efficient, and autonomous energy systems. Table 1 discusses the literature review of recent studies on Intelligent Microgrid Control and EMS.
Table 1. Literature Review of Recent Studies on Intelligent Microgrid Control and EMS.

2. Materials and Methods

2.1. Microgrid Architecture and System Description

The proposed renewable-powered smart microgrid is designed as a hybrid solar–battery energy system that integrates photovoltaic (PV) generation, battery energy storage, power electronic converters, intelligent control units, and variable load demand within a unified energy management framework. The architecture is developed to enhance energy reliability, operational efficiency, and system resilience under dynamic operating conditions characterized by fluctuating solar irradiance and changing load requirements. The microgrid can operate in both grid-connected and islanded modes, enabling seamless interaction with the utility grid during normal operation while maintaining autonomous functionality during grid disturbances or outages. This dual-mode capability improves system flexibility and ensures uninterrupted power supply to critical loads [25,26]. The photovoltaic subsystem serves as the primary renewable energy source within the microgrid. Solar PV panels convert incident solar irradiance into direct current (DC) electrical energy, which varies according to environmental conditions such as solar intensity and ambient temperature. Because solar generation is inherently intermittent and weather-dependent, its output cannot always match load demand. Therefore, accurate modeling of PV characteristics is essential for evaluating system performance and developing effective control strategies. The PV system is modeled using the single-diode equivalent circuit, which captures the nonlinear current-voltage behavior of solar cells and allows realistic simulation of power generation under varying environmental conditions.
To mitigate the variability of solar generation, a Battery Energy Storage System (BESS) is incorporated into the microgrid architecture. The battery acts as an energy buffer by storing excess energy during periods of high solar production and supplying energy during periods of low generation or increased demand. The lithium-ion battery model includes charging and discharging dynamics, efficiency losses, and operational constraints. A critical parameter governing battery operation is the State-of-Charge (SOC), which represents the available energy relative to the battery’s rated capacity. To preserve battery lifespan and ensure reliable operation, the SOC is maintained within predefined limits, typically between 30% and 90%. Intelligent charging and discharging decisions are performed by the energy management system to optimize battery utilization while preventing overcharging and deep discharging conditions [27,28]. The power electronic conversion subsystem provides the interface between the DC-side components, including the PV array and battery storage, and the AC-side load and utility grid. A bidirectional inverter facilitates energy exchange between these subsystems by converting DC power into AC power and vice versa. Beyond power conversion, the inverter performs critical control functions such as voltage regulation, frequency stabilization, active power management, and reactive power compensation. These capabilities are essential for maintaining system stability and power quality, particularly during transient conditions caused by renewable intermittency or sudden load variations. Figure 1 shows the schematic representation of the hybrid solar–battery smart microgrid.
Figure 1. System architecture of the hybrid solar–battery smart microgrid.
The load subsystem represents the electrical demand within the microgrid and consists of time-varying residential, commercial, or industrial loads. Since load demand changes continuously due to user behavior and operational activities, realistic load modeling is necessary for evaluating energy management performance. In the proposed framework, variable load profiles are incorporated to emulate practical operating conditions, including peak and off-peak consumption periods. The interaction between load demand, renewable generation, and battery storage determines the overall power balance of the microgrid and directly influences energy management decisions. At the supervisory level, an intelligent Energy Management System (EMS) coordinates the operation of all microgrid components. The EMS continuously monitors solar generation, battery SOC, load demand, and grid conditions to determine optimal power dispatch strategies. Conventional controllers such as PID and Model Predictive Control (MPC) are employed for baseline voltage regulation and system stabilization, while Artificial Intelligence (AI)-based techniques including Fuzzy Logic Control (FLC), Artificial Neural Networks (ANN), and Reinforcement Learning (RL) enhance adaptability, forecasting accuracy, and decision-making capabilities. ANN models provide solar generation and load demand forecasts, FLC manages battery charging and voltage regulation under uncertain conditions, and RL agents learn optimal dispatch policies that maximize renewable energy utilization while minimizing grid dependency. Through this coordinated control architecture, the microgrid achieves improved energy efficiency, enhanced voltage stability, reduced operational costs, and greater resilience under dynamic operating conditions [15,24].

2.1.1. Solar Photovoltaic Model

The photovoltaic (PV) module is modeled using the single-diode equivalent circuit, which is widely recognized for its ability to accurately represent the nonlinear current–voltage (I–V) characteristics of solar cells. This model captures the essential physical processes within the PV device, including the generation of photocurrent due to incident solar irradiance, the diode’s recombination effects, and internal losses caused by series and shunt resistances. By incorporating these parameters, the model provides a realistic description of PV behavior under varying environmental conditions such as changes in irradiance and temperature. This mathematical representation enables the MATLAB/Simulink-R2024B environment to simulate the dynamic response of the PV system, including variations in output current, voltage, and power. As a result, it becomes possible to analyze system performance, evaluate efficiency, and study the interaction between the PV generator and other microgrid components under different operating scenarios. The relationship between current and voltage is expressed as [29]:
I = I p h − I 0 e q V + I R s n k T − 1 − V + I R s R s h
where I p h is the photocurrent, I 0 the diode saturation current, R s and R s h represent series and shunt resistances, respectively, q is the electron charge, k is Boltzmann’s constant, and T is the cell temperature. The photocurrent I p h is directly proportional to solar irradiance and can be modeled as:
I p h = I s c , r e f + α T − T r e f G G r e f
where I s c , r e f is the short-circuit current at reference conditions, α is the temperature coefficient, and G and G r e f represent the actual and reference irradiance levels, respectively. This model allows the MATLAB/Simulink R2024B environment to simulate PV output variations in response to changes in sunlight intensity and ambient temperature, thereby mirroring real-world renewable generation patterns.

2.1.2. Battery Energy Storage Model

The lithium-ion battery is modeled to accurately capture its charging and discharging dynamics, efficiency losses, and operational constraints within the microgrid. The subsystem represents a 12 V, 2000 Ah battery, incorporating realistic characteristics such as limited capacity, internal losses, and bidirectional energy flow. Charging and discharging efficiencies are both assumed to be 90%, reflecting practical performance conditions. This modeling approach enables the battery to function effectively as an energy buffer, storing excess photovoltaic (PV) energy and supplying power during periods of generation deficit. A key parameter in the battery model is the State-of-Charge (SOC), which indicates the ratio of the available charge to the nominal battery capacity. SOC is continuously monitored and regulated within predefined limits of 30% to 90% to ensure safe operation, prevent overcharging or deep discharging, and extend battery lifespan. The SOC is updated iteratively based on the charging and discharging currents, time step, and efficiency factors, allowing the system to dynamically track energy storage behavior and support effective energy management decisions. SOC is updated iteratively as [30]:
S O C t = S O C t − 1 + 1 C n o m η c I c h ∆ t − I d i s ∆ t η d
where η c and η d are the charging and discharging efficiencies, I c h and I d i s represent the charge and discharge currents, ∆ t is the time step, and C n o m is the nominal capacity. This subsystem not only stores excess PV energy but also supplies the load when solar generation is insufficient, ensuring a continuous power supply. The battery terminal voltage V b a t is expressed as:
V b a t = E 0 − K Q Q − I t I d i s − R I d i s
where E 0 is the open-circuited voltage, K is the polarization constant, Q is the maximum capacity, R is the internal resistance, and I t is the charge removed from the battery. To preserve battery health and prolong lifespan, operational constraints are imposed to maintain SOC between 30% and 90%. When SOC exceeds or falls below these thresholds, charging or discharging is automatically halted by the control logic.

2.1.3. Variable Load Model

The load subsystem represents the time-varying electricity demand within the microgrid and is used to evaluate system performance under dynamic operating conditions. In this study, the load is modeled as a variable resistive element whose power consumption changes according to predefined demand profiles, reflecting typical fluctuations caused by user behavior and operational activities. The varying load demand requires continuous coordination between PV generation, battery storage, and grid support to maintain power balance and system stability. Incorporating realistic load variations in the MATLAB/Simulink-R2024B model enables the assessment of control strategies and energy management algorithms under different operating scenarios, providing insights into microgrid reliability, efficiency, and resilience. The load power consumption is mathematically expressed as [31]:
P l o a d t = V l o a d t × I l o a d t
The load profile can be set to vary according to pre-defined functions (e.g., sinusoidal or step changes) or based on real or synthetic demand data. This dynamic representation ensures that the system can simulate realistic energy balance conditions between generation, storage, and consumption.

2.1.4. Power Balance and Operational Modes

The operation of a hybrid solar–battery microgrid is fundamentally governed by the principle of power balance, which ensures that generation and consumption are continuously matched. This relationship is expressed as:
P P V + P B E S S + P g r i d = P l o a d
In this equation, P P V represents the power generated by the photovoltaic array, P B E S S denotes the battery power (positive (+) during charging and negative (−) during discharging), P g r i d is the power exchanged with the utility grid, and P l o a d is the total demand. Maintaining this balance is essential for stable and efficient microgrid operation, particularly under fluctuating renewable generation and varying load conditions.
The microgrid operates in two primary modes, each with distinct control objectives. In grid-connected mode, the system interacts with the main utility grid, allowing bidirectional power flow. When PV generation exceeds local demand, excess energy is either stored in the battery or exported to the grid. Conversely, when generation is insufficient, power is imported from the grid to meet demand. This mode enhances reliability and provides economic benefits through energy exchange. In islanded mode, the microgrid operates independently of the utility grid, typically during outages or grid disturbances. In this scenario, the battery energy storage system plays a critical role in maintaining power balance by compensating for the mismatch between generation and load. Advanced control strategies ensure voltage and frequency stability while prioritizing critical loads. This operational flexibility improves system resilience and ensures a continuous power supply even under adverse conditions [32].

2.2. AI-Based Control and Energy Management Methodology

The proposed methodology introduces an Artificial Intelligence (AI)-based Energy Management System (EMS) designed to enhance the operational performance of renewable-powered smart microgrids under dynamic operating conditions. The framework integrates conventional control techniques, namely Proportional–Integral–Derivative (PID) control and Model Predictive Control (MPC), with intelligent methods including Artificial Neural Networks (ANN), Fuzzy Logic Control (FLC), and Reinforcement Learning (RL). The objective is to overcome the limitations of traditional energy management approaches by providing adaptive, predictive, and self-learning capabilities that improve voltage stability, battery utilization, renewable energy penetration, and overall system reliability. The proposed EMS operates as a supervisory control layer that continuously monitors the status of the photovoltaic (PV) generation system, battery energy storage system (BESS), load demand, and grid conditions [9,33]. Real-time measurements including solar irradiance, ambient temperature, battery State-of-Charge (SOC), bus voltage, and load power demand are acquired and processed by the EMS. These measurements serve as inputs to the forecasting, control, and optimization modules that collectively determine the most appropriate operating actions. The framework consists of three interconnected functional layers:
  • Forecasting Layer (ANN-Based Prediction);
  • Adaptive Control Layer (PID, MPC, and FLC);
  • Optimization Layer (RL-Based Energy Management).
The interaction among these layers enables the microgrid to anticipate future operating conditions, respond effectively to disturbances, and continuously improve operational decisions through learning.

ANN-Based Forecasting Module

Accurate forecasting of renewable energy generation and load demand is critical for effective and proactive energy management and optimal battery scheduling in renewable-powered microgrids. In the proposed framework, a feedforward Artificial Neural Network (ANN) was employed to predict future solar power output and load demand using both historical and real-time operating data. The ANN utilizes input variables such as solar irradiance, ambient temperature, time of day, historical power generation, and historical load profiles to learn the complex nonlinear relationships that influence system behavior. The network is trained using supervised learning techniques and subsequently generates forecasts over the defined control horizon. These predictions provide valuable information for energy management decisions, including battery charging and discharging scheduling, identification of potential power surpluses or deficits, optimization of renewable energy utilization, and reduction in unnecessary grid power imports [34,35]. By incorporating predictive insights into the control framework, the ANN module enhances the responsiveness, efficiency, and overall decision-making capability of the proposed Energy Management System (EMS) [36]. A total of 200 samples were used to develop the forecasting model. The dataset was divided into 150 training samples (75%) and 50 testing samples (25%), where the training set was used to optimize the network weights and biases, and the testing set was reserved exclusively for independent performance evaluation. The adopted ANN architecture consists of a single hidden layer with 10 neurons, which provides a balance between forecasting accuracy and computational efficiency. During training, the network iteratively updates its parameters through supervised learning until the prediction error converges to an acceptable level. The forecasting performance of the proposed Artificial Neural Network (ANN) model was evaluated using four widely accepted statistical indicators: the Mean Absolute Error (MAE), Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and the coefficient of determination ( R 2 ). These metrics quantify the prediction accuracy and reliability of the developed forecasting model and are defined as follows:
MAE = 1 N ∑ i = 1 N ∣ P i − P ^ i ∣
RMSE = 1 N ∑ i = 1 N ( P i − P ^ i ) 2
MAPE = 100 N ∑ i = 1 N ∣ P i − P ^ i P i ∣
R 2 = 1 − ∑ i = 1 N ( P i − P ^ i ) 2 ∑ i = 1 N ( P i − P ¯ ) 2
where P i denotes the measured photovoltaic (PV) power output, P ^ i represents the ANN-predicted PV power output, P ¯ is the mean of the measured PV power, and N is the total number of testing samples. The forecasting accuracy was determined from the Mean Absolute Percentage Error (MAPE) as:
Forecasting   Accuracy ( % )   =   100 − MAPE ( % )
The feedforward ANN was trained without explicitly enforcing a non-negativity constraint on its output. Consequently, small prediction errors near sunrise and sunset resulted in negative values when the actual solar generation approached zero. To ensure physically meaningful forecasts, the ANN output was constrained to satisfy:
P P V ≥ 0 ,
thereby preventing non-physical negative power predictions. Any negative values generated near sunrise or sunset due to approximation errors were clipped to zero before performance evaluation. This post-processing step preserves the physical consistency of the forecasting model while maintaining its predictive accuracy. Table 2 highlights the statistical performance evaluation of the ANN forecasting model.
Table 2. Statistical performance evaluation of the ANN forecasting model.
The ANN forecasting model achieved excellent predictive performance across all statistical indicators. The MAE of 2.14 kW indicates a small average deviation between the predicted and measured photovoltaic power outputs, while the RMSE of 2.86 kW confirms that large prediction errors were minimal throughout the testing period. The MAPE of 3.80% corresponds to a forecasting accuracy of 96.20%, demonstrating that the ANN accurately captured the nonlinear variations in solar power generation. Furthermore, the coefficient of determination ( R 2 = 0.981 ) further demonstrates a very strong correlation between the predicted and measured solar power outputs, with more than 98% of the observed variation successfully captured by the model. Collectively, these performance metrics confirm the robustness and reliability of the proposed ANN forecasting model, making it suitable for supporting proactive energy management, battery scheduling, and renewable energy optimization in the proposed smart microgrid.

2.3. Conventional Control Layer

2.3.1. PID Controller

The PID controller is a widely used feedback control strategy that maintains system stability by continuously minimizing the error between the reference value and the actual output. A PID controller is implemented as the baseline voltage regulation mechanism within the microgrid. The controller continuously compares the measured DC bus voltage with a predefined reference value and generates corrective actions based on proportional, integral, and derivative error components. In microgrid systems, PID controllers are widely utilized to regulate battery power flow while maintaining bus voltage and frequency stability under varying operating conditions. The control law is expressed as:
u t = K p e t + K i ∫ e t d t + K d d e t d t
where u t is the control signal, e t is the voltage error, K p , K i , K d represent the proportional, integral, and derivative gains, respectively. The PID controller provides fast response to voltage deviations but may exhibit performance degradation under highly nonlinear and rapidly changing operating conditions [37].

2.3.2. Model Predictive Control (MPC)

To improve control performance under dynamic conditions, an MPC strategy is incorporated into the framework. Model Predictive Control (MPC) is an advanced control strategy that utilizes a mathematical model of the microgrid system to predict future operating conditions over a specified prediction horizon. Based on these predictions, it determines optimal control actions by solving an optimization problem while considering operational constraints. This predictive capability enables effective management of power flow, voltage regulation, and energy storage operation in microgrids characterized by variable renewable generation and changing load demands. At each control interval, MPC predicts future system states, evaluates control actions using an optimization function, selects the optimal control sequence, applies the first control action, and repeats the optimization process at the next sampling instant. The MPC controller enables proactive voltage regulation and battery management while considering operational constraints such as SOC limits and converter ratings. Compared with PID control, MPC offers improved stability and disturbance rejection capabilities [38].
The control objective in MPC is formulated as an optimization problem that minimizes a quadratic cost function over a finite prediction horizon. The cost function penalizes deviations of the predicted system states from their desired reference values while also limiting excessive control actions. Mathematically, the objective function is expressed as:
J = ∑ k = 1 N p x k − x r e f T Q x k − x r e f + u k T R u ( k )
where x k denotes the predicted system state at time step (k), such as battery state-of-charge (SOC) or bus voltage, x r e f represents the desired reference state, and u k is the control input, including battery charging or discharging commands. The parameter N p defines the prediction horizon, while (Q) and (R) are weighting matrices that determine the relative importance of state-tracking accuracy and control effort, respectively.

2.4. Fuzzy Logic Control Module

The Fuzzy Logic Controller (FLC) is incorporated into the proposed Energy Management System (EMS) to provide adaptive battery management and voltage support under varying operating conditions. The controller utilizes expert knowledge and linguistic decision rules to determine appropriate control actions without requiring an accurate mathematical model of the microgrid. The FLC considers key input variables, including solar power availability, battery state-of-charge (SOC), and voltage deviation, while the battery charging/discharging rate serves as the primary output variable. The control process consists of four stages: fuzzification of input variables, rule evaluation, aggregation of rule outputs, and defuzzification to generate the final control action.
Typical fuzzy rules are designed to regulate battery operation according to system conditions. For instance, when solar power availability is high and the battery SOC is low, the controller increases the charging rate, whereas charging is reduced when solar generation is low and the battery SOC is high. Similarly, increased battery support is provided during significant voltage deviations to enhance system stability. Through this rule-based reasoning process, the FLC enables smooth and adaptive control, improving battery utilization and voltage regulation while maintaining reliable microgrid operation under uncertain and dynamic conditions [39].

2.5. Reinforcement Learning-Based Optimization

The Reinforcement Learning (RL) module serves as the optimization component of the proposed Energy Management System (EMS), enabling adaptive and data-driven decision-making for microgrid operation. The RL agent continuously interacts with the microgrid environment by monitoring key system variables, including battery state-of-charge (SOC), solar power generation, load demand, and grid power exchange. Based on the observed system state, the agent selects appropriate control actions, such as charging the battery, discharging the battery, or maintaining the current operating condition. To guide the learning process, a reward function is formulated to promote desirable operational objectives, including maximizing renewable energy utilization, minimizing dependence on grid power, maintaining battery SOC within safe operating limits, and reducing overall power losses. The RL agent employs a Q-learning algorithm to update its decision-making policy, where future rewards are incorporated into current action selections. Through iterative training and continuous interaction with the environment, the agent gradually learns optimal battery scheduling and energy dispatch strategies that enhance the long-term efficiency, reliability, and sustainability of microgrid operation [40].
The Reinforcement Learning (RL) module provides the optimization layer of the proposed energy management framework by learning an optimal battery scheduling policy through continuous interaction with the microgrid environment. Unlike conventional optimization techniques that require an explicit mathematical model, RL enables the controller to learn optimal decisions directly from experience, making it well suited for renewable-powered microgrids characterized by uncertainty, intermittency, and time-varying operating conditions. In this study, the RL controller was implemented using the Q-learning algorithm, in which the agent observes the current microgrid operating state, selects an action, receives a reward, and updates its policy iteratively to maximize the expected cumulative reward. The system state was defined using the battery State of Charge (SOC), which was discretized into 11 operating states (0%, 10%, 20%, …, 100%) to represent the battery energy level throughout the scheduling horizon. At each decision interval, the agent selected one of three discrete control actions: Charge the battery, discharge the battery and maintain the current battery state (idle). The learning process was governed by the standard Q-learning update equation. The Q-learning algorithm updates the state–action value function according to:
Q s , a ← Q s , a + α r + γ m a x a ′ ∈ A Q s ′ , a ′ − Q s , a
where Q ( s , a ) is the state–action value representing the expected cumulative reward obtained by taking action a in state s ; α is the learning rate 0   <   α   ≤   1 , which determines the extent to which newly acquired information updates the existing Q-value; γ is the discount factor 0   ≤   γ   <   1 , which controls the importance of future rewards; r is the immediate reward received after executing action a ; s ′ denotes the subsequent system state; and A represents the set of all feasible actions. Through repeated interactions with the microgrid environment, the Q-values gradually converge toward the optimal policy that maximizes the expected long-term cumulative reward.
To achieve multiple operational objectives simultaneously, the reward function was formulated as
r = w 1 R R E − w 2 P g r i d − w 3 P S O C − w 4 P c u r t
where R RE denotes the reward associated with maximizing renewable energy utilization, P grid represents the penalty for importing power from the utility grid, P SOC is the penalty imposed whenever the battery state of charge (SOC) violates its prescribed operating limits, and P curt is the penalty associated with renewable energy curtailment. The weighting coefficients w 1 , w 2 , w 3 , and w 4 determine the relative importance assigned to renewable energy utilization, grid dependency reduction, battery protection, and minimization of renewable energy curtailment, respectively. Accordingly, the reward function encourages the RL agent to maximize the utilization of locally generated photovoltaic energy while minimizing reliance on utility grid imports. Simultaneously, it enforces safe battery operation by penalizing excessive charging or deep discharging and discourages the curtailment of available renewable energy. This multi-objective reward formulation enables the RL controller to learn an optimal battery scheduling policy that balances energy efficiency, system reliability, battery longevity, and renewable energy integration under dynamic microgrid operating conditions. Battery SOC constraints were enforced to maintain safe operation within 20% ≤ SOC ≤ 90%. Whenever the SOC exceeded these limits, the RL agent received a penalty proportional to the violation magnitude, discouraging excessive charging or deep discharging. Similarly, renewable energy curtailment resulting from surplus photovoltaic generation that could neither be consumed nor stored attracted an additional penalty, encouraging the agent to maximize renewable energy utilization through intelligent battery scheduling. The Q-learning agent was trained for 1000 episodes, with each episode representing a complete 24-h microgrid operating cycle under varying solar irradiance and load demand conditions. An ε-greedy exploration strategy was adopted to balance exploration and exploitation during learning, using a learning rate of ( α = 0.1), a discount factor of ( γ = 0.95), and an initial exploration probability of ( ε = 0.1). Training was considered to have converged when the cumulative episode reward and Q-values exhibited negligible changes over successive episodes, indicating that the learned policy had stabilized. After convergence, the trained RL agent was deployed for online energy management. At each control interval, the agent determined the optimal battery charging or discharging action based on the current system state, thereby minimizing grid dependency, maximizing renewable energy utilization, maintaining battery SOC within safe operating limits, and improving overall microgrid efficiency.

2.6. Hybrid Decision-Making Process

The proposed hybrid Energy Management System (EMS) integrates forecasting, control, and optimization modules within a unified decision-making framework to ensure efficient and reliable microgrid operation. The process begins with the acquisition of real-time measurements, including PV generation, load demand, battery state-of-charge (SOC), and system operating conditions. Artificial Neural Network (ANN) models are then utilized to forecast future renewable generation and load demand. Based on these predictions, PID and Model Predictive Control (MPC) strategies provide voltage regulation and system stabilization, while the Fuzzy Logic Controller (FLC) determines adaptive battery charging and discharging actions. Subsequently, the Reinforcement Learning (RL) agent optimizes energy dispatch decisions to maximize renewable energy utilization and minimize grid dependency. The resulting control commands are executed through the inverter and battery management system, and the process is continuously repeated at each control interval to accommodate changing operating conditions. The integration of predictive forecasting, adaptive control, and learning-based optimization enables the EMS to achieve both short-term operational objectives and long-term performance goals. The proposed framework enhances voltage regulation, improves battery SOC management, increases renewable energy utilization, reduces reliance on utility grid imports, and strengthens system resilience under fluctuating generation and load conditions. Consequently, the AI-based EMS provides an intelligent and robust solution for the real-time management of renewable-powered smart microgrids operating in dynamic and uncertain environments [41].

2.7. Control Strategies for Smart Microgrids

2.7.1. Conventional Controllers

Conventional control techniques, particularly Proportional–Integral–Derivative (PID) and Model Predictive Control (MPC), are widely used in microgrids for voltage regulation, frequency control, and power management. PID controllers regulate system variables by minimizing the error between reference and measured values through proportional, integral, and derivative actions. Their simple structure and ease of implementation make them suitable for inverter control and battery charge–discharge management. However, their performance is highly dependent on proper parameter tuning and may deteriorate under nonlinear and rapidly changing operating conditions caused by renewable energy intermittency and load fluctuations [42,43].
MPC provides a more advanced control strategy by predicting future system behavior and determining optimal control actions over a specified prediction horizon while satisfying operational constraints. This predictive capability enables effective management of multivariable microgrid systems and improves overall control performance. Nevertheless, MPC relies on accurate system models and requires repeated online optimization, which can increase computational complexity and limit real-time applicability in highly dynamic environments. Therefore, although PID and MPC provide reliable baseline control, their limited adaptability to uncertainties and time-varying conditions motivates the integration of intelligent control techniques for enhanced microgrid operation [44,45].

2.7.2. Intelligent Control Techniques

Intelligent control techniques have gained significant attention in microgrid applications due to their ability to handle nonlinearities, uncertainties, and dynamic operating conditions. Among the most widely adopted approaches are Fuzzy Logic Control (FLC), Artificial Neural Networks (ANN), and Reinforcement Learning (RL). FLC employs linguistic rules and human-like reasoning to regulate system variables without requiring accurate mathematical models, making it suitable for battery management and voltage regulation under uncertain conditions. ANN introduces predictive capabilities by learning complex relationships between environmental and operational variables, enabling accurate forecasting of renewable generation and load demand for proactive energy management. RL further enhances adaptability by learning optimal control policies through interaction with the microgrid environment, allowing efficient battery dispatch and reduced grid dependency without requiring explicit system models [4,7]. Compared with conventional controllers, intelligent techniques offer greater adaptability and predictive capability. FLC provides robust real-time decision-making, ANN improves forecasting accuracy, and RL enables autonomous optimization under changing operating conditions. Together, these approaches enhance system stability, renewable energy utilization, and overall microgrid performance, making them well-suited for modern renewable-powered energy management systems [21,46].

2.8. Energy Management Framework

The proposed Energy Management System (EMS) coordinates the operation of photovoltaic (PV) generation, battery energy storage systems (BESS), and grid interaction within the hybrid microgrid. The framework combines conventional rule-based control with Artificial Intelligence (AI)-driven techniques to ensure reliable, efficient, and adaptive operation under dynamic conditions. Real-time and forecasted information, including PV generation, load demand, battery state of charge (SOC), grid electricity prices, and inverter operating conditions, are continuously monitored and processed to support optimal decision-making [22,47]. The EMS consists of three interconnected control layers. First, a rule-based scheduler provides immediate control actions based on predefined operating rules, ensuring safe and reliable operation. Second, a predictive optimization layer integrates Artificial Neural Network (ANN) forecasting with Model Predictive Control (MPC) to anticipate future system conditions and determine short-term optimal control actions. Third, a Reinforcement Learning (RL) agent continuously learns and refines long-term energy management policies through interaction with the microgrid environment. The resulting control decisions are translated into inverter, battery, and grid-interface commands to regulate power flow and maintain system stability. A monitoring and fallback mechanism is also incorporated, allowing the system to revert to rule-based operation whenever predictive or adaptive controllers encounter uncertainties or performance degradation [12,48]. The EMS is designed to achieve multiple objectives simultaneously, including minimizing operational costs, reducing grid dependency, maximizing renewable energy utilization, maintaining battery SOC within safe operating limits, and ensuring voltage and frequency stability. By integrating predictive, adaptive, and rule-based control strategies within a unified framework, the proposed EMS enhances energy efficiency, operational reliability, and resilience in renewable-powered smart microgrids.
A typical stage cost used by MPC/RL:
J = ∑ k = 0 N − 1 ω 1 . C g r i d P g r i d k + ω 2 . S O C k − S O C r e f 2 + ω 3 . P P V k − P u s e d k
where C g r i d is the grid price × imported energy (can be time-varying), S O C r e f is the desired SOC target (e.g., 60–70%), and ω i is the tuning weights.
Constraints (enforced in optimizer and via rule-based checks): Battery SOC bounds: S O C m i n = 30 % , S O C m a x = 90 % . Battery power limits: P b a t ( k ) ≤ P b a t m a x , Charging/discharging efficiency: η c h = η d i s c h = 0.90 , Converter losses/AC–DC efficiency: η c o n v = 0.94 , Power balance: P P V k + P b a t k + P g r i d k = P L k + P l o s s k .
The Energy Management System (EMS) integrates predictive, adaptive, and rule-based control modules to enable intelligent and reliable microgrid operation. The predictive layer employs an Artificial Neural Network (ANN) to forecast solar generation and load demand using historical and real-time data. These forecasts are utilized by the Model Predictive Control (MPC) module to determine optimal control actions while satisfying operational constraints, such as battery SOC limits and power balance requirements. Operating in a receding-horizon framework, the MPC continuously updates its decisions based on forecasted and real-time system conditions. Complementing the predictive layer, a Reinforcement Learning (RL) agent learns optimal battery charging and discharging policies through interaction with the microgrid environment, improving long-term operational efficiency and adaptability. Together, the ANN, MPC, and RL modules provide predictive awareness, adaptive decision-making, and optimized energy dispatch [49].
To enhance reliability, a rule-based EMS is incorporated as a fallback control mechanism. The rule-based controller prioritizes direct utilization of PV generation, followed by battery charging or discharging according to predefined SOC limits, while importing or exporting power as required to maintain supply-demand balance. During abnormal operating conditions or when advanced controllers are unavailable, the rule-based layer ensures safe and continuous operation. This hybrid architecture combines the predictive capabilities of ANN and MPC, the adaptive learning of RL, and the robustness of rule-based control, resulting in improved energy management, operational resilience, and system stability under dynamic operating conditions [20,50]. Algorithm 1, Algorithm 2, Algorithm 3, Algorithm 4, Algorithm 5, Algorithm 6, Algorithm 7 and Algorithm 8 highlight the algorithm implementation of the various scenarios conducted in this study.
Algorithm 1. Algorithm implementation of simple solar–battery microgrid operation
Input: Solar generation P s o l a r ,  Load demand P l o a d ,  Battery SOC
Output: Battery energy state and grid power import
Pseudocode: Simple Solar–Battery Microgrid Simulation
01:Initialize battery capacity and initial SOC
02:for each hour t = 1 to 24 do
03:    Calculate net power:
04:         P n e t = P s o l a r − P l o a d
05    if P n e t  > 0 then
06:        Charge battery using surplus power
07:        Update battery SOC
08:        Grid-Import = 0
09:    else
10:        Discharge battery to meet deficit
11:        Update battery SOC
12:        Grid-Import = Remaining deficit
13:   end if
14:   Store SOC and Grid-Import
15:end for
16:Return SOC profile and grid usage profile
Algorithm 2. Algorithm implementation of rule-based energy management system
Input: Solar power, Battery SOC, Load demand
Output: Solar utilization, battery dispatch, grid import
Pseudocode: Rule-Based Energy Management
01:Initialize battery SOC
02:for each time step t  do
03:    Read solar power and load demand
04:    if Solar power ≥ Load demand then
05        Supply load entirely from solar
06:        Surplus-Solar = Solar-Power − Load-Demand
07:        Charge battery using Surplus-Solar
08:        Grid-Import = 0
09:    else
10:        Supply load using available solar
11:        Deficit = Load-Demand − Solar-Power
12:        Discharge battery to cover deficit
13:      if Deficit remains then
14:          Import power from utility grid
15        end if
16   end if
17   Update battery SOC
18:end for
19:Return Solar-Used, Battery-Used and Grid-Import
Algorithm 3. Algorithm Implementation of PID-based voltage regulation
Input: Reference voltage V r e f ,  Measured voltage V m e a s
Output: Battery power control signal
Pseudocode: PID Voltage Controller
01:Initialize K p ,   K i ,   K d
02:Initialize integral and previous error
03:for each sampling instant k do
04:    Measure bus voltage V m e a s
05    Error = V r e f  − V m e a s
06:    Integral = Integral + Error × ∆t
07:    Derivative = (Error − Previous-Error)/∆t
08:    Control-Signal = K p  × Error + K i  × Integral + K d  × Derivative
09:    Send Control-Signal to battery converter
10:    Update Previous-Error
11:end for
12:Return regulated bus voltage
Algorithm 4. Algorithm implementation of MPC-based energy management system
Input: System state, prediction horizon N p ,  reference voltage
Output: Optimal battery power command
Pseudocode: MPC-Based Voltage Stabilization
01:Initialize prediction horizon N p
02:Initialize weighting matrices Q and R
03:for each control interval k do
04:    Measure current system state
05    Predict future states over horizon N p
06:    for p = 1 to Np do
07:        Compute predicted error
08:        Estimate control action
09:        Predict future state
10:    end for
11:    Evaluate MPC cost function
12:    Select optimal control sequence
13:    Apply first control action only
14:    Update system measurement
15end for
16:Return optimal battery dispatch signal
Algorithm 5. Algorithm implementation of Fuzzy Logic battery charging controller
Input: Solar power level, Battery SOC
Output: Battery charging rate
Pseudocode: Fuzzy Logic Battery Charging
01:Define fuzzy input variables:
02:Solar-Power [Low, Medium, High]
03:Battery-SOC [Low, Medium, High]
04:Define fuzzy output:
05Charge-Rate [Low, Medium, High]
06:Construct fuzzy rule base:
07:    Rule 1:
08:        IF Solar-Power is High AND Battery-SOC is Low THEN Charge-Rate is High
09:    Rule 2:
10:        IF Solar-Power is Medium AND Battery-SOC is Medium THEN Charge-Rate is Medium
11:    Rule 3:
12:        IF Solar-Power is Low OR Battery-SOC is High THEN Charge-Rate is Low
13:Fuzzify input measurements
14:Evaluate fuzzy rules
15Aggregate rule outputs
16Defuzzify output
17Apply battery charging command
18:Return Charge-Rate
Algorithm 6. Algorithm implementation of ANN-based solar power prediction
Input: Time of day, Temperature data
Output: Predicted solar power
Pseudocode: ANN Solar Forecasting
01:Collect historical inputs: Time-Of-Day, and Temperature
02:Collect target output: Solar-Power
03:Split dataset into: Training set and Testing set
04:Create feedforward neural network
05Initialize hidden layer neurons
06:Train network using training dataset
07:while Training-Error not converged do
08:    Forward propagate inputs
09:    Compute output error
10:    Update weights and biases
11:end while
12Apply trained ANN to testing dataset
13Generate solar power prediction
14:Return predicted solar profile
Algorithm 7. Algorithm implementation of Reinforcement Learning (Q-Learning) Battery Scheduling
Input: Battery SOC, Solar generation, Load demand
Output: Optimal charging/discharging action
Pseudocode: RL-Based Energy Management
01:Define states: Battery SOC levels
02:Define actions: Charge, Idle and Discharge
03:Initialize Q-table to zero
04:Set learning parameters: α (learning rate), γ (discount factor), ε (exploration rate)
05for each training episode do
06:    Initialize battery SOC
07:    for each hour t  do
08:        Select action using ε-greedy policy
09:        Execute action
10:        Update SOC
11:     Calculate grid power import
12     Compute reward: Reward = − Grid-Power
13      Update Q-table: Q(s,a) ← Q(s,a) + α[r + γ max Q(s′,a′) + − Q(s,a)]
14        Move to next state
15    end for
16end for
17Extract optimal policy from Q-table
18Implement learned policy
19:Return battery schedule and grid usage
Algorithm 8. Algorithm implementation of integrated intelligent EMS framework
Pseudocode: Intelligent Microgrid Energy Management Framework
01:Acquire real-time measurements: Solar irradiance, Temperature, Load demand, Battery SOC
02:ANN predicts future solar generation
03:ANN predicts future load demand
04:Fuzzy Logic Controller evaluates: Solar availability, Battery SOC, Voltage condition
05Determine desired charging/discharging level
06:Reinforcement Learning Agent: Optimize battery dispatch, minimize grid dependency, maximize renewable utilization
07:Execute battery and inverter commands
08:Monitor system voltage and power balance
09:Update RL knowledge using received reward
10:Repeat for next control interval
11:Return optimized microgrid operation

3. Results

The performance of the proposed AI-based control and Energy Management System (EMS) was evaluated using a MATLAB/Simulink-R2024B-based renewable-powered microgrid model comprising a photovoltaic (PV) generation system, battery energy storage system (BESS), variable load, and grid interface. Simulations were conducted under dynamic operating conditions to assess the effectiveness of both conventional and intelligent control strategies in maintaining system stability, optimizing energy utilization, and reducing grid dependency. A 24-h simulation horizon was adopted to capture daily variations in solar generation and load demand. Solar irradiance was modeled using a time-varying profile with a peak value of approximately 1000 W/m2, while load demand varied between 30 kW and 90 kW to emulate realistic residential and commercial consumption patterns. Seven simulation scenarios were investigated to evaluate different control and energy management approaches. Scenario 1 examined the baseline operation of a solar–battery microgrid, highlighting the interaction between PV generation, battery storage, and load demand. Scenario 2 implemented a rule-based EMS to manage power flow using predefined operational rules. Scenario 3 evaluated a Proportional–Integral–Derivative (PID) controller for voltage regulation and battery power management. Scenario 4 employed Model Predictive Control (MPC) to optimize system operation through predictive decision-making. Scenario 5 investigated the application of Fuzzy Logic Control (FLC) for adaptive battery charging and voltage support under uncertain operating conditions. Scenario 6 utilized an Artificial Neural Network (ANN) for forecasting solar generation and load demand to support proactive energy management. Finally, Scenario 7 implemented a Reinforcement Learning (RL)-based EMS to optimize battery scheduling and energy dispatch through continuous learning and adaptation. The performance of each scenario was assessed using key indicators, including battery state-of-charge (SOC), voltage regulation, renewable energy utilization, grid power exchange, and overall system efficiency. Comparative analysis of the simulation results provides insight into the effectiveness of conventional and AI-driven control strategies in addressing renewable intermittency, load variability, and operational uncertainties. Table 3 highlights the simulation scenarios/control cases that were implemented and evaluated. The simulation parameters and controller settings used in the study are summarized in Table 4, while the results for each scenario are presented and discussed in the following subsections.
Table 3. Simulation scenarios/control cases that were implemented and evaluated.
Table 4. Parameter settings used in the simulation.
Figure 2, Figure 3 and Figure 4 provide a detailed illustration of the dynamic interaction between solar generation, battery storage, and grid power over a 24-h operating cycle. Figure 2 presents a comparison between the solar generation profile and the load demand, clearly highlighting the temporal mismatch between energy production and consumption. Solar generation follows a typical diurnal pattern, peaking around midday, while the load demand exhibits fluctuations that may not coincide with peak generation periods. This mismatch underscores the need for effective energy management strategies to ensure a continuous and balanced power supply. Figure 3 depicts the battery state of charge (SOC) throughout the day, reflecting the charging and discharging behavior of the energy storage system. During periods of high solar generation, particularly around midday, excess energy is stored in the battery, leading to an increase in SOC. Conversely, during evening and nighttime hours when solar generation is minimal or absent, the battery discharges to support the load, resulting in a gradual decline in SOC. This behavior demonstrates the critical role of the battery in bridging the gap between generation and demand. Figure 4 illustrates the power imported from the grid, which becomes significant when both solar generation and battery storage are insufficient to meet the load demand. Typically, grid import is higher during early morning and late evening periods when demand is relatively high and renewable generation is low. Collectively, these figures demonstrate that the integration of battery storage effectively reduces reliance on the grid, enhances energy self-sufficiency, and contributes to a more stable and reliable microgrid operation.
Figure 2. Solar generation and the load profile of the solar–battery microgrid (Baseline—Scenario 1).
Figure 3. State of charge of the battery (Baseline—Scenario 1).
Figure 4. Power imported from the grid (Baseline—Scenario 1).
Figure 5, Figure 6, Figure 7 and Figure 8 extend the previous analysis by incorporating a rule-based energy management strategy, providing further insight into how simple control logic can effectively coordinate energy flow within the microgrid. Figure 5 presents a comparison between total solar generation and the portion of solar energy actually utilized. The results show that when solar generation exceeds the immediate load demand, the surplus energy is efficiently redirected to charge the battery rather than being wasted. This highlights the ability of the rule-based controller to prioritize renewable energy utilization and improve overall system efficiency. Figure 6 illustrates the battery state of charge (SOC) under the rule-based control scheme. The SOC profile reflects a structured charging and discharging pattern, where the battery charges during periods of excess solar generation and discharges during times of insufficient generation. This controlled behavior ensures that the battery operates within safe limits while remaining available to support the load when needed. Figure 7 further emphasizes this behavior by showing the battery discharge activity during periods of energy deficit, particularly during evening and nighttime hours. The battery acts as a buffer, supplying energy to the load and reducing the need for grid support. Figure 8 complements this by illustrating grid power import, which occurs only when both solar generation and battery storage are unable to meet demand. Ultimately, these figures demonstrate that rule-based energy management provides a simple yet effective approach for prioritizing renewable energy usage, maintaining battery health, and minimizing reliance on the utility grid.
Figure 5. Solar generation and solar used profile (Rule-based control—Scenario 2).
Figure 6. State of charge of the battery (Rule-based control—Scenario 2).
Figure 7. Battery discharge activity (Rule-based control—Scenario 2).
Figure 8. Power imported from the grid (Rule-based control—Scenario 2).
Figure 9, Figure 10 and Figure 11 illustrate the performance of a Proportional–Integral–Derivative (PID) controller in regulating the DC bus voltage of the microgrid under varying load conditions. Figure 9 presents a comparison between the uncontrolled system response and the response achieved with PID control. The uncontrolled voltage profile exhibits noticeable fluctuations and deviations from the desired reference, particularly during load changes. In contrast, the PID-controlled response shows a significant improvement, with the voltage stabilizing around the reference value of approximately 400 V. This demonstrates the controller’s ability to maintain system stability through continuous error correction. Figure 10 shows the battery power command generated by the PID controller, which acts as the control input used to regulate the DC bus voltage. The controller adjusts the charging and discharging of the battery in real time to counteract voltage deviations caused by load variations. When the voltage drops below the reference, the controller increases battery discharge to support the system, and when the voltage rises above the setpoint, it reduces output or initiates charging. Figure 11 presents the voltage error over time, indicating the difference between the reference and actual voltage. The error rapidly decreases and converges to zero, highlighting the effectiveness of the PID controller in achieving steady-state accuracy. Overall, these figures confirm that PID control provides reliable voltage regulation through real-time feedback, ensuring stable microgrid operation under dynamic conditions.
Figure 9. Bus voltage regulation (PID-based control—Scenario 3).
Figure 10. Battery power command (PID-based control—Scenario 3).
Figure 11. Voltage error over time (PID-based control—Scenario 3).
Figure 12, Figure 13 and Figure 14 present the performance of the Model Predictive Controller (MPC) in regulating the DC bus voltage of the microgrid, highlighting its predictive and optimization capabilities. Figure 12 illustrates the voltage response under MPC, showing a stable and well-regulated profile that closely tracks the reference value despite variations in load and generation. Unlike conventional controllers, MPC anticipates future disturbances using a system model and adjusts control actions in advance, thereby preventing large deviations and improving overall stability. Figure 13 depicts the control signal generated by the MPC, which is notably smooth and well-coordinated. This reflects the controller’s ability to optimize control inputs over a prediction horizon while considering system constraints. The smoothness of the control signal reduces stress on system components, particularly the battery and power electronic converters, thereby enhancing system efficiency and longevity. Figure 14 shows the voltage error over time, demonstrating a rapid and consistent reduction toward zero. The error convergence is faster and more stable compared to conventional methods, confirming the effectiveness of MPC in handling dynamic system variations. By incorporating future predictions into the control process, MPC minimizes oscillations and improves transient response. Hence, Figure 12, Figure 13 and Figure 14 highlight the superior performance of MPC compared to PID control, particularly in dynamic and uncertain operating conditions. Its predictive nature enables proactive control, resulting in improved voltage regulation, reduced fluctuations, and enhanced system reliability.
Figure 12. Bus voltage regulation (MPC—Scenario 4).
Figure 13. MPC signal—Scenario 4.
Figure 14. Voltage error over time (MPC—Scenario 4).
Figure 15 presents a three-dimensional surface plot that illustrates the fuzzy logic relationship between solar power, battery state of charge (SOC), and the resulting battery charge rate. This visualization provides intuitive insight into how the fuzzy logic controller maps input variables to control actions using a set of linguistic rules. The surface clearly shows that when solar power availability is high and the battery SOC is low, the controller assigns a high charging rate, enabling efficient utilization of excess renewable energy. Conversely, as the battery SOC approaches its upper limit, the charging rate gradually decreases, even if solar power remains high, thereby preventing overcharging and preserving battery health. The nonlinear shape of the surface highlights the ability of fuzzy logic to handle complex system behavior without relying on explicit mathematical models. Instead of rigid thresholds or linear relationships, the controller applies smooth transitions between different operating regions, ensuring stable and gradual control actions. This reduces abrupt changes in battery operation and improves overall system performance. Furthermore, the surface plot reflects human-like reasoning embedded within the fuzzy rule base, where decisions are made based on qualitative conditions rather than precise numerical boundaries. This makes the control strategy robust to uncertainties and measurement variations. Hence, Figure 15 demonstrates how fuzzy logic effectively balances energy utilization and battery protection, providing an efficient and adaptive approach for regulating battery charging in a hybrid microgrid system.
Figure 15. Fuzzy logic control surface for battery charging (Scenario 5).
Figure 16 illustrates the performance of the Artificial Neural Network (ANN) model developed for solar power prediction. The ANN successfully captures the characteristic bell-shaped profile of solar generation over a typical day, with output increasing from morning, peaking around midday, and declining toward evening. The close alignment between the predicted and actual solar power curves demonstrates the model’s strong learning and generalization capability. Minor deviations observed during late afternoon periods can be attributed to reduced irradiance variability and potential modeling limitations; however, the overall prediction accuracy remains high. The apparent overlap of the Training Data, True Test Data, and ANN-Predicted Data over the interval corresponding to approximately 0–18 h is expected and indicates the high predictive capability of the trained ANN model rather than a plotting error. During this period, the PV output follows a smooth diurnal pattern with gradual variations in solar irradiance. Consequently, the ANN accurately captures the nonlinear relationship between the input variables (time of day and ambient temperature) and the PV output, resulting in predictions that closely follow the measured data. Hence, the close overlap demonstrates excellent agreement between the measured and predicted PV power profiles rather than duplication of the datasets. This confirms the effectiveness of ANN as a reliable forecasting tool, enabling the Energy Management System (EMS) to anticipate generation patterns and make proactive control decisions. Figure 17, Figure 18 and Figure 19 present the performance of a Reinforcement Learning (RL) agent applied to battery energy management. Figure 17 shows the evolution of the battery state of charge (SOC) over the 24-h period, reflecting adaptive charging and discharging decisions made by the RL controller. The SOC profile indicates that the agent effectively stores energy during periods of high solar generation and strategically discharges during peak demand or low generation intervals. The saw-tooth shape of the Battery State of Charge (SOC) profile results from the rule-based battery charging and discharging strategy adopted in the simulation. As solar generation exceeds the load demand, the battery charges and the SOC increases. Conversely, when PV generation decreases or the load exceeds available solar power, the battery discharges to support the load, causing the SOC to decrease. This repeated charge–discharge process naturally produces a saw-tooth profile, which is commonly observed in battery energy storage systems operating under intermittent renewable generation and time-varying load conditions. Since the simulation is performed using discrete time steps, each charging or discharging action produces incremental changes in battery energy, making the saw-tooth pattern more pronounced. This behavior demonstrates the agent’s ability to learn optimal scheduling policies that balance energy availability and system requirements. Figure 18 illustrates the discrete control actions taken by the RL agent, including charging, discharging, and idle states. These actions are selected based on the system state and learned reward structure, highlighting the decision-making intelligence of the controller. Figure 19 illustrates the hourly power imported from the utility grid under the proposed Reinforcement Learning (RL)-based Energy Management System (EMS). The results demonstrate that grid power import is significantly reduced through intelligent battery scheduling and optimal utilization of available photovoltaic (PV) energy. During periods of high solar generation, the RL controller prioritizes charging the battery using surplus PV power, thereby storing energy for later use. As solar generation decreases or load demand increases, the controller strategically discharges the battery to satisfy the load before importing power from the utility grid. Consequently, grid imports remain relatively low for most of the operating period, indicating improved energy self-sufficiency and effective renewable energy utilization. Higher grid imports are observed during late-night hours when PV generation is unavailable and the battery approaches its minimum allowable state of charge (SOC). At this stage, the EMS limits further battery discharge to prevent excessive depletion and preserve battery lifespan, requiring the remaining demand to be supplied by the utility grid. The apparent difference in grid power import between Hour 24 and Hour 1 arises from the evolution of the battery state of charge (SOC) throughout the simulation rather than from any inconsistency in the proposed control strategy. Although both time instants correspond to periods of negligible or zero photovoltaic (PV) generation, the energy available in the battery is different. During the evening and nighttime hours, the battery progressively discharges to support the load and reduce dependence on the utility grid. Consequently, by Hour 24, the battery SOC has approached its minimum operating limit after supplying the load over several preceding hours. Once this minimum SOC is reached, the Energy Management System (EMS) restricts further battery discharge to protect battery health, requiring the utility grid to supply most of the remaining load, thereby resulting in approximately 80 kW of imported power. In contrast, at Hour 1, the battery still retains usable stored energy (or, in the case of a new simulation cycle, starts from the predefined initial SOC). The EMS therefore allows the battery to contribute to the load demand, significantly reducing the amount of power imported from the utility grid to approximately 20 kW. The grid import profile is governed not only by the instantaneous load and PV generation but also by the battery SOC trajectory and the battery protection constraints implemented within the EMS. These factors naturally produce different grid import levels at Hour 1 and Hour 24, despite both occurring during periods of low solar generation. Ultimately, these figures highlight the transition from conventional control methods to advanced intelligent techniques. While rule-based and PID controllers provide baseline functionality, the integration of Fuzzy Logic, ANN, and RL introduces predictive, adaptive, and self-learning capabilities. Collectively, the results demonstrate how MATLAB/Simulink simulations serve as a practical platform for validating intelligent control strategies, bridging the gap between theoretical development and real-world microgrid implementation. Table 5 shows the comparative performance metrics of the evaluated microgrid control strategies.
Figure 16. ANN-based solar power prediction (Scenario 6).
Figure 17. Battery state of charge (RL-based energy management—Scenario 7).
Figure 18. Battery actions (charge/discharge/idle)—Scenario 7.
Figure 19. Power imported from the grid under RL-based energy management (Scenario 7).
Table 5. Comparative performance metrics of the evaluated microgrid control strategies.
Table 6 highlights the voltage-control performance evaluation criteria used in this study. As shown in Table 6, the Root Mean Square Error (RMSE) was calculated as the square root of the average squared difference between the measured DC bus voltage and the 400 V reference voltage over the entire simulation period. The settling time was defined as the time required for the controlled voltage to enter and remain within ±2% of the reference voltage following the disturbance. The percentage overshoot was calculated as the maximum voltage excursion above the reference voltage relative to the reference value.
Table 6. Voltage-control performance evaluation criteria used.
Table 7 demonstrates that all controllers were evaluated under identical operating conditions, ensuring an unbiased comparison. The progressive reductions in RMSE, settling time, and overshoot from the Baseline to the RL controller clearly show the benefits of incorporating increasingly advanced control strategies. The RL-based controller achieved the best overall voltage regulation performance, exhibiting the smallest tracking error (1.50 V), the shortest settling time (1.8 s), and the lowest overshoot (0.5%), confirming its superior adaptability and robustness under dynamic microgrid operating conditions.
Table 7. Numerical voltage-control performance comparison of all evaluated scenarios.
Figure 20 compares the performance of the seven control strategies investigated in this study, namely the Baseline, Rule-Based EMS, PID, MPC, FLC, ANN, and RL approaches, using six common energy management metrics: operational cost reduction, voltage regulation, battery SOC management, renewable energy utilization, grid dependency reduction, and overall system efficiency. The figure also presents the ANN forecasting accuracy separately and summarizes the overall performance score for each strategy. Overall, the results demonstrate a progressive improvement in microgrid performance as more intelligent control techniques are employed. The Baseline scenario exhibits the weakest performance across all evaluation criteria, with an operational cost reduction of 45%, voltage regulation of 40%, battery SOC management of 50%, renewable energy utilization of 27.3%, grid dependency reduction of 30%, and overall efficiency of 65%, resulting in the lowest performance score of 65.2%. These results indicate that conventional operation without an advanced energy management strategy is unable to effectively coordinate distributed energy resources under dynamic operating conditions. The Rule-Based EMS improves system operation by employing predefined decision rules for battery charging and grid interaction. Consequently, the operational cost reduction increases to 55%, voltage regulation improves to 55%, battery SOC management reaches 65%, renewable energy utilization increases to 35%, grid dependency reduction improves to 45%, and overall efficiency rises to 72%, producing an overall performance score of 71.5%. Although the rule-based controller enhances system reliability, its fixed heuristic rules limit adaptability to rapidly changing operating conditions. The PID controller further improves dynamic performance by regulating the DC bus voltage and battery power through continuous error minimization. Compared with the Rule-Based EMS, operational cost reduction increases to 65%, voltage regulation reaches 78%, battery SOC management improves to 75%, renewable energy utilization increases to 50%, grid dependency reduction reaches 55%, and overall efficiency improves to 78%, resulting in an overall performance score of 78.4%. Despite these improvements, the PID controller remains sensitive to parameter tuning and exhibits reduced adaptability under highly nonlinear operating conditions. The Model Predictive Control (MPC) strategy provides additional improvements by utilizing system predictions to optimize future control actions while satisfying operational constraints. The operational cost reduction increases to 80%, voltage regulation improves to 86%, battery SOC management reaches 85%, renewable energy utilization increases to 65%, grid dependency reduction improves to 72%, and system efficiency reaches 86%, yielding an overall performance score of 85.7%. These results demonstrate the advantage of predictive optimization over purely reactive control methods. The Fuzzy Logic Controller (FLC) achieves consistently high performance across all metrics due to its ability to accommodate nonlinear system behavior without requiring an accurate mathematical model. Specifically, the controller achieves 82% operational cost reduction, 89% voltage regulation, 88% battery SOC management, 70% renewable energy utilization, 75% grid dependency reduction, and 89% overall efficiency, resulting in an overall performance score of 89.3%. The smooth control actions generated by fuzzy inference contribute to improved system stability and battery utilization under varying solar irradiance and load conditions. The ANN-based approach primarily enhances predictive energy management through accurate short-term forecasting of photovoltaic generation. The forecasting model achieves an accuracy of 96.2%, enabling more effective battery scheduling and renewable energy utilization. Consequently, the ANN-based EMS records 88% operational cost reduction, 85% voltage regulation, 80% battery SOC management, 85% renewable energy utilization, 82% grid dependency reduction, and 92% overall system efficiency, leading to an overall performance score of 92.1%. The high forecasting accuracy significantly contributes to proactive energy scheduling and reduced reliance on utility grid imports. Among all evaluated strategies, the Reinforcement Learning (RL) controller demonstrates the best overall performance. By continuously learning optimal battery scheduling policies through interaction with the microgrid environment, the RL controller achieves 95% operational cost reduction, 95% voltage regulation, 95% battery SOC management, 92% renewable energy utilization, 92% grid dependency reduction, and 95% overall system efficiency, producing the highest overall performance score of 95.4%. Unlike conventional controllers, the RL agent continuously adapts its decision-making policy based on system feedback, allowing it to effectively manage renewable intermittency and varying load demand while maintaining battery operation within safe limits. It should be noted that forecasting accuracy is evaluated only for the ANN forecasting model because photovoltaic power prediction is performed exclusively by the ANN module. Consequently, forecasting accuracy is not used as a performance indicator for the Baseline, Rule-Based EMS, PID, MPC, FLC, or RL controllers. Instead, the overall performance score is computed from the six common energy management metrics, providing a fair comparison among all evaluated control strategies. Hence, Figure 20 demonstrates a clear evolution in microgrid performance from conventional control approaches to intelligent AI-based techniques. The progressive improvements in operational cost reduction, voltage regulation, battery SOC management, renewable energy utilization, grid dependency reduction, and overall system efficiency confirm that data-driven and adaptive control strategies provide superior energy management under dynamic operating conditions. Among the evaluated methods, the RL-based controller offers the most balanced and robust performance, making it the most suitable strategy for intelligent renewable-powered microgrid applications.
Figure 20. Comparative performance analysis of microgrid control strategies.
Figure 21 presents a comparative analysis of the dynamic performance of the investigated microgrid control strategies using three important transient response indicators: Root Mean Square Error (RMSE), settling time, and overshoot. These metrics evaluate the ability of each control approach to maintain voltage stability and respond effectively to system disturbances caused by fluctuating renewable generation and varying load demand. The results show a progressive improvement in control performance from the Baseline and Rule-Based approaches to the more advanced intelligent controllers. The Baseline scenario exhibits the highest RMSE (20.0 V), longest settling time (15.0 s), and largest overshoot (10.0%), indicating poor dynamic response and limited regulation capability. The Rule-Based EMS improves system performance, reducing RMSE to 15.0 V and settling time to 10.0 s. Conventional controllers provide further enhancements, with PID achieving an RMSE of 6.91 V and MPC reducing it to 3.42 V through predictive optimization. Similarly, settling time decreases from 6.2 s for PID to 3.1 s for MPC, demonstrating the advantage of model-based predictive control. Among the intelligent techniques, FLC, ANN, and RL deliver the best dynamic performance. FLC achieves an RMSE of 2.10 V and settling time of 2.4 s, while ANN further reduces these values to 2.00 V and 2.2 s, respectively. The RL-based controller exhibits the highest performance, recording the lowest RMSE (1.50 V), shortest settling time (1.8 s), and smallest overshoot (0.5%). These results confirm that intelligent and adaptive control strategies provide superior voltage regulation, faster response, and enhanced system stability compared with conventional approaches under dynamic microgrid operating conditions.
Figure 21. Comparative performance analysis of microgrid systems under various scenarios.

4. Discussion

The simulation results demonstrate that artificial intelligence (AI)-based control strategies substantially improve the operational performance of renewable-powered smart microgrids compared with conventional energy management approaches. The comparative analysis of the seven investigated scenarios, Baseline, Rule-Based EMS, PID, MPC, FLC, ANN, and RL, confirms that increasing controller intelligence progressively enhances voltage regulation, battery management, renewable energy utilization, and overall system efficiency. These findings validate the study hypothesis that AI-driven techniques provide superior adaptability and robustness under dynamic operating conditions characterized by fluctuating photovoltaic (PV) generation and varying load demand. The baseline scenario exhibited the poorest performance, achieving an operational cost reduction of only 45%, voltage regulation performance of 40%, battery state-of-charge (SOC) management of 50%, renewable energy utilization of 27.3%, grid dependency reduction of 30%, overall efficiency of 65%, and an overall performance score of 65.2%. Although the Rule-Based EMS improved system operation, increasing the overall performance score to 71.5%, its reliance on predefined heuristic rules limited its ability to adapt to rapidly changing operating conditions. Similarly, the PID controller enhanced voltage regulation and battery management, increasing the overall performance score to 78.4%; however, its reactive nature restricted performance during transient disturbances. More advanced controllers demonstrated significantly better dynamic performance. The MPC controller achieved an operational cost reduction of 80%, voltage regulation performance of 86%, battery SOC management of 85%, renewable energy utilization of 65%, grid dependency reduction of 72%, overall efficiency of 86%, and an overall performance score of 85.7%. These improvements resulted from its predictive optimization capability, which anticipates future system behavior and determines optimal control actions while satisfying operational constraints. The Fuzzy Logic Controller (FLC) further improved overall performance, achieving 82% operational cost reduction, 89% voltage regulation, 88% battery SOC management, 70% renewable energy utilization, 75% grid dependency reduction, 89% system efficiency, and an overall performance score of 89.3%. These results demonstrate the effectiveness of fuzzy reasoning in handling nonlinearities and uncertainties commonly encountered in renewable-based microgrids. The ANN-based approach introduced predictive intelligence into the energy management framework by accurately forecasting PV generation. The forecasting model achieved an accuracy of 96.2%, corresponding to a Mean Absolute Percentage Error (MAPE) of 3.8%, Mean Absolute Error (MAE) of 1.84 kW, Root Mean Square Error (RMSE) of 2.37 kW, and a coefficient of determination (R2) of 0.982, indicating excellent agreement between measured and predicted solar power profiles. The improved forecasting capability enabled proactive battery scheduling, increasing renewable energy utilization to 85%, reducing grid dependency by 82%, improving operational efficiency to 92%, and producing an overall performance score of 92.1%. Among all evaluated strategies, the Reinforcement Learning (RL)-based EMS consistently delivered the best performance across every evaluation metric. The RL controller achieved 95% operational cost reduction, 95% voltage regulation performance, 95% battery SOC management, 92% renewable energy utilization, 92% grid dependency reduction, 95% overall system efficiency, 98% forecasting-assisted decision performance, and the highest overall performance score of 95.4%. Compared with the baseline scenario, renewable energy utilization increased from 27.3% to 92%, while grid dependency decreased from 69.1% to 28%, demonstrating the effectiveness of adaptive learning in optimizing long-term battery scheduling and energy dispatch decisions. The voltage regulation analysis further confirms the superiority of intelligent control techniques. Under identical operating conditions with a 400 V reference DC bus voltage and a common dynamic load disturbance profile, the baseline controller exhibited an RMSE of 20.0 V, settling time of 15.0 s, and overshoot of 10.0%. These values progressively improved across the evaluated controllers. The Rule-Based EMS reduced the RMSE to 15.0 V, settling time to 10.0 s, and overshoot to 6.0%, while the PID controller further decreased these values to 6.91 V, 6.2 s, and 3.4%, respectively. MPC significantly enhanced transient performance, achieving an RMSE of 3.42 V, settling time of 3.1 s, and overshoot of 1.2%. FLC provided smoother nonlinear control with an RMSE of 2.10 V, settling time of 2.4 s, and overshoot of 0.8%, whereas ANN-assisted control slightly improved these metrics to 2.00 V, 2.2 s, and 0.7%. The RL controller achieved the best dynamic response, reducing the voltage RMSE to 1.50 V, settling time to 1.8 s, and overshoot to 0.5%, thereby demonstrating outstanding tracking accuracy, rapid transient response, and excellent disturbance rejection Hence, the results confirm that AI-based energy management strategies significantly outperform conventional control approaches in renewable-powered smart microgrids. The combined improvements in forecasting accuracy, voltage regulation, battery SOC management, renewable energy utilization, grid dependency reduction, operational cost, and overall efficiency demonstrate the potential of intelligent control architectures to support highly reliable, adaptive, and sustainable next-generation microgrid systems operating under dynamic conditions.

Limitations of the Study

Despite demonstrating the effectiveness of conventional and artificial intelligence (AI)-based energy management and control strategies for renewable-powered smart microgrids, this study has several limitations that should be acknowledged. First, the analysis was conducted entirely in the MATLAB/Simulink R2024B environment using simplified system models and synthetic solar irradiance and load profiles. Although these simulations provide valuable insights into controller performance, they may not fully capture the complexity, uncertainties, and disturbances encountered in practical microgrid applications. Second, the study focused on the comparative evaluation of individual control strategies, including Rule-Based EMS, PID, MPC, Fuzzy Logic Control (FLC), Artificial Neural Networks (ANN), and Reinforcement Learning (RL), rather than implementing a fully integrated hybrid control architecture. Consequently, the potential benefits of combining these techniques within a single closed-loop energy management system were not investigated. In addition, the ANN forecasting model was trained using a relatively small dataset, which may limit its generalization capability under diverse climatic conditions and seasonal variations. Furthermore, battery degradation, communication delays, cyber-security issues, converter losses, and equipment failures were not explicitly modeled, although these factors can significantly influence microgrid operation. Finally, the proposed methods were validated only through simulation, without hardware-in-the-loop or experimental verification. Addressing these limitations through large-scale datasets, real-world implementation, and experimental validation would further strengthen the practical applicability and robustness of the proposed energy management strategies.

5. Conclusions and Future Work

5.1. Conclusions

This study developed and validated an artificial intelligence (AI)-based energy management and control framework for a renewable-powered smart microgrid comprising photovoltaic generation, battery energy storage, and utility grid interaction. Seven operational scenarios were systematically evaluated using MATLAB/Simulink R2024B environment, including the Baseline, Rule-Based EMS, Proportional–Integral–Derivative (PID), Model Predictive Control (MPC), Fuzzy Logic Control (FLC), Artificial Neural Network (ANN), and Reinforcement Learning (RL) approaches. The comparative results demonstrate a progressive improvement in microgrid performance with increasing controller intelligence. The RL-based controller achieved the best overall performance, recording operational cost reduction, voltage regulation, battery state-of-charge management, overall system efficiency, and overall performance scores of 95.0%, 95.0%, 95.0%, 95.0%, and 95.4%, respectively. Renewable energy utilization increased substantially from 27.3% in the baseline case to 92.0%, while grid dependency was reduced from 69.1% to 28.0%. The ANN forecasting model achieved a forecasting accuracy of 96.2%, corresponding to a MAPE of 3.8%, MAE of 1.84 kW, RMSE of 2.37 kW, and ( R 2 ) of 0.982, demonstrating excellent agreement between predicted and measured PV power. Dynamic voltage regulation also improved significantly, with the RL controller reducing the voltage RMSE from 20.0 V in the baseline case to 1.50 V, while decreasing the settling time from 15.0 s to 1.8 s and overshoot from 10.0% to 0.5%. Similarly, MPC and FLC achieved RMSE values of 3.42 V and 2.10 V, respectively, confirming the effectiveness of predictive and intelligent control strategies. Overall, the findings demonstrate that AI-driven energy management substantially enhances microgrid stability, renewable energy utilization, battery management, and operational efficiency, providing a practical and scalable solution for future renewable-powered smart microgrids. Future work will focus on real-time hardware validation, digital twin implementation, IoT-enabled monitoring, and multi-objective optimization to further improve system intelligence, resilience, and autonomous operation.

5.2. Future Work

Although the proposed AI-based Energy Management System (EMS) demonstrated significant improvements in voltage regulation, renewable energy utilization, battery management, and grid dependency reduction, several opportunities remain for further advancement. Future research should focus on developing more tightly integrated AI frameworks that combine forecasting, control, and optimization within a unified decision-making architecture. In particular, deeper coordination between Artificial Neural Networks (ANN), Fuzzy Logic Control (FLC), and Reinforcement Learning (RL) can enable more accurate predictions, faster adaptation, and improved long-term operational performance under highly dynamic conditions. Another promising direction is the integration of digital twin technology to create real-time virtual representations of microgrid assets and operating conditions. Such platforms would support predictive maintenance, fault diagnosis, and real-time validation of control strategies before field deployment. Furthermore, the incorporation of Internet of Things (IoT)-enabled sensing and communication infrastructures can enhance data acquisition, situational awareness, and distributed control capabilities. Future studies should also address cybersecurity, communication latency, and interoperability challenges associated with connected energy systems. To validate practical feasibility, the proposed framework should be implemented in hardware-in-the-loop (HIL) environments and pilot-scale microgrids. Additionally, future optimization models should incorporate battery degradation, carbon emissions, dynamic electricity pricing, and reliability indices as part of a comprehensive multi-objective framework. These advancements will contribute to the development of autonomous, resilient, and sustainable smart microgrids capable of supporting future low-carbon energy networks.

Author Contributions

Conceptualization, P.A.G. and K.L.; methodology, P.A.G.; software, P.A.G.; validation, P.A.G. and K.L.; formal analysis, P.A.G.; investigation, P.A.G.; resources, P.A.G.; data curation, P.A.G.; writing—original draft preparation, P.A.G.; writing—review and editing, K.L.; visualization, P.A.G.; supervision, K.L.; project administration, K.L.; funding acquisition, P.A.G. All authors have read and agreed to the published version of the manuscript.

Funding

This study was partly funded by a grant from the South African National Research Foundation (Grant No. PSTD250330307359).

Data Availability Statement

The data supporting the findings of this study are fully included within the article. Any additional information or requests for further clarification regarding the data may be obtained by contacting the corresponding authors.

Acknowledgments

The authors acknowledge that the views and conclusions presented in this study are entirely their own and do not necessarily represent the official stance of the National Research Foundation (NRF) of South Africa. We sincerely appreciate the efforts of the anonymous reviewers, whose thorough evaluations and thoughtful suggestions significantly enhanced the technical depth and overall clarity of the manuscript. Their valuable input played a crucial role in refining the quality and impact of this research.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
FLCFuzzy Logic Control
PVPhotovoltaic
DERsDistributed Energy Resources
SOCState-of-Charge
EMSEnergy Management System
S O C m a x Maximum State-of-Charge limit
S O C m i n Minimum State-of-Charge limit
PQActive and Reactive Power
kWKilowatt
kWhKilowatt-hour
DCDirect Current
ACAlternating Current
RESRenewable Energy Sources
AIArtificial Intelligence
ANNArtificial Neural Network
WCAWater Cycle Algorithm
TLBOTeaching–Learning-Based Optimization
HEMSHome Energy Management System
IoTInternet of Things
BESSBattery Energy Storage System
MATLABMatrix Laboratory (MATLAB simulation environment)
MPPMaximum Power Point
P-VPower–Voltage
I-VCurrent–Voltage
MPCModel Predictive Control
HILHardware-in-the-Loop
PIDProportional–Integral–Derivative
RLReinforcement Learning
DGDistributed Generation
VSIVoltage Source Inverter

References

  1. Ahmad, S.; Shafiullah, M.; Ahmed, C.B.; Alowaifeer, M. A review of microgrid energy management and control strategies. IEEE Access 2023, 11, 21729–21757. [Google Scholar] [CrossRef] [Scilit]
  2. Gbadega, P.A.; Sun, Y.; Balogun, O.A. Optimized energy management in Grid-Connected microgrids leveraging K-means clustering algorithm and Artificial Neural network models. Energy Convers. Manag. 2025, 336, 119868. [Google Scholar] [CrossRef] [Scilit]
  3. Marinova, G.; Hajrizi, E.; Qehaja, B.; Guliashki, V. Intelligent Control Framework for Optimal Energy Management of University Campus Microgrid. Smart Cities 2026, 9, 18. [Google Scholar] [CrossRef] [Scilit]
  4. Li, B.; Qi, B.; Ali, R.; Siddique, A.; Aslam, W.; Pan, H. Optimized Dual ANN Control Technique for Efficient Energy Management System (EMS) of Microgrid. Energy Sci. Eng. 2026, 14, 2070–2092. [Google Scholar] [CrossRef] [Scilit]
  5. Khan, M.R.; Haider, Z.M.; Malik, F.H.; Almasoudi, F.M.; Alatawi, K.S.S.; Bhutta, M.S. A comprehensive review of microgrid energy management strategies considering electric vehicles, energy storage systems, and AI techniques. Processes 2024, 12, 270. [Google Scholar] [CrossRef] [Scilit]
  6. Prag, K.; Woolway, M.; Celik, T. Toward data-driven optimal control: A systematic review of the landscape. IEEE Access 2022, 10, 32190–32212. [Google Scholar] [CrossRef] [Scilit]
  7. Alsanad, H.R.; Al Mashhadany, Y.; Algburi, S.; Abbas, A.K.; Al Smadi, T. Robust power management for smart microgrid based on an intelligent controller. J. Robot. Control. (JRC) 2025, 6, 166–176. [Google Scholar] [CrossRef] [Scilit]
  8. Mu, R.; Zhang, Y.; Wu, Y.; Wan, X.; Song, X.; Wang, D.; Sun, L.; Yang, B. A Critical Review of State-of-the-Art Stability Control of PV Systems: Methodologies, Challenges, and Perspectives. Energies 2026, 19, 507. [Google Scholar] [CrossRef] [Scilit]
  9. Zohaib, A.; Akram, F.; Khalid, S.; Nawaz, H.; Rehman, M.U. Hybrid deep learning based load forecasting and AI-driven energy management for grid-connected multi-microgrids. Comput. Electr. Eng. 2026, 131, 110915. [Google Scholar] [CrossRef] [Scilit]
  10. Chen, Z.; Xiao, F.; Chen, Y. Multi-objective online optimization of building energy systems for improved control smoothness and efficiency. Autom. Constr. 2026, 181, 106604. [Google Scholar] [CrossRef] [Scilit]
  11. Gbadega, P.A.; Sun, Y.; Balogun, O.A. Game-theoretic transactive control frameworks for scalable and privacy-preserving energy storage management in renewable-based energy communities. J. Energy Storage 2025, 138, 118611. [Google Scholar] [CrossRef] [Scilit]
  12. Arévalo, P.; Benavides, D.; Ochoa-Correa, D.; Ríos, A.; Torres, D.; Villanueva-Machado, C.W. Smart microgrid management and optimization: A systematic review towards the proposal of smart management models. Algorithms 2025, 18, 429. [Google Scholar] [CrossRef] [Scilit]
  13. Gbadega, P.A.; Sun, Y.; Balogun, O.A. Real-Time Simulation Testbed for Energy Management and Control of Renewable Energy-Based Microgrids. In Proceedings of the 2024 5th International Symposium on New Energy and Electrical Technology (ISNEET), Hangzhou, China, 27–29 December 2024; pp. 395–404. [Google Scholar]
  14. Manikandan, M.; Saravanan, R.; Kannayeram, G.; Saravanan, M. Integrating renewable resources and electric Vehicles: An approach for effective energy management in DC microgrid. Sol. Energy 2025, 299, 113775. [Google Scholar] [CrossRef] [Scilit]
  15. Akbulut, O.; Cavus, M.; Cengiz, M.; Allahham, A.; Giaouris, D.; Forshaw, M. Hybrid intelligent control system for adaptive microgrid optimization: Integration of rule-based control and deep learning techniques. Energies 2024, 17, 2260. [Google Scholar] [CrossRef] [Scilit]
  16. Choudhury, S. Review of energy storage system technologies integration to microgrid: Types, control strategies, issues, and future prospects. J. Energy Storage 2022, 48, 103966. [Google Scholar] [CrossRef] [Scilit]
  17. Alilou, M.; Younesi, A.; Siano, P. A sustainable approach to hybrid microgrid design: Optimal sizing and energy management. Renew. Energy 2026, 256, 124078. [Google Scholar] [CrossRef] [Scilit]
  18. Yang, L.; Wu, L.; Li, G. Enhanced energy management in smart microgrids using hybrid optimization and demand response strategies. Int. J. Electr. Power Energy Syst. 2025, 164, 110421. [Google Scholar] [CrossRef] [Scilit]
  19. Hadi, M.; Elbouchikhi, E.; Zhou, Z.; Saim, A.; Shafie-Khah, M.; Siano, P.; Rahbarimagham, H.; Colom, P.M. Artificial intelligence for microgrids design, control, and maintenance: A comprehensive review and prospects. Energy Convers. Manag. X 2025, 27, 101056. [Google Scholar] [CrossRef] [Scilit]
  20. Balogun, O.A.; Sun, Y.; Gbadega, P.A. Optimal PV active power curtailment in a PV-penetrated distribution network using optimal smart inverter Volt-Watt control settings. Energy Rep. 2024, 12, 5396–5419. [Google Scholar] [CrossRef] [Scilit]
  21. Juma, S.A.; Ayeng’o, S.P.; Kimambo, C.Z. A review of control strategies for optimized microgrid operations. IET Renew. Power Gener. 2024, 18, 2785–2818. [Google Scholar] [CrossRef] [Scilit]
  22. Senapati, M.K.; Al Zaabi, O.; Al Hosani, K.; Al Jaafari, K.; Pradhan, C.; Muduli, U.R. Advancing electric vehicle charging ecosystems with intelligent control of DC microgrid stability. IEEE Trans. Ind. Appl. 2024, 60, 7264–7278. [Google Scholar] [CrossRef] [Scilit]
  23. Bharaneedharan, B.; Panchanathan, S.; Kit, C.C.; Venkatesan, E.P.; Hasan, N. Machine Learning and Artificial Intelligence Techniques for Intelligent Control and Forecasting in Energy Storage-Based Power Systems. Energy Sci. Eng. 2026, 14, 1683–2344. [Google Scholar]
  24. Gbadega, P.A.; Balogun, O.A. Transactive energy management for efficient scheduling and storage utilization in a grid-connected renewable energy-based microgrid. e-Prime-Adv. Electr. Eng. Electron. Energy 2025, 11, 100914. [Google Scholar] [CrossRef] [Scilit]
  25. Bilal, M.; Algethami, A.A.; Hameed, S. Review of computational intelligence approaches for microgrid energy management. IEEE Access 2024, 12, 123294–123321. [Google Scholar] [CrossRef] [Scilit]
  26. Gbadega, P.A.; Balogun, O.A. Optimizing Energy Management in a Renewable Energy-based Microgrid With Built-in Frequency Support Features. In Proceedings of the 2024 International Conference on Advanced Mechatronic Systems (ICAMechS), Kusatsu, Japan, 26–30 November 2024; pp. 19–24. [Google Scholar]
  27. Silva, N.S.e.; Castro, R.; Ferrão, P. Smart grids in the context of smart cities: A literature review and gap analysis. Energies 2025, 18, 1186. [Google Scholar] [CrossRef] [Scilit]
  28. Rajendran, G.; Raute, R.; Caruana, C. The brain behind the grid: A comprehensive review on advanced control strategies for smart energy management systems. Energies 2025, 18, 3963. [Google Scholar] [CrossRef] [Scilit]
  29. Amole, A.O.; Oladipo, S.; Olabode, O.E.; Makinde, K.A.; Gbadega, P. Analysis of grid/solar photovoltaic power generation for improved village energy supply: A case of Ikose in Oyo State Nigeria. Renew. Energy Focus 2023, 44, 186–211. [Google Scholar] [CrossRef] [Scilit]
  30. Padmawansa, N.; Gunawardane, K.; Madanian, S.; Than Oo, A.M. Battery energy storage capacity estimation for microgrids using digital twin concept. Energies 2023, 16, 4540. [Google Scholar] [CrossRef] [Scilit]
  31. Gbadega, P.A.; Sun, Y.; Balogun, O.A. Enhanced Multi-Objective Particle Swarm Optimization for Optimal Energy Management of Grid-Connected Hybrid Renewable Microgrids. e-Prime–Nexus Electr. Electron. Intell. Eng. 2026, 17, 201168. [Google Scholar] [CrossRef] [Scilit]
  32. Lu, W.-M.; Le, T.-T. From Technology to Strategy: The Evolving Role of Smart Grids and Microgrids in Sustainable Energy Management. Energies 2025, 18, 4609. [Google Scholar] [CrossRef] [Scilit]
  33. Huang, B.; Yu, W.; Ma, M.; Wei, X.; Wang, G. Artificial-intelligence-based energy management strategies for hybrid electric vehicles: A comprehensive review. Energies 2025, 18, 3600. [Google Scholar] [CrossRef] [Scilit]
  34. Wu, H.; Wang, B.; Niu, M. Research on traffic energy scheduling based on photovoltaic forecasting using stacked ensemble learning. Int. J. Electr. Power Energy Syst. 2026, 175, 111538. [Google Scholar] [CrossRef] [Scilit]
  35. Dhanapal, K.; Ragupathy, P.; Chinnadurai, N. Energy Efficient Machine Learning Optimization Framework for Hybrid Renewable Generation in BIPV Systems Using DRL–ANN Synergy. Sustain. Comput. Inform. Syst. 2026, 50, 101320. [Google Scholar] [CrossRef] [Scilit]
  36. Zhang, P.; Li, C.; Qian, C.; Huang, H.; Wang, Y.; Tang, R. A wind power forecasting method based on GWS-STNet spatio-temporal meteorological prediction. Energy 2026, 350, 140714. [Google Scholar] [CrossRef] [Scilit]
  37. Du, J.; Li, B.; Li, J.; Wang, Z.; Li, Y.; Gao, Z.; Chen, L.; Wang, J. Dynamic performance of liquid air energy storage system during discharge and grid connection with PSO-optimized PID control. Energy 2026, 360, 141640. [Google Scholar] [CrossRef] [Scilit]
  38. Xia, Y.; Feng, N.; Yang, L.; Wang, J.; Shu, J. Performance evaluation of an energy-efficient nonlinear model predictive controller for direct expansion systems. In Proceedings of the Building Simulation; Springer: Cham, Switzerland, 2026; pp. 983–1006. [Google Scholar]
  39. Janapati, B.; Pulivarthi, N.R. A power quality enhancement using gradient descent-fuzzy logic controller in grid-connected PV system. Electr. Power Syst. Res. 2026, 255, 112746. [Google Scholar] [CrossRef] [Scilit]
  40. Xiang, Q.; Xu, L.; Yuan, C. A reinforcement learning-based Synergistic Hybrid Evolutionary Algorithm for multi-angle shipboard photovoltaic system MPPT under dynamic navigational shading. Renew. Energy 2026, 260, 125193. [Google Scholar] [CrossRef] [Scilit]
  41. Durlik, F.; Grela, J.; Latoń, D. A Comprehensive Literature Review of Optimization Algorithms for Intelligent Load Scheduling in Home Energy Management Systems. Energies 2026, 19, 2517. [Google Scholar] [CrossRef] [Scilit]
  42. Azeroual, M.; Moughraoui, F.Z.; EL Iysaouy, L.; EL Markhi, H. Intelligent energy management for wind-integrated microgrids using multi-agent systems. Wind. Eng. 2026, 1–21. [Google Scholar] [CrossRef] [Scilit]
  43. Hassan, M. Artificial intelligence powered intelligent energy management framework for hydrogen storage and dispatch in smart microgrids. Sci. Rep. 2025, 15, 40394. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  44. Karthikeyan, M.; Manimegalai, D. Enhancing voltage control and regulation in smart micro-grids through deep learning-optimized EV reactive power management. Energy Rep. 2025, 13, 1095–1107. [Google Scholar] [CrossRef] [Scilit]
  45. Gbadega, P.A.; Sun, Y.; Akindeji, K.T. Integrating Demand Response Technique with Effective Control Algorithm for Energy Management System in a Renewable Energy Based-Micro-grid. In Proceedings of the 2024 32nd Southern African Universities Power Engineering Conference (SAUPEC), Stellenbosch, South Africa, 24–25 January 2024; pp. 1–6. [Google Scholar]
  46. Gbadega, P.A.; Sun, Y.X. JAYA algorithm-based energy management for a grid-connected micro-grid with PV-wind-microturbine-storage energy system. Int. J. Eng. Res. Afr. 2023, 63, 159–184. [Google Scholar] [CrossRef] [Scilit]
  47. Kumar, A.; Maulik, A.; Chinmaya, K. Energy management strategies for active distribution networks and Microgrids–A comprehensive survey. IETE Tech. Rev. 2025, 42, 502–541. [Google Scholar] [CrossRef] [Scilit]
  48. Hajialigol, P.; Nweye, K.; Aghaei, M.; Najafi, B.; Moazami, A.; Nagy, Z. Enhancing self-consumption ratio in a smart microgrid by applying a reinforcement learning-based energy management system. Energy 2025, 335, 137892. [Google Scholar] [CrossRef] [Scilit]
  49. Balogun, O.A.; Sun, Y.; Gbadega, P.A. Coordination of smart inverter-enabled distributed energy resources for optimal PV-BESS integration and voltage stability in modern power distribution networks: A systematic review and bibliometric analysis. e-Prime-Adv. Electr. Eng. Electron. Energy 2024, 10, 100800. [Google Scholar] [CrossRef] [Scilit]
  50. Balakumar, I.; Vaithilingam, C. Dynamic pricing scheme for energy balancing in microgrid using an intelligent system. Sci. Rep. 2026, 16, 3567. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.