Next Article in Journal
From Classical to Reduced Semi-Empirical PEMFC Models: Evolution, Lambert W and g-Function Reformulation, and Applications in Optimization and Parameter Estimation
Previous Article in Journal
Improving Supercooling and Properties of Hydrated Salt Phase-Change Materials Using Binary Nucleating Agent
Previous Article in Special Issue
Differential Protection Based on Virtual Short-Circuit Current Considering Both Grid-Forming Inverter and Grid-Following Inverter for New Energy Bases
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Power Quality Improvement Strategy Based on Grid-Forming Control and Consensus Algorithm

State Grid Shanxi Electric Power Company Electric Power Research Institute, Taiyuan 030001, China
*
Author to whom correspondence should be addressed.
Energies 2026, 19(12), 2890; https://doi.org/10.3390/en19122890
Submission received: 17 April 2026 / Revised: 12 June 2026 / Accepted: 16 June 2026 / Published: 18 June 2026

Abstract

With the integration of high-penetration distributed renewable energy sources and grid-forming inverters, AC microgrids face significant challenges in maintaining autonomous voltage and frequency stability. While traditional droop control can achieve autonomous power allocation, it introduces inherent steady-state deviations when load change. To address this, this paper proposes a distributed secondary control strategy for AC microgrids based on a consensus algorithm, aiming to achieve high-precision coordinated correction of voltage and frequency and improve power quality. In the proposed strategy, each grid-forming inverter autonomously generates dynamic secondary compensation signals based solely on local measurements and limited information exchange with neighboring nodes, eliminating the need for a central controller and enhancing robustness, scalability, and fault tolerance. Stability is proven via Lyapunov function construction. Simulation results show that the strategy effectively eliminates steady-state errors, with frequency deviations within ±0.01 Hz and voltage deviations below 0.5% of the rated value. Rapid and precise regulation is achieved under various load disturbances and network conditions, validating its effectiveness and application potential.

1. Introduction

Against the backdrop of the global energy transition and the steady progress toward the “dual carbon” goals, a high proportion of distributed renewable energy is being rapidly integrated into the grid [1], driving the gradual evolution of traditional centralized power systems toward more resilient and flexible microgrid architectures [2]. Among these, AC microgrids have garnered significant attention for their ability to effectively integrate renewable resources and maintain a reliable power supply in both grid-connected and islanded modes [3]. However, the increasing penetration of converter-interfaced renewable energy also brings new challenges to voltage regulation, frequency stability, and power quality, particularly during load variations and the plug-and-play operation of distributed units. Therefore, it is necessary to develop effective control strategies that can enhance both the dynamic response and steady-state performance of AC microgrids.
To ensure the safety and stability of AC microgrids under various operating modes, a hierarchical control architecture is widely adopted. This architecture typically comprises primary control for maintaining system frequency and voltage stability, secondary control for suppressing frequency and voltage deviations, and tertiary control for energy management and optimized dispatch [4,5,6]. At the primary control level, based on inverters, control strategies can be broadly categorized into two types: grid-following control and grid-forming control [7]. Grid-following inverters rely on voltage and frequency references provided by the external grid for synchronization and power regulation, whereas grid-forming inverters are capable of autonomously establishing and regulating voltage and frequency, thereby enabling islanded operation and effectively enhancing system stability [8,9]. For renewable-energy-dominated microgrids, grid-forming control is particularly attractive because it allows inverters to actively participate in voltage and frequency support instead of merely tracking external grid references.
Grid-forming control strategies include droop control, virtual impedance control, and other voltage/frequency regulation methods [10]. Among these, droop control is widely adopted due to its simple structure and ease of decentralized implementation. This control method simulates the active-power–frequency and reactive-power–voltage droop characteristics of synchronous generators to dynamically adjust the frequency and voltage amplitude of inverters based on the active and reactive power output at the local level [11,12]. However, while this locally based regulation mechanism ensures reasonable power allocation, it inevitably introduces frequency and voltage deviations [13,14]. As a result, primary droop-based grid-forming control alone is usually insufficient to achieve high-precision voltage and frequency restoration, and an additional secondary control layer is required to compensate for steady-state deviations and improve power-sharing accuracy among multiple inverters.
To eliminate steady-state errors caused by primary control, it is typically necessary to introduce secondary control for global correction [15]. In addition to restoring voltage and frequency deviations, the design of secondary control should also ensure the dynamic stability of the microgrid under disturbances. Therefore, stability-oriented control analysis is an important issue in microgrid frequency regulation. In this regard, Lyapunov-based methods have been adopted to analyze and improve the dynamic stability of microgrids. For example, Petrík et al. investigated the damping of microgrid frequency fluctuations in synchronous machines using Lyapunov theory for exciter regulation [16]. This study demonstrates the applicability of Lyapunov theory to microgrid frequency stability analysis. However, it mainly focuses on synchronous-machine-based exciter regulation, whereas the present paper addresses the stability of distributed secondary control for grid-forming inverter-based AC microgrids.
Traditional methods often employ centralized secondary control, which significantly reduces system reliability [17]. For example, Reference [18] proposes a centralized secondary control strategy to restore the output voltage and frequency of an isolated microgrid, while Reference [19] proposes a centralized model predictive control strategy for grid-forming inverters aimed at correcting frequency deviations in droop-controlled microgrids. Although centralized secondary control methods are widely used, they suffer from inherent drawbacks such as single-point-of-failure risks, high communication overhead, and insufficient scalability [20,21], making it difficult to meet the future development needs of microgrids—including large-scale deployment, plug-and-play functionality, and high reliability—under conditions of high penetration of distributed energy resources [22,23].
Furthermore, as microgrids continue to expand in scale, centralized control relies heavily on interconnected communication networks, leading to increased system communication overhead. In contrast, distributed control primarily relies on communication networks between neighboring nodes for limited information exchange [24]. This network architecture, based on local communication, not only significantly reduces the requirements for the underlying communication infrastructure but also effectively alleviates the complexity of data processing [25,26]. At the same time, the local communication topology endows the system with greater flexibility, enabling the rapid plug-and-play integration of new distributed units without the need to reconfigure global communication links [27]. Therefore, optimizing the communication network structure and reducing reliance on global communication are key to overcoming the limitations of traditional centralized architectures and enhancing the scalability of microgrids.
In response to the aforementioned issues, distributed cooperative control has emerged as a promising solution [28]. This paper proposes a distributed secondary control strategy based on grid-forming control and a consensus algorithm for AC microgrids integrating grid-forming inverters, with the aim of achieving cooperative management of voltage and frequency deviations and improving power quality. The main contributions of this paper are as follows: (1) A distributed secondary control architecture is designed, in which each inverter achieves coordinated regulation by exchanging only limited information with neighboring nodes, eliminating the need for a central controller; (2) An improved consensus algorithm is proposed, incorporating an adaptive adjustment mechanism to accelerate dynamic response and enhance steady-state accuracy, and the stability of the proposed distributed secondary control based on the consensus algorithm is proven using Lyapunov functions; (3) Through system simulation studies, the effectiveness, robustness, and improved power quality performance of the proposed strategy—which outperforms traditional centralized methods—are verified under various disturbance scenarios (such as sudden load changes and the connection/disconnection of distributed units).

2. System Architecture and Grid-Forming Control Strategy

In this section, the general architecture of the AC microgrid is first introduced, followed by the detailed mathematical formulation of the primary droop control and the inner-loop controllers.

2.1. Overview of AC Microgrid Structure

To provide a clear context, Figure 1 illustrates the general structure of a typical AC microgrid. The system primarily comprises several fundamental elements: Energy Storage Systems (ESS), Renewable Energy Sources (RES) such as wind turbines (WT) and photovoltaics (PV), grid-forming inverters (DC/AC), transmission lines, and various AC/DC loads. The grid-forming inverters interface the ESS with the AC bus, acting as autonomous voltage sources to establish and maintain the voltage and frequency of the entire microgrid.
From a control perspective, such microgrids typically adopt a hierarchical architecture. As shown in Figure 1, the primary control (e.g., droop control) is embedded locally in each inverter. It ensures instantaneous power sharing and basic voltage/frequency regulation without relying on external communication. However, this decentralized nature inherently introduces steady-state deviations. To mitigate this issue and improve overall power quality, a distributed secondary control layer—facilitated by a sparse communication network (depicted by the dashed lines between units)—is deployed. This secondary layer coordinates the distributed units to compensate for local deviations, forming the physical and cyber foundation of the consensus-based strategy proposed in this paper.
It is worth noting that while a comprehensive microgrid integrates various RESs, these renewable units typically operate in a grid-following or maximum power point tracking (MPPT) mode. The grid-forming ESSs play the dominant role in providing voltage and frequency support during islanded operation. Therefore, to explicitly verify the effectiveness of the proposed secondary consensus strategy in regulating system voltage and frequency, the subsequent theoretical analysis and simulation validation in this paper are strictly focused on the coordination among multiple grid-forming ESS units.

2.2. Grid-Forming Inverter Control Architecture

In grid-forming inverters, the control system plays a critical role in maintaining voltage and frequency stability, particularly during islanded operation. Figure 2 illustrates a typical control architecture for a three-phase grid-forming inverter. The main circuit primarily consists of a voltage-source full-bridge inverter, an LC filter, and an output coupling inductor. To precisely regulate the output voltage and current, the system employs a hierarchical control structure, which includes an inner-loop current control loop, an outer-loop power control loop, and a secondary control loop for steady-state error compensation.
To further clarify the operation of the system, the detailed functionalities of the physical circuit components and control blocks illustrated in Figure 2 are systematically elaborated. In the main circuit, the energy storage and DC/DC converter serve as the primary DC energy source, providing a stable DC-link voltage (Udc) to the three-phase inverter bridge (T1T6, D1D6). Composed of insulated gate bipolar transistors (IGBTs) with anti-parallel diodes, this bridge executes high-frequency switching based on PWM commands to modulate the DC voltage into a pulsed AC output. Subsequently, an LC filter (L, C) attenuates the associated switching harmonics to shape smooth sinusoidal voltage and current waveforms at the Point of Common Coupling (PCC), while the physical line impedance (Rg, Lg) governs the active and reactive power transfer characteristics from the source to the AC bus. To regulate this physical process, the control system employs a hierarchical architecture. Initially, the power calculation block continuously samples the instantaneous PCC voltage and output current to compute the filtered active power (P) and reactive power (Q). These values are processed by the outer power loop (droop control), which emulates the governor traits of a synchronous generator to autonomously yield the reference angular frequency (ω*) and voltage magnitude (V*) without central synchronization. The voltage and current closed-loop control then provide fast and precise dynamic tracking, regulating internal state variables to force the actual PCC voltage to strictly adhere to these reference commands while suppressing transient overcurrent. Finally, the PWM module compares the modulating signals from the inner loop with a high-frequency triangular carrier wave to generate the ultimate gate-driving signals for the inverter bridge.

2.3. Droop Control Strategy

Unlike grid-following control, which relies on a phase-locked loop to track the external grid, grid-forming control does not require an external voltage reference and can autonomously establish and regulate the amplitude and frequency of the output voltage, offering significant advantages in islanded operation and weak grid scenarios [29]. Common grid-forming control technologies include droop control and virtual synchronous control [30]. Given that droop control features a simple structure, high flexibility, and the ability to adapt to varying load conditions, this paper adopts it as the primary control strategy. The droop mechanism power establishes a linear relationship between power output and voltage/frequency deviations [31], expressed as follows:
f = f * K p P P * V = V * K q Q Q *
where P and Q denote the output values of active power and reactive power, respectively; P * and Q * represent the rated values of active power and reactive power, respectively; K p and K q are the droop coefficients of the active and reactive power loops, respectively; f , f * , V , V * represent the actual and rated values of frequency and voltage. The droop characteristics between active power and frequency, as well as between reactive power and voltage, for a grid-forming inverter are shown in Figure 3.
In Figure 3, f and V represent the output frequency and voltage amplitude, respectively; f * and V* denote the rated frequency and voltage setpoints; P and Q denote the active and reactive power; P1, P2 and Q1, Q2 indicate specific power operating points, with f 1 , f 2 and V1, V2 being their corresponding steady-state frequency and voltage values dictated by the droop mechanism.
As shown in Figure 3a, when the active power output of the inverter rises to P 1 , the system operating point shifts along the droop curve, causing the frequency to drop from the rated value f * to f 1 . This reflects an inherent limitation of droop control: an increase in power output leads to a frequency deviation Δ f = f 1 f * . Similarly, in Figure 3b, an increase in reactive power output to Q 1 causes the output voltage to drop from V * to V 1 , resulting in a voltage deviation Δ V . This deviation from the rated value is an inherent characteristic of droop control, reflecting its nature as a power allocation mechanism under non-communication conditions. However, such steady-state deviations in voltage and frequency may affect the system’s power quality and long-term stable operation; therefore, they must be compensated for through secondary control.

2.4. Voltage–Current Double-Closed-Loop Control

The droop control loop outputs reference commands for voltage amplitude, phase, and frequency. To generate the final PWM signals that drive the inverter bridge, the inner-loop control must rapidly and accurately track the voltage and current. Since the controlled variables are AC quantities, using a Proportional–Integral (PI) controller directly would result in steady-state error. Therefore, the Park transformation is typically employed to convert variables from the three-phase stationary coordinate system to the two-phase synchronous rotating d-q coordinate system, thereby achieving tracking without steady-state error [32]. The system dynamic equations within the d-q rotating reference frame are expressed as follows:
L d i d d t = v d R i d u d + ω L i q L d i q d t = v q R i q u q ω L i d
C d u d d t = i d i gd + ω C u q C d u q d t = i q i gq ω C u d
where i d and i q represent the d-axis and q-axis components of the inverter output current, respectively; u d and u q denote the d-axis and q-axis components of the output voltage at the filter capacitor, respectively; v d and v q are the d-axis and q-axis internal control voltage variables generated by the inner current loop controllers, respectively; i g d and i g q denote the d-axis and q-axis components of the load-side current, respectively; R and L represent the equivalent resistance and inductance of the output filter, respectively; and C denotes the capacitance of the filter capacitor; and ω is the fundamental angular frequency of the system provided by the outer droop controller.
In a rotating coordinate system, the mainstream control strategies include voltage–current double-closed-loop control and voltage single loop control. This paper adopts the voltage–current double-closed-loop control structure, which offers superior dynamic performance. Its specific block diagram is shown in Figure 4.
As illustrated in Figure 4, the control structure consists of a cascaded outer voltage loop and an inner current loop. The outer voltage loop utilizes PI controllers to regulate the filter capacitor voltages, namely the d-axis voltage U d and the q-axis voltage U q , so that they accurately track the reference commands generated by the outer droop controller, i.e., the d-axis voltage reference U dref and the q-axis voltage reference U qref . The outputs of this voltage loop serve as the reference signals for the inner current loop, i.e., the d-axis current reference i dref and the q-axis current reference i qref . Subsequently, the inner current loop employs PI controllers to regulate the inductor currents, including the d-axis inductor current i d and the q-axis inductor current i q , thereby ensuring fast dynamic response and overcurrent protection. To eliminate the inherent cross-coupling between the d-axis and q-axis in the synchronous rotating frame, feedforward decoupling terms are introduced: the term ω C f for the voltage loop, where ω is the synchronous angular frequency and C f is the filter capacitor; and the term ω L f for the current loop, where L f is the filter inductor. Furthermore, the grid-side voltages, i.e., the d-axis grid voltage U gd and the q-axis grid voltage U gq , are fed forward to the output of the current controllers to enhance the disturbance rejection capability and overall stability of the system. Finally, the outputs of the current controllers are transformed into three-phase reference voltages U aref , U bref , U cref , which are sent to the modulation module.
In grid-forming control strategies, reference values for voltage magnitude, frequency and phase are first obtained through the droop control loop. Then, the voltage loop undergoes PI control and a decoupling stage to derive the reference values for the inner current loop. The current loop uses PI control and a decoupling stage to generate the output voltage command. Finally, the output voltage amplitude command is combined with phase information, and the PWM module generates the inverter switching signals. Although inner-loop control enables precise tracking of voltage and current, it cannot correct the system-level steady-state error introduced by the primary droop control itself.

3. Secondary Control Strategy for Distributed Grid-Forming Inverters Based on a Consensus Algorithm

To fundamentally eliminate the voltage and frequency deviations introduced by droop control, this paper proposes a distributed secondary control strategy based on consensus algorithm, and its system architecture is shown in Figure 5. This control architecture employs a hierarchical structure, in which each inverter forms a local secondary controller by exchanging information with its neighboring nodes. Specifically, voltage and frequency deviations are compensated for by PI controllers coordinated by the consensus algorithm. These compensation signals are superimposed onto the droop control references, thereby dynamically adjusting the inverter output to restore the system to rated operating conditions without relying on a central controller.
In Figure 5, U0 represents the nominal rated voltage reference; Ui and Uj denote the measured voltage amplitudes of the local inverter i and its neighboring node j, respectively; fi and fj represent their corresponding measured operational frequencies. The parameters ki, kj and k1, k2, k3 denote the active power-sharing coefficients and consensus coupling gains among the distributed units. ΔUi and Δfi are the voltage and frequency compensation signals generated by the secondary consensus PI controllers, which are subsequently fed into the primary droop control layer. P1, P2, and P3 represent the measured active power outputs of the respective inverters. The numbered labels ① and ② denote the voltage/frequency deviation compensation module and the power-sharing regulation module, respectively.

3.1. Graph Theory

To design a distributed secondary control strategy, graph theory is employed to describe the communication topology among inverters [33]. The system is modeled as an undirected graph G = ( V , E ) , where V = 1 , 2 , , N is the set of nodes and E V × V is the set of communication links. Each inverter i V communicates with a subset of its neighboring inverters, denoted as N i = j V j , i E . The adjacency relationship between nodes is defined by the symmetric adjacency matrix A = a i j N × N , where a i j = 1 if there is a communication link between nodes i and j ; otherwise a i j = 0 [34]. The Laplacian matrix of the graph is given by L = D A , where D = d i a g d i is the degree matrix. The diagonal elements of the degree matrix represent the number of communication links connected to each node, defined as the row sum of the adjacency matrix, i.e., d i = j N i a i j .
This graph-theoretic framework lays the foundation for consensus-based distributed control [35], in which each node updates its control input using local measurements and information from neighboring nodes.

3.2. Secondary Control Strategy

The proposed distributed secondary control strategy is designed to eliminate frequency and voltage deviations caused by primary droop control, while maintaining the decentralized nature of the control architecture. Each inverter performs secondary control actions locally based on local measurements and voltage/frequency information obtained from neighboring nodes. The input signals for the secondary controller, based on the consensus algorithm, are as follows:
ξ ˙ i f t = j N i a i j f i t f j t + f * f i t
ξ ˙ i V t = j N i a i j V i t V j t + V * V i t
where f i and V i are the local frequency and voltage; f j and V j represent the frequency and voltage of the neighboring node. The distributed secondary controller generates control inputs ξ ˙ i f t and ξ ˙ i V t for frequency and voltage regulation. Specifically, the compensation signals are calculated as follows:
δ f i = k f k P f ξ ˙ i f t + k I f ξ ˙ i f t dt
δ V i = k V k P V ξ ˙ i V t + k I V ξ ˙ i V t dt
where k f and k V are the feedforward gains of the corresponding PI controller; k P f and k I f are the proportional and integral coefficients of the frequency PI controller, respectively; k P V and k I V are the proportional and integral coefficients of the voltage PI controller, respectively.
The generated secondary compensation signals are superimposed on the primary droop control to form the final control commands:
f i = f * K p P i P i * + δ f i V i = V * K q Q i Q i * + δ V i

3.3. Stability Proof of the Secondary Controller

To prove the stability of the proposed secondary control strategy, this section presents a stability proof based on Lyapunov functions. Since the dynamic response of the primary droop control is much faster than that of the distributed secondary control based on communication networks, this paper introduces a multiple time-scale separation assumption: namely, that within the timescale of the secondary control, the physical-layer dynamics constituted by the primary droop control have reached a quasi-steady state. Based on this assumption, the equation shown in Equation (8) can be transformed into:
f = f * 1 + δ f V = V * 1 + δ V
where f , P , δ f , V , Q , δ V are all N × 1 vectors. Define the error vectors as:
e f = f f * 1 e V = V V * 1
Based on the multi-time-scale separation assumption in Equation (9), we obtain e f = δ f and e V = δ V . Combining Equations (4), (6) and (10), the state-space representation of the system is derived as follows:
ξ ˙ f = L + I e f ξ ˙ V = L + I e V
Let T = L + I . According to graph theory, T is a positive definite matrix. Substituting Equations (6) into (9) and combining them with (10), the error mapping relationship is derived as follows:
e f = k f k P f ξ ˙ f + k I f ξ f e V = k V k P V ξ ˙ V + k I V ξ V
Substituting Equations (10) and (11) into (12):
e f = I + k f k P f L + I 1 H f k f k I f ξ f e V = I + k V k P V L + I 1 H V k V k I V ξ V
Clearly, H f and H V are positive definite. Define the Lyapunov candidate function for the system as:
V ˜ = 1 2 ξ f Τ ξ V Τ ξ f ξ V
Obviously, V ˜ are positive definite. Taking its time derivative and substituting Equation (11):
V ˜ ˙ = ξ f Τ ξ V Τ ξ ˙ f ξ ˙ V   = ξ f Τ ξ V Τ L + I e f L + I e V
Substituting Equation (13) into the above expression:
V ˜ ˙ = ξ f Τ ξ V Τ k f k I f T H f 0 0 k V k I V T H V Θ ξ f ξ V
Since the gains such as k f and k V are all positive, the matrix Θ is positive definite. Therefore, V ˜ ˙ _ 0 holds true for all, and V ˜ ˙ = 0 if and only if ξ f Τ ξ V Τ = 0 . According to LaSalle’s invariance principle, the system state will asymptotically converge to the origin. From Equation (13), it follows that when the system state asymptotically converges to 0, the system error is also 0. Therefore, the proposed distributed secondary control strategy satisfies global asymptotic stability under the multiple time-scale separation assumption and can effectively eliminate frequency and voltage deviations in the system.

4. Simulation Analysis

To validate the proposed control strategy, a microgrid system as shown in Figure 6 is constructed, including multiple distributed energy storage controlled by grid-forming control and loads. Specific system parameters are listed in Table 1. Subsequently, through simulation and analysis of the dynamic responses of the system output voltage and frequency, the proposed strategy’s effectiveness in ensuring system stability and improving power quality under adjacent communication conditions is evaluated.

4.1. Effectiveness Validation of Voltage and Frequency

To verify the effectiveness of the proposed control strategy in a multi-point distributed grid-forming energy storage system, simulation comparisons are conducted on the dynamic responses of voltage amplitude, reactive power, frequency, and active power under both conventional and improved grid-forming control. Among them, Figure 7 and Figure 8 show the variations in voltage amplitude and reactive power, while Figure 9 and Figure 10 illustrate the responses of frequency and active power.
Figure 7a shows the voltage response waveform under conventional grid-forming control. After system startup, the voltage drops from 340 V to 310 V, with a recovery time of approximately 1 s, indicating that the conventional strategy has a limited ability to suppress initial fluctuations. In contrast, under the improved strategy shown in Figure 8a, the voltage fluctuates only to 330 V, and the recovery time is reduced to less than 0.5 s, demonstrating that the improved strategy effectively suppresses voltage sags and enhances transient response performance.
The stability of reactive power has a significant impact on the operational performance of distributed power systems, particularly during load switching or system startup. Figure 7b shows the reactive power response waveform under the conventional grid-forming control strategy. At system startup, the reactive power fluctuates by approximately 3.5 kW and takes 4 s to stabilize. Such severe fluctuations may jeopardize power quality and system stability. In contrast, Figure 8b illustrates the reactive power response under the improved strategy. The peak fluctuation is reduced to 2.5 kW, and stability is restored within 0.3 s, validating the effectiveness of the improved strategy in enhancing dynamic response speed and disturbance immunity.
A comprehensive analysis of the dynamic responses of voltage and reactive power reveals that the improved grid-forming control strategy offers significant advantages in enhancing the system’s steady-state performance. Comparing Figure 7 and Figure 8, under the traditional strategy, the system suffers from a deep voltage sag and large reactive power fluctuations at startup, with recovery times of about 1 s and 4 s, respectively. In contrast, the improved strategy effectively suppresses the amplitude of fluctuations and reduces the recovery times for voltage and reactive power to 0.5 s and 0.3 s, respectively, significantly enhancing the system’s robustness and dynamic response capability, thereby validating its effectiveness in improving power quality and operational stability.
Furthermore, the simulation results of the dynamic responses of frequency and active power for the multi-point distributed grid-forming energy storage system under the traditional and improved grid-forming control strategies are shown in Figure 9 and Figure 10.
In Figure 9a, under conventional grid-forming control, the bus frequency jumps from 50 Hz to 50.3 Hz at the moment of startup, exhibiting significant fluctuations and taking approximately 0.5 s to gradually recover. In contrast, Figure 10a shows that under the improved strategy, frequency fluctuations are significantly reduced, the response process is smoother, and the recovery time is also significantly shortened. The simulation results demonstrate that the proposed strategy can effectively suppress frequency deviations, improve the system’s frequency stability and dynamic response speed, and reduce the adverse effects of disturbances on the power grid.
Figure 9b shows the active power response waveform under conventional grid-forming control. During system startup, the active power rises rapidly, peaking at over 5 kW. Overall, the response exhibits significant fluctuations and a high steady-state value, reflecting shortcomings in the system’s energy distribution and dynamic stability. Figure 10b shows the active power response under improved grid-forming control. Compared to the traditional strategy, the improved strategy significantly suppresses peak fluctuations in active power, shortens the settling time, and results in a more balanced steady-state value, indicating that the proposed strategy effectively improves the dynamic regulation capability of active power and enhances the overall stability of the system.

4.2. Effectiveness Validation of the Plug-and-Play Function

To verify the plug-and-play performance of the proposed strategy in the multi-point system, simulation tests are conducted under load disturbance scenarios. The specific chronological sequence of the system operational events is detailed as follows: At t = 4.0 s, a switching load is connected to each inverter node. At t = 8.0 s, all previously added switching loads are completely disconnected from the system. Figure 11 and Figure 12 show the response waveforms of voltage and reactive power, while Figure 13 and Figure 14 illustrate the variations in frequency and active power.
Figure 11a illustrates the response characteristics of the bus voltage under the conventional grid-forming control strategy. During load switching at 4 s and 8 s, the bus voltage drops sharply from nearly 600 V to −600 V, with a fluctuation range of 1200 V, indicating that the conventional strategy has limited voltage regulation capability. In contrast, as shown in Figure 12a, under the improved strategy, the voltage under the same operating conditions fluctuates only from approximately 330 V to 290 V, with the fluctuation range reduced to about 40 V and a significantly faster recovery speed. This demonstrates that the improved strategy can effectively suppress voltage disturbances and reduce the risk of system failures.
Figure 11b shows the dynamic response of reactive power under the conventional grid-forming control strategy. During load switching at 4 s and 8 s, the reactive power jumps sharply from near 0 W to approximately 10 kW and then drops rapidly, with these significant fluctuations posing a threat to system stability. In contrast, Figure 12b shows a much smoother reactive power response under the improved strategy. Under the same operating conditions, the reactive power changes from approximately 1 kW to 5 kW and then quickly stabilizes. While the maximum fluctuation amplitude under traditional control approaches 10 kW, the improved strategy suppresses it to approximately 4 kW while significantly shortening the recovery time, indicating that the improved strategy effectively enhances the system’s reactive power regulation capability and dynamic stability.
Figure 13a shows the frequency response of the system under the conventional grid-forming control strategy. Significant frequency fluctuations occur during load switching at 2 s and 6 s. Specifically, after the 6 s load shedding, the frequency drops from 50.2 Hz to 49.8 Hz, with a fluctuation range of 0.4 Hz, and it takes approximately 1 s to recover to 50 Hz. This indicates that the conventional strategy suffers from insufficient frequency stability and slow recovery. Figure 14a illustrates the frequency response under the improved control strategy. Under the same conditions, the range of frequency fluctuations is significantly reduced, with the maximum fluctuation controlled within 0.1 Hz, and the recovery time shortened to less than 1 s. This demonstrates that the improved strategy effectively enhances frequency stability and dynamic response speed.
Figure 13b shows the active power response waveform under the traditional grid-forming control strategy. When the load is connected at 2 s and disconnected at 6 s, the active power exhibits severe fluctuations with a maximum amplitude approaching 20 kW and a long recovery process. Such significant fluctuations not only threaten system stability but may also cause overloads or operational disturbances to equipment on the load side, reflecting the traditional strategy’s insufficient dynamic regulation capability in responding to sudden load changes. Figure 14b shows the active power response under the improved control strategy. Under the same load operation conditions, the amplitude of active power fluctuations is significantly reduced; after the load is disconnected at 6 s, the fluctuation is controlled within 4 kW, and stability is restored within a short time. The results indicate that the improved strategy effectively suppresses dynamic fluctuations in active power, shortens the recovery time, and enhances the system’s energy management efficiency and operational stability.

5. Conclusions

This paper proposes a power quality improvement strategy based on grid-forming control and a consensus algorithm for power grids with high-penetration distributed renewable energy integration. Through simulation comparisons with traditional grid-forming control in terms of the dynamic responses of voltage amplitude, reactive power, frequency and active power, the following conclusions are drawn:
Firstly, the proposed improved control strategy significantly reduces voltage and reactive power fluctuations of the system during load switching and improves the power quality and steady-state performance of the system. Secondly, the proposed improved control exhibits obvious advantages in frequency and active power regulation, limiting the frequency error within ±0.01 Hz and the voltage deviation to below 0.5% of the rated value, meeting the requirements of high-precision operation. In addition, the system can respond to load changes more rapidly and recover to a steady state in a shorter time.
In summary, this study effectively enhances the dynamic response capability and operational stability of the system, especially by providing a strong guarantee for the safe and reliable operation of the system under plug-and-play scenarios. It can offer important technical support for the optimal design and application of power grids with high-penetration renewable energy. Furthermore, while the proposed strategy has been validated through specific simulation parameters, its reliance on distributed consensus algorithms inherently provides scalability to a broader class of microgrid networks with varying topologies, provided that the communication graph remains connected. However, the transition to real-world applications introduces practical challenges such as communication delays, data dropouts, and measurement noise. Therefore, future work will focus on the experimental verification of the proposed control framework using a scaled-down physical microgrid platform to evaluate its robustness against these unmodeled practical constraints.
It is worth noting that this study focuses on secondary control operating on a relatively slow timescale. The reported improvements in voltage and frequency stability rely on a stable DC-link voltage, sufficient storage capacity and power margins, and adequate state-of-charge (SOC) management by the energy management system (EMS). However, SOC constraints, storage sizing, converter power limits, and fast transient support are not explicitly modeled in the present study, which constitutes a limitation of the current work. The physical characteristics of different energy storage technologies, such as batteries and supercapacitors, are expected to play a more prominent role in millisecond-level transient dynamics. Therefore, incorporating storage constraints and transient characteristics into the proposed control framework will be an important direction of our future work.

Author Contributions

Conceptualization, M.Z. and R.F.; Methodology, S.Z., M.Z. and H.Y.; Software, S.Z., M.Z. and R.F.; Validation, S.Z. and R.F.; Formal analysis, S.Z. and R.F.; Investigation, M.Z. and R.F.; Resources, M.Z. and H.Y.; Data curation, S.Z., M.Z. and H.Y.; Writing—original draft, S.Z. and R.F.; Writing—review & editing, S.Z. and H.Y.; Visualization, M.Z. and R.F.; Supervision, M.Z. and H.Y.; Project administration, S.Z. and H.Y.; Funding acquisition, H.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Science and Technology Project of State Grid Shanxi Electric Power Co., Ltd., grant number: 52053024000T.

Data Availability Statement

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

Conflicts of Interest

All authors were employed by the State Grid Shanxi Electric Power Company Electric Power Research Institute. The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Valinejad, J.; Marzband, M.; Korkali, M.; Xu, Y.; Al-Sumaiti, A.S. Coalition Formation of Microgrids with Distributed Energy Resources and Energy Storage in Energy Market. J. Mod. Power Syst. Clean. Energy 2020, 8, 906–918. [Google Scholar] [CrossRef]
  2. Deng, F.; Yao, W.; Zhang, X.; Tang, Y.; Mattavelli, P. Review of Impedance-Reshaping-Based Power Sharing Strategies in Islanded AC Microgrids. IEEE Trans. Smart Grid 2023, 14, 1692–1707. [Google Scholar] [CrossRef]
  3. Panda, S.K.; Subudhi, B. A Review on Robust and Adaptive Control Schemes for Microgrid. J. Mod. Power Syst. Clean. Energy 2023, 11, 1027–1040. [Google Scholar] [CrossRef]
  4. Bevrani, H. An Updated Microgrid Hierarchical Control Scheme. In Proceedings of the 2023 10th International Conference on Power and Energy Systems Engineering, Nagoya, Japan, 8–10 September 2023. [Google Scholar] [CrossRef]
  5. Wan, Y.; Wen, G.; Yu, X.; Kurths, J. Distributed Event-Based Resilient Secondary Control for AC Microgrids: A Trust-Reputation Approach. IEEE Trans. Smart Grid 2024, 15, 2116–2128. [Google Scholar] [CrossRef]
  6. Cárdenas, P.A.; Martínez, M.; Molina, M.G.; Mercado, P.E. Development of Control Techniques for AC Microgrids: A Critical Assessment. Sustainability 2023, 15, 15195. [Google Scholar] [CrossRef]
  7. Li, Y.; Gu, Y.; Green, T.C. Revisiting Grid-forming and Grid-Following Inverters: A Duality Theory. IEEE Trans. Power Syst. 2022, 37, 4541–4554. [Google Scholar] [CrossRef]
  8. Poolla, B.K.; Groß, D.; Dörfler, F. Placement and Implementation of Grid-forming and Grid-Following Virtual Inertia and Fast Frequency Response. IEEE Trans. Power Syst. 2019, 34, 3035–3046. [Google Scholar] [CrossRef]
  9. Wu, C.; Wang, J.H.; Wang, Y.; Zhan, C. Deduction of a Unified Control Framework for Grid-forming Converters Considering Power Constraint and Current Protection. Proc. CSEE 2025, 45, 9376–9391. [Google Scholar] [CrossRef]
  10. Qin, X.H.; Fan, C.H.; Qi, L.; Ding, B.; Liu, H.; Yang, S.; Meng, Z.J. Analysis of the Essence of Grid-forming Droop Control and the Impact of Virtual Impedance on Its Source End Characteristic. Proc. CSEE 2025, 45, 5930–5941. [Google Scholar] [CrossRef]
  11. Du, Y.; Lu, X.; Chen, B.; Lin, F. Resiliency Augmented Hybrid AC and DC Distribution Systems with Inverter-Dominated Dynamic Microgrids. IEEE Trans. Smart Grid 2022, 13, 4088–4101. [Google Scholar] [CrossRef]
  12. Rashwan, A.; Mikhaylov, A.; Senjyu, T.; Eslami, M.; Hemeida, A.M.; Osheba, D.S.M. Modified Droop Control for Microgrid Power-Sharing Stability Improvement. Sustainability 2023, 15, 11220. [Google Scholar] [CrossRef]
  13. Zhu, Y.; Wang, F.; Lin, Z.; Fleming, J.; Shi, T.; Guo, H.; Xu, H. Impedance Shaping Method for System-Level Stabilization of Droop-Controlled DC Microgrids. IEEE Trans. Energy Convers. 2025, 40, 409–421. [Google Scholar] [CrossRef]
  14. Wang, Y.; Shi, J.; Ma, N.; Liu, G.; Xin, L.; Liu, Z.; Liu, D.; Xu, Z.; Chen, C. An Improved Secondary Control Strategy for Dynamic Boundary Microgrids toward Resilient Distribution Systems. Energies 2024, 17, 1731. [Google Scholar] [CrossRef]
  15. Jabr, R.A. Economic operation of droop-controlled AC microgrids. IEEE Trans. Power Syst. 2022, 37, 3119–3128. [Google Scholar] [CrossRef]
  16. Petrík, T.; Gravalos, I.; Uhlíř, I.; Libra, M.; Poulek, V. Parametric Damping of Microgrid Frequency Fluctuations at Synchronous Machines with Using Lyapunov Theory for Exciter Regulation. Int. J. Energy Res. 2023, 2023, 5569059. [Google Scholar] [CrossRef]
  17. Yang, T.; Sun, S.; Liu, G.P. Distributed Discrete-Time Secondary Cooperative Control for AC Microgrids with Communication Delays. IEEE Trans. Ind. Electron. 2023, 70, 5949–5959. [Google Scholar] [CrossRef]
  18. Chantola, A.; Sharma, V.; Singh, D. Centralized Secondary Control Strategy on Droop Controlled Inverter-Based Microgrid. In Proceedings of the 2023 Second IEEE International Conference on Measurement, Instrumentation, Control and Automation (ICMICA), Kurukshetra, India, 3–5 May 2024. [Google Scholar] [CrossRef]
  19. Heins, T.; Joševski, M.; Gurumurthy, S.K.; Monti, A. Centralized Model Predictive Control for Transient Frequency Control in Islanded Inverter-Based Microgrids. IEEE Trans. Power Syst. 2023, 38, 2641–2652. [Google Scholar] [CrossRef]
  20. Aluko, A.; Buraimoh, E.; Oni, O.E.; Davidson, I.E. Advanced Distributed Cooperative Secondary Control of Islanded DC Microgrids. Energies 2022, 15, 3988. [Google Scholar] [CrossRef]
  21. Nguyen, T.L.; Nguyen, H.T.; Wang, Y.; Mohammed, O.A.; Anagnostou, E. Distributed Secondary Control in Microgrids Using Synchronous Condenser for Voltage and Frequency Support. Energies 2022, 15, 2968. [Google Scholar] [CrossRef]
  22. Zhu, C.Z.; Yuan, M.T.; Bo, Y.L.; Xia, Y.H.; Liu, K.J.; Wei, W. Distributed Secondary Frequency Regulation Strategy for Virtual Power Plant Based on Improved Exact Diffusion Algorithm. Autom. Electr. Power Syst. 2025, 49, 149–160. [Google Scholar]
  23. Sarathkumar, D.; Maheswari, P.; Manivel, M.; Jayakumar, T.; Sivakumar, R.; Parrthipan, B.K. Decentralized and Distributed Control Strategies for Microgrids: A Review of Key Techniques and Applications. In Proceedings of the 2025 IEEE International Students’ Conference on Electrical, Electronics and Computer Science (SCEECS), Bhopal, India, 18–19 January 2025. [Google Scholar] [CrossRef]
  24. Yu, L.; Shi, D.; Xu, G.; Guo, X.; Jiang, Z.; Jing, C. Consensus Control of Distributed Energy Resources in a Multi-Bus Microgrid for Reactive Power Sharing and Voltage Control. Energies 2018, 11, 2710. [Google Scholar] [CrossRef]
  25. Shafiee, Q.; Guerrero, J.M.; Vasquez, J.C. Distributed Secondary Control for Islanded Microgrids—A Novel Approach. IEEE Trans. Power Electron. 2014, 29, 1018–1031. [Google Scholar] [CrossRef]
  26. Lasabi, O.; Swanson, A.; Jarvis, L.; Aluko, A. Dynamic Distributed Collaborative Control for Equitable Current Distribution and Voltage Recovery in DC Microgrids. Energies 2023, 16, 6657. [Google Scholar] [CrossRef]
  27. Bidram, A.; Davoudi, A.; Lewis, F.L.; Qu, Z. Secondary control of microgrids based on distributed cooperative control of multi-agent systems. IET Gener. Transm. Distrib. 2013, 7, 822–831. [Google Scholar] [CrossRef]
  28. Cai, X.; Nan, X.; Gao, B.; Yuan, J. Distributed Event-Triggered Secondary Control of Microgrids with Quantization Communication. IEEE Trans. Power Syst. 2023, 38, 4572–4581. [Google Scholar] [CrossRef]
  29. Rosso, R.; Wang, X.; Liserre, M.; Lu, X.; Engelken, S. Grid-Forming Converters: Control Approaches, Grid-Synchronization, and Future Trends—A Review. IEEE Open J. Ind. Appl. 2021, 2, 93–109. [Google Scholar] [CrossRef]
  30. Liu, J.; Miura, Y.; Ise, T. Comparison of Dynamic Characteristics Between Virtual Synchronous Generator and Droop Control in Inverter-Based Distributed Generators. IEEE Trans. Power Electron. 2016, 31, 3600–3611. [Google Scholar] [CrossRef]
  31. Guerrero, J.M.; Vasquez, J.C.; Matas, J.; de Vicuna, L.G.; Castilla, M. Hierarchical Control of Droop-Controlled AC and DC Microgrids—A General Approach Toward Standardization. IEEE Trans. Ind. Electron. 2011, 58, 158–172. [Google Scholar] [CrossRef]
  32. Cao, X.; Dong, K.; Wei, X. An Improved Control Method Based on Source Current Sampled for Shunt Active Power Filters. Energies 2020, 13, 1405. [Google Scholar] [CrossRef]
  33. Cao, Y.; Gao, Y.; Zhang, G.; Wang, J.; Fu, C.; Niu, S. Secondary Frequency and Voltage Regulation of dVOC-Based Microgrids Based on Distributed Model Predictive Control. Energies 2026, 19, 1834. [Google Scholar] [CrossRef]
  34. Olfati-Saber, R.; Fax, J.A.; Murray, R.M. Consensus and Cooperation in Networked Multi-Agent Systems. Proc. IEEE 2007, 95, 215–233. [Google Scholar] [CrossRef]
  35. Olfati-Saber, R.; Murray, R.M. Consensus Problems in Networks of Agents with Switching Topology and Time-Delays. IEEE Trans. Autom. Control 2004, 49, 1520–1533. [Google Scholar] [CrossRef]
Figure 1. Typical structure of an AC microgrid.
Figure 1. Typical structure of an AC microgrid.
Energies 19 02890 g001
Figure 2. Typical control structure of a three-phase grid-forming inverter.
Figure 2. Typical control structure of a three-phase grid-forming inverter.
Energies 19 02890 g002
Figure 3. Droop characteristic curves: (a) Frequency–active power, and (b) Voltage–reactive power.
Figure 3. Droop characteristic curves: (a) Frequency–active power, and (b) Voltage–reactive power.
Energies 19 02890 g003
Figure 4. Voltage–current double-closed-loop control structure diagram.
Figure 4. Voltage–current double-closed-loop control structure diagram.
Energies 19 02890 g004
Figure 5. Distributed secondary control structure.
Figure 5. Distributed secondary control structure.
Energies 19 02890 g005
Figure 6. Test system of the AC microgrid.
Figure 6. Test system of the AC microgrid.
Energies 19 02890 g006
Figure 7. Bus voltage magnitude and reactive power output of distributed energy storage under traditional grid-forming control: (a) voltage and (b) reactive power.
Figure 7. Bus voltage magnitude and reactive power output of distributed energy storage under traditional grid-forming control: (a) voltage and (b) reactive power.
Energies 19 02890 g007
Figure 8. Bus voltage magnitude and reactive power output of distributed energy storage under improved grid-forming control: (a) voltage and (b) reactive power.
Figure 8. Bus voltage magnitude and reactive power output of distributed energy storage under improved grid-forming control: (a) voltage and (b) reactive power.
Energies 19 02890 g008
Figure 9. Frequency and active power output of distributed energy storage under traditional grid-forming control: (a) frequency and (b) active power.
Figure 9. Frequency and active power output of distributed energy storage under traditional grid-forming control: (a) frequency and (b) active power.
Energies 19 02890 g009
Figure 10. Frequency and active power output of distributed energy storage under improved grid-forming control: (a) frequency and (b) active power.
Figure 10. Frequency and active power output of distributed energy storage under improved grid-forming control: (a) frequency and (b) active power.
Energies 19 02890 g010
Figure 11. Bus voltage magnitude and reactive power output of distributed energy storage under load disturbance with traditional grid-forming control: (a) voltage and (b) reactive power.
Figure 11. Bus voltage magnitude and reactive power output of distributed energy storage under load disturbance with traditional grid-forming control: (a) voltage and (b) reactive power.
Energies 19 02890 g011
Figure 12. Bus voltage magnitude and reactive power output of distributed energy storage under load disturbance with improved grid-forming control: (a) voltage and (b) reactive power.
Figure 12. Bus voltage magnitude and reactive power output of distributed energy storage under load disturbance with improved grid-forming control: (a) voltage and (b) reactive power.
Energies 19 02890 g012
Figure 13. Frequency and active power output of distributed energy storage under load disturbance with traditional grid-forming control: (a) frequency and (b) active power.
Figure 13. Frequency and active power output of distributed energy storage under load disturbance with traditional grid-forming control: (a) frequency and (b) active power.
Energies 19 02890 g013
Figure 14. Frequency and active power output of distributed energy storage under load disturbance with improved grid-forming control: (a) frequency and (b) active power.
Figure 14. Frequency and active power output of distributed energy storage under load disturbance with improved grid-forming control: (a) frequency and (b) active power.
Energies 19 02890 g014
Table 1. Simulation parameters.
Table 1. Simulation parameters.
ParameterValue
DC-link Voltage700 V
Switching Frequency10 kHz
Rated Voltage310 V
Rated Frequency50 Hz
Line Resistance Rg5 × 10−3 Ω
Line Reactance Lg1.5 × 10−4 H
Filter Inductance Lf3 × 10−3 H
Filter Capacitance Cf2 × 10−5 F
Rated Energy Storage Capacity12 kW
Switching Load8 kW
Local Load2.8 kW
Common Load5.8 kW
Active Power Droop Coefficient Kp3.14 × 10−4 Hz/kW
Reactive Power Droop Coefficient Kq6.22 × 10−4 V/kVar
Feedforward Gain k f / k V 10/100
Outer Voltage Loop PI Controller parameters50/100 s−1
Inner Current Loop PI Controller parameters0.5/10 s−1
Secondary Frequency PI Controller k P f / k I f 0.1/0.1 s−1
Secondary Voltage PI Controller k P V / k I V 0.5/5 s−1
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

Zhang, S.; Zhang, M.; Yao, H.; Fan, R. Power Quality Improvement Strategy Based on Grid-Forming Control and Consensus Algorithm. Energies 2026, 19, 2890. https://doi.org/10.3390/en19122890

AMA Style

Zhang S, Zhang M, Yao H, Fan R. Power Quality Improvement Strategy Based on Grid-Forming Control and Consensus Algorithm. Energies. 2026; 19(12):2890. https://doi.org/10.3390/en19122890

Chicago/Turabian Style

Zhang, Shifeng, Min Zhang, Hongmin Yao, and Rui Fan. 2026. "Power Quality Improvement Strategy Based on Grid-Forming Control and Consensus Algorithm" Energies 19, no. 12: 2890. https://doi.org/10.3390/en19122890

APA Style

Zhang, S., Zhang, M., Yao, H., & Fan, R. (2026). Power Quality Improvement Strategy Based on Grid-Forming Control and Consensus Algorithm. Energies, 19(12), 2890. https://doi.org/10.3390/en19122890

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