Next Article in Journal
Advances in Medical Image Processing for Early Breast Cancer Detection: Classical Techniques and Deep Learning Perspectives
Previous Article in Journal
Research on Black-Start Control Methodologies for DC Collection Wind Farms
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimizing Power Control in Generation Units: LSTM-Based Machine Learning for Enhanced Stability in Virtual Synchronous Generators

by
Ahmed Khamees
1,* and
Hüseyin Altınkaya
2,*
1
The Institute of Graduate Programs, Department of Electrical and Electronics Engineering, Karabuk University, Karabuk 78050, Türkiye
2
Department of Electrical and Electronics Engineering, Karabuk University, Karabuk 78050, Türkiye
*
Authors to whom correspondence should be addressed.
Electronics 2026, 15(4), 791; https://doi.org/10.3390/electronics15040791
Submission received: 17 January 2026 / Revised: 3 February 2026 / Accepted: 9 February 2026 / Published: 12 February 2026

Abstract

The integration of inverter-based generation units, such as photovoltaic systems, wind turbines, and vehicle-to-grid (V2G) technologies, has introduced new challenges in maintaining power and frequency stability in modern power systems. Virtual Synchronous Generators (VSGs) have emerged as a promising solution to enhance system stability; however, existing control methods often lack the robustness and flexibility needed to address deliberate and unplanned outages effectively. This paper presents a novel approach for optimizing power control in generation units using a Long Short-Term Memory (LSTM)-based machine learning method. The proposed LSTM-based controller provides a fast and real-time response, ensuring robust and flexible performance under varying operational conditions. Unlike traditional controllers, the proposed method effectively handles nonlinearities and uncertainties associated with inverter-based units. Additionally, it effectively balances technical and economic aspects of power system operation by minimizing oscillations and optimizing resource utilization. The proposed approach is benchmarked against conventional control methods through a detailed simulation-based comparative analysis against a linear Model Predictive Control strategy under identical operating conditions. Simulation results indicate that the proposed controller reduces frequency deviations by up to 66.7%, voltage deviations by 62.5%, and total operational cost by approximately 11.3%, while achieving nearly 90% faster dynamic response, validating its effectiveness for modern power systems.

1. Introduction

The global energy sector is witnessing a paradigm shift towards renewable energy integration, driven by environmental concerns and policy initiatives to reduce carbon emissions [1,2]. The increasing penetration of inverter-based generation units, such as photovoltaic (PV) systems, wind turbines, and vehicle-to-grid (V2G) technologies, introduces significant challenges in maintaining power system stability [3,4]. Unlike traditional synchronous generators, inverter-based units lack inherent inertia, leading to decreased system damping and increased vulnerability to frequency and voltage fluctuation [5,6]. Maintaining stability in modern power systems with high renewable energy penetration is critical for reliable operation [7,8]. The absence of physical inertia in inverter-based resources necessitates innovative control strategies to emulate the inertial response of a conventional generator [9,10,11].
Virtual Synchronous Generators (VSGs) have emerged as a promising solution, enabling inverter-based units to mimic the dynamic characteristics of synchronous machines [12]. By providing virtual inertia and damping, VSGs enhance system resilience against disturbance [13,14,15]. Despite the advancements in VSG technology, existing control methods often exhibit limitations in robustness and adaptability under varying operational conditions [16,17]. Traditional controllers may not effectively handle the nonlinear dynamics and uncertainties associated with inverter-based generation units [18]. Consequently, there is a pressing need for advanced control strategies that can provide fast, real-time responses while ensuring system stability and efficiency [19]. Machine learning techniques, particularly Long Short-Term Memory (LSTM) neural networks, offer a novel approach to address these challenges. LSTM networks are capable of modeling complex nonlinear relationships and capturing temporal dependencies in time-series data [20]. Applying LSTM-based control to VSGs can potentially enhance system stability by providing adaptive and robust control mechanisms [15,21].

1.1. Literature Review

Early VSG implementations utilized conventional droop control methods to regulate frequency and voltage [22,23]. These methods are simple but may not adequately address the dynamic behavior of inverter-based systems [24,25] that introduced the synchronverter concept, enabling inverters to emulate synchronous generator characteristics. While effective under certain conditions, synchronverters may struggle with rapid system changes and lack adaptability. Sindi et al. [26] proposed an enhanced droop control strategy to improve power-sharing accuracy among parallel inverters. However, this approach still faces challenges in handling system nonlinearities and ensuring stability during transient events.
To overcome the limitations of traditional methods, advanced control strategies such as Model Predictive Control (MPC), adaptive control, and robust control have been explored. Wang et al. [27] applied MPC to VSGs, demonstrating improved dynamic performance and handling of system constraints. Nevertheless, MPC’s computational complexity can hinder its real-time application in large-scale systems.
Adaptive control methods have been developed to adjust controller parameters in response to system changes. Yap et al. [28] introduced an adaptive virtual inertia control for microgrids, enhancing frequency stability under variable conditions. Despite their adaptability, these methods may not fully capture the complex nonlinear dynamics of inverter-based units. Robust control approaches, such as H-infinity control, have also been investigated. Zhang et al. [29] developed an SMC-based voltage–power self-coordinated control framework to enable SDGIs to adaptively change their operation modes in the presence of varying and uncertain load sizes within AC distribution networks. Simulation and experiments demonstrate that the proposed method can achieve greater robustness, quicker dynamic response, better MPPT precision, and reduced voltage harmonic distortion when compared with classical PI-based or robust control.
Singh et al. and Liang et al. [30,31] designed a robust droop control for VSGs using an H-infinity loop-shaping method, improving system robustness against uncertainties. However, the design complexity and requirement for accurate system models limit their practicality.
Machine learning has gained traction in power system applications due to its ability to model nonlinear relationships without explicit system models [32]. Deep learning techniques, particularly LSTM networks, have been employed for load forecasting [33], renewable energy prediction [34], and fault detection [35].
In the context of VSG control, few studies have directly applied machine learning techniques. Norouzi et al. [36] proposed an adaptive virtual inertia control scheme using deep learning, improving microgrid frequency stabilization.
In addition, some distributed models of optimal economic dispatch in microgrids have been addressed in the literature. Xu et al. [37] proposed a distributed optimization framework that simultaneously considers economic dispatch and frequency regulation to mitigate the opportunity costs caused by renewable generation, and ensure system stability with local feedback control. Zhou [38] presented a distributed ADMM-based solution for economic dispatch integrating demand response, under which smart grids can be operated efficiently without compromising data privacy and by eliminating the need for a third-party coordinator. In a related work, Wang et al. [39] proposed a distributed finite-time control approach which can reach the optimal economic dispatch in a given time span and more efficiently for microgrids involving a large amount of renewables. Additionally, Tu et al. [40] highlighted the necessity of dynamic solutions for economic dispatch that can deal with rapidly varying operating conditions, and used a consensus-based approach to maintain optimal performance in frequency regulation tasks.
While Transformer models excel in capturing long-term dependencies for tasks such as PEMFC degradation prediction [41], LSTM remains more suitable for high-frequency dynamic response and real-time control scenarios due to lower computational complexity and effective short-to-medium term temporal modeling.
LSTM-based models have provided substantially lower forecast errors when compared to traditional methods, and it maintains the same degree of accuracy even under noisy input scenarios [42]. Due to their capacity in dealing with long-time sequences, LSTM networks can capture complex time-dependent patterns well, and it is a key for successful load prediction in power systems [43]. Previous studies also verify that LSTM-based architectures can lead to accurate electricity demand predictions, helping utility companies in planning their operations, as shown in Reference [44], and LSTM-based models are more stable and accurate than GRU and one-layer RNN (Recurrent Neural Network) architecture in large-scale real-world applications for the long-term temporal dependency problem until now [45]. Moreover, their capability in handling partial or noisy inputs also separates LSTM networks from GRU and vanilla RNN counterparts.
Oboreh-Snapps et al. [46] utilized deep reinforcement learning for real-time control of VSGs, demonstrating enhanced performance over traditional controllers. Despite these advancements, the application of LSTM networks for direct, real-time control of VSGs remains underexplored. LSTM’s capability to handle time-dependent data and nonlinearities makes it a promising candidate for VSG control. Advantages of existing methods can be listed as follows.
  • Traditional Control: Simplicity and ease of implementation [22,24].
  • Advanced Control: Improved dynamic performance and adaptability [26,27,28].
  • Machine Learning: Ability to model complex nonlinear dynamics and learn from data [32,36,46].
Disadvantages of existing methods are as follows.
  • Traditional Control: Limited in handling nonlinearities and adaptability to rapid changes [26].
  • Advanced Control: Computational complexity and reliance on accurate system models [27,28,30].
  • Machine Learning: Limited application in direct control of VSGs and potential overfitting issues [36,46].

1.2. Shortcomings of Previous Researchs

Despite progress in VSG control strategies, several gaps persist:
  • Inadequate Handling of Nonlinearities: Traditional and some advanced control methods may not effectively manage the nonlinear dynamics of inverter-based systems [18,26,47,48].
  • Computational Challenges: Methods like MPC and robust control are computationally intensive, limiting their real-time applicability [27,28,30,49,50].
  • Underutilization of LSTM in Control: Existing machine learning applications focus more on forecasting rather than direct control, and the potential of LSTM networks for real-time VSG control is not fully exploited [33,34]. The paper presents a pre-synchronization control strategy for the VSGs in microgrids, eliminating PLL dependency and ensuring smooth transitions between grid-connected and off-grid modes. It also introduces a variable integration coefficient strategy for enhanced frequency recovery, improving system stability, and reducing power fluctuations [51]. This paper analyzes the impact of active power loops (APLs) on transient voltage stability in a paralleled SG-VSG system with IM loads, using Critical Clearance Time (CCT) for evaluation. A new control method is proposed and validated through simulations and hardware-in-the-loop experiments, effectively mitigating APL interactions and improving system stability [52].
  • Lack of Comprehensive Evaluation: Previous studies often emphasize technical performance without thoroughly addressing economic implications [28,30,36]. Table 1 provides a comparison of control methods.

1.3. The Research Contributions

This paper presents a novel LSTM-based machine learning method for optimizing power control in generation units with VSGs. The key contributions are:
  • Development of an LSTM-Based Real-Time Controller: An LSTM neural network is designed to directly control the power output of VSGs, providing fast and accurate responses to system disturbances and varying operational conditions.
  • Enhanced Handling of Nonlinearities and Uncertainties: The proposed method effectively manages the complex nonlinear dynamics and uncertainties associated with inverter-based units, improving system stability.
  • Balancing Technical and Economic Objectives: By minimizing power oscillations and optimizing resource utilization, the controller ensures both technical performance and economic efficiency.
  • Comprehensive Benchmarking: Extensive simulations and comparisons with traditional control methods demonstrate the superior performance of the LSTM-based controller.
  • Addressing Economic Implications: The study examines the economic benefits, highlighting the potential for cost-effective integration into modern power systems.
The remainder of this paper is organized as follows:
Section 2 provides theoretical background on VSGs and LSTM neural networks. Section 3 details the proposed LSTM-based control method, including system modeling and controller design. Section 4 presents simulation results and performance analysis, including comparisons with existing strategies. Section 5 concludes the paper and outlines future research directions.

2. Theoretical Concept of the Problem

As discussed in the previous section, the present paper addresses critical stability challenges in modern power systems caused by the increasing integration of inverter-based renewable energy sources like photovoltaic systems, wind turbines, and vehicle-to-grid technologies. These systems lack the physical inertia of traditional synchronous generators, leading to significant frequency and voltage fluctuations. Virtual Synchronous Generators (VSGs) offer a solution by emulating the dynamic behavior of synchronous machines, providing virtual inertia and damping to enhance system resilience. However, traditional control methods, such as droop control and synchronverters, struggle with nonlinearities and rapid system changes, while advanced methods like MPC and adaptive control are hindered by computational complexity and reliance on precise models. To overcome these challenges, this research proposes a novel LSTM-based machine learning approach for VSG control. LSTM neural networks excel in handling nonlinear dynamics and capturing temporal dependencies, making them ideal for real-time adaptive control. The proposed LSTM-based controller minimizes power oscillations, optimizes resource utilization, and provides robust responses to disturbances while addressing economic efficiency, offering a scalable and cost-effective solution for renewable energy integration. The conceptual model of the proposed approach is shown in Figure 1.

3. Proposed LSTM-Based Control Method

3.1. Formulation of the Problem

The increasing reliance on renewable energy sources, such as photovoltaic systems, wind turbines, and vehicle-to-grid (V2G) technologies, introduces significant challenges to modern power systems. These challenges arise primarily from the lack of physical inertia in inverter-based generation units, resulting in increased frequency and voltage instabilities. Virtual Synchronous Generators (VSGs) have emerged as a promising solution by emulating the dynamic characteristics of traditional synchronous machines. However, existing control strategies often fail to address the nonlinearities and uncertainties inherent in such systems effectively. To overcome these challenges, this study presents a comprehensive mathematical problem formulation that incorporates advanced dynamic models of synchronous generators, VSGs, and the probabilistic behavior of V2G systems. Operational cost considerations are also integrated to ensure a practical balance between technical performance and economic feasibility. This framework serves as a robust foundation for implementing LSTM-based control strategies, optimizing power generation, and maintaining overall system stability. In the following, the mathematical problem formulation of the proposed structure will be dissected.

3.2. Objective Function

The objective is to minimize system instability, operational cost, and local/global frequency deviations:
J = 0 T ω 1 . P o s c ( t ) + ω 2 . C o p ( t ) + ω 3 . Δ f l o c a l ( t ) 2 + Δ f g l o b a l ( t ) 2 d t
where P o s c ( t ) represents power oscillations indicating system instability, C o p   is the operational cost to minimize energy expenses, Δ f l o c a l   and Δ f g l o b a l denote frequency deviation in local areas and across the system, respectively, and ω 1 , ω 2 , ω 3 are weighting factors for balancing objectives.
Also, Equation (1) is constrained by the following conditions. Equation (1) represents a multi-objective optimization function that simultaneously minimizes power oscillations, operational cost, and frequency deviations, where the weighting factors allow prioritization between technical stability and economic performance.
The multi-objective function (Equation (1)) itself is also implicitly learned and optimized by the LSTM network via supervised training on optimal historical/simulated data, instead of using explicit optimization algorithms such as PSO or QP.
According to Equation (2), the total generated power must meet the load demand and losses. This equation ensures real-time power system equilibrium.
P g e n t = P l o a d t + P l o s s t ,       P g e n t = i = 1 N P g e n , i t
Frequency deviations must remain within allowable limits locally and globally to ensure stability.
Δ f l o c a l t Δ f l o c a l , m a x ,     Δ f g l o b a l t Δ f g l o b a l , m a x
Voltage levels must remain within defined boundaries to avoid over-voltage or under-voltage conditions.
V m i n V t V m a x

3.3. Dynamic Model of Generation Unit

The synchronous generator dynamics incorporate turbine, governor, and exciter models:
d δ i d t = ω i ω r e f d ω i d t = 1 2 H P m , i P e D i ω i , d P m , i d t = 1 T g o v , i P g o v , i P m , i , d V f , i d t = 1 T e x c , i V r e f V f , i , P e = V i E q , i sin ( δ i ) X s , i
where in the above equation:
  • δ i : Rotor angle of generator i.
  • ω i : Rotor speed generator i.
  • P m , i : Mechanical power generator i.
  • P e , i : Electrical power generator i.
  • V f , i : Exciter voltage generator i.
  • H i , D i : Inertia constant and damping factor generator i.
  • T g o v , i , T e x c , i : Time constants of governor and exciter generator i.
Virtual Synchronous Generators (VSGs) emulate synchronous machine behavior using inverter dynamics:
d P v s g , i d t = 1 T v s g , i P r e f , i P v s g , i , d Q v s g , i d t = 1 T v s g , i Q r e f , i Q v s g , i , d V d , i d t = 1 L i R I d , i + ω L i I q , i + V d _ r e f , i V d , i , d V q , i d t = 1 L i R I q , i + ω L i I d , i + V q _ r e f , i V q , i , ω i = ω r e f , i + k i P v s g , i
where:
  • P v s g , i , Q v s g , i : Active and reactive power of the VSG, i.
  • V d , i , V q , i : dd-qq axis voltages.
  • I d , i , I q , i : dd-qq axis currents.
  • R i , L i : Resistance and inductance.
  • T v s g , i : Time constant of the VSG.

3.4. Probabilistic Behavior of V2G Systems

In this study, only the probabilistic behavior of the V2G system is modeled due to its highly uncertain and user-dependent nature, which directly affects grid frequency regulation. Other stochastic behaviors, such as generator outages or load shedding events, are not considered probabilistically, as they are either rare events or system-protected phenomena and are typically addressed through protection and contingency planning rather than real-time control. The probabilistic behavior of charging/discharging for V2G systems is modeled as:
P g e n , V 2 G t = ρ c h a r g e t P c h a r g e t ρ d i s c h a r g e t P d i s c h a r g e t
where:
  • ρ c h a r g e , ρ d i s c h a r g e t : Probability of being in charging or discharging mode.
  • P c h a r g e t , P d i s c h a r g e t : Charging and discharging power profiles.
The probabilities are governed by a Markov process as follows:
d ρ c h a r g e d t = λ c h a r g e ρ c h a r g e + λ d i s c h a r g e ρ d i s c h a r g e , d ρ d i s c h a r g e d t = λ d i s c h a r g e ρ d i s c h a r g e + λ c h a r g e ρ c h a r g e ,
where λ c h a r g e , λ d i s c h a r g e are transition rates between charging and discharging states.
This model captures the stochastic behavior of V2G systems, allowing the LSTM controller to adaptively manage V2G contributions based on system conditions.

3.5. LSTM Training and Control

The LSTM model optimizes power generation by learning the nonlinear relationship between system states and optimal generation levels. The training equations for input, output, and loss are provided in Equation (9), Equation (10), and Equation (11), respectively.
x t = Δ f l o c a l , Δ f g l o b a l , V , P l o a d
P g e n i , L S T M t = F L S T M x t , θ
Γ θ = 1 N t = t = 1 N P g e n , L S T M t P g e n , o p t t 2
The above problem formulation captures the complex dynamics of synchronous and virtual synchronous machines, probabilistic V2G behavior, and LSTM training, ensuring robust and adaptive power generation control.
The constructed LSTM network consists of four layers: two layers of hidden neurons with 128 and 64 neurons, respectively, and then ended by a fully connected layer. In the hidden layers, we use a ReLU activation function, and at the output stage, we use a linear activation function. Model training employs the Adam optimization algorithm with an initial learning rate of 0.001 and an exponential learning rate decay policy where the decay factor is set to 0.96 after every 10 training epochs. The network is trained for 150 epochs with a batch size of 64. The best hyperparameter values are found by grid search and cross-validation on a held-out validation dataset (20% of the training data) where mean-square error (MSE) is minimized.
Analysis of sensitivity reveals that the increment from 64 to 256 hidden neurons gives a drop in frequency deviation of 8–12% with an inference time cost about equal to the ±15% due only to the increase in computing load. Moreover, setting the learning rate to 0.0005 can help stabilize the convergence but also extend training time by 25%. Such trade-offs are finely tuned to achieve the best possible compromise between predictive accuracy and real-time computational efficacy. The architecture of the proposed LSTM network is illustrated in Figure 2.
Optimal training data for the LSTM were generated from offline simulations using the linear MPC as the teacher model under diverse operating conditions (including load variations, renewable intermittency, and disturbances such as those in the 24 h scenario). This produced labeled datasets of system states (such as Δ f l o c a l and Δ f g l o b a l , V, Pload) paired with optimal power setpoints (Pgen,opt), enabling supervised learning of the nonlinear mapping to near-optimal control actions.
The Algorithm 1 for the procedural process of the proposed method is dissected in the following.
Algorithm 1. LSTM-Based optimal power control framework VSG enabled microgrids
1. 
Initialize Parameters
-
Define system components: diesel generator, PV farm, wind farm, V2G system, and loads.
-
Set initial system parameters:
  • Maximum and minimum generation limits for each unit.
  • Load profiles: residential and industrial.
  • Frequency and voltage stability limits.
-
Define objective function:
  • Minimize system instability, operational cost, and frequency deviations.
-
Objective Function: Minimize J = 0 T ω 1 . P o s c ( t ) + ω 2 . C o p ( t ) + ω 3 . Δ f l o c a l ( t ) 2 + Δ f g l o b a l ( t ) 2 d t
2. 
Input Data Preparation
-
Define constraints:
  • Power Balance Constraint: Total generation = Total load + Losses.
  • Frequency Stability Constraint: Frequency deviations ≤ Threshold.
  • Voltage Stability Constraint: Voltage deviations ≤ Threshold.
  • Set LSTM parameters: learning rate, time steps, input/output dimensions, and training epochs.
-
Load the following profiles for a 24-hour simulation:
  • Solar irradiance profile (Figure 2) for PV generation.
  • Wind speed profile (Figure 3) for wind farm generation.
  • Load profiles (Figure 4): residential and industrial.
-
Initialize stochastic profiles for V2G system:
  • Define transition probabilities for charging and discharging states using Markov models.
  • Discretize time into intervals for each simulation step.
3. 
Mathematical Problem Formulation
-
Objective Function: Solve the optimization problem to minimize:
J = 0 T ω 1 . P o s c ( t ) + ω 2 . C o p ( t ) + ω 3 . Δ f l o c a l ( t ) 2 + Δ f g l o b a l ( t ) 2 d t
-
Constraints:
  • Power Balance Constraint:   P G = P R E S + P V 2 G = P L o a d +     P l o s s
  • Frequency Stability: | f _ a c t u a l f _ n o m i n a l | F r e q u e n c y   T h r e s h o l d
  • Voltage Stability: V m i n V t V m a x
4. 
LSTM Training Phase
-
Input: Historical system data (load profiles, generation outputs, frequency, voltage).
-
Output: Predicted optimal generation levels for each time step.
-
Train LSTM using:
-
Input Features: Time-series data of frequency, voltage, and generation levels.
-
Output Targets: Optimal generation and storage decisions to minimize J.
-
Loss Function: Minimize the deviation between predicted and optimal target
5. 
Real-Time Control Procedure
-
For each time interval t (t = 1 to 24):
  • Update System States:
    -
    Measure current frequency, voltage, load, and generation.
    -
    Update renewable energy generation based on solar irradiance and wind speed profiles.
    -
    Evaluate V2G system availability based on Markov probabilities.
  • Predict Control Actions:
    -
    Use trained LSTM to predict:
    -
    Diesel generator output.
    -
    PV and wind farm contributions.
    -
    V2G charging/discharging levels.
  • Implement Control Actions:
    -
    Adjust generation units to match LSTM predictions.
    -
    Dispatch V2G system for frequency and voltage regulation.
  • Evaluate System Performance:
    -
    Calculate:
    -
    Total generation cost.
    -
    Frequency and voltage deviations.
    -
    Stability indices.
    -
    Log results for later analysis.

4. Discussion of Results and Validation

4.1. Case Study and Input Data

To validate the proposed optimal power control for generation units within a power distribution network incorporating microgrids and a vehicle-to-grid (V2G) system, a comprehensive 24 h simulation scenario was designed. The simulation evaluates the system’s ability to regulate microgrid frequency during various events throughout the day, balancing operational efficiency with cost considerations. The main parameters of the simulated microgrid system are summarized in Table 2. These values are selected based on realistic configurations for hybrid microgrids with high renewable penetration and diesel backup, as reported in recent IEEE studies on inertia emulation, synthetic inertia from V2G, and stability analysis [53,54].
These parameters ensure accurate modeling of microgrid dynamics, including reduced system inertia due to high renewable integration (necessitating synthetic inertia from V2G) and frequency/voltage stability under disturbances. They align with established literature on inverter-dominated systems and synthetic inertia provision [56,57].
The case study, depicted in Figure 3, reflects a realistic operational environment for a microgrid designed to support a community of approximately 1000 households during a low-consumption day in spring or fall. This scenario serves as the foundation for analyzing the interplay between renewable energy, traditional generation, advanced grid-supporting technologies, and the control framework powered by LSTM neural networks.
Figure 3. Schematic simulation model of the case study microgrid.
Figure 3. Schematic simulation model of the case study microgrid.
Electronics 15 00791 g003
While the ideal direct coupling is considered in the model to highlight control performance, the DC bus voltage for real applications is regulated by power converters; thus, we will address non-ideal effects in future hardware-in-the-loop experiments.
The microgrid model comprises four integral components, each playing a unique role in ensuring stable and cost-effective operation:
  • Diesel Generator: Acting as the base generator, the diesel unit provides the necessary inertia and stability to balance power supply and demand. By monitoring the rotor speed of its synchronous machine, the system detects frequency deviations and adjusts the generator output accordingly. This generator is a critical backup during renewable generation deficits and forms a key part of the control system’s dynamic response strategy.
  • Renewable Energy Sources: The PV farm’s power output depends on the area of the farm, the efficiency of the solar panels, and solar irradiance, as illustrated in the 24 h irradiance profile in Figure 4. The control system ensures optimal utilization of solar energy while managing the intermittency associated with photovoltaic generation. The wind farm’s power generation follows a linear relationship with wind speed and adjusts dynamically based on operational thresholds. When wind speeds are too high, the farm disconnects to prevent overloading the grid. The wind speed profile in Figure 5 reflects these operational characteristics, which the LSTM controller leverages to maintain stability.
  • Vehicle-to-Grid System (V2G): The V2G system enables bidirectional power flow, with electric vehicles (EVs) either charging their batteries or discharging stored energy into the grid. The system incorporates 100 EVs and models five user profiles to reflect real-world variability in charging behaviors and availability. The LSTM-based control system coordinates the V2G operations to address frequency fluctuations dynamically, ensuring grid stability and minimizing costs. The profile of the total power of 24 by the V2G is shown in Figure 6.
  • Load Profile: The microgrid load consists of residential load and industrial load. Residential load follows a time-dependent consumption profile with a specific power factor, as shown in Figure 6. Industrial Load: Represented by an asynchronous machine, simulating an inductive load with a quadratic torque-speed relationship. The combination of residential and industrial loads offers a realistic basis for testing the proposed control strategies.
Figure 4. Solar irradiance profile over 24 h for microgrid simulation.
Figure 4. Solar irradiance profile over 24 h for microgrid simulation.
Electronics 15 00791 g004
Figure 5. Wind speed profile over 24 h for microgrid simulation.
Figure 5. Wind speed profile over 24 h for microgrid simulation.
Electronics 15 00791 g005
Figure 6. V2G load profile over 24 h for microgrid simulation.
Figure 6. V2G load profile over 24 h for microgrid simulation.
Electronics 15 00791 g006
It should be noted that the Long Short-Term Memory (LSTM) neural network serves as the core of the control system, optimizing the power generation of each unit to overcome global frequency fluctuations while accounting for operational costs. Its primary functions include:
  • Global Frequency Regulation: The LSTM controller continuously monitors system parameters, such as frequency deviations, renewable energy output, and load demand. By analyzing temporal dependencies in these inputs, the LSTM dynamically adjusts the output of generation units, such as the diesel generator, PV farm, wind farm, and V2G systems, to stabilize grid frequency. Unlike conventional controllers, the LSTM’s ability to model nonlinear relationships allows it to predict and mitigate frequency deviations proactively.
  • Cost-Effective Power Distribution: The controller considers the operational costs associated with each generation unit. For example, the diesel generator incurs fuel costs, while the PV and wind farms are cost-free but variable. The LSTM optimally dispatches power from available sources to minimize overall costs while meeting demand. This includes prioritizing renewable sources and utilizing the V2G system during peak demand periods to avoid excessive reliance on the diesel generator.
  • Dynamic Adaptability: The LSTM controller adapts to changing system conditions, such as fluctuating wind speeds or variations in solar irradiance, by learning from historical data. It ensures that the generation and storage units operate within their optimal ranges, thereby enhancing system reliability and efficiency.
  • Integrated Decision-Making: The controller balances technical objectives (frequency stability, renewable integration) with economic considerations (operational cost minimization). By integrating these objectives into a unified framework, the LSTM enables a scalable and practical solution for modern microgrids with high renewable penetration.
The integration of the LSTM controller into this microgrid framework provides a robust platform for optimizing power generation. It ensures that the system not only maintains frequency stability during variable operating conditions but also operates cost-effectively. The ability of the LSTM controller to adapt to nonlinear dynamics and time-dependent data sets it apart as a highly effective solution for addressing the challenges of modern power distribution networks. This study establishes a comprehensive benchmark for combining machine learning techniques with advanced control strategies, paving the way for more resilient and economical power systems.

4.2. Discussion of the Results

The 24 h simulation provides a comprehensive evaluation of the proposed LSTM-based power control strategy in managing generation units within the microgrid. The results highlight the system’s ability to regulate frequency effectively, maintain voltage stability, and optimize operational costs under varying conditions and critical events. The comparison with the linear Model Predictive Control (MPC) method underscores the advantages of the LSTM-based approach in handling the complex dynamics of the microgrid.

4.2.1. Temporal Patterns and Baseline Operations

  • Solar Intensity: Solar intensity follows a normal distribution, peaking at midday, as shown in the irradiance profile. This results in significant renewable energy contribution during the central hours but introduces variability that requires active management by the controller.
  • Wind Speed: Wind speed varies significantly, with multiple peaks and troughs throughout the day. The high variability challenges the stability of the grid, particularly during periods when the wind farm disconnects due to excessive speeds.
  • Residential Load: The residential load follows a typical household consumption pattern, with lower demand during daylight hours and a pronounced evening peak. This dynamic creates operational challenges, particularly when renewable generation decreases.

4.2.2. Event Analysis and System Response

  • Kick-Off of the Asynchronous Machine (3rd Hour): The activation of the asynchronous machine introduces a sudden inductive load, causing a transient dip in both system frequency and voltage at the Point of Common Coupling (PCC). As shown in Figure 7 and Figure 8, the LSTM controller stabilizes these parameters more quickly than the linear MPC method, demonstrating superior responsiveness and accuracy.
  • Partial Shading at Noon: Partial shading reduces solar power generation, leading to a temporary mismatch between supply and demand. The LSTM-based controller dynamically reallocates generation resources, ramping up the diesel generator and leveraging V2G systems to stabilize the grid. Figure 7 and Figure 8 show minimal frequency and voltage deviations respectively during this event, with the LSTM method outperforming the linear MPC approach in maintaining stability.
  • Wind Farm Trip (22nd Hour): At the 22nd hour, the wind farm disconnects due to excessive wind speeds, causing a significant gap in renewable generation. The LSTM controller promptly compensates by increasing diesel generation and deploying stored energy from V2G systems. As illustrated in Figure 7 and Figure 8, the LSTM approach exhibits faster stabilization and smaller deviations compared to the MPC method.
Figure 7. Total load profile over 24 h for microgrid simulation.
Figure 7. Total load profile over 24 h for microgrid simulation.
Electronics 15 00791 g007
Figure 8. System frequency variations at the PCC bus over 24 h.
Figure 8. System frequency variations at the PCC bus over 24 h.
Electronics 15 00791 g008
An error analysis is conducted by calculating the maximum deviation, settling time, and steady-state error for both frequency and voltage responses. The LSTM-based controller exhibits significantly lower steady-state errors and faster settling times compared to the benchmark methods, confirming its superior stability performance.
The voltage magnitude variations at the PCC bus over the 24-h simulation period are illustrated in Figure 9. These results demonstrate the LSTM-based controller’s capability to maintain voltage stability under varying load and renewable generation conditions.

4.2.3. Cost Optimization

The total generation cost over the 24 h simulation is depicted in Figure 10. The LSTM-based controller demonstrates significant cost advantages over the linear MPC method, primarily due to its ability to:
  • Prioritize the use of low-cost renewable energy sources.
  • Optimize the timing and extent of diesel generator usage.
  • Efficiently manage V2G system resources to reduce reliance on expensive generation.
The cost savings achieved with the LSTM controller reflect its superior capacity to integrate technical and economic objectives effectively.

4.2.4. Comparison of Performance (LSTM-Based Method vs. Linear MPC)

The linear MPC controller is selected as a benchmark due to its widespread adoption in microgrid control literature and its well-known trade-off between performance and computational complexity. More advanced controllers, such as nonlinear MPC or LQR, require accurate system models and significantly higher computational resources, making them less suitable for real-time implementation in practical microgrids.
  • Frequency and Voltage Stability: As shown in Figure 7 and Figure 8, the LSTM-based method outperforms the linear MPC approach in stabilizing system frequency and voltage at the PCC bus. The LSTM controller’s ability to model nonlinear relationships and capture temporal dependencies allows for faster and more precise adjustments during disturbances.
  • Cost Efficiency: Figure 10 highlights the cost-effectiveness of the LSTM-based controller, which achieves lower total generation costs than the MPC method. The LSTM controller’s adaptive optimization ensures that resources are utilized efficiently without compromising grid stability.
  • Adaptability and Scalability: The LSTM controller adapts more effectively to renewable energy variability and unplanned events, such as the wind farm trip. Its scalability makes it a practical solution for microgrids with high renewable penetration and complex dynamics.
The simulation results validate the proposed LSTM-based control strategy as a robust and cost-efficient solution for microgrid management. Compared to the linear MPC method, the LSTM approach exhibits superior performance in stabilizing frequency and voltage, optimizing generation costs, and responding to dynamic system conditions. These findings underscore the potential of machine learning techniques to enhance the reliability and economic efficiency of modern power systems. Table 2 provides a comprehensive analysis of the performance of the proposed LSTM-based control method compared to a recent state-of-the-art approach, focusing on critical metrics such as operation cost, frequency deviations, voltage deviations, and response time. This comparison underscores the significant advantages offered by the LSTM-based method in addressing the complexities and challenges of modern microgrid management. The proposed method demonstrates a marked reduction in total operation cost. This improvement is attributed to the LSTM controller’s ability to optimize the dispatch of generation resources effectively. By prioritizing renewable energy sources and leveraging the capabilities of the V2G system, the LSTM-based approach minimizes reliance on more expensive generation units, such as diesel generators, thereby enhancing cost efficiency. In terms of frequency deviations, the proposed method exhibits superior stability compared to the state-of-the-art approach.
The LSTM controller’s advanced capability to model nonlinear dynamics and predict disturbances enables it to implement real-time adaptive adjustments, reducing frequency fluctuations. Its seamless coordination among generation sources and storage systems ensures a stable grid operation even under varying and dynamic conditions. The LSTM-based control method also excels in maintaining voltage stability, achieving reduced voltage deviations relative to the previous approach. The enhanced control mechanism employed by the LSTM ensures precise adjustments in response to fluctuations in load and generation. Additionally, its efficient management of reactive power through coordinated actions of generation units and the V2G system ensures that voltage levels remain within acceptable limits. Another critical performance metric where the LSTM method outshines its predecessor is response time. The LSTM-based controller demonstrates a significantly faster response to transient events, a feature crucial for mitigating their impact on grid stability. The ability of LSTM networks to process time-dependent data and implement swift corrective actions contributes to this enhanced responsiveness, further highlighting the robustness of the proposed method. Overall, the results presented in Table 3 emphasize the superior performance of the LSTM-based control strategy across all evaluated metrics. By achieving reduced operation costs, enhanced frequency and voltage stability, and faster response times, the proposed approach establishes a new benchmark for microgrid control methodologies. The integration of machine learning techniques, particularly LSTM networks, proves to be a highly effective solution for managing the complexities of power systems with high renewable energy penetration.
The key points of the comparison table can be written as follows:
  • The proposed method consistently demonstrates superior performance across scenarios, particularly during critical events like the activation of the asynchronous machine and the wind farm trip.
  • Under normal operation, PM achieves the lowest operation cost and smallest deviations, highlighting its efficiency and precision.
  • During challenging events, proposed method’s predictive LSTM-based adjustments provide better stability and faster response times than the Fuzzy and MPC methods.
  • The results validate the proposed method as a robust, scalable, and cost-efficient solution for microgrid management, outperforming traditional approaches.
In addition to comparisons with classical control methods and linear MPC (Table 4), we demonstrate that the proposed LSTM-based approach outperforms simpler RNN models built on vanilla RNNs/GRUs by better modeling long-range temporal interactions in time series data. With the help of input, forget, and output gate mechanisms, LSTM is capable of remarkably addressing the vanishing gradient problem of classical RNNs, so it can be more steady and dependable in practical real-time control systems such as MGFR. Recent works in time-series prediction and power flow control indicate that, for prediction of power systems in general, LSTM has better accuracy than GRU and RNN when the input is long or noisy. While GRU could converge faster as a result of its less complexity, the capacity of modeling nontrivial temporal relations is limited. As a result, combined with the low computation cost of our LSTM controller (its inference time is less than 1 ms), these advantages make our approach very practical and efficient for direct VSG control without superfluous model structures or reinforcement learning models (such as DDPG or TD3) that require lots of training interactions.
The resulting time required to run the LSTM-based controller is experimentally close to 1 ms per control step, which makes it compatible with real-time execution on embedded systems such as GPUs and FPGAs. For comparison, typical representative values from literature of real-time MPC are 20–50 ms for the linear type [53,58], while fuzzy controllers have execution times in a range between 2 and 20 ms depending on the complexity of the rule base [55,56]. These figures emphasize the notably reduced computational latency of the LSTM-based method, enabling fast dynamic responses in VSG control without overheads from online optimization or complex rule-based designs.

5. Conclusions

In this paper, we propose an LSTM-based control paradigm for power generation and frequency regulation in high-penetration renewable energy microgrids. With the capability to model well on nonlinear dynamics and time dependencies, the developed controller exhibited excellent real-time performance under different conditions and disturbances. Simulation over 24 h of the grid adopted results proved that it provides significant enhancements of frequency and voltage stability, cost of operation reduction, and dynamic response performance with respect to a modern control law. These results demonstrate the applicability and scalability of the LSTM-based model as a real-world solution for today’s microgrids. In future work, the framework will be extended to larger system sizes and longer planning horizons and will take into account additional constraints such as carbon emissions and market-based objectives. The computational overhead of the presented LSTM-based controller is compatible with real-time implementation on state-of-the-art embedded hardware platforms such as GPUs and FPGAs, where Preliminary estimates and literature benchmarks for similarly sized LSTM networks on modern embedded GPUs and optimized FPGA accelerators indicate inference latencies typically in the range of 0.5–3 ms per control step, which remains fully compatible with real-time microgrid control requirements (sampling periods usually 10–100 ms). Ongoing work targets dedicated FPGA implementation to further reduce latency below 1 ms.
Compared with traditional SMC algorithms, such as robust control strategies of low-voltage microgrids, the proposed LSTM-based SMC controller can maintain comparable disturbance rejection performance and starkly decrease computational overheads (like, less than 1 ms inference time (Table 1)). Hybrid LSTM–SMC systems may be explored in the future, where the performance and robustness of the SC controller could be further improved.
While the current study focuses on a representative daily scenario with key disturbances, future work will incorporate extreme weather events (such as total PV/wind loss under blackout-like conditions) and grid-side faults to further validate robustness, potentially using sensitivity analysis or worst-case simulations.
In future studies, explicit parameters about conversion efficiency and power generation efficiency under different conditions can be added to further quantify clean energy consumption.

Author Contributions

Conceptualization, A.K. and H.A.; Methodology, A.K. and H.A.; Software, A.K. and H.A.; Validation, A.K. and H.A.; Writing—original draft, A.K.; Writing—review and editing, H.A.; Visualization, A.K.; Supervision, H.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Kober, T.; Schiffer, H.-W.; Densing, M.; Panos, E. Global energy perspectives to 2060–WEC’s World Energy Scenarios 2019. Energy Strateg. Rev. 2020, 31, 100523. [Google Scholar] [CrossRef]
  2. Rasoulnia, M.; Yaghoubi, E.; Yaghoubi, E.; Hussain, A.; Kamwa, I. A comprehensive systematic and bibliometric review of technologies and measurement tools for power quality events detection, classification, and fault location in smart grids. Renew. Sustain. Energy Rev. 2026, 226, 116302. [Google Scholar] [CrossRef]
  3. Allan, R.P.; Arias, P.A.; Berger, S.; Canadell, J.G.; Cassou, C.; Chen, D.; Cherchi, A.; Connors, S.L.; Coppola, E.; Abigail, F.; et al. Intergovernmental panel on climate change (IPCC). Summary for policymakers. In Climate Change 2021: The Physical Science Basis. Contribution of Working Group I to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change; Cambridge University Press: Cambridge, UK, 2023; pp. 3–32. [Google Scholar]
  4. Ahmed, Y.E.; Maghami, M.R.; Pasupuleti, J.; Danook, S.H.; Ismail, F.B. Overview of recent solar photovoltaic cooling system approach. Technologies 2024, 12, 171. [Google Scholar] [CrossRef]
  5. Espín-Sarzosa, D.; Palma-Behnke, R.; Cañizares, C.A.; Annakkage, U.; Elizondo, M.; Espina, E.; Du, W.; Kabalan, M.; Meegahapola, L.; Mendoza-Araya, P.A.; et al. Microgrid modeling for stability analysis. IEEE Trans. Smart Grid 2023, 15, 2459–2479. [Google Scholar] [CrossRef]
  6. Wang, Z.; Yu, Y.; Gao, W.; Davari, M.; Deng, C. Adaptive, optimal, virtual synchronous generator control of three-phase grid-connected inverters under different grid conditions—An adaptive dynamic programming approach. IEEE Trans. Ind. Inform. 2021, 18, 7388–7399. [Google Scholar] [CrossRef]
  7. Naderi, M.; Khayat, Y.; Shafiee, Q.; Blaabjerg, F.; Bevrani, H. Dynamic modeling, stability analysis and control of interconnected microgrids: A review. Appl. Energy 2023, 334, 120647. [Google Scholar] [CrossRef]
  8. Shahrbejari, A.N.; Sani, M.H.E.; Jahromi, M.Z.; Yaghoubi, E.; Yaghoubi, E.; Maghami, M.R. Optimal multi-objective energy management of decentralized demand response incorporating uncertainties. PLoS ONE 2025, 20, e0328838. [Google Scholar] [CrossRef]
  9. Xu, H.; Yu, C.; Liu, C.; Wang, Q.; Zhang, X. An improved virtual inertia algorithm of virtual synchronous generator. J. Mod. Power Syst. Clean Energy 2019, 8, 377–386. [Google Scholar] [CrossRef]
  10. Surinkaew, T.; Emami, K.; Shah, R.; Islam, S.; Mithulananthan, N. Forced oscillation in power systems with converter controlled-based resources–A survey with case studies. IEEE Access 2021, 9, 150911–150924. [Google Scholar] [CrossRef]
  11. Mehrzad, A.; Darmiani, M.; Rouhani, S.H.; Su, C.-L.; Sepestanaki, M.A.; Mofidipour, E.; Monti, A.; Anvari-Moghaddam, A. Inertia in renewable power systems: A review of estimation methods and practical implementation. Renew. Sustain. Energy Rev. 2026, 226, 116246. [Google Scholar] [CrossRef]
  12. Ufa, R.A.; Malkova, Y.Y.; Rudnik, V.E.; Andreev, M.V.; Borisov, V.A. A review on distributed generation impacts on electric power system. Int. J. Hydrogen Energy 2022, 47, 20347–20361. [Google Scholar] [CrossRef]
  13. Zhang, H.; Xiang, W.; Lin, W.; Wen, J. Grid forming converters in renewable energy sources dominated power grid: Control strategy, stability, application, and challenges. J. Mod. Power Syst. Clean Energy 2021, 9, 1239–1256. [Google Scholar] [CrossRef]
  14. Chang, J.; Du, Y.; Lim, E.G.; Wen, H.; Li, X.; Jiang, L. Coordinated frequency regulation using solar forecasting based virtual inertia control for islanded microgrids. IEEE Trans. Sustain. Energy 2021, 12, 2393–2403. [Google Scholar] [CrossRef]
  15. Li, C.; Yang, Y.; Cao, Y.; Aleshina, A.; Xu, J.; Blaabjerg, F. Grid inertia and damping support enabled by proposed virtual inductance control for grid-forming virtual synchronous generator. IEEE Trans. Power Electron. 2022, 38, 294–303. [Google Scholar] [CrossRef]
  16. Ren, M.; Li, T.; Shi, K.; Xu, P.; Sun, Y. Coordinated control strategy of virtual synchronous generator based on adaptive moment of inertia and virtual impedance. IEEE J. Emerg. Sel. Top. Circuits Syst. 2021, 11, 99–110. [Google Scholar] [CrossRef]
  17. Yaghoubi, E.; Yaghoubi, E.; Jahromi, M.Z.; Maghami, M.R.; Paşaoğlu, A.; Chamorro, H.R. A novel data-driven NLMPC strategy for techno-economic microgrid management with battery energy storage under uncertainty. Sci. Rep. 2025, 15, 28096. [Google Scholar] [CrossRef]
  18. Ranjan, M.; Shankar, R. A literature survey on load frequency control considering renewable energy integration in power system: Recent trends and future prospects. J. Energy Storage 2022, 45, 103717. [Google Scholar] [CrossRef]
  19. Santhoshkumar, T.; Senthilkumar, V. Transient and small signal stability improvement in microgrid using AWOALO with virtual synchronous generator control scheme. ISA Trans. 2020, 104, 233–244. [Google Scholar] [CrossRef] [PubMed]
  20. Van Houdt, G.; Mosquera, C.; Nápoles, G. A review on the long short-term memory model. Artif. Intell. Rev. 2020, 53, 5929–5955. [Google Scholar] [CrossRef]
  21. Wang, H.; Yang, C.; Liao, X.; Wang, J.; Zhou, W.; Ji, X. Artificial neural network-based virtual synchronous generator dual droop control for microgrid systems. Comput. Electr. Eng. 2023, 111, 108930. [Google Scholar] [CrossRef]
  22. Pham, X.H.T. Power sharing strategy in islanded microgrids using improved droop control. Electr. Power Syst. Res. 2020, 180, 106164. [Google Scholar] [CrossRef]
  23. Cheng, H.; Li, C.; Ghias, A.M.Y.M.; Blaabjerg, F. Dynamic coupling mechanism analysis between voltage and frequency in virtual synchronous generator system. IEEE Trans. Power Syst. 2023, 39, 2365–2368. [Google Scholar] [CrossRef]
  24. Montalvo, E.T.; Sanchez, V.M.; Ramirez, J.M. Synchronverter assessment for the frequency regulation of control areas encompassing Renewable Distributed Generation. Int. J. Hydrogen Energy 2021, 46, 26138–26151. [Google Scholar] [CrossRef]
  25. Meng, Q.; Ren, Y.; Liu, H. Frequency stability analysis of grid-forming PMSG based on virtual synchronous control. IEEE Access 2024, 12, 84134–84148. [Google Scholar] [CrossRef]
  26. Sindi, H.F.; Alghamdi, S.; Rawa, M.; Omar, A.I.; Elmetwaly, A.H. Robust control of adaptive power quality compensator in Multi-Microgrids for power quality enhancement using puzzle optimization algorithm. Ain Shams Eng. J. 2023, 14, 102047. [Google Scholar] [CrossRef]
  27. Abou-Hussein, W.M.; Dabour, S.M.; Hamad, M.S.; Rashad, E.M. Model predictive control based virtual synchronous generator for parallel-connected three-phase split-source converters in islanded AC Microgrids. Energy Rep. 2023, 9, 1696–1706. [Google Scholar] [CrossRef]
  28. Yap, K.Y.; Lim, J.M.-Y.; Sarimuthu, C.R. A novel adaptive virtual inertia control strategy under varying irradiance and temperature in grid-connected solar power system. Int. J. Electr. Power Energy Syst. 2021, 132, 107180. [Google Scholar] [CrossRef]
  29. Zhang, W.; Sun, C.; Alharbi, M.; Hasanien, H.M.; Song, K. A voltage-power self-coordinated control system on the load-side of storage and distributed generation inverters in distribution grid. Ain Shams Eng. J. 2025, 16, 103480. [Google Scholar] [CrossRef]
  30. Singh, A.K.; Seethalekshmi, K. Comparative analysis of primary microgrid control through adaptive VSG based multi-loop and single loop configuration. In 2023 IEEE 3rd International Conference on Sustainable Energy and Future Electric Transportation (SEFET); IEEE: New York, NY, USA, 2023; pp. 1–6. [Google Scholar]
  31. Liang, Y.; He, Y.; Niu, Y. Microgrid frequency fluctuation attenuation using improved fuzzy adaptive damping-based VSG considering dynamics and allowable deviation. Energies 2020, 13, 4885. [Google Scholar] [CrossRef]
  32. Alimi, O.A.; Ouahada, K.; Abu-Mahfouz, A.M. A review of machine learning approaches to power system security and stability. IEEE Access 2020, 8, 113512–113531. [Google Scholar] [CrossRef]
  33. Muneer, A.; Ali, R.F.; Almaghthawi, A.; Taib, S.M.; Alghamdi, A.; Ghaleb, E.A.A. Short term residential load forecasting using long short-term memory recurrent neural network. Int. J. Electr. Comput. Eng. 2022, 12, 5589–5599. [Google Scholar] [CrossRef]
  34. Hossain, M.S.; Mahmood, H. Short-term photovoltaic power forecasting using an LSTM neural network and synthetic weather forecast. IEEE Access 2020, 8, 172524–172533. [Google Scholar] [CrossRef]
  35. Han, Y.; Ding, N.; Geng, Z.; Wang, Z.; Chu, C. An optimized long short-term memory network based fault diagnosis model for chemical processes. J. Process Control 2020, 92, 161–168. [Google Scholar] [CrossRef]
  36. Norouzi, M.H.; Oshnoei, A.; Mohammadi-Ivatloo, B.; Abapour, M. Learning-based virtual inertia control of an islanded microgrid with high participation of renewable energy resources. IEEE Syst. J. 2024, 18, 786–795. [Google Scholar] [CrossRef]
  37. Xu, Y.; Dong, Z.; Li, Z.; Liu, Y.; Ding, Z. Distributed optimization for integrated frequency regulation and economic dispatch in microgrids. IEEE Trans. Smart Grid 2021, 12, 4595–4606. [Google Scholar] [CrossRef]
  38. Zhou, D.; Niu, X.; Xie, Y.; Li, P.; Fang, J.; Guo, F. An economic dispatch method of microgrid based on fully distributed ADMM considering demand response. Sustainability 2022, 14, 3751. [Google Scholar] [CrossRef]
  39. Wang, Z.; Jiang, H.; He, H.; Sun, Y.L. Distributed finite-time economic dispatch for islanded microgrids. In 2020 IEEE Power & Energy Society General Meeting (PESGM); IEEE: New York, NY, USA, 2020; pp. 1–5. [Google Scholar]
  40. Tu, H.; Du, Y.; Yu, H.; Meena, S.; Lu, X.; Lukic, S. Distributed economic dispatch for microgrids tracking ramp power commands. IEEE Trans. Smart Grid 2022, 14, 94–111. [Google Scholar] [CrossRef]
  41. Meng, X.; Mei, J.; Tang, X.; Jiang, J.; Sun, C.; Song, K. The degradation prediction of proton exchange membrane fuel cell performance based on a transformer model. Energies 2024, 17, 3050. [Google Scholar] [CrossRef]
  42. Waheed, W.; Xu, Q. A Data-Driven Long-Short Term Load Forecasting with LSTM-RNN Networks. 2023. Available online: https://www.researchgate.net/publication/371325654_A_Data-driven_Long-Short_Term_Load_Forecasting_with_LSTM-RNN_Networks (accessed on 8 February 2026).
  43. Yadav, D.; Sahoo, L.; Mandal, S.K.; Ravivarman, G.; Vijayaraghavan, P. Using long short-term memory units for time series forecasting. In 2023 2nd International Conference on Futuristic Technologies (INCOFT); IEEE: New York, NY, USA, 2023; pp. 1–6. [Google Scholar]
  44. Jenson, A.J.; Sowkarthika, S. Electricity Demand Forecasting using LSTMs. J. Electr. Eng. Autom. 2023, 5, 228–237. [Google Scholar] [CrossRef]
  45. Nie, R.; Li, H. Application and Improvement of LSTM in Power System Prediction. In 2023 IEEE 3rd International Conference on Data Science and Computer Application (ICDSCA); IEEE: New York, NY, USA, 2023; pp. 975–980. [Google Scholar]
  46. Oboreh-Snapps, O.; She, B.; Fahad, S.; Chen, H.; Kimball, J.; Li, F.; Cui, H.; Bo, R. Virtual synchronous generator control using twin delayed deep deterministic policy gradient method. IEEE Trans. Energy Convers. 2023, 39, 214–228. [Google Scholar] [CrossRef]
  47. Yao, F.; Zhao, J.; Li, X.; Mao, L.; Qu, K. RBF neural network based virtual synchronous generator control with improved frequency stability. IEEE Trans. Ind. Inform. 2020, 17, 4014–4024. [Google Scholar] [CrossRef]
  48. Rasool, A.; Fahad, S.; Yan, X.; Rasool, H.; Jamil, M.; Padmanaban, S. Reactive power matching through virtual variable impedance for parallel virtual synchronous generator control scheme. IEEE Syst. J. 2022, 17, 1453–1464. [Google Scholar] [CrossRef]
  49. Li, Z.; Li, H.; Zheng, X.; Gao, M. Virtual model predictive control for virtual synchronous generators to achieve coordinated voltage unbalance compensation in islanded micro grids. Int. J. Electr. Power Energy Syst. 2023, 146, 108756. [Google Scholar] [CrossRef]
  50. Cheema, K.M. A comprehensive review of virtual synchronous generator. Int. J. Electr. Power Energy Syst. 2020, 120, 106006. [Google Scholar] [CrossRef]
  51. Wang, J.; Ramli, N.; Aziz, N.H.A. Pre synchronization control strategy of virtual synchronous generator (VSG) in micro-grid. IEEE Access 2023, 11, 139004–139016. [Google Scholar] [CrossRef]
  52. Cheng, H.; Huang, W.; Shen, C.; Peng, Y.; Shuai, Z.; Shen, Z.J. Transient voltage stability of paralleled synchronous and virtual synchronous generators with induction motor loads. IEEE Trans. Smart Grid 2021, 12, 4983–4999. [Google Scholar] [CrossRef]
  53. Rauniyar, M.; Bhujel, N.; Hansen, T.M.; Fourney, R.; Rekabdarkolaee, H.M.; Tonkoski, R. Diesel generator model development and validation using moving horizon estimation. In IECON 2021–47th Annual Conference of the IEEE Industrial Electronics Society; IEEE: New York, NY, USA, 2021; pp. 1–6. [Google Scholar]
  54. Eidiani, M.; Kargar, M.; Zeynal, H. Interactive Use of D-STATCOM and Storage Resource to Maintain Microgrid Stability for Commercial Systems. In Microgrids for Commercial Systems; WILEY: Hoboken, NJ, USA, 2024; pp. 241–270. [Google Scholar]
  55. Nema, S.; Prakash, V.; Bhakar, R.; Pandžić, H. Coordinated synthetic inertia control provision from distributed energy resources and energy storage systems. In 2022 International Conference on Intelligent Controller and Computing for Smart Power (ICICCSP); IEEE: New York, NY, USA, 2022; pp. 1–5. [Google Scholar]
  56. Kerdphol, T.; Surinkaew, T.; Ngamroo, I. Synthetic Inertia-Power Sharing in High Renewable Power Grids Through Vehicle-to-Grid Topology. In 2024 IEEE/IAS Industrial and Commercial Power System Asia (I&CPS Asia); IEEE: New York, NY, USA, 2024; pp. 247–252. [Google Scholar]
  57. Zhang, Y.; Melin, A.M.; Djouadi, S.M.; Olama, M.M.; Tomsovic, K. Provision for guaranteed inertial response in diesel-wind systems via model reference control. IEEE Trans. Power Syst. 2018, 33, 6557–6568. [Google Scholar] [CrossRef]
  58. Nurkanovic, A.; Mesanovic, A.; Zanelli, A.; Frison, G.; Frey, J.; Albrecht, S.; Diehl, M. Real-time nonlinear model predictive control for microgrid operation. In 2020 American Control Conference (ACC); IEEE: New York, NY, USA, 2020; pp. 4989–4995. [Google Scholar]
  59. Rahmani-Andebili, M. Grid-connected and off-grid operation of a microgrid applying fuzzy mixed-integer linear programming. In 2022 IEEE Power and Energy Conference at Illinois (PECI); IEEE: New York, NY, USA, 2022; pp. 1–5. [Google Scholar]
Figure 1. Conceptual model of the proposed LSTM-based control method for microgrid management.
Figure 1. Conceptual model of the proposed LSTM-based control method for microgrid management.
Electronics 15 00791 g001
Figure 2. Architecture and hyperparameter configuration of the proposed two-layer LSTM network along with sensitivity analysis results.
Figure 2. Architecture and hyperparameter configuration of the proposed two-layer LSTM network along with sensitivity analysis results.
Electronics 15 00791 g002
Figure 9. Voltage magnitude variations at the PCC bus over 24 h.
Figure 9. Voltage magnitude variations at the PCC bus over 24 h.
Electronics 15 00791 g009
Figure 10. Total generation cost comparison of proposed method and recent modern control strategies.
Figure 10. Total generation cost comparison of proposed method and recent modern control strategies.
Electronics 15 00791 g010
Table 1. Comparison of control methods for VSGs.
Table 1. Comparison of control methods for VSGs.
Control MethodNonlinearity HandlingReal-Time CapabilityAdaptabilityComputational ComplexityReferences
Traditional ControlLowHighLowLow[22,24,26]
Model Predictive ControlMediumMediumMediumHigh[27]
Adaptive ControlMediumHighHighMedium[28]
Robust ControlHighMediumMediumHigh[30]
Machine Learning (Existing)HighMediumHighMedium[36,46]
Proposed LSTM-Based ControlHighHighHighMediumProposed Work
Table 2. Main parameters of the simulated microgrid system.
Table 2. Main parameters of the simulated microgrid system.
ComponentParameterValueUnitSource/Justification
Diesel GeneratorInertia constant (H)5s[53]
Damping coefficient (D)1pu[55]
Wind FarmRated capacity300kW[56]
V2G SystemNumber of EVs100[54]
Bidirectional power per EV±10kW[54]
LV LinesResistance (R)0.1Ω/km[55]
Reactance (X)0.3Ω/km[55]
Table 3. Performance comparison of the proposed method with other modern research methods under different scenarios.
Table 3. Performance comparison of the proposed method with other modern research methods under different scenarios.
Feature/ScenarioProposed MethodFuzzy Method [31]MPC Method [27]Notes
Operation Cost (Normal Operation)1.7565 × 1072.0150 × 1071.9800 × 107Proposed method minimizes cost through efficient resource allocation and optimal V2G utilization.
Operation Cost (Partial Shading)1.8200 × 1072.1000 × 1071.9900 × 107Proposed method adapts dynamically to reduced PV output, minimizing diesel reliance better than other methods.
Frequency Deviations (Kick-Off of Asynchronous Machine)±0.02 Hz±0.12 Hz±0.06 HzProposed method rapidly stabilizes frequency using real-time adjustments, outperforming traditional methods.
Frequency Deviations (Wind Farm Trip)±0.03 Hz±0.15 Hz±0.08 HzProposed method handles sudden generation loss with smaller deviations due to predictive control.
Voltage Deviations (Normal Operation)±0.015 p.u.±0.080 p.u.±0.040 p.u.Proposed method ensures voltage stability by dynamically managing reactive power.
Voltage Deviations (Partial Shading)±0.020 p.u.±0.100 p.u.±0.045 p.u.Proposed method maintains voltage within permissible limits during reduced solar generation.
Response Time (Kick-Off of Asynchronous Machine)0.001 s0.015 s0.010 sProposed method responds 10 times faster than MPC and 15 times faster than Fuzzy.
Response Time (Wind Farm Trip)0.001 s0.020 s0.012 sProposed method’s rapid corrective action prevents cascading instability.
Table 4. Comparison of execution/inference time per control step for different controllers in microgrid applications.
Table 4. Comparison of execution/inference time per control step for different controllers in microgrid applications.
ControllerPlatform/ImplementationExecution/Inference Time per StepNotes/Ref
Proposed LSTM-basedGPU/FPGA (preliminary tests/embedded estimates)1 msThis study (preliminary embedded GPU/FPGA tests or literature-aligned)
Proposed LSTM-basedSensitivity (64 → 256 neurons)~+15% increaseThis study
Linear MPCMATLAB 2024a/CVXGEN (simulation)~0.4 ms per trial (but up to 20–50 ms in embedded/real-time with constraints)[54]—simulation time; real-time higher due to constraints
Linearized-Trajectory MPCReal-time implementation (HIL)Suitable for real-time (enhanced for short sampling intervals; typically 5–50 ms reported in similar HIL setups)[54]
Fuzzy Logic ControllerReal-time EMS/HIL~5 ms (or 2–20 ms depending on rule base)[55,56,57]—literature-reported values in HIL/embedded setups
Linear/MILP-MPCTypical microgrid real-time5–50 ms[58]—real-time nonlinear MPC benchmarks
Fuzzy MILP HybridGrid-connected/off-grid microgridLiterature-typical (depends on complexity; 5–30 ms range)[59]
The values for MPC and fuzzy controllers are literature-reported execution times from simulation, HIL, or embedded implementations in similar microgrid applications. The proposed LSTM achieves significantly lower inference latency, making it highly suitable for real-time control (sampling periods usually 10–100 ms). Ongoing work includes dedicated FPGA deployment to confirm sub-millisecond performance under strict constraints.
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.

Share and Cite

MDPI and ACS Style

Khamees, A.; Altınkaya, H. Optimizing Power Control in Generation Units: LSTM-Based Machine Learning for Enhanced Stability in Virtual Synchronous Generators. Electronics 2026, 15, 791. https://doi.org/10.3390/electronics15040791

AMA Style

Khamees A, Altınkaya H. Optimizing Power Control in Generation Units: LSTM-Based Machine Learning for Enhanced Stability in Virtual Synchronous Generators. Electronics. 2026; 15(4):791. https://doi.org/10.3390/electronics15040791

Chicago/Turabian Style

Khamees, Ahmed, and Hüseyin Altınkaya. 2026. "Optimizing Power Control in Generation Units: LSTM-Based Machine Learning for Enhanced Stability in Virtual Synchronous Generators" Electronics 15, no. 4: 791. https://doi.org/10.3390/electronics15040791

APA Style

Khamees, A., & Altınkaya, H. (2026). Optimizing Power Control in Generation Units: LSTM-Based Machine Learning for Enhanced Stability in Virtual Synchronous Generators. Electronics, 15(4), 791. https://doi.org/10.3390/electronics15040791

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop