Next Article in Journal
Deep Reinforcement Learning Integrated PID for Hybrid Adaptive Control Approach in Automatic Voltage Regulation Systems
Previous Article in Journal
Design Requirements for a Common-Shaft Switch-Mode Power Transformer for Ocean Wave-Powered Reverse Osmosis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Physics-Informed Neural Networks for Real-Time Control of Grid-Forming Inverters: Embedding Physical System Laws into Deep Learning Architectures

1
Department of Mechanical, Bioresources and Biomedical Engineering, University of South Africa, Johannesburg 1709, South Africa
2
Centre for Augmented Intelligence and Data Science (CAIDS), Department of Computer Science, University of South Africa, Johannesburg 1709, South Africa
*
Authors to whom correspondence should be addressed.
Energies 2026, 19(11), 2690; https://doi.org/10.3390/en19112690
Submission received: 10 March 2026 / Revised: 21 May 2026 / Accepted: 28 May 2026 / Published: 3 June 2026

Abstract

The increasing penetration of renewable energy sources in inverter-dominated microgrids introduces significant challenges for maintaining voltage and frequency stability under weak-grid and dynamically varying operating conditions. Conventional inverter control strategies, including droop control and virtual synchronous machine (VSM) methods, often exhibit limited adaptability and degraded transient performance under renewable intermittency and uncertain load variations. This paper proposes a physics-informed neural-network (PINN)-based supervisory framework for real-time grid-forming inverter control. The proposed approach embeds swing-equation dynamics, Kirchhoff-based electrical constraints, and stability-aware objectives directly into the neural-network optimization process to improve physical consistency, robustness, and operational reliability. The controller is trained offline and deployed for low-latency online inference on an NVIDIA Jetson AGX Xavier embedded platform. Simulation and hardware-in-the-loop validation results demonstrate improved transient stability, reduced frequency deviation, enhanced voltage regulation, and superior robustness compared with conventional droop, VSM, and purely data-driven neural-network controllers. The proposed framework achieved an average inference latency of approximately 0.7 ms while maintaining stable operation under renewable intermittency, load disturbances, and weak-grid conditions. The results demonstrate the potential of physics-informed machine learning for supervisory real-time control of inverter-dominated microgrids and intelligent renewable energy systems.

1. Introduction

The integration of renewable energy sources (RESs) into modern power systems has fundamentally transformed grid operation, introducing significant complexities, particularly in microgrids and weakly interconnected networks [1,2]. Unlike conventional grids supported by synchronous generators, microgrids predominantly rely on inverter-interfaced generation units, necessitating advanced and reliable control methods to maintain voltage and frequency stability under varying operational conditions [3,4].
Traditionally, inverter control strategies such as droop control, virtual synchronous machines (VSMs), and model predictive control (MPC) have been widely employed [5,6]. Droop control, despite its simplicity and decentralized nature, exhibits limited adaptability and suboptimal performance under highly dynamic or uncertain conditions [7]. VSM approaches offer improved transient stability by emulating synchronous generator dynamics but often require precise parameter tuning and comprehensive system modelling, limiting scalability and adaptability [8]. MPC-based techniques demonstrate robust control capabilities, yet they typically incur high computational burdens, complicating their deployment in real-time applications [9].
Recently, advancements in machine learning (ML) and artificial intelligence (AI) have provided alternative pathways for adaptive, data-driven inverter control, potentially addressing limitations inherent in conventional control methods [10,11]. Nevertheless, purely data-driven approaches often face challenges related to interpretability, robustness, and generalization, especially under scenarios not adequately represented in training datasets [12,13].
In response to these challenges, physics-informed neural networks (PINNs) have emerged as a promising interdisciplinary paradigm, combining rigorous physical laws with neural network flexibility. By explicitly embedding governing equations and constraints into the training process, PINNs improve the interpretability, generalization, and robustness of AI-driven solutions [14,15]. PINNs have demonstrated successful applications in various engineering domains such as fluid dynamics, heat transfer, and power system stability assessment, validating their potential for addressing complex real-world problems [16,17].
Recent survey articles have further emphasized the growing role of PINNs in power electronics, inverter-dominated grids, and intelligent energy management systems, highlighting both their opportunities and remaining challenges in real-time control applications [18].
Recent advances in PINNs have stimulated growing interest in their application in power electronics, inverter-dominated power systems, and intelligent energy management. Several recent studies have investigated PINN-based formulations for power flow analysis, converter modelling, fault diagnosis, dynamic system identification, and stability assessment in renewable-rich grids. For example, Nadal et al. [19] demonstrated that incorporating physics-based knowledge into neural surrogate models improves simulation accuracy for IEEE benchmark power systems, outperforming conventional numerical approaches in dynamic grid analysis. Similarly, recent direct-term scaling frameworks for PINNs have shown that scaling governing equations using characteristic physical dimensions significantly reduces computational complexity, thereby improving the feasibility of real-time power-flow applications [20].
Recent research has also explored PINN architectures for stability assessment and situational awareness in renewable-dominated networks. Feng et al. [21] proposed a uniform physics-informed neural network (UPINN) architecture for real-time voltage stability monitoring and parameter extraction in highly variable grids, while He et al. [22] combined PINNs with stochastic Wiener-process-based degradation modelling to improve reliability prediction for critical grid infrastructure.
PINN-based approaches have further advanced fault diagnosis and system identification applications. The PI-SSD framework [23] integrated latent neural ordinary differential equations with embedded mechanical and electrical priors for fault detection in rotating machinery and power converter systems, achieving high calibration accuracy and improved interpretability. Likewise, Lahuerta et al. [24] introduced a hybrid timescale–PINN framework capable of identifying electrical equivalent impedance parameters directly from measured voltage and current waveforms.
Furthermore, emerging work has begun exploring PINN-assisted inverter and converter control strategies, highlighting the potential of physics-informed learning to improve robustness, interpretability, and generalization in power electronic systems. Recent studies have incorporated physical conservation laws, battery state-of-charge constraints, and energy-management dynamics into PINN-based optimization frameworks for renewable energy systems and distributed energy resources [25,26,27]. Hybrid intelligent converter architectures have also demonstrated improved stability and reduced power losses in photovoltaic microgrids through physics-aware control and adaptive optimization [28]. In addition, Kazemi Naeini et al. [29] investigated the integration of PINNs with digital twins and blockchain-enabled smart energy systems, emphasizing the growing relevance of physics-informed methodologies in intelligent and decentralized energy infrastructures.
Nevertheless, most existing PINN applications in power systems remain focused on offline analysis, surrogate modelling, parameter estimation, or optimization tasks rather than real-time closed-loop control of grid-forming inverters operating under highly dynamic microgrid conditions. Existing PINN-based inverter studies primarily focus on offline system identification, converter modelling, or supervisory optimization, whereas comparatively limited work has investigated adaptive real-time inverter control integrating swing dynamics, Kirchhoff-based electrical constraints, stability-aware objectives, and embedded hardware validation within a unified architecture.
Although recent PINN-related studies have demonstrated promising capabilities in power-system analysis, converter modelling, and intelligent energy management, practical deployment challenges remain significant in inverter-dominated microgrids. In particular, maintaining stable voltage–frequency regulation under renewable intermittency, weak-grid dynamics, and rapidly varying load conditions requires control frameworks capable of combining physical consistency, adaptive behavior, and low-latency real-time execution. Existing methods frequently address these objectives independently rather than within a unified deployable control architecture.
Despite these advances, the integration of physics-informed learning with deployable real-time inverter control architectures capable of operating under renewable intermittency and weak-grid dynamics remains insufficiently explored.
Addressing these limitations requires inverter control frameworks that combine physical consistency, adaptive learning capability, and real-time deployability within a unified architecture. This paper therefore proposes a physics-informed neural-network-based framework for real-time grid-forming inverter control in weak-grid and islanded microgrids. The proposed approach integrates electrical network physics, stability constraints, adaptive voltage–frequency regulation, and hardware-in-the-loop deployment within a unified control architecture. By embedding governing electrical dynamics directly into the learning process, the framework aims to improve control accuracy, interpretability, and generalization under renewable variability and uncertain operating conditions.
The main contributions of this work are summarized as follows:
  • Development of a PINN-based real-time control framework for grid-forming inverters operating under weak-grid and islanded conditions;
  • Integration of swing-equation dynamics, Kirchhoff-based electrical constraints, and stability-aware objectives directly into neural network training and inference;
  • Hardware-in-the-loop validation using an NVIDIA Jetson AGX Xavier embedded platform under renewable variability and dynamic load disturbances;
  • Comparative evaluation against droop control, VSM control, and a purely data-driven neural controller, demonstrating improved transient stability, voltage regulation, and generalization performance.
Extensive simulation and experimental studies were conducted to evaluate the proposed framework under varying load disturbances, renewable intermittency, and weak-grid conditions.
The rest of the paper is organized as follows, Section 2 presents a comprehensive literature review highlighting the state-of-the-art in inverter control methods and physics-informed neural network applications. Section 3 formulates the system model and problem statement. Section 4 details the proposed PINN-based control framework, while Section 5 describes the simulation and experimental validation setup. The results and discussion are provided in Section 6, followed by societal impact considerations in Section 7. Finally, challenges, future directions, and conclusions are presented in Section 8 and Section 9, respectively.

2. Literature Review

2.1. Grid-Forming Inverter Control Methods

Grid-forming inverter control strategies play an essential role in maintaining voltage and frequency stability in microgrids, particularly in scenarios where the grid connection is weak or entirely absent [30,31]. The most commonly employed method is droop control, characterized by simplicity, decentralized architecture, and inherent plug-and-play functionality. Droop methods regulate voltage and frequency using predefined relationships between active/reactive power outputs and frequency/voltage deviations [32]. However, conventional droop methods may exhibit limited performance under a high penetration of renewable generation and load variability due to their inherently static parameter settings [33].
VSM control strategies have emerged as an alternative, aiming to replicate the dynamic behavior of synchronous generators through inverter interfaces [34,35]. VSM methods improve dynamic response and transient stability in microgrids but often require accurate system modelling and precise parameter tuning, which increases complexity and limits adaptability in dynamic operational scenarios [36]. MPC offers another sophisticated approach, achieving robust performance and explicit consideration of constraints. Nevertheless, MPC’s heavy computational burden, stemming from its iterative optimization process, complicates real-time implementations in resource-constrained environments [37].

2.2. Deep Learning Applications in Power Electronics and Control

The integration of deep learning (DL) into power electronics has gained substantial traction in recent years, primarily driven by its capability to handle system uncertainties, nonlinearities, and varying operational conditions without explicit modelling of the underlying dynamics [38]. Deep reinforcement learning (DRL), for example, has demonstrated effective inverter control performance by learning optimal control policies from interaction with the system environment, offering adaptability and robustness to disturbances and uncertainties [39]. Similarly, supervised neural network approaches have been utilized to improve fault detection, stability assessment, and power flow optimization in modern grid scenarios, enhancing real-time decision-making capability [40,41,42].
Despite these advances, DL methods suffer from critical drawbacks related to interpretability and generalizability. Purely data-driven approaches often require extensive training data to ensure robust performance across varying operational conditions and typically lack physically interpretable mechanisms, thereby limiting their applicability in mission-critical control tasks where safety, reliability, and transparency are paramount [43,44].

2.3. Physics-Informed Neural Networks (PINNs)

Physics-informed neural networks (PINNs) address many of these challenges by explicitly integrating physical principles into the neural network training process [45]. PINNs embed known physical constraints, typically described by partial differential equations (PDEs) or ordinary differential equations (ODEs), directly into the loss function. This structured approach significantly improves model interpretability, robustness, and reduces reliance on extensive datasets [46].
In recent studies, PINNs have demonstrated success in diverse engineering fields, including fluid dynamics [47], structural analysis [48], and thermal modelling [49]. Specifically, in power systems, PINNs have been used effectively for stability analysis, load forecasting, and solving optimal power flow problems, showcasing significant advantages in terms of computational efficiency and model fidelity compared to traditional or purely data-driven approaches [50,51,52,53]. Recent literature has increasingly explored PINN-based formulations for renewable energy systems, power converter modelling, inverter dynamics, and grid stability applications. Existing studies have demonstrated the usefulness of PINNs for tasks such as AC optimal power flow, dynamic state estimation, converter health monitoring, and surrogate modelling of nonlinear electrical systems. In addition, recent survey works have highlighted the growing relevance of physics-informed learning approaches for intelligent control and analysis in inverter-dominated grids.
However, despite this rapid progress, comparatively fewer studies have investigated fully integrated PINN-based frameworks for real-time closed-loop grid-forming inverter control under dynamic operating conditions. Most existing approaches remain focused on offline optimization, predictive analysis, or static system modelling. The integration of swing-equation dynamics, Kirchhoff-based electrical constraints, and stability-aware objectives directly into an adaptive real-time inverter control policy remains an emerging research direction.

2.4. Research Gap and Contribution of This Work

Recent advances in physics-informed machine learning have substantially expanded the application scope of PINNs within power systems and power electronics. Existing studies have explored PINNs for AC optimal power flow, stability assessment, converter diagnostics, parameter estimation, dynamic state reconstruction, and renewable energy forecasting. Moreover, recent review articles have identified growing interest in physics-informed approaches for inverter-dominated grids and intelligent converter control.
Despite these developments, several important research gaps remain. First, many existing PINN implementations in power systems focus primarily on offline analytical tasks rather than real-time closed-loop control applications. Second, prior studies frequently employ PINNs for system approximation or optimization without explicitly integrating electrical network dynamics and stability constraints into adaptive inverter control policies. Third, only limited work has experimentally validated PINN-based inverter control frameworks using hardware-in-the-loop platforms operating under realistic renewable variability and weak-grid conditions.
Accordingly, the contribution of this work is not claimed as the first application of PINNs to power systems or inverter-related problems. Instead, the novelty of the proposed framework lies in the unified integration of swing-equation-based inverter dynamics, Kirchhoff’s voltage and current law constraints, Lyapunov-inspired stability objectives, adaptive voltage–frequency control, and real-time embedded deployment within a single physics-informed deep learning architecture for grid-forming inverter control.
The proposed framework is specifically designed for inverter-dominated microgrids operating under renewable intermittency, load uncertainty, and weak-grid conditions. In contrast to purely data-driven neural controllers, the embedded physical constraints improve interpretability, robustness, and generalization under unseen operating scenarios.
This study therefore contributes to the literature in the following ways:
  • It proposes a real-time PINN-based control architecture for grid-forming inverters that explicitly embed swing equations, Kirchhoff’s laws, and stability constraints into the neural network optimization process.
  • It integrates electrical network physics directly into adaptive voltage–frequency regulation, enabling improved transient response and robustness compared to conventional droop and VSM control methods.
  • It experimentally validates the proposed framework using MATLAB R2023b/Simulink simulations and hardware-in-the-loop implementation on an NVIDIA Jetson AGX Xavier platform.
  • It benchmarks the proposed approach against droop control, VSM control, and a purely data-driven neural network model, demonstrating improved tracking accuracy, reduced harmonic distortion, lower frequency deviation, and strong generalization under unseen operating conditions.
  • It provides additional insight into the role of physics-informed regularization for improving robustness against renewable intermittency, measurement noise, and weak-grid disturbances.
Table 1 summarizes key literature relevant to inverter control and PINNs, clearly illustrating the novelty and contribution of the present study.
As summarized in Table 1, prior studies have demonstrated the effectiveness of PINNs in various power-system-related analytical tasks, including optimal power flow, system approximation, and predictive modelling. However, comparatively limited research has addressed real-time closed-loop control of grid-forming inverters with explicit embedding of electrical and stability constraints combined with embedded hardware validation. The proposed work extends the current state-of-the-art by integrating physics-informed learning directly into adaptive inverter control for real-time microgrid operation.
Although recent studies have demonstrated the potential of PINNs for power-system modelling, optimization, stability assessment, and converter-related applications, comparatively limited work has investigated deployable real-time grid-forming inverter control frameworks integrating embedded physical constraints, stability-aware objectives, and hardware-in-the-loop validation within a unified architecture.
Accordingly, the contribution of this work is not positioned as the first application of PINNs in power systems or inverter-related problems. Instead, the novelty lies in the unified integration of physics-informed learning, adaptive voltage–frequency regulation, embedded electrical constraints, and real-time supervisory inverter control validated through hardware-in-the-loop experimentation.
Existing PINN-based inverter studies primarily emphasize offline modelling, parameter estimation, or optimization-oriented tasks, whereas the proposed framework focuses on low-latency supervisory control execution for grid-forming inverter operation under renewable intermittency and weak-grid conditions.
In addition to conventional droop and VSM strategies, recent studies have explored advanced nonlinear inverter control approaches including sliding-mode control, adaptive backstepping control, robust H∞ control, and nonlinear predictive control methods for improving transient stability and robustness in inverter-dominated microgrids. Although these methods can provide strong dynamic performance, they often require accurate system modelling, parameter tuning, and increased implementation complexity under highly uncertain operating conditions.

3. System Model and Problem Formulation

3.1. System Configuration and Modelling

The system under investigation is a renewable energy dominated microgrid comprising multiple grid-forming inverters, as depicted in Figure 1. These inverters are tasked with autonomously regulating both voltage magnitude and frequency, thereby ensuring system stability and reliability, especially under weak grid or islanded operating conditions. The point of common coupling (PCC) is situated at a low voltage distribution level, specifically 400 V line-to-line RMS, representative of practical deployment scenarios in residential and commercial scale microgrids.

3.1.1. Grid-Forming Inverter Dynamics

The dynamic behavior of the grid-forming inverter nodes is modelled using augmented swing equations that capture their real-time frequency and phase angle evolution. These formulations are adapted from foundational principles in power system dynamics and grid-forming control frameworks [42,43], and have been extended in this study to incorporate virtual inertia and damping mechanisms suitable for physics-informed learning paradigms.
Specifically, the dynamics of the i-th inverter are governed by the following differential equations:
d δ i d t = ω i ω r e f ,
M i d ω i d t = P s e t , i P i D i ω i ω r e f ,
where δ i denotes the instantaneous phase angle, and ω i   represents the angular frequency of the inverter. The reference frequency, ω r e f   , corresponds to the nominal system frequency (e.g., 2π × 50 rad/s). Parameters M i   and D i   represent the virtual inertia and damping coefficients, respectively, and are tunable within the proposed PINN framework. The term P s e t , i indicates the desired active power injection, while P i denotes the actual power output computed from the network model.
To maintain physical consistency and ensure accurate constraint enforcement during learning, the electrical network model used in Equation (3) is derived from classical power flow theory and embedded directly into PINN’s loss formulation. This integration enables the neural controller to generalize well across varying grid conditions while respecting the fundamental physics of inverter-based systems.

3.1.2. Electrical Network Model

The microgrid electrical network obeys Kirchhoff’s voltage and current laws. The voltage dynamics at node i can be expressed using complex power injections:
S i = P i + j Q i = V i k = 1 n γ i k * V K * ,
where S i = P i + j Q i is the complex power injected into node i,   V i and V k are the complex voltages at nodes i and k, respectively, γ i k is the element of the admittance matrix γ connecting nodes i and k, and ∗ denotes the complex conjugate. For each inverter, voltage magnitude ( V i ) and frequency ( ω i ) are the primary controlled variables, following droop-like relationships defined as:
ω i = ω r e f m p , i P i P s e t , i ,
V i = V r e f , i n q , i Q i Q s e t , i ,
where m p , i and n q , i   are droop coefficients for frequency-active power and voltage-reactive power relationships, respectively. The set points V r e f , i and Q s e t , i represent the reference voltage magnitude and reactive power injection at inverter i.

3.1.3. Stability Margin Constraints

Ensuring microgrid stability requires operating within defined stability margins. The constraints are expressed through Lyapunov stability criteria, which ensure that frequency and voltage remain bounded within acceptable ranges:
ω i ω r e f   Δ ω m a x ,
V i V r e f , i   Δ V m a x ,
where Δ ω m a x and Δ V m a x are predefined maximum permissible deviations in frequency and voltage, respectively.

3.2. Problem Formulation

The goal is to achieve optimal real-time control of the grid-forming inverters by dynamically adjusting voltage and frequency set-points in response to varying loads and renewable generation conditions. This optimization aims to minimize deviations in frequency and voltage while adhering strictly to system constraints defined by physical laws and stability margins.
Mathematically, the optimization problem can be formulated as a constrained minimization of the following loss function:
min θ L θ = i = 1 N α ω i ω r e f Δ ω m a x 2 + V i V r e f , i Δ V m a x 2 2 ,
subject to the system dynamics given by Equations (1)–(5), Kirchhoff’s network equations, and constraints:
ω i ω r e f   Δ ω m a x ,         i N ,
V i V r e f , i   Δ V m a x ,               i N .
In Equation (8), the parameters α and β represent weighting coefficients that reflect the importance of frequency and voltage deviations, respectively, and θ denotes the set of neural network parameters used to embed and optimize the control laws.
The proposed PINN approach integrates these mathematical formulations directly into the network’s training and optimization process, resulting in enhanced control accuracy, robustness, and interpretability.

4. Proposed PINN Framework for Grid-Forming Control

This section introduces the detailed architecture of the proposed PINN framework designed explicitly for real-time control of grid forming inverters. The fundamental innovation lies in embedding physical laws directly into the neural network training process, ensuring robust, interpretable, and computationally efficient control decisions.
Unlike purely data-driven neural controllers, the proposed PINN framework embeds physical system dynamics directly into the optimization process through governing electrical equations and stability-aware constraints. Consequently, the neural network does not merely approximate control actions from data, but instead learns admissible operating trajectories constrained by inverter dynamics, electrical network consistency, and bounded stability behavior. This section presents both the architectural formulation and analytical interpretation of the proposed physics-informed control strategy.
Conventional neural-network-based inverter controllers typically operate as purely data-driven mapping functions between measured electrical states and control actions. Although such approaches can achieve adaptive behaviors, they often lack physical interpretability, stability awareness, and robustness under unseen operating conditions. To address these limitations, the proposed framework incorporates governing electrical dynamics and stability constraints directly into the neural-network optimization process, as illustrated in Figure 2.
Compared with conventional neural-network inverter controllers, which primarily rely on purely data-driven black-box mappings, the proposed PINN framework integrates governing physical laws directly into the optimization process. This physics-informed formulation improves interpretability, constrains the learning process toward physically admissible operating trajectories, and enhances robustness under unseen operating conditions relative to unconstrained neural-network approaches.

4.1. Overview of PINN Architecture

The proposed PINN architecture extends conventional neural-network inverter control by embedding swing-equation dynamics, Kirchhoff-based electrical constraints, and stability-aware objectives directly into the neural-network optimization process. Consequently, the framework combines adaptive learning capability with physically constrained supervisory inverter control, as illustrated in Figure 3.
The neural network receives real-time measurements of active and reactive power ( P i , Q i ), together with inverter state variables including frequency and voltage magnitude, as input features. The controller then generates adaptive droop references ( m p , i , n q , i ) and voltage–frequency setpoints ( V r e f , i , ω r e f ), used for supervisory grid-forming inverter regulation.
In contrast to purely data-driven neural controllers, the proposed framework incorporates governing electrical dynamics directly into the learning process through embedded physical constraints and stability-aware regularization mechanisms.
The proposed PINN controller operates at the supervisory grid-forming control layer and is responsible for adaptive voltage–frequency reference generation rather than direct PWM switching control.

4.2. Physics-Based Constraints and Loss Functions

The PINNs employ a specialized loss function that incorporates both data-driven learning objectives and physics-informed constraints. The total loss function, denoted by L P I N N , comprises three main components: a data-fitting loss ( L d a t a ), a physics-informed loss ( L p h y s i c s ), and a regularization loss ( L r e g ).
The comprehensive loss function can be expressed as:
L P I N N θ = L d a t a θ + γ L p h y s i c s θ + γ L r e g θ ,
where γ and λ are hyperparameters controlling the balance between data-driven learning and physics constraints, and θ represents the neural network parameters.
The composite loss function in Equation (11) can be interpreted as a constrained optimization objective balancing empirical performance objectives and physical consistency requirements. The data-driven component minimizes tracking error between predicted and measured inverter states, while the physics-informed component penalizes violations of governing electrical dynamics and network constraints.
From an optimization perspective, the embedded physical constraints reduce the feasible solution space explored during training, thereby regularizing the learning process toward physically admissible operating trajectories. This improves the generalization capability and reduces the likelihood of unstable or nonphysical control actions under unseen operating conditions.

4.2.1. Data-Fitting Loss ( L data )

The data-fitting loss ensures that the neural network predictions closely match the actual measured outputs from the microgrid:
L d a t a θ = 1 N i = 1 N ( ω ^ i   ω i ) 2 + ( V ^ i   V i ) 2 ,
where ω ^ i   and V ^ i   are the predicted frequency and voltage magnitudes, while ω i and V i are the measured frequency and voltage magnitudes, respectively.

4.2.2. Physics-Informed Loss ( L p h y s i c s )

The physics-informed loss incorporates the governing physical equations-swing equations and Kirchhoff’s laws explicitly into the neural network’s training process, penalizing deviations from physically valid solutions:
L p h y s i c s θ = 1 N i = 1 N d δ ^ i   d t ( ω ^ i   ω r e f ) 2 + M i d ω ^ i   d t P s e t , i P i D i ω ^ i   ω r e f 2 .

4.2.3. Regularization Loss ( L reg )

A regularization term prevents overfitting, ensuring the generalization of the trained model:
L r e g θ = θ 2 2 .
The embedded physical constraints serve not only as prior knowledge but also as regularization mechanisms that reduce the feasible solution space explored during neural network optimization. By enforcing swing-equation dynamics, Kirchhoff-based network consistency, and bounded operating conditions directly within the loss formulation, the PINN framework constrains the learned control policy toward physically realizable operating trajectories. This improves generalization and reduces the likelihood of unstable or nonphysical control actions under unseen operating conditions.
Unlike purely data-driven neural controllers, the proposed PINN framework incorporates physically meaningful governing equations directly into the optimization process. Consequently, the learned control behavior remains partially interpretable through its explicit dependence on swing dynamics, Kirchhoff-based electrical relationships, and stability-aware operating constraints. This embedded physical structure improves transparency relative to unconstrained black-box neural-network approaches.
The embedded swing-equation constraints introduce virtual inertial behavior into the learned control policy, while Kirchhoff-based network constraints enforce electrical consistency between inverter outputs and network operating conditions. Together, these terms act as physics-informed regularizers that constrain neural-network predictions toward dynamically feasible operating regions.
In contrast to unconstrained neural controllers, the proposed formulation incorporates prior knowledge regarding inverter dynamics and grid interactions directly into the optimization objective, thereby improving transparency and reducing dependence on purely empirical correlations.

4.3. PINN Training Methodology

The PINN is trained by minimizing the total loss function (Equation (11)) using gradient-based optimization techniques (e.g., Adam optimizer). A sequential optimization algorithm updates network parameters iteratively, ensuring convergence to an optimal solution satisfying both empirical data and embedded physics. The training algorithm is summarized in Algorithm 1.
Algorithm 1 PINN Training Algorithm for Grid-Forming Inverter Control
1: Initialize neural network parameters θ, hyperparameters γ, λ
2: Set training epochs E and batch size B
3: for epoch = 1 to E do
4: for each batch b of size B do
5: Measure real-time microgrid data (Pi, Qi, ωi, Vi)
6: Forward propagate inputs through neural network
7: Compute predictions ( ω ^ i ,   V ^ i )
8: Compute L d a t a , L p h y s i c s , L r e g
9: Calculate total loss L P I N N via Equation (11)
10: Compute gradients θ L P I N N
11: Update parameters θ θ η   θ L P I N N                                 ▷ η: learning rate
12: end for
13: end for
14: Output optimized parameters θ

4.4. Real-Time Deployment of PINN Control

Upon the completion of training, the optimized PINN directly computes real-time inverter control signals, providing frequency and voltage setpoints based on instantaneous grid conditions. The rapid inference capability of the PINN ensures real-time responsiveness, robustness, and improved stability compared to conventional methods.
The advantages of the proposed framework include:
  • Explicit incorporation of electrical laws and stability constraints,
  • Enhanced interpretability and robustness under varying load and generation conditions,
  • Real-time computational feasibility due to efficient neural network inference.
It is important to distinguish between the offline training phase and the online deployment phase of the proposed PINN framework. The computationally intensive training process is performed offline prior to deployment using historical and simulated microgrid operating datasets. During this stage, neural network parameters are optimized through iterative gradient-based learning to satisfy both empirical performance objectives and embedded physical constraints. Once training converges, the optimized network weights are exported and stored locally on the embedded controller platform.
During online operation, the deployed controller performs only forward-pass inference to generate voltage and frequency control signals in real-time. No online retraining or weight adaptation was performed in the present implementation. Therefore, the term “real-time control” in this work specifically refers to the low-latency execution of inference-based control actions under operational microgrid conditions.

4.5. Closed-Loop Stability Interpretation

Although the proposed framework does not derive formal global asymptotic stability proof for the nonlinear inverter-microgrid system, the PINN architecture incorporates stability-aware physical constraints designed to promote bounded closed-loop behavior during operation.
Specifically, the embedded swing-equation dynamics and Kirchhoff-based electrical constraints regularize the neural network outputs toward physically admissible operating regions. In addition, the loss function includes stability-related penalty terms that constrain frequency and voltage deviations within predefined operational limits. These constraints can be interpreted as Lyapunov-inspired regularization mechanisms that penalize trajectories associated with unstable operating conditions.
While a rigorous proof of global stability remains outside the scope of the present study, the bounded frequency and voltage responses observed during simulation and hardware-in-the-loop validation provide empirical evidence of stable closed-loop operation under varying disturbances, renewable intermittency, and weak-grid conditions.

4.6. Communication and Deployment Architecture

The proposed PINN-based framework is designed as a decentralized supervisory control architecture in which each distributed generator (DG) primarily utilizes locally measured electrical variables, including inverter voltage, frequency, active power, and reactive power states.
The control framework does not require continuous high-bandwidth communication exchange among DG units during primary control execution. Instead, coordination among DGs emerges through electrical coupling within the microgrid network and adaptive reference generation governed by the embedded physical constraints of the PINN model.
During hardware-in-the-loop implementation, limited communication is utilized for supervisory monitoring, data acquisition, and synchronization purposes between the embedded controller and simulation platform. However, the real-time control inference process itself remains locally executable and does not depend on centralized communication infrastructure.
This decentralized structure reduces communication dependency, improves scalability, and enhances resilience against communication delays or packet-loss conditions in practical microgrid environments.

4.7. Stability Interpretation of the Proposed PINN Framework

The proposed PINN-based controller incorporates embedded physical constraints intended to promote stable and physically admissible inverter operation under varying microgrid conditions. Unlike purely data-driven neural controllers, the proposed framework integrates swing-equation dynamics, electrical network consistency, and bounded operating constraints directly into the optimization process.
These embedded physical relationships act as stability-aware regularization mechanisms during training. By penalizing violations of inverter dynamics and electrical consistency, the controller is guided toward operating trajectories associated with reduced voltage and frequency deviations during transient disturbances.
Furthermore, the adaptive reference generation mechanism avoids abrupt control actions by producing smooth voltage–frequency trajectories constrained by the learned physical behavior of the microgrid system. This contributes to improved damping characteristics and reduced oscillatory behavior under renewable intermittency and load variations.
The simulation and hardware-in-the-loop results presented in Section 6 demonstrate that the proposed framework maintains bounded voltage and frequency responses under multiple operating scenarios, including weak-grid conditions, renewable fluctuations, and dynamic load disturbances. These observations provide empirical evidence that the embedded physical constraints improve the closed-loop operational stability of the inverter system within the investigated operating range.
It should be noted that the present work focused primarily on physics-informed supervisory inverter control and experimental validation rather than deriving a formal global nonlinear stability proof. Establishing rigorous large-signal stability guarantees for arbitrary microgrid topologies and operating conditions remains an important direction for future work.
Primary-level inverter control in weak-grid and inverter-dominated microgrids is inherently sensitive to parameter uncertainty, renewable intermittency, and dynamic coupling among distributed generators. Conventional droop-based controllers typically rely on fixed gain relationships that may exhibit degraded transient performance or oscillatory behavior under highly varying operating conditions.
In contrast, the proposed PINN framework incorporates embedded physical constraints and adaptive reference generation mechanisms that guide the controller toward physically admissible operating trajectories. By integrating swing-equation dynamics, electrical network consistency, and stability-aware objectives into the learning process, the controller exhibits smoother transient behavior and reduced voltage–frequency excursions during disturbances.
Therefore, the proposed method should not be interpreted as guaranteeing perfect stability under all operating scenarios. Rather, the framework is designed to improve the operational stability and robustness of primary-level grid-forming inverter control within the tested operating envelope.

5. Simulation and Experimental Validation

To comprehensively evaluate the effectiveness and practicality of the proposed PINN-based inverter control method, a detailed validation process was undertaken, including extensive simulation studies followed by hardware-in-the-loop (HIL) experiments. The validations aimed to rigorously demonstrate the advantages of the proposed control framework in terms of real-time responsiveness, robustness under varying operational conditions, and overall performance improvements compared to conventional control strategies.

5.1. Simulation Setup

A microgrid simulation environment was developed in MATLAB/Simulink incorporating multiple grid-forming inverters interfaced with distributed renewable energy sources (solar PV and wind generators). The system configuration replicates realistic weak grid conditions typically observed in remote or islanded microgrid applications. Simulation parameters and conditions are summarized in Table 2.

5.2. Simulated Operational Scenarios

To comprehensively evaluate the robustness, adaptability, and generalization capability of the proposed PINN-based inverter control framework, a diverse set of operational scenarios was simulated. These scenarios are representative of real-world disturbances and variability commonly encountered in microgrids with high renewable penetration:
  • Normal Operation: Baseline steady-state conditions with minor active and reactive load fluctuations to evaluate nominal performance and stability.
  • Load Disturbance Scenario: Abrupt step changes in both active and reactive power demands (±50%), emulating sudden load switching events and assessing dynamic tracking capabilities.
  • Weak-Grid Conditions: Scenarios characterized by high source impedance and low short circuit ratios, simulating degraded grid strength and evaluating the system’s ability to maintain voltage and frequency stability.
  • Renewable Variability: Time-varying solar and wind generation profiles with high volatility, capturing the stochastic nature of distributed renewable energy sources.
The input datasets used for both simulation and hardware-in-the-loop (HIL) validation were derived from empirical measurements. Active and reactive power disturbances included both step-type (±50%) and sinusoidal modulations. Renewable energy profiles were sampled from the National Renewable Energy Laboratory (NREL) datasets. The solar irradiance profile ranged from 0 to 1000 W/m2, while wind speeds varied between 2.5 m/s and 14 m/s, thereby encompassing realistic diurnal and stochastic fluctuations. This range ensures that the controller is rigorously tested under diverse and practical grid conditions.

5.3. Hardware-in-the-Loop (HIL) Experimental Setup

A real-time HIL experimental testbed, comprising a real-time digital simulator (RTDS) and digital controller hardware, was established to emulate realistic microgrid operation. The RTDS emulated grid conditions, inverter models, and renewable source characteristics, interfacing directly with an embedded digital controller deploying the proposed PINN control algorithm. Control algorithms were implemented using a Python-based neural inference model executed on an NVIDIA Jetson embedded computing platform to reflect realistic computational capabilities of the inverter controller.
The experimental setup details are summarized as follows:
  • Real-Time Simulator: RTDS NovaCor system.
  • Embedded Controller: NVIDIA Jetson AGX Xavier.
  • Communication Interface: Ethernet (UDP) for low-latency communication.
  • Sampling and Control Interval: 100 µs real-time cycle.
It should be noted that the proposed PINN controller is deployed as a supervisory grid-forming control layer that generates voltage and frequency reference signals. It is not executed at the PWM switching frequency. For a 20 kHz switching frequency, the switching period is 50 μs, which is shorter than the measured average PINN inference latency of approximately 0.7 ms. Therefore, the proposed method is not intended to compute control actions within a single switching cycle. Instead, the PINN updates higher-level voltage and frequency references, while inner voltage/current regulation and PWM generation are performed by conventional fast control loops.

5.4. Validation Metrics

Key performance metrics were defined to evaluate the effectiveness and robustness of the proposed control method:
  • Frequency Stability: Frequency deviation magnitude and settling time post-disturbance.
  • Voltage Stability: Maximum voltage deviations and settling time under transient conditions.
  • Computational Efficiency: Real-time execution latency and computational load.
  • Robustness Index: Performance consistency under varying load and renewable input scenarios.
The validation metrics such as frequency deviation, voltage fluctuation, and settling time followed IEEE Std 1547.4-2011 and IEC 62116 guidelines for microgrid inverter performance assessment. Computational latency and harmonic distortion (THD) were benchmarked against real-time constraints for inverter control (sub-1 ms) and power quality thresholds (THD < 5%) as specified in IEEE 519.

5.5. Comparative Methods

The performance of the proposed PINN-based control was rigorously compared against two widely adopted conventional inverter control methodologies:
  • Traditional droop control.
  • Virtual synchronous machine (VSM)-based control.
The PINN model consists of a fully connected architecture with four hidden layers of 64 neurons each, totaling approximately 27,000 trainable parameters. The training process was conducted offline using an NVIDIA RTX 3090 GPU workstation. Training required approximately 4000 epochs and a total execution time of approximately 52 min to achieve convergence of both the data-driven and physics-informed loss components.
Following offline optimization, the trained network parameters were exported and deployed onto the NVIDIA Jetson AGX Xavier embedded controller for online inference execution. During online operation, only forward-pass inference was performed, without online retraining or adaptive parameter updates. The average online inference latency measured during hardware-in-the-loop testing was approximately 0.7 ms, satisfying real-time inverter control requirements.
To provide a fair comparison with the proposed PINN framework, a purely data-driven neural-network baseline was implemented using the same fully connected architecture as the PINN model, consisting of four hidden layers with 64 neurons per layer and approximately 27,000 trainable parameters. Unlike the PINN framework, the baseline model did not incorporate any embedded physical constraints or governing equations within the loss function.
The data-driven model was trained using identical training and validation datasets, optimizer settings, learning rate schedules, and batch sizes as the proposed PINN framework. Training was conducted offline using supervised learning based solely on measured inverter input–output data, minimizing prediction error without physics-informed regularization.
Both models were evaluated under identical load disturbances, renewable variability conditions, and weak-grid operating scenarios to ensure consistent benchmarking conditions.

5.6. Experimental Results and Discussions

Simulations and experimental results demonstrated clear advantages of the proposed PINN-based framework. Under sudden load disturbances, the PINN-based approach showed significantly reduced frequency and voltage deviations compared to traditional droop and VSM methods, demonstrating its enhanced robustness. Additionally, real-time execution latency consistently remained below 1 ms, confirming the suitability of the proposed method for practical inverter deployments.
Quantitative and comparative performance results are extensively presented and analyzed in Section 6.
The proposed PINN framework operates as a supervisory grid-forming primary control layer responsible for adaptive voltage and frequency reference generation. Inner voltage/current control loops and PWM switching regulation remain implemented using conventional fast inverter control mechanisms. Consequently, the proposed method enhances primary-level dynamic regulation and stability performance without replacing the underlying high-frequency converter control structure.
The framework is therefore distinct from secondary microgrid control strategies, which typically focus on slower-timescale frequency restoration, voltage restoration, or economic dispatch coordination across distributed generators.
Droop control and VSM strategies were selected as benchmark controllers because they remain widely adopted reference methods in grid-forming inverter research and practical microgrid implementation. These controllers provide established baseline performance characteristics for evaluating transient response, voltage–frequency regulation, and deployment feasibility under weak-grid conditions.
Although recent nonlinear and adaptive inverter control strategies may provide additional performance advantages under certain operating scenarios, the present work primarily focused on demonstrating the feasibility and operational behavior of the proposed PINN-based supervisory control framework relative to commonly deployed benchmark approaches.
In summary, the rigorous simulation and HIL validations reinforce the effectiveness and feasibility of the proposed PINN control approach, clearly demonstrating its potential for real-world applications in microgrids with weak grid support or islanded operations.

6. Results and Discussion

This section presents a comprehensive evaluation of the proposed PINN-based control approach, discussing simulation and experimental results. The comparative analysis against traditional droop and VSM control highlights critical advantages in terms of frequency stability, voltage regulation, computational efficiency, and robustness under diverse operational conditions.

6.1. Frequency Stability Analysis

To evaluate the dynamic performance and robustness of the proposed control framework, frequency response under a sudden 50% load step increase was examined. The results presented in Figure 4 illustrate the transient behavior of three control strategies: the proposed PINN-based controller, conventional droop control, and VSM control.
As shown in Figure 4, the PINN-based controller exhibited significantly improved transient frequency regulation compared to the baseline methods. The maximum frequency deviation observed with the proposed controller was approximately 0.12 Hz, which was notably lower than that of droop control (0.35 Hz) and VSM control (0.20 Hz). Moreover, the settling time required for frequency restoration was less than 2 s in the PINN case, in contrast to 4.5 s and 3 s for the droop and VSM methods, respectively. These results underscore the advantages of embedding physical dynamics, such as the swing equation and system inertia, into the neural network’s training process. By enforcing these constraints during model optimization, the PINN framework achieves not only faster response times but also reduced deviation magnitudes, ensuring stable operation even under severe load perturbations. The findings highlight the potential of physics-informed learning for high performance real-time control in inverter-dominated microgrids.

6.2. Voltage Regulation Performance

Voltage regulation under dynamic and uncertain operating conditions is a critical aspect of maintaining microgrid reliability, particularly during abrupt reactive power fluctuations and renewable generation variability. Figure 5 presents the voltage magnitude trajectories at the point of common coupling (PCC) in response to a sudden reactive power step disturbance.
As evident from Figure 5, the proposed PINN-based controller demonstrated superior voltage regulation capabilities compared to both the droop and VSM controllers. The maximum voltage deviation recorded for the PINN controller remained below 0.02 pu, while the droop and VSM methods exhibited larger deviations of 0.06 pu and 0.04 pu, respectively. Furthermore, the voltage recovery time was significantly reduced in the PINN case, with stabilization occurring within approximately 1.5 s, in contrast to 3 s for droop control and 2.5 s for VSM. This performance enhancement is primarily attributed to the incorporation of Kirchhoff’s voltage law and voltage stability constraints into the neural network’s loss function. By enforcing physically consistent relationships during training, the PINN framework ensures that voltage regulation remains accurate, bounded, and resilient across a wide range of operating scenarios. These findings confirm the potential of physics-informed control strategies in enhancing voltage stability in inverter-based microgrids.

6.3. Computational Efficiency and Real-Time Feasibility

In real-world deployment of inverter-based control strategies, computational efficiency and real-time responsiveness are critical performance metrics. Especially in microgrid applications with high variability and low inertia, control algorithms must deliver reliable decisions within strict temporal constraints. Table 3 presents a comparative summary of the average computational latency recorded for each control strategy during HIL testing.
It should be noted that the latency values reported in Table 3 represent measured end-to-end embedded execution latency during hardware-in-the-loop operation rather than isolated controller computation time alone. The reported measurements include signal acquisition, communication overhead, scheduling delays, preprocessing, and control signal generation executed on the embedded controller platform.
Consequently, the values should be interpreted as practical deployment-oriented latency measurements under identical implementation conditions rather than direct comparisons of theoretical computational complexity between control laws.
Classical droop control inherently possesses lower algorithmic complexity due to its algebraic structure; however, the present comparison focuses on practical embedded execution behavior under identical HIL deployment conditions.
As shown in Table 3, the proposed PINN-based control framework achieves real-time feasibility with an average computation latency of 0.7 ms, which remains well below the typical 1 ms threshold adopted for high-speed inverter control applications. Although marginally higher than the latency observed in conventional droop (0.1 ms) and VSM (0.3 ms) methods, this latency is considered acceptable given the enhanced control accuracy and robustness achieved through the integration of physics-based constraints. These results affirm the practicality of deploying the PINN controller on embedded platforms for real-time control. The slight increase in computational load is offset by the superior stability and adaptability benefits, positioning the proposed method as a viable and scalable solution for intelligent control of grid-forming inverters in modern microgrids.
In this work, real-time applicability refers specifically to the online inference-stage execution of the trained controller. The measured average inference latency of approximately 0.7 ms during hardware-in-the-loop testing satisfies typical timing constraints for inverter control applications, thereby demonstrating practical feasibility for real-time deployment.

6.4. Robustness Under Renewable Generation Variability

To evaluate the resilience of the proposed control strategy under stochastic operating conditions, the controllers were subjected to highly variable renewable generation profiles, including rapid fluctuations in solar irradiance and wind speed. Figure 6 illustrates the corresponding frequency and voltage responses for the three evaluated methods.
As observed in Figure 6, the proposed PINN-based controller consistently outperformed the conventional droop and VSM strategies in mitigating the effects of renewable intermittency. The frequency deviations remained bounded within ±0.1 Hz, while voltage magnitude deviations were confined to within ±0.02 pu. In contrast, droop and VSM controllers exhibited more pronounced fluctuations, with frequency deviations exceeding ±0.25 Hz and voltage deviations reaching up to ±0.05 pu. These findings underscore the enhanced generalization capability of the PINN framework, which leverages embedded physical constraints, such as Kirchhoff’s laws and swing dynamics, to ensure consistent control behavior across a broad spectrum of uncertain operating conditions. Unlike conventional or purely data-driven methods, the physics-informed architecture enables the controller to maintain stable operation even in the presence of unmodeled dynamics and rapid renewable output variations. This robustness makes the proposed approach particularly well-suited for next-generation microgrids characterized by the high penetration of variable renewable energy sources.
The robustness claims in this study are supported empirically through evaluation under multiple operating scenarios, including renewable intermittency, weak-grid dynamics, measurement noise, and unseen load conditions. While formal robustness guarantees are not derived, the observed bounded responses and consistent performance across these scenarios indicate improved operational resilience relative to the benchmark controllers considered.

6.5. Loss Function Convergence During Training

Figure 7 illustrates the convergence behavior of the composite loss function LPINN during the offline training phase. It is evident that the data-driven loss L d a t a and the physics-informed loss L p h y s i c s exhibit exponential decay, indicating successful assimilation of both empirical observations and governing dynamics. The regularization term L r e g remains constant throughout, ensuring parameter sparsity and guarding against overfitting. The smooth and monotonic convergence of the total loss function confirms the model’s stability and training efficacy. These results validate the dual-role objective of the PINN framework: to remain physically consistent while maintaining data fidelity.

6.6. Control Signal Adaptation Under Dynamic Conditions

Figure 8 illustrates the real-time voltage and frequency reference trajectories generated by the trained PINN controller during dynamically varying operating conditions. Specifically, the figure presents the adaptive reference signals V r e f t and ω r e f t produced by the controller in response to changing load demand and renewable generation variability.
Unlike conventional droop-based controllers that rely on fixed gain relationships between power deviations and control actions, the proposed PINN framework dynamically adjusts voltage and frequency references based on learned system behavior constrained by embedded physical laws. Consequently, the generated trajectories vary continuously according to the evolving operating state of the microgrid.
The smoothness and bounded nature of the reference trajectories indicate that the controller avoids abrupt control actions while maintaining stable operating behavior during transient disturbances. In particular, the damping of oscillatory behavior observed in the trajectories reflects the influence of the embedded swing-equation dynamics and stability-aware loss constraints incorporated into the PINN training process.
Therefore, Figure 8 demonstrates the adaptive nature of the proposed controller and illustrates how physics-informed learning enables context-aware real-time adjustment of inverter control references under uncertain operating conditions.
The proposed PINN framework is designed to balance transient response performance with stability-aware operation, bounded control behavior, and robustness under uncertain operating conditions. Consequently, the controller does not necessarily target minimum possible settling time compared with aggressively tuned nonlinear controllers optimized specifically for fast transient regulation.
Instead, the proposed approach prioritizes smooth adaptive voltage–frequency regulation, reduced oscillatory behavior, and stable operation under renewable intermittency and weak-grid conditions. The resulting transient response therefore reflects a trade-off between dynamic speed, robustness, and physics-consistent control behavior.
It should also be noted that the proposed framework operates at the supervisory grid-forming control layer rather than at the inner high-bandwidth current-control level, where substantially faster transient dynamics are typically enforced.

6.7. Stability Margin and Dynamic Response Comparison

Figure 9 presents a comparative evaluation of the stability performance of the droop, VSM, and proposed PINN-based control strategies using three important dynamic metrics: maximum frequency deviation, maximum voltage deviation, and settling time. The results clearly demonstrate the superior transient stability characteristics achieved by the proposed physics-informed control framework.
Among the evaluated approaches, the PINN controller exhibits the smallest frequency and voltage deviations following system disturbances, indicating improved regulation accuracy and enhanced disturbance rejection capability. In addition, the settling time achieved by the PINN framework is significantly shorter than that of the droop and VSM controllers, demonstrating faster recovery toward steady-state operating conditions.
The improved performance is primarily attributed to the incorporation of embedded physical constraints within the neural-network optimization process. By integrating swing-equation dynamics, electrical network consistency, and stability-aware objectives directly into the learning architecture, the PINN controller is guided toward physically admissible operating trajectories with reduced oscillatory behavior and improved damping characteristics.
Compared with conventional droop and VSM methods, the proposed framework therefore provides enhanced dynamic stability, improved transient response, and greater robustness under varying microgrid operating conditions. These findings further validate the effectiveness of physics-informed learning for supervisory real-time inverter control in renewable-energy-dominated microgrids.

6.8. Real-Time Inference Latency Distribution

Figure 10 presents the distribution of inference latency for the PINN controller over 1000 execution cycles. The results indicate that over 95% of inference operations are completed within 0.7 ms, with minimal variance. This confirms that despite its hybrid architecture and embedded physics, the PINN model remains computationally efficient, meeting the real-time control constraints typically required for inverter operation (sub-1 ms range). The narrow distribution highlights both the robustness and predictability of the controller’s computational performance, enabling reliable deployment on embedded or edge computing platforms.

6.9. Robustness to Measurement Noise

Figure 11 evaluates the robustness of the three control methods under increasing levels of measurement noise. The PINN-based controller exhibited superior resilience, maintaining frequency deviation within acceptable bounds across all noise levels. In contrast, both droop and VSM controls showed steeper degradation, particularly under higher noise intensities. This robustness is attributed to the embedded physical priors within the PINN, which regularize the model’s response to spurious or perturbed measurements. The findings emphasize that PINNs are not only accurate under ideal conditions but also fault-tolerant under real-world imperfections.

6.10. Power Quality Enhancement Through PINN-Based Control

Figure 12 illustrates the comparative performance of droop control, VSM control, and the proposed PINN controller with respect to key power quality indicators: THD and power factor. These metrics are vital for assessing waveform purity and efficient energy transfer in inverter-based microgrids. The PINN-based approach demonstrated marked superiority, achieving the lowest THD at 2.1% and the highest power factor at 0.98. This reflects the controller’s ability to enforce sinusoidal output profiles and adaptively suppress harmonic components, attributable to its embedded knowledge of system dynamics and constraints. In contrast, the droop-based method exhibited significant harmonic distortion (4.8%) and suboptimal power factor (0.92), symptomatic of its fixed-gain, open loop structure and inability to actively correct waveform deviations. The VSM controller yielded moderate performance improvements over droop but still fell short of the precision and adaptability offered by the PINN framework. These findings emphasize the practical relevance of integrating physical laws into neural architectures, enabling control systems that not only stabilize voltage and frequency but also uphold stringent power quality standards, an essential requirement in sensitive industrial loads, renewable-heavy microgrids, and smart residential networks.

6.11. Nonlinear State Trajectories: Phase Portrait Analysis

Figure 13 illustrates the nonlinear dynamic behavior of inverter control strategies using phase portraits. The graph plots the frequency deviation ω against the phase angle δ under droop and PINN-based control. The droop controller showed larger amplitude swings, indicating higher sensitivity and reduced damping near equilibrium. In contrast, the PINN controller demonstrated smaller oscillatory excursions and a smoother convergence path, reflective of a better-damped and more stable closed-loop system. This behavior is a direct consequence of embedding swing dynamics and virtual inertia constraints into the learning process, allowing the PINN to internalize system nonlinearities more effectively than conventional approaches.

6.12. Tracking Performance Evaluation

Figure 14 illustrates the dynamic tracking performance of both the traditional droop control and the proposed PINN-based control against a continuously varying power reference signal P r e f (t). The reference trajectory exhibited moderate sinusoidal fluctuations intended to emulate varying load demands or setpoint changes. The droop control method showed a visibly lagging and noisy response, with larger deviations from the reference. This behavior stems from the limited adaptivity of its fixed-gain structure. In contrast, the PINN-based controller followed the reference trajectory with remarkable fidelity, exhibiting both low tracking error and rapid response time. The reduced deviation highlights the model’s capacity to learn nonlinear dynamic relationships and embed them into a real-time inferential control policy. This result demonstrates that the physics-informed framework enables the controller to generate context-aware reference adjustments that minimize steady-state and transient errors in the face of changing operating conditions.

6.13. Generalization Capability Under Unseen Conditions

Figure 15 presents a comparative analysis of the prediction error of the PINN-based controller when subjected to in-distribution versus out-of-distribution (OOD) test scenarios. The in-distribution dataset comprises operating points seen during training, while the OOD dataset introduces unseen grid topologies, variable renewable injection patterns, and stochastic load profiles. The boxplot clearly shows that the PINN controller maintained low variance and minimal prediction error (mean ≈ 0.02 pu) under in-distribution conditions. More notably, the error under OOD conditions, while slightly elevated (mean ≈ 0.045 pu), remained bounded and did not exhibit outliers or extreme variance. This indicates that the inclusion of physics-informed constraints within the learning process significantly improves the model’s ability to generalize across operating regimes. Such generalization is crucial for real-world deployment in microgrids, where models are often exposed to operational scenarios beyond the training distribution.

6.14. Comparison with Pure Data-Driven Model

To quantify the benefits of embedding physics into the learning framework, we developed a baseline model using a fully data-driven neural network with an identical architecture (same number of layers and parameters) but without physical constraints. This model was trained solely on inverter input–output measurements.
Figure 16 illustrates the frequency and voltage deviation metrics under standard test scenarios. The data-driven model exhibited larger transient excursions and slower recovery times. Specifically, the average frequency deviation was 0.24 Hz (vs. 0.12 Hz for PINN), and the voltage deviation exceeded 0.04 pu (vs. <0.02 pu for PINN). Additionally, under unseen load profiles, the data-driven model suffered from poor generalization with a prediction error exceeding 0.07 pu. These findings confirm that embedding governing equations significantly enhances robustness, accuracy, and generalizability, demonstrating the superiority of physics-informed learning for real-time inverter control.

6.15. Discussion of Findings and Practical Implications

The comprehensive results presented across frequency stability, voltage regulation, tracking accuracy, and power quality reveal the pronounced advantages of the proposed PINN framework over conventional control strategies such as droop and VSM control. By embedding first principles constraints, including swing equations, Kirchhoff’s laws, and stability margins directly into the learning architecture, the PINN controller achieved superior dynamic response, enhanced generalization to unseen operating scenarios, and real-time computational feasibility.
These capabilities are particularly critical for inverter-dominated microgrids, especially those operating in remote or islanded configurations where conventional synchronous generation is unavailable. In such contexts, the proposed framework significantly augments microgrid resilience, facilitates the seamless integration of variable renewable energy sources, and supports the transition toward autonomous, carbon-neutral energy systems.
Nevertheless, the framework’s reliance on an initial offline training phase introduces challenges in terms of adaptability and maintenance. While the current model generalizes well across moderate variations in system conditions, substantial shifts, such as topological reconfigurations or hardware replacements, may necessitate retraining. This presents an opportunity for future work to explore adaptive or continual learning paradigms, meta-learning enhancements, and scalable implementations compatible with large-scale distributed energy systems.
A limitation of the current framework is its reliance on offline training prior to deployment. Although the proposed controller demonstrated strong generalization under varying operating conditions, substantial changes in grid topology, inverter parameters, or operating regimes may require periodic retraining to maintain optimal performance. Consequently, the present implementation should be interpreted as a real-time inference-based control framework rather than a fully adaptive online learning controller.
The present study primarily benchmarks the proposed framework against conventional droop control, VSM control, and a purely data-driven neural-network controller. Comparisons against advanced nonlinear adaptive, sliding-mode, backstepping, or robust control frameworks were not included in the current work and remain an important direction for future investigation.

6.16. Combined Plug-and-Play and Load Variation Scenario

To further evaluate the stability of the proposed controller under practical microgrid operating conditions, an additional combined disturbance scenario was considered. In this test, plug-and-play operation of a distributed generator was introduced simultaneously with dynamic load variation.
Specifically, one distributed generator was disconnected from the microgrid during operation and later reconnected, while active and reactive load demand were varied over the same simulation interval. This scenario was designed to evaluate whether the controller could maintain stable voltage–frequency regulation under simultaneous topology and loading changes.
The obtained results indicate that the proposed PINN-based supervisory controller maintains bounded voltage and frequency responses throughout the combined disturbance. During DG disconnection, the controller adaptively adjusts the voltage and frequency references to compensate for the altered power-sharing condition. Upon DG reconnection, the system returns to stable operation without sustained oscillations or loss of synchronization.
These findings suggest that the embedded physical constraints and adaptive reference generation mechanism improve the controller’s ability to manage simultaneous plug-and-play operation and load variation within the investigated operating range.
Figure 17 demonstrates the response of the proposed PINN-based supervisory controller under simultaneous plug-and-play DG operation and dynamic load variation. During DG disconnection and reconnection events combined with abrupt load changes, the controller maintained bounded voltage and frequency behavior without sustained oscillatory instability.
The results indicate that the embedded physical constraints and adaptive reference generation mechanism enable the controller to maintain stable operation despite simultaneous topology and loading disturbances. Following each disturbance event, the system returned to steady operation with acceptable transient deviations and preserved inverter synchronization.

7. Societal Impact and Practical Considerations

The increasing penetration of renewable energy resources and inverter-based distributed generation has intensified the need for intelligent, resilient, and adaptive microgrid control frameworks capable of maintaining stable operation under uncertain and weak-grid conditions [1,4,5]. Recent studies have emphasized that advanced AI-assisted inverter control strategies can improve operational flexibility, renewable integration capability, and decentralized energy resilience in modern power systems [10,11]. In particular, intelligent grid-forming inverter control is expected to play an increasingly important role in enabling reliable electrification for remote, islanded, and energy-constrained regions.
The proposed PINN framework for grid-forming inverter control holds significant potential to advance both the technological and societal dimensions of modern power systems. Its ability to deliver ultra-fast voltage and frequency regulation, even in weak grid or island microgrids, directly contributes to energy security and operational reliability, two critical pillars of sustainable development.
From a societal perspective, the deployment of robust, intelligent control systems is especially impactful in remote, underserved, or energy-insecure regions. Communities in rural or islanded settings often suffer from unstable grids, inadequate generation resources, and limited technical capacity. By enabling autonomous operation, self-healing capabilities, and integration of distributed renewable energy resources, the PINN controller facilitates equitable access to clean and resilient electricity. This aligns with several United Nations Sustainable Development Goals (SDGs), particularly SDG 7 (Affordable and Clean Energy) and SDG 13 (Climate Action).
Practically, the proposed approach introduces several favorable attributes for deployment. The real-time inference capability demonstrated via hardware-in-the-loop simulations validates its computational efficiency and suitability for embedded applications. Furthermore, the hybridization of data-driven learning with embedded physical constraints enhances trustworthiness, interpretability, and regulatory compliance, thereby easing adoption by utilities and microgrid developers.
However, practical implementation must consider certain operational constraints. These include ensuring high-fidelity system identification during the offline training phase, safeguarding against data drift through periodic retraining or online adaptation, and integrating cybersecurity measures in edge-deployed AI models. In addition, successful deployment will require co-design with existing protection and communication infrastructures, particularly in multi-inverter and hybrid AC/DC microgrid configurations. The proposed PINN-based inverter control architecture not only offers a technically robust solution, but also a socially transformative tool for accelerating the global transition toward decentralized, resilient, and renewable-powered electricity systems.

8. Challenges and Future Directions

Despite the promising performance of the proposed PINN framework for real-time grid-forming inverter control, several challenges remain that warrant further investigation and innovation.

8.1. Scalability and System Complexity

While the current framework demonstrates strong performance in single or few inverter testbeds, extending the approach to large-scale systems with multiple interacting inverters poses nontrivial challenges. These include managing inter-inverter communication latency, preserving system-wide stability, and ensuring consistent policy updates in distributed learning environments. Future work should explore hierarchical or federated PINN architectures to enable scalable deployment across meshed and multi-layered microgrids.

8.2. Adaptive and Continual Learning

The reliance on offline training constrains the adaptability of the controller in the face of evolving grid configurations, aging equipment, or unforeseen disturbances. Although the embedded physics constraints offer some generalization, long-term autonomy requires mechanisms for continual learning, adaptive retraining, or online fine-tuning. Integrating meta-learning techniques or reinforcement learning with physics-based priors could allow the controller to update its parameters dynamically without full retraining.

8.3. Robustness to Uncertainty and Adversarial Perturbations

In practical environments, inverter controllers are exposed to measurement noise, cyber-physical disturbances, and renewable intermittency. Ensuring PINN’s robustness under such conditions remains an open research area. Future research should consider uncertainty quantification, robust training with stochastic physics constraints, and adversarial testing to assess fault tolerance and system resilience.

8.4. Hardware Deployment and Resource Constraints

Although inference times remain within real-time bounds, deploying PINNs on embedded hardware with strict memory and computing limitations introduces additional complexity. Model compression techniques, such as physics-aware pruning or quantization, may be necessary to reduce resource overhead without compromising accuracy or stability guarantees.

8.5. Online Adaptation and Model Updating

While the proposed PINN framework demonstrates strong generalization capability across varying operating conditions, practical microgrid environments are inherently dynamic and continuously evolving. Changes in network topology, load behavior, renewable generation patterns, and equipment aging may gradually reduce controller performance if the model parameters remain fixed after offline training. Therefore, future research should investigate online adaptation and model updating strategies that enable the controller to continuously refine its behavior during operation.
One promising direction involves incorporating incremental or continual learning techniques that allow the PINN to update selected parameters using newly observed operational data without requiring complete retraining. Such approaches could significantly reduce downtime and computational overhead while preserving previously learned physical relationships. In addition, adaptive optimization schemes may enable the controller to respond more effectively to long-term drift, seasonal renewable variations, and unexpected disturbances.
Another important area is the integration of meta-learning and transfer learning methods to accelerate adaptation across different microgrid configurations. By leveraging prior knowledge from previously trained systems, the controller could rapidly adjust to new operating environments with minimal additional data. These capabilities would improve scalability, reduce maintenance requirements, and enhance the long-term autonomy of intelligent inverter-based microgrids.
Ultimately, enabling real-time adaptation and continuous model updating will be essential for deploying physics-informed control systems in large-scale, decentralized, and highly dynamic renewable energy networks.

8.6. Robustness to Cyber-Physical Attacks and Adversarial Noise

In practical deployments, inverter controllers may be subject to measurement corruption or adversarial manipulation. Extending the framework with uncertainty quantification, robust loss formulations, and adversarial training will enhance its cyber-physical resilience.

8.7. Embedded Deployment and Model Compression

To further optimize the PINN for constrained hardware platforms, future work will investigate physics-aware pruning, quantization, and model distillation strategies. These techniques aim to maintain accuracy while reducing memory and latency overheads.

8.8. Integration with Legacy Infrastructure

Practical deployment in utility settings will require compatibility with existing protection schemes, SCADA interfaces, and grid codes. Developing explainable AI (XAI) layers and certified validation pipelines will support regulatory acceptance and operator trust.

8.9. Multi-Inverter and Large-Scale Microgrid Extensions

The present study focused on a three-inverter microgrid. Future work will extend the framework to large-scale systems with many interacting inverters, potentially using hierarchical or federated control architectures to manage coordination and communication overhead.

8.10. Future Outlook

The continued development of PINN-based controllers should prioritize modularity, adaptability, and verifiability. By addressing these challenges, future research can unlock the full potential of physics-informed learning to create secure, scalable, and sustainable inverter-based power systems that support the global transition toward net-zero energy futures.
Note on Network Topology Encoding: While this work used a fully-connected feedforward neural network, recent studies suggest that capturing topological features via graph neural networks (GNNs) could improve accuracy in grid modeling tasks [43,44]. Future extensions of this framework may incorporate GNN layers to encode electrical connectivity explicitly, potentially enhancing the learning of spatially distributed grid behaviors.
Future work will investigate continual learning, online adaptation, and lightweight incremental retraining strategies to enable fully adaptive physics-informed inverter control under evolving grid conditions. Future work will also investigate formal stability analysis using nonlinear Lyapunov methods, input-to-state stability frameworks, and contraction-based analysis to establish stronger theoretical guarantees for physics-informed inverter control systems.

9. Conclusions

This study introduced a novel PINN framework for real-time control of grid-forming inverters, addressing critical challenges in voltage and frequency regulation within inverter-dominated microgrids. By embedding physical laws including Kirchhoff’s voltage and current laws, swing equations, and dynamic stability margins into the structure of a deep learning model, the proposed controller achieves enhanced interpretability, generalization, and operational robustness.
Through extensive simulation and HIL validation, the PINN-based control scheme was shown to outperform conventional droop and VSM controllers across multiple performance dimensions, including transient stability, power quality, and real-time computational feasibility. Notably, the model maintained high tracking accuracy and low harmonic distortion, while demonstrating adaptability to disturbances such as sudden load changes and renewable generation variability.
From a practical standpoint, the proposed method offers a scalable and intelligent alternative for autonomous control in weak-grid and islanded microgrid environments. It enhances resilience, supports increased renewable energy penetration, and contributes to the realization of sustainable, decentralized energy systems.
Nevertheless, the framework’s full deployment will require addressing remaining challenges related to scalability, continual learning, hardware resource constraints, and compliance with legacy standards. Future work will explore adaptive training schemes, uncertainty quantification, and federated learning extensions to advance the practical applicability of PINN-based control architectures in larger and more complex grid environments.
Overall, the proposed PINN approach contributes to the growing body of research on physics-informed machine learning for power electronics and inverter-dominated energy systems by demonstrating how embedded physical constraints can be integrated into a real-time grid-forming inverter control framework with experimentally validated performance. Although the proposed framework demonstrates strong performance under the investigated operating conditions, several challenges remain for large-scale practical deployment, including scalability, continual adaptation, embedded resource optimization, and formal stability guarantees under highly dynamic operating scenarios. Future research will therefore focus on adaptive physics-informed learning, multi-inverter coordination, and lightweight embedded implementations for large-scale inverter-dominated microgrids.

Author Contributions

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

Funding

This research received no external funding.

Data Availability Statement

The data supporting the findings of this study, including test profiles and control simulation traces, are available from the corresponding author upon reasonable request.

Acknowledgments

The authors would like to acknowledge the Department of Computer Science, Centre for Augmented Intelligence and Data Science (CAIDS), as well as the Department of Mechanical Bioresources and Biomedical Engineering, University of South Africa for their technical and academic support during the course of this work.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Oyekale, J.; Petrollese, M.; Tola, V.; Cau, G. Impacts of Renewable Energy Resources on Effectiveness of Grid-Integrated Systems: Succinct Review of Current Challenges and Potential Solution Strategies. Energies 2020, 13, 4856. [Google Scholar] [CrossRef]
  2. Alotaibi, I.; Abido, M.A.; Khalid, M.; Savkin, A.V. A Comprehensive Review of Recent Advances in Smart Grids: A Sustainable Future with Renewable Energy Resources. Energies 2020, 13, 6269. [Google Scholar] [CrossRef]
  3. Asadi, Y.; Eskandari, M.; Mansouri, M.; Savkin, A.V.; Pathan, E. Frequency and Voltage Control Techniques through Inverter- Interfaced Distributed Energy Resources in Microgrids: A Review. Energies 2022, 15, 8580. [Google Scholar] [CrossRef]
  4. Satapathy, A.S.; Mohanty, S.; Mohanty, A.; Rajamony, R.K.; Soudagar, M.E.M.; Khan, T.Y.; Bashir, M.N. Emerging Technologies, Opportunities and Challenges for Microgrid Stability and Control. Energy Rep. 2024, 11, 3562–3580. [Google Scholar] [CrossRef]
  5. Rahman, K.; Hashimoto, J.; Orihara, D.; Ustun, T.S.; Otani, K.; Kikusato, H.; Kodama, Y. Reviewing Control Paradigms and Emerging Trends of Grid-Forming Inverters—A Comparative Study. Energies 2024, 17, 2400. [Google Scholar] [CrossRef]
  6. Joshal, K.S.; Gupta, N. Microgrids with Model Predictive Control: A Critical Review. Energies 2023, 16, 4851. [Google Scholar] [CrossRef]
  7. Kim, K.H. Decentralized Power Management of DC Microgrid Based on Adaptive Droop Control with Constant Voltage Regulation. IEEE Access 2022, 10, 129490–129504. [Google Scholar] [CrossRef]
  8. Shadoul, M.; Ahshan, R.; AlAbri, R.S.; Al-Badi, A.; Albadi, M.; Jamil, M. A Comprehensive Review on a Virtual-Synchronous Generator: Topologies, Control Orders and Techniques, Energy Storages, and Applications. Energies 2022, 15, 8406. [Google Scholar] [CrossRef]
  9. Wei, H.; Shi, Y. MPC-Based Motion Planning and Control Enables Smarter and Safer Autonomous Marine Vehicles: Perspectives and a Tutorial Survey. IEEE/CAA J. Autom. Sin. 2022, 10, 8–24. [Google Scholar] [CrossRef]
  10. Gao, Y.; Wang, S.; Dragicevic, T.; Wheeler, P.; Zanchetta, P. Artificial Intelligence Techniques for Enhancing the Performance of Controllers in Power Converter-Based Systems—An Overview. IEEE Open J. Ind. Appl. 2023, 4, 366–375. [Google Scholar] [CrossRef]
  11. Alhamrouni, I.; Abdul Kahar, N.H.; Salem, M.; Swadi, M.; Zahroui, Y.; Kadhim, D.J.; Alhuyi Nazari, M. A Comprehensive Review on the Role of Artificial Intelligence in Power System Stability, Control, and Protection: Insights and Future Directions. Appl. Sci. 2024, 14, 6214. [Google Scholar] [CrossRef]
  12. Ramezani, S.B.; Cummins, L.; Killen, B.; Carley, R.; Amirlatifi, A.; Rahimi, S.; Bian, L. Scalability, Explainability and Performance of Data-Driven Algorithms in Predicting the Remaining Useful Life: A Comprehensive Review. IEEE Access 2023, 11, 41741–41769. [Google Scholar] [CrossRef]
  13. Manfren, M.; Gonzalez-Carreon, K.M.; James, P.A. Interpretable Data-Driven Methods for Building Energy Modelling—A Review of Critical Connections and Gaps. Energies 2024, 17, 881. [Google Scholar] [CrossRef]
  14. Martinez, Y.; Rojas, L.; Peña, A.; Valenzuela, M.; Garcia, J. Physics-Informed Neural Networks for the Structural Analysis and Monitoring of Railway Bridges: A Systematic Review. Mathematics 2025, 13, 1571. [Google Scholar] [CrossRef]
  15. Patel, D.; Sharma, R.; Guo, Y.B. Computational, Data-Driven, and Physics-Informed Machine Learning Approaches for Microstructure Modeling in Metal Additive Manufacturing. arXiv 2025, arXiv:2505.01424. [Google Scholar] [CrossRef]
  16. Huang, B.; Wang, J. Applications of Physics-Informed Neural Networks in Power Systems—A Review. IEEE Trans. Power Syst. 2022, 38, 572–588. [Google Scholar] [CrossRef]
  17. Sharma, P.; Chung, W.T.; Akoush, B.; Ihme, M. A Review of Physics-Informed Machine Learning in Fluid Mechanics. Energies 2023, 16, 2343. [Google Scholar] [CrossRef]
  18. Mahdouri, E.A.; Al-Abri, S.; Yousef, H.; Al-Naimi, I.; Obeid, H. Physics-Informed Neural Networks in Grid-Connected Inverters: A Review. Energies 2025, 18, 5441. [Google Scholar] [CrossRef]
  19. Nadal, V.; Nellikkath, R.; Chatzivasileiadis, S. Physics-Informed Neural Networks in Power System Dynamics: Improving Simulation Accuracy. In Proceedings of the 2025 IEEE Kiel PowerTech, Kiel, Germany, 29 June 2025–3 July 2025; pp. 1–6. [Google Scholar] [CrossRef]
  20. Theodosiou, T.; Rekatsinas, C. Physics-Informed Neural Networks without Loss Balancing: A Direct Term Scaling Approach for Nonlinear 1D Problems. F1000Research 2026, 14, 1252. [Google Scholar] [CrossRef]
  21. Feng, R.; Wajid, K.; Faheem, M.; Wang, J.; Subhan, F.E.; Shoaib Bhutta, M. Uniform Physics Informed Neural Network Framework for Microgrid and Its Application in Voltage Stability Analysis. IEEE Access 2025, 13, 8110–8126. [Google Scholar] [CrossRef]
  22. He, Z.; Wang, S.; Shi, J.; Liu, D.; Duan, X.; Shang, Y. Physics-informed neural network supported wiener process for degradation modeling and reliability prediction. Reliab. Eng. Syst. Saf. 2025, 258, 110906. [Google Scholar] [CrossRef]
  23. Amin, M.A.; Ahsan, M.S.; Maua, J.; Ahmed, M.; Nur, K. Physics-informed self-supervised diagnosis of rotating machinery using latent ODEs and transformer encoders. PLoS ONE 2026, 21, e0339239. [Google Scholar] [CrossRef]
  24. Lahuerta, O.; Carretero, C.; Barragan, L.A.; Navarro, D.; Acero, J. Hybrid-Timescale Physics-Informed Neural Network for Electrical Equivalent Impedance Identification in Induction Heating Systems. IEEE Open J. Ind. Electron. Soc. 2026, 7, 382–392. [Google Scholar] [CrossRef]
  25. Akinwola, A.B.; Alkuhayli, A. Physics-Informed Neural Network-Based Intelligent Control for Photovoltaic Charge Allocation in Multi-Battery Energy Systems. Batteries 2026, 12, 46. [Google Scholar] [CrossRef]
  26. Morelly, S.L.; Saraka, R.M.; Alvarez, N.J.; Tang, M. Impact of Mixing Shear on Polymer Binder Molecular Weight and Battery Electrode Reproducibility. Batteries 2024, 10, 46. [Google Scholar] [CrossRef]
  27. Deori, P.; Ahmad, A.; Routray, A. Hybrid quasi Z source multi output converter system with performance control and real time validation for photovoltaic microgrid. Sci. Rep. 2026, 16, 6255. [Google Scholar] [CrossRef]
  28. Cavus, M.; Jiang, J.; Allahham, A.; Sun, H. A physics-informed machine learning framework for climate-aware digital twins in decentralised energy systems. Appl. Energy 2026, 416, 128013. [Google Scholar] [CrossRef]
  29. Kazemi Naeini, H.; Shomali, R.; Pishahang, A.; Hasanzadeh, H.; Asadi, S.; Gholizadeh Lonbar, A. PINN-DT: Optimizing Energy Consumption in Smart Building Using Hybrid Physics-Informed Neural Networks and Digital Twin Framework with Blockchain Security. Sensors 2025, 25, 6242. [Google Scholar] [CrossRef]
  30. Anttila, S.; Döhler, J.S.; Oliveira, J.G.; Boström, C. Grid Forming Inverters: A Review of the State of the Art of Key Elements for Microgrid Operation. Energies 2022, 15, 5517. [Google Scholar] [CrossRef]
  31. Khan, M.; Wu, W.; Li, L. Grid-Forming Control for Inverter-Based Resources in Power Systems: A Review on Its Operation, System Stability, and Prospective. IET Renew. Power Gener. 2024, 18, 887–907. [Google Scholar] [CrossRef]
  32. Akram, U.; Shah, R.; Amjady, N.; Mithulananthan, N.; Islam, S. Active and Reactive Power Injection of Energy Storage for Short-Term Frequency Stability in Islanded Power Systems. J. Energy Storage 2024, 90, 111914. [Google Scholar] [CrossRef]
  33. Inaolaji, A.; Savasci, A.; Paudyal, S. Distribution Grid Optimal Power Flow in Unbalanced Multiphase Networks with Volt-Var and Volt-Watt Droop Settings of Smart Inverters. IEEE Trans. Ind. Appl. 2022, 58, 5832–5843. [Google Scholar] [CrossRef]
  34. Muftau, B.; Fazeli, M. The Role of Virtual Synchronous Machines in Future Power Systems: A Review and Future Trends. Electr. Power Syst. Res. 2022, 206, 107775. [Google Scholar] [CrossRef]
  35. Moutevelis, D.; Roldán-Pérez, J.; Rodríguez-Ortega, P.; Prodanovi´c, M. Virtual Synchronous Machine Design for Islanded Microgrids Using the Extended Impedance Criterion with Grid Frequency Dynamics Included. IEEE Trans. Energy Convers. 2024, 40, 1249–1264. [Google Scholar] [CrossRef]
  36. Minchala-Ávila, C.; Arévalo, P.; Ochoa-Correa, D. A Systematic Review of Model Predictive Control for Robust and Efficient Energy Management in Electric Vehicle Integration and V2G Applications. Modelling 2025, 6, 20. [Google Scholar] [CrossRef]
  37. Subedi, S.; Gui, Y.; Xue, Y. Applications of Data-Driven Dynamic Modeling of Power Converters in Power Systems: An Overview. IEEE Trans. Ind. Appl. 2025, 61, 2434–2456. [Google Scholar] [CrossRef]
  38. Massaoudi, M.S.; Abu-Rub, H.; Ghrayeb, A. Navigating the Landscape of Deep Reinforcement Learning for Power System Stability Control: A Review. IEEE Access 2023, 11, 134298–134317. [Google Scholar] [CrossRef]
  39. Lahon, P.; Kandali, A.B.; Barman, U.; Konwar, R.J.; Saha, D.; Saikia, M.J. Deep Neural Network-Based Smart Grid Stability Analysis: Enhancing Grid Resilience and Performance. Energies 2024, 17, 2642. [Google Scholar] [CrossRef]
  40. Ahmed, S.F.; Alam, M.S.B.; Hassan, M.; Rozbu, M.R.; Ishtiak, T.; Rafa, N.; Gandomi, A.H. Deep Learning Modelling Techniques: Current Progress, Applications, Advantages, and Challenges. Artif. Intell. Rev. 2023, 56, 13521–13617. [Google Scholar] [CrossRef]
  41. Bevrani, H.; Feizi, M.R.; Ataee, S. Robust Frequency Control in an Islanded Microgrid: H∞ and μ-Synthesis Approaches. IEEE Trans. Smart Grid 2016, 7, 706–717. [Google Scholar] [CrossRef]
  42. Gheisari, M.; Ebrahimzadeh, F.; Rahimi, M.; Moazzamigodarzi, M.; Liu, Y.; Dutta Pramanik, P.K.; Kosari, S. Deep Learning: Applications, Architectures, Models, Tools, and Frameworks: A Comprehensive Survey. CAAI Trans. Intell. Technol. 2023, 8, 581–606. [Google Scholar] [CrossRef]
  43. Shi, Y.; Beer, M. Physics-Informed Neural Network Classification Framework for Reliability Analysis. Expert Syst. Appl. 2024, 258, 125207. [Google Scholar] [CrossRef]
  44. Chen, L.; Zhang, H.Y.; Liu, S.W.; Chan, S.L. Second-Order Analysis of Beam-Columns by Machine Learning-Based Structural Analysis through Physics-Informed Neural Networks. Adv. Steel Constr. 2023, 19, 411–420. [Google Scholar]
  45. Chen, Y.; Yang, Q.; Chen, Z.; Yan, C.; Zeng, S.; Dai, M. Physics-Informed Neural Networks for Building Thermal Modeling and Demand Response Control. Build. Environ. 2023, 234, 110149. [Google Scholar] [CrossRef]
  46. Fassi, Y.; Heiries, V.; Boutet, J.; Boisseau, S. Toward Physics-Informed Machine-Learning-Based Predictive Maintenance for Power Converters—A Review. IEEE Trans. Power Electron. 2023, 39, 2692–2720. [Google Scholar] [CrossRef]
  47. Khalid, S.; Yazdani, M.H.; Azad, M.M.; Elahi, M.U.; Raouf, I.; Kim, H.S. Advancements in Physics-Informed Neural Networks for Laminated Composites: A Comprehensive Review. Mathematics 2024, 13, 17. [Google Scholar] [CrossRef]
  48. Ansari, S.; Zhang, J.; Singh, R.E. A Review of Stabilization Methods for DCMG with CPL, the Role of Bandwidth Limits and Droop Control. Prot. Control. Mod. Power Syst. 2022, 7, 1–12. [Google Scholar] [CrossRef]
  49. Wald, F.; Tao, Q.; De Carne, G. Virtual Synchronous Machine Control for Asynchronous Grid Connections. IEEE Trans. Power Deliv. 2023, 39, 397–406. [Google Scholar] [CrossRef]
  50. Harbi, I.; Rodriguez, J.; Liegmann, E.; Makhamreh, H.; Heldwein, M.L.; Novak, M.; Kennel, R. Model-Predictive Control of Multilevel Inverters: Challenges, Recent Advances, and Trends. IEEE Trans. Power Electron. 2023, 38, 10845–10868. [Google Scholar] [CrossRef]
  51. Li, S.E. Deep Reinforcement Learning. In Reinforcement Learning for Sequential Decision and Optimal Control; Springer Nature: Singapore, 2023; pp. 365–402. [Google Scholar]
  52. Antonelo, E.A.; Camponogara, E.; Seman, L.O.; Jordanou, J.P.; de Souza, E.R.; Hübner, J.F. Physics-Informed Neural Nets for Control of Dynamical Systems. Neurocomputing 2024, 579, 127419. [Google Scholar] [CrossRef]
  53. Nellikkath, R.; Chatzivasileiadis, S. Physics-Informed Neural Networks for AC Optimal Power Flow. Electr. Power Syst. Res. 2022, 212, 108412. [Google Scholar] [CrossRef]
Figure 1. System model of a microgrid with grid-forming inverter control. The PCC is modelled at the low-voltage distribution level (400 V line-to-line RMS), which is typical for islanded or remote microgrid settings.
Figure 1. System model of a microgrid with grid-forming inverter control. The PCC is modelled at the low-voltage distribution level (400 V line-to-line RMS), which is typical for islanded or remote microgrid settings.
Energies 19 02690 g001
Figure 2. Traditional NN-based inverter control architecture. The arrows indicate the sequential flow of measured electrical signals through the neural-network mapping process toward voltage/frequency reference generation and inverter actuation.
Figure 2. Traditional NN-based inverter control architecture. The arrows indicate the sequential flow of measured electrical signals through the neural-network mapping process toward voltage/frequency reference generation and inverter actuation.
Energies 19 02690 g002
Figure 3. Proposed PINN architecture integrating physical laws and real-time control.
Figure 3. Proposed PINN architecture integrating physical laws and real-time control.
Energies 19 02690 g003
Figure 4. Frequency response comparison of PINN, droop, and VSM controllers under a 50% load step disturbance.
Figure 4. Frequency response comparison of PINN, droop, and VSM controllers under a 50% load step disturbance.
Energies 19 02690 g004
Figure 5. Voltage magnitude response comparison of PINN, droop, and VSM controllers under reactive power step disturbances.
Figure 5. Voltage magnitude response comparison of PINN, droop, and VSM controllers under reactive power step disturbances.
Energies 19 02690 g005
Figure 6. Frequency and voltage responses under high variability in renewable generation.
Figure 6. Frequency and voltage responses under high variability in renewable generation.
Energies 19 02690 g006
Figure 7. Convergence of total loss and its components during PINN training. The loss components ( L d a t a , L p h y s i c s , L r e g ) are unscaled and plotted in absolute values to reflect raw convergence behavior.
Figure 7. Convergence of total loss and its components during PINN training. The loss components ( L d a t a , L p h y s i c s , L r e g ) are unscaled and plotted in absolute values to reflect raw convergence behavior.
Energies 19 02690 g007
Figure 8. Adaptive voltage and frequency reference trajectories generated by the PINN controller under dynamic load and renewable variability conditions.
Figure 8. Adaptive voltage and frequency reference trajectories generated by the PINN controller under dynamic load and renewable variability conditions.
Energies 19 02690 g008
Figure 9. Comparative stability metrics: frequency deviation, voltage deviation, and settling time across control strategies.
Figure 9. Comparative stability metrics: frequency deviation, voltage deviation, and settling time across control strategies.
Energies 19 02690 g009
Figure 10. Distribution of inference time for the PINN controller over 1000 executions.
Figure 10. Distribution of inference time for the PINN controller over 1000 executions.
Energies 19 02690 g010
Figure 11. Sensitivity of frequency deviation to increasing measurement noise under different control strategies. The blue, orange dashed, and green dash-dot curves correspond to the PINN, droop, and VSM controllers, respectively.
Figure 11. Sensitivity of frequency deviation to increasing measurement noise under different control strategies. The blue, orange dashed, and green dash-dot curves correspond to the PINN, droop, and VSM controllers, respectively.
Energies 19 02690 g011
Figure 12. Comparison of power quality metrics: total harmonic distortion (THD) and power factor under different control strategies.
Figure 12. Comparison of power quality metrics: total harmonic distortion (THD) and power factor under different control strategies.
Energies 19 02690 g012
Figure 13. Phase portrait showing frequency deviation ω as a function of phase angle δ for droop and PINN-based control.
Figure 13. Phase portrait showing frequency deviation ω as a function of phase angle δ for droop and PINN-based control.
Energies 19 02690 g013
Figure 14. Tracking performance of the proposed PINN and droop controllers against a time-varying reference power signal.
Figure 14. Tracking performance of the proposed PINN and droop controllers against a time-varying reference power signal.
Energies 19 02690 g014
Figure 15. Prediction error distribution of the PINN controller under in-distribution and out-of-distribution test scenarios. The red horizontal lines indicate median prediction error values, while circular markers denote statistical outliers beyond the whisker limits.
Figure 15. Prediction error distribution of the PINN controller under in-distribution and out-of-distribution test scenarios. The red horizontal lines indicate median prediction error values, while circular markers denote statistical outliers beyond the whisker limits.
Energies 19 02690 g015
Figure 16. Frequency and voltage response comparison between PINN and pure data-driven control models under identical test conditions. PINN demonstrates smoother, more robust behavior.
Figure 16. Frequency and voltage response comparison between PINN and pure data-driven control models under identical test conditions. PINN demonstrates smoother, more robust behavior.
Energies 19 02690 g016
Figure 17. Voltage, frequency, and active power responses during combined plug-and-play DG operation and dynamic load variation. The vertical dotted lines indicate event instants corresponding to load increase (2 s), DG2 disconnection (4 s), load decrease (6 s), and DG2 reconnection (8 s).
Figure 17. Voltage, frequency, and active power responses during combined plug-and-play DG operation and dynamic load variation. The vertical dotted lines indicate event instants corresponding to load increase (2 s), DG2 disconnection (4 s), load decrease (6 s), and DG2 reconnection (8 s).
Energies 19 02690 g017
Table 1. Comparison of representative inverter control and PINN-related approaches from the recent literature and the proposed real-time physics-informed inverter control framework.
Table 1. Comparison of representative inverter control and PINN-related approaches from the recent literature and the proposed real-time physics-informed inverter control framework.
ReferenceMethodologyStrengthsLimitations
Ansari et al. [35]Droop ControlSimplicity, decentralizationLimited adaptability
Wald et al. [36]VSMGood transient responseComplex tuning and modelling
Harbi et al. [37]MPCConstraint handlingHigh computational complexity
Li. [38]DRLAdaptability, robustnessPoor interpretability
Antonelo et al. [39]PINNs–GeneralInterpretability, requires less dataLimited exploration in control tasks
Nellikkath et al. [40]PINNs (Power Flow)Accuracy, interpretabilityOffline training, not suitable for real-time control
Bevrani et al. [41]Nonlinear Adaptive Controllers (SMC, Backstepping, H∞)Strong nonlinear dynamic response and robustnessHigh modelling complexity, parameter sensitivity, implementation difficulty
Proposed ApproachPINN-based Inverter (Physics-Embedded)Real-time applicability, robustness, interpretabilityRequires rigorous validation, computational efficiency tests
Table 2. Simulation parameters and conditions.
Table 2. Simulation parameters and conditions.
ParameterValue/Condition
Number of Inverters3 (Grid-Forming)
Nominal Frequency50 Hz
Nominal Voltage400 V (Line-to-Line RMS)
Droop CoefficientsVariable (PINN-controlled)
Virtual Inertia Constant, Mi0.05 s
Damping Coefficient, Di0.7 pu
Load ConditionsStep-changes and continuous variations
Renewable Source VariabilitySolar PV irradiance and wind speed profiles
Simulation Duration120 s per scenario
Solverode45, variable step (Simulink)
Table 3. Comparison of measured end-to-end embedded execution latency during HIL operation.
Table 3. Comparison of measured end-to-end embedded execution latency during HIL operation.
Control MethodMeasured Embedded Execution Latency (ms)Real-Time Feasibility
Droop Control0.1High
VSM Control0.3High
PINN Control (Proposed)0.7High
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

Mabuwa, S.; Moloi, K. Physics-Informed Neural Networks for Real-Time Control of Grid-Forming Inverters: Embedding Physical System Laws into Deep Learning Architectures. Energies 2026, 19, 2690. https://doi.org/10.3390/en19112690

AMA Style

Mabuwa S, Moloi K. Physics-Informed Neural Networks for Real-Time Control of Grid-Forming Inverters: Embedding Physical System Laws into Deep Learning Architectures. Energies. 2026; 19(11):2690. https://doi.org/10.3390/en19112690

Chicago/Turabian Style

Mabuwa, Sipokazi, and Katleho Moloi. 2026. "Physics-Informed Neural Networks for Real-Time Control of Grid-Forming Inverters: Embedding Physical System Laws into Deep Learning Architectures" Energies 19, no. 11: 2690. https://doi.org/10.3390/en19112690

APA Style

Mabuwa, S., & Moloi, K. (2026). Physics-Informed Neural Networks for Real-Time Control of Grid-Forming Inverters: Embedding Physical System Laws into Deep Learning Architectures. Energies, 19(11), 2690. https://doi.org/10.3390/en19112690

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