Hierarchical Coordinated Optimization for PV–Battery Microgrids: Virtual-Impedance Droop, Consensus Control, and Tie-Line Balancing

Microgrids that combine photovoltaic (PV) generation with energy battery storage face a control problem that is difficult to solve at a single level. Converter interfaces must regulate local voltage and frequency, the microgrid must balance generation and demand, and a group of microgrids must exchange power without overloading tie lines. A three-layer hierarchy separates these tasks so that each layer can operate on the variables and timescale it can handle reliably.

The architecture examined here divides a PV–battery microgrid into an equipment layer, a microgrid layer, and a microgrid-group layer. The equipment layer uses local droop control with virtual impedance. The microgrid layer uses a distributed consensus algorithm to restore frequency and voltage and to share power according to capacity. The group layer uses tie-line power balancing and a capacity-ratio consensus variable to coordinate exchange among microgrids. The validation combines a seven-microgrid simulation with a laboratory three-phase inverter platform.

Control Problem and Layer Decomposition

Direct centralized optimization of all converters in a multi-microgrid system is communication-intensive and can weaken local autonomy. It also mixes different control objectives: power quality at the converter terminals, power balance inside a microgrid, and power exchange between microgrids. The layered structure assigns each objective to a separate control level and allows the upper levels to compensate for the steady-state errors left by the lower levels.

Table 1. Control layers, objectives, and main variables
Layer Controlled scope Main objective Method Key variables
Equipment layer Converters, metering, protection, and energy-conversion equipment Local voltage and frequency support, power quality, and proportional load sharing Droop control with virtual impedance; dq-frame power calculation; PI voltage-loop regulation \(\omega\), \(V\), \(P\), \(Q\), \(i_o\), \(a_v\)
Microgrid layer PV generation, battery storage, and local loads Restore bus voltage and frequency; balance internal generation and demand; share active and reactive power by capacity Distributed consensus with secondary compensation terms \(\Omega_i\), \(e_i\), \(P_i\), \(Q_i\)
Microgrid-group layer Multiple microgrids and their tie lines Coordinate power exchange; maintain tie-line power balance; preserve regional autonomy Capacity-ratio consensus and event-driven tie-line power balancing \(\beta_n\), \(P_{\max,n}\), \(P_{\mathrm{ref},n}\)

The separation is functional rather than merely organizational. The equipment layer acts on fast converter dynamics. The microgrid layer acts on slower restoration and sharing errors. The group layer acts on inter-microgrid power exchange and can leave a microgrid islanded when its capacity ratio does not require participation.

Battery energy storage cabinet with power conversion equipment
Battery storage provides the controllable energy buffer that the equipment and microgrid layers regulate.

Device Layer: Virtual-Impedance Droop Control

The equipment layer includes the metering, protection, and energy-conversion devices that connect PV and battery storage to the microgrid. Its converter control adopts the conventional \(p\)–\(f\) and \(Q\)–\(V\) droop characteristic:

\[
\omega=\omega_n-mP,\qquad V=V_n-nQ
\]

where \(\omega\) and \(V\) are the output angular frequency and voltage amplitude of a distributed source, \(\omega_n\) and \(V_n\) are their references, \(P\) and \(Q\) are the active and reactive power outputs, and \(m\) and \(n\) are the droop coefficients. Adjusting \(m\) and \(n\) shifts the operating point and changes how power is distributed among converters.

The difficulty is that practical PV–battery microgrids have unequal external line impedances. With a fixed droop coefficient, the same power output does not produce the same voltage drop at every converter, so frequency and voltage can retain static deviations and reactive power may not be shared accurately. Virtual impedance is introduced to make the converter output impedance more consistent and to reduce circulating current:

\[
u’_{\mathrm{ref}}(s)=u_{\mathrm{ref}}(s)-Z_v(s)i_o(s)
\]

where \(u_{\mathrm{ref}}\) is the reference voltage before compensation, \(u’_{\mathrm{ref}}\) is the modified reference, \(Z_v(s)\) is the virtual impedance, and \(i_o(s)\) is the output current. With equal virtual resistance and virtual reactance, \(R_v=X_v=a_v\), the compensation can be parameterized by a single coefficient \(a_v\). The operating-point power factor is used to select this coefficient:

\[
\cot\phi=\frac{P_2}{Q_2}
\]

where \(\phi\) is the power-factor angle and \(P_2\), \(Q_2\) are the active and reactive power at the operating point. When the virtual impedance is matched to the feeder conditions, line-impedance mismatch is compensated and power can be distributed more evenly.

The implementation follows a dq-frame power calculation. The instantaneous active and reactive powers are obtained from the inverter output voltage and current components:

\[
P’=u_{od}i_{od}+u_{oq}i_{oq},\qquad
Q’=u_{oq}i_{od}-u_{od}i_{oq}
\]

where \(u_{od}\), \(u_{oq}\) are the d- and q-axis output voltages and \(i_{od}\), \(i_{oq}\) are the corresponding currents. A low-pass filter extracts the average powers used by the droop controller:

\[
P=\frac{\omega_c}{s+\omega_c}P’,\qquad
Q=\frac{\omega_c}{s+\omega_c}Q’
\]

where \(s\) is the Laplace operator and \(\omega_c\) is the cutoff frequency. The filtered \(P\) and \(Q\) enter the \(p\)–\(f\) and \(Q\)–\(V\) loops to generate the reference phase and amplitude. A PI controller then regulates the voltage loop, and a P controller tracks the voltage-loop reference to provide transient compensation. This sequence keeps the converter response fast while the virtual-impedance term corrects the steady-state sharing error.

Microgrid Layer: Consensus-Based Restoration

The equipment layer leaves a steady-state error by design: droop control must allow frequency and voltage to deviate so that power can be shared. The microgrid layer compensates this error and balances generation and demand inside the microgrid. It uses a distributed consensus algorithm rather than a central controller, so each node exchanges information only with its neighbors.

For a local node \(i\) with state variable \(x_i\), the continuous-time consensus update is

\[
\dot{x}_i=\sum_{j\in N_i}a_{ij}(x_j-x_i)
\]

where \(x_j\) is the state of a neighboring node and \(a_{ij}\) is the connection weight. The corresponding weighted-average form is

\[
w_{ij}=\frac{a_{ij}}{\sum_{k=1}^{N}a_{ik}},\qquad
x_i=\sum_{j\in N_i}w_{ij}x_j
\]

If the communication graph is connected, the states converge to a common value. This property is used for frequency and active-power compensation, and for voltage and reactive-power compensation.

The secondary frequency term enters the droop characteristic as an additional compensation variable:

\[
\omega_i=\omega_n-m_iP_i+\Omega_i
\]

where \(\Omega_i\) is the compensation produced by the consensus loop and \(k_i\) is the controller gain. If the adjacency matrix is zero, the distributed sources do not communicate and the compensation reduces to a local integral of the frequency error. If the adjacency matrix is nonzero, the sources exchange information and the compensation represents the vertical shift of the droop characteristic needed to restore frequency.

Voltage restoration follows the same layered logic. The voltage reference is adjusted by a secondary compensation term \(e_i\):

\[
V_i=V_n-n_iQ_i+e_i
\]

The term \(e_i\) is driven by the local voltage error through the gain \(\lambda_i\), and by a reactive-power mismatch term weighted by \(\beta_i\) and the coefficients \(b_{ij}\). The rated reactive powers of sources \(i\) and \(j\) are denoted \(Q_{in}\) and \(Q_{jn}\). Setting \(\beta_i\) and \(b_{ij}\) determines the trade-off between accurate reactive-power sharing and tight voltage restoration; increasing the sharing weight improves proportionality but can slow the voltage recovery.

Microgrid Group: Tie-Line Power Balance

The group layer coordinates several microgrids connected by tie lines. Its objective is not to force every microgrid to the same operating point, but to keep the tie-line exchange within limits while allowing each microgrid to retain regional autonomy. The coordination variable is the capacity ratio \(\beta_n\).

For microgrid \(n\), the maximum available generation is the sum of the rated maximum outputs of its distributed sources:

\[
P_{\max,n}=\sum_{i=1}^{N_n}P_{\max,n,i}
\]

The capacity ratio is the current generation divided by this maximum:

\[
\beta_n=\frac{P_{\mathrm{gen},n}}{P_{\max,n}}
\]

A small \(\beta_n\) means that the microgrid has reserve capacity and can export power. A large \(\beta_n\) means that it has little headroom and may struggle with a sudden load increase. A threshold is therefore imposed to keep sufficient reserve. In the reported setting, the threshold is set empirically to 1.

The group controller issues an optimization signal when a microgrid’s capacity ratio crosses the threshold; otherwise it waits. The update is event-driven and uses a state-transition matrix to propagate the capacity ratio through the communication topology. The iterative update is written as

\[
\beta_n(k+1)=\beta_n(k)+\Delta\beta_n(k)
\]

where \(\Delta\beta_n\) is the change in the capacity ratio at iteration \(k\). The active-power reference for the next step is adjusted in proportion to the available capacity:

\[
P_{\mathrm{ref},n}(k+1)=P_{\mathrm{ref},n}(k)+P_{\max,n}\Delta\beta_n(k)
\]

Constraints on tie-line transmission and generation output are then applied. This keeps the tie-line power balanced while allowing a microgrid that does not participate in the consensus to remain islanded and operate autonomously.

Validation on a Seven-Microgrid System

The method was tested on a seven-microgrid system. Each microgrid contained PV generation and battery storage, with a maximum output of 10 p.u. per microgrid and a tie-line resistance of 0.5 p.u. The case assumed that microgrids 1 and 3 could not meet their local load demand, while the other microgrids had sufficient generation. Numerical simulation was performed in Simulink on an AMD Ryzen 7 CPU with an NVIDIA GeForce RTX 2060 GPU and 32 GB of memory.

Table 2. Test-system and experimental-platform parameters
Item Value or specification Role in validation
Test system 7 microgrids; PV and battery storage in each Multi-microgrid coordination test
Maximum output per microgrid 10 p.u. Capacity-ratio normalization
Tie-line resistance 0.5 p.u. Network coupling between microgrids
Capacity-ratio threshold 1 Reserve trigger for power exchange
Simulation environment Simulink; AMD Ryzen 7, RTX 2060, 32 GB Numerical case study
DC source PRD series, 2000 V/667 A Experimental DC bus
Programmable load IT8615 AC load Load emulation
Controller TMS320F28035PNT Three-phase inverter control
Filter capacitor 650 µF, 2500 V DC Output filtering
Filter inductor DER-2133 Output filtering
Switch D2X-A150SS-UL, 500 V/100 A Inverter switching

At the equipment layer, the virtual-impedance droop controller improved voltage sharing and reactive-power sharing relative to the conventional droop controller. Active-power sharing was not degraded. This is consistent with the intended function of virtual impedance: it corrects the effect of unequal feeder impedance without changing the active-power dispatch characteristic.

At the microgrid layer, the consensus algorithm made active and reactive power follow the capacity ratio. The microgrid layer therefore performed the expected secondary function: it removed the sharing error left by local droop control and restored the bus variables toward their references.

At the group layer, the tie-line power-balancing method produced consistent capacity ratios among the participating microgrids. Microgrid 7 did not participate in the consensus calculation and exchanged no power with the others, forming an autonomous region. The remaining microgrids participated in the consensus and maintained consistent tie-line capacity ratios, which is the intended group-level result.

The laboratory platform used a three-phase inverter with a PRD-series 2000 V/667 A DC source and an IT8615 AC programmable load. The control circuit transferred sampled information to a PC-based control code through a digital signal processor and generated drive signals; the drive signals were amplified to operate the switches. The main controller was a TMS320F28035PNT, the filter capacitor was 650 µF at 2500 V DC, the filter inductor was DER-2133, and the switch was a D2X-A150SS-UL rated at 500 V and 100 A.

The output waveforms showed active-power sharing among the distributed sources, fast convergence of voltage to the given reference, and reactive-power balancing according to capacity. Some sources recovered to the voltage reference after a transient response. Taken together, the waveforms indicate that the layered controller achieved voltage compensation and reactive-power sharing without sacrificing active-power sharing.

Interpretation and Limitations

The main technical value of the hierarchy is that it does not require one controller to solve all objectives at once. The equipment layer maintains local power quality and proportional sharing. The microgrid layer corrects steady-state errors and allocates power by capacity. The group layer manages tie-line exchange and preserves autonomy for microgrids that do not need to participate. This division is consistent with the observed behavior: the lower layer provides fast response, the middle layer restores accuracy, and the upper layer coordinates exchange.

The validation also has clear boundaries. The tests concern short-time-scale electrical coordination; long-time-scale scheduling, forecast uncertainty, and battery aging are not part of the reported results. The capacity-ratio threshold is set empirically at 1, and its sensitivity is not established by the reported cases. The experimental platform is a laboratory inverter system rather than a field installation. These limitations do not invalidate the layered control behavior, but they define the conditions under which the results should be applied.

Conclusion

A PV–battery microgrid can be organized into equipment, microgrid, and microgrid-group layers, with each layer using a control method matched to its objective. Virtual-impedance droop control improves voltage and reactive-power sharing at the equipment layer. Consensus-based secondary control restores frequency and voltage and allocates active and reactive power by capacity at the microgrid layer. Capacity-ratio consensus and tie-line power balancing coordinate exchange among microgrids while allowing an autonomous region to remain isolated. The seven-microgrid simulation and the three-phase inverter platform both support this layered approach, and the remaining open issue is the extension from short-time-scale electrical coordination to long-time-scale operation.

Scroll to Top