An average consensus-based power-sharing among VOC-based distributed generations in multi-bus islanded microgrids

This study proposes a hierarchical control structure for load power-sharing among distributed generations (DG) in a multi-bus microgrid (MG). The proposed control structure uses an average consensus-based distributed protocol (CDP) for the secondary control layer and virtual oscillator control (VOC) as a primary controller. The proposed method can nullify the power-sharing inaccuracy caused by the mismatches of the equivalent impedances seen from the outputs of DGs. The eigenvalue-based small-signal analysis is used to analyse the secondary controller and communication time-delay on system stability. The results of the stability analysis are used to design secondary controller and time-delay compensator. The validity of the proposed method is veriﬁed by both ofﬂine simulations in Matlab/Simulink and control hardware-in-the-loop (CHiL) using a real-time Opal-RT platform.


INTRODUCTION
The rapid increase of the penetration level and capacity of renewable energy resources (RE) exhibits various technical challenges to integrating into existing power systems, such as load/generation balancing, power quality, and system stability. The concept of distributed generation (DG) and microgrid (MG) has emerged to realise flexible cooperation between REs. An essential feature of an MG is the ability to operate in both autonomous (i.e. islanded) and grid-connected modes to accommodate various operating conditions [1]. To ensure stable operation and maximise the overall efficiency of an islanded MG, the active and reactive power of DGs should be shared accurately.
In literature, the power-sharing can be achieved by using welldeveloped droop control methods [2,3]. Recently, the virtual oscillator control (VOC) method has emerged as an innovative control method to control the voltage-source-converter (VSC) interface of a DG, which has the potential to replace conventional droop controller [4,5]. The power-sharing mechanism of VOC is achieved by properly setting the current scaling factor in proportion to the VSC-rated powers with the assumption that the equivalent impedance seen from the output of VSCs has the same order of magnitude as the power-sharing ratio. However, when applied to control VSCs in a multi-bus MG, it is a great challenge for single-layer conventional VOCs to set appropriate power-sharing ratio because of the lack of global information and the complexity of the system topology, load position and the differences of feeder impedances. Therefore, upgrading the VOC structure is essential to enable advanced features that improve the application of VOC in such systems. It is noted that the majority of researches in literature focuses only on the solution of power-sharing in droop-based MG. On the contrary, there are only a few compatible methods for improving power-sharing accuracy in VOC-based MG which lacks in-depth controller analysis and design. Therefore, this study aims at fulfilling this knowledge gap. The comprehensive review of existing methods that were designed to control power-sharing in droop-based MG is first presented. Then an appropriate control method is chosen and developed for VOC-based MG. Typically, to achieve accurate power-sharing in proportion to the VSC ratings, the conventional static droop control is widely utilised by assuming that the feeder characteristics (inductive, or resistive dominated or mixed) and impedances are known [6,7]. The drawbacks of the static droop control are the line impedance dependency, active and reactive power coupling, slow transient response, and the trade-off between power-sharing accuracy and dynamic stability. Therefore, in literature, advanced droop controls are developed to overcome such challenges. The innovation of these methods may include: The improvement from conventional droop control [8][9][10][11][12], or the advancement of the additional control loops such as virtual impedance [13][14][15]. An improved droop control method based on circulating current power is proposed in [8] to achieve accurate active and reactive power-sharing and mitigate steady-state voltage error simultaneously. In [9], a power derivative-integral term is added into a conventional droop control scheme to improve the transient performance without affecting power-sharing precision. These methods have high reliability and redundancy; however, their performance, when applied to complex multi-bus MGs, is not analysed. A method proposed in [11] adaptively regulates droop coefficients to compensate reactive power-sharing inaccuracy caused by the mismatched feeder impedance using a central energy management system. The performance of this method is unaffected by the delay in the communication network, but the steady-state error is not eliminated entirely and the impact of loads that consists of different types is not considered. The method proposed in [13] uses virtual complex impedance to simultaneously improve reactive power-sharing and voltage quality of the conventional static droop control. This control method is robust against even hardware parameter variations. By using a communication network to exchange local measurements of a DG with its neighbours, a droop control method with a tunable virtual impedance is proposed in [14] to enhance the reactive power-sharing accuracy. Even though the communication network is only used for tuning the parameters of the virtual impedance, the loss of communication link still downgrades the controller performance. The aforementioned power-sharing strategies only consider the simple MG with a common bus, that is, the critical impact of the complex networked structure (multi-bus MG) on the controller performance has not been investigated. In [15], an optimal virtual impedance method is introduced based on network feature analysis and its parameters are tuned using offline genetic algorithm. This method shows good performance for the reactive power-sharing. However, the optimal algorithm is sophisticated, which makes it challenging to implement in practice. In summary, the general drawbacks of the improved droop-and VI-based power-sharing methods are either: (i) Need a sophisticated algorithm, or (ii) the high-efficiency adaptive algorithm is difficult to obtain, or (iii) may not be suitable for complex multi-bus MG without an in-depth analysis of the network structure.
Since balancing the accuracy and dynamic transient of powersharing simultaneously considering all impact factors (DG output impedances, feeders, local loads, and network topology) are difficult to achieve with the above methods, the hierarchical control method has emerged to enhance the primary control method for power-sharing [7]. The secondary control layer may adopt either centralised or fully distributed control approaches.
The authors in [16] proposed a centralised hierarchical solution for VOC-based MG control that enables MG to operate in both autonomous and grid-connected modes, as well as seamless synchronisation mode. The centralised secondary control requires a full communication network (i.e. all DGs need to have communication links to the central controller) and a powerful computational centre [17], which results in a significant increment of investment cost and the risk of single-point failure in the system, especially in distribution systems. In MGs, since the number of components that need communication link is small, the investment cost issue is less significant. However, the control performance is still highly affected by a single-point failure. Therefore, the distributed control that uses a peer-to-peer communication network has been developed as a better solution to reduce the problems associated with the centralised structure. In [18], a distributed averaging proportional-integral controller is proposed to optimise voltage regulation and precise reactive power-sharing simultaneously. This method uses local measurements and information exchange through a spare communication network only; therefore, it does not require prior knowledge of the MG topology, feeders, or load conditions. The method proposed in [19] uses a consensus-based distributed protocol to guarantee reactive power-sharing in meshed MG. Besides using only information exchanged among a DG and its neighbours to generate appropriate reference signals, this research also provides a detailed mathematic model of the overall control system to optimise the choice of control parameters. Another consensus-based distributed control method is proposed in [20] to adaptively control virtual impedance to eliminate the impact of impedance mismatches on power-sharing accuracy. This method also contains average voltage restoration to compensate for voltage drop caused by droop action and added virtual impedance.
Inspired from the advantage of the consensus-based distributed control, in this study, a secondary control layer based on an average consensus-based distributed protocol [21] is embedded directly into VOCs to achieve desired power distribution among DGs. The secondary control layer receives information (active and reactive power) exchanged from a DG and its neighbours through a spare communication network to adaptively change internal parameters of VOC so that the DG power outputs are adjusted accordingly. The main contributions of this study are as follows: (i) An Resistive-Inductive (RL)-based active damping is designed to minimise the deficiency of the current control capability in conventional VOC systems, thus enabling the adoption of VOC in multi-bus MG applications. (ii) A hierarchical control structure, in which the secondary control layer adopts an average consensus-based distributed protocol, is developed to compensate for the power-sharing inaccuracy among VOC-based DGs in multi-bus MG. (iii) An in-depth small-signal analysis is performed, considering both the generality of multi-bus MG topology and communication time-delay, to define the margin of controller parameters and communication time-delays that maintain overall system stability. (iv) A modelless compensation method is proposed to eliminate the adverse impacts of time-delays on system dynamics performance and stability. The rest of this study is organised as follows: In Section 2, a hierarchical control structure applied to control VOC-based DGs in islanded multi-bus MG is presented. The proposed averaged consensus-based distributed control protocol to control the power-sharing amongst DGs is presented in Section 3. Section 4 presents the small-signal stability analysis to realise the dependency of the system stability on control parameters and time-delay. The validation of the performance of the proposed method in both offline simulation (Matlab/Simulink) and realtime Opal-RT platform is presented in Section 5. Section 6 concludes this study.

ISLANDED MULTI-BUS MG WITH HIERARCHICAL CONTROL
As seen in Figure 1, the hierarchical control structure adopted in this study consists of three main control layers, namely, the VOC-based primary control layer, the secondary control layer that uses an average-based distributed consensus protocol, and the communication network that is used to share local measurement of a DG with its neighbours.
In islanded operation, the control objective of the primary control layer is to stabilise the local voltage and frequency, and guarantee the power-sharing function in a fully distributed manner. VOC used in the primary control layer is an innovative control method, which has the potential to replace conventional droop control. Initially, VOC is known as a decentralised controller that uses the measurement of the filter inductor current i L f _ as an input to generate the Pulse Width Modulation (PWM) signal v * VOC at the output (the detailed configuration of the VOC circuit can be found in [22]). VOC regulates the system Root-Mean-Square (RMS) voltage, and frequency FIGURE 2 Islanded multi-bus microgrid (MG) architecture within a required limit (grid-forming mode), as well as provides a fast synchronisation mechanism. Also, VOC is designed so that parallel-connected DGs share the load power in proportion to their rated power with the assumption that the equivalent impedance seen from the output of VSCs have the same order of magnitude with power-sharing ratio. In multi-bus MG applications, the power-sharing inaccuracy becomes significant since the equivalent impedance terms are difficult to obtain, or even unknown. Besides the power-sharing error problem, the poor dynamic performance of the VOC when applying to multi-bus MGs is identified. Then a virtual impedance Z v (Active Damping block) is proposed to improve VOC performance under significant system disturbances. In the secondary control layer, the information of power measurement from a set of neighbours of a DG is sent to the input of the CDP via the communication network. Then the output of CDP is used to adaptively adjust VOC parameters (the voltage scaling factor K v and virtual capacitor C) to achieve desired power distribution among DGs in islanded multi-bus MGs, that is, the power output of each DG finally converges to a so-called averaged value. The detail of CDP is presented in Section 3. Starting from the fact that the communication time-delay is an inevitable issue in a secondary controller, its impact on overall system stability and dynamic performance is also investigated. Then a delay compensation (DC) method is proposed based on the results of the eigenvalue-based small-signal stability analysis.
The architecture of the test MG is shown in Figure 2, which contains N VSC-based DG units connect to the Point-of-Common-Coupling (PCC) through a physical network where feeders have different impedance Z line,i . The loads can be connected locally near a DG or at the common bus between two DGs. The secondary controller of every DG i exchanges active and reactive power information x i (k) to its neighbours (denoted as x j (k)) through either full or spare communication network.

AVERAGE CONSENSUS-DISTRIBUTED CONTROL DESIGN
In this section, the structure of a conventional VOC is modified to adapt to multi-bus MG application. Then CDP is designed to nullify the power-sharing inaccuracy caused by VSC output-impedance mismatches, non-identical line impedances, and parameter drifts.

Adaptive VOC with virtual RL damping
The definition of VOC was first introduced in 2014 for a lineartime invariant (LTI) electrical system [4]. Unlike multi-layer droop-based control methods, the intrinsic non-linear dynamics of VOC allows it to stabilise VSC output voltage and frequency within a desired limit, and guarantees the power-sharing function among parallel-connected DGs by using a single control layer. By applying Kirchhoff 's voltage and current law into the VOC circuit in Figure 1, the dynamics model of VOC is obtained as follows: where , C , and L are negative resistance, capacitance, and inductance of the VOC circuit, respectively. K v and K i are decouple voltage and current scaling factors, respectively. By averaging Equations (1) and (2) over an AC cycle T = 1∕ f * , the VOC model applied to LV MG can be represented in droop-like relations as follow:

√
LC is nominal electrical frequency, and P, Q are VSC output average active, reactive power measured at the physical point before LCL filter, respectively. The VOC average model in Equations (3) and (4) shows that the active power P is strongly dependent on RMS-voltage magnitude of the oscillator (P − |v| relation), while the reactive power Q is mainly dependent on the frequency (Q − relation). Consequently, it is obvious to control VSC active and reactive power output by adjusting the voltage scaling factor (K v ) and capacitor C (or inductor L) in the VOC circuit, respectively (see Figure 1). In this study, instead of using fixed values, we use adaptive K v and C values, determined via a finite-time average consensus protocol, to achieve desired power-sharing accuracy among DGs. The detail of the CDP is presented in the subsequent section.
Conventionally, VOC only prioritises the voltage, frequency control function based on grid-code specifications. However, the current control function is not considered in the structure of the VOC and controller parameter design. Thus, VOC is unable to limit the current in the DG unit during large disturbance conditions. The overcurrent may cause damage for physical semiconductor components and trigger the wrong decision of protection devices. In a simple single-bus MG, that is, several DGs connected in parallel to serve a common load, since the equivalent impedances seen from the output of VSCs are almost identical or the ratio of these impedances is equal to powersharing ratio, a large disturbance (e.g. when the load is largely increased or decreased) is shared equally among DGs, resulting in an insignificant transient in current outputs of VSCs. However, in a multi-bus MG, the equivalent impedance mismatches can be very large due to the different line impedances and the local loads, causing sizeable current transient, especially as the output of VSC located near the load is connected or disconnected. The overcurrent problem is exclusively explained as follows. Consider a small part of a network model of a multi-bus MG in Figure 3 which consists of two DGs connected in parallel via electrical cable with impedances Z line,1 , Z line,2 to serve a common load Z load,1 at the PCC and a local load Z load,2 located near DG 2 (note: for ease of explanation, the loads are modelled as impedances. However, without loss of generality, other load types do not affect the result of the analysis).
For ease of analysis, we consider the line impedances are identical and much smaller than the impedance of the loads, that is, Z line,1 ≈ Z line,2 ≪ Z load,2 . Assuming that two DGs are synchronised and operated in a steady-state to serve only common load Z load,1 . The synchronisation of two VOC implies that V VOC,1 = V VOC,2 . From the network topology, we have The filter impedances are chosen to satisfy the power-sharing where K 1 , K 2 facilitate power-sharing ratio and Z re f denotes the base filter impedance value, which is set identical for all VSCs [4]. Simplifying Equation (5), we obtain: Furthermore, since the value of K 1 , K 2 is chosen so that P rated,1 ∕K 1 = P rated,2 ∕K 2 , the following expression holds: The expression in Equation (7) indicates that, in steady-state, when two VOCs synchronise their voltage outputs, two DGs share the load current in proportion to the VSC rated powers. When the local load Z load,2 is connected, the majority of the current i o,2 flows through Z load,2 , causing the current supplied to . To fulfill the power-sharing ratio in Equation (7), DG 2 tends to supply more power to compensate for the shortage of the current i o,2 . Since there is no current control mechanism embedded in VOC, if the load Z load,2 is large, the current generated from DG 2 will significantly exceed the current rating of the VSC, causing severe damage to power electronic devices of DG 2 . Therefore, it is important to add a new mechanism into VOC to improve the current transient behaviour under large disturbance conditions. This study proposes a simple active damping method that places a virtual RL between VSC and MG for damping current transient even under a wide range of load variation and location. Figure 4 represents the closed-loop control diagram of the VSC and the equivalent circuit of the power stage of a DG in Figure 2 (without considering the branch impedances and the rest of the network). Here, the active damping is equivalent to adding a virtual RL in series with the inverter-side filter inductor L 1 . To avoid possible high-frequency noise introduced by a derivative term in the RL damper, a high-pass filter implementation can be used instead. The resulting transfer function can thus be expressed in Equation (8), where T vr represents the time constant of the filter.
The value of T vr is chosen to be small enough to cause an insignificant voltage drop at the output of the VSC, but needs to be higher than the smallest time constant of the controller to prevent additional time-delay on the controller. The design of the virtual RL damper is the trade-off between the damping effect and voltage drop. A better damping effect can be obtained at the cost of higher voltage drop, and vice versa. The perfor-

Average consensus-based distributed control for load power-sharing
In this study, an average consensus-distributed control is adopted to obtain control signals to adaptively adjust K v and C to achieve the desired power-sharing ratio among DGs. Each DG has a unique ID, and its primary controller only has access to its local measurement of active and reactive power. The secondary controller of each DG aims at discovering the global information of power-sharing errors based on the local measurement and information exchange from its neighbours, then providing a mechanism to compute and force all the DGs to reach a consensus value.
The following two theorems are used to describe the basics of distributed consensus control. Theorem I presents the necessary and sufficient conditions for the consensus algorithm to be converged to the global average value which is shown in theorem II.
Theorem I. Graph theory: Considering the theory of directed graph, a topology of MG can be expressed as a graph with N nodes and m edges, where N and m are the number of agents (each agent represents a DG) and communication links between agents, respectively. A = [a i j ] ∈ ℝ N ×N is defined as an adjacency matrix that shows the connection of agents with a i j = 1 if there is a communication link and a i j = 0 otherwise. An example of an equivalent graph of MG with five DGs and corresponding adjacency matrix A is shown in Figure 5.
The corresponding Laplacian matrix of the graph is defined The elements of L are defined as follows: where N i being a total number of neighbours of DG i . The definition of the Laplacian matrix in Equation (9) indicates that there is a spanning tree in a communication network, that is, there exists a root node such that all other nodes can be linked to it via a directed path. In addition, the Laplacian matrix L with components shown in Equation (9) has a zero eigenvalue and rank (L) = (N i − 1) [23]. Moreover, the spanning tree condition also indicates that L 1 N = 0 (1 N denotes a vector of all ones) [24].
Theorem II. Average consensus algorithm: A consensus protocol is an interaction rule that exchanges information between an agent and its neighbours on a connected network to reach an agreement regarding a specified interest that depends on the state of agents. Given a system with directed graph G(N,m), assuming is the vector that describes the initial states of all agents. After a finite iteration k, the value of all agents converge to an average value defined by their initial conditions, that is, A discrete-time representation of an average consensus algorithm for a DG i is as follows: where j is the local information of the states (active and reactive power) of DG i and DG j at the step k, respectively. K i and K j are the gains that define desired power-sharing ratio. G i is the controller coefficient that plays a significant role in ensuring system stability during the information exchange and enhancing the convergence speed. Optimally, G i is chosen as G i = 1∕ max with max as the maximum positive eigenvalue of L.
The compact matrix form of Equation (10) can be written as follows: If the Laplacian matrix L fulfills the spanning-tree condition, the algorithm in Equation (10) drives the states (active and reactive power) of DGs ∀i, j = 1, … , N , toward average consensus values in a finite-time step K as follows: i are the initial values of the active and reactive power measured locally at the output of the VSC of each DG.
The continuous form of Equation (10) is given aṡ As shown in Figure 1, the output of the secondary controller is used to adaptively regulate K v and C parameter of the VOC circuit, consequently forcing the power outputs of DGs to the value indicated in Equation (12). The distributed secondary active, reactive power control algorithm corresponding to DG i is given as follows: (15) where as the set of DG i and its neighbours. A i ∈ ℝ 1×N i is the row i of the Laplacian matrix L ∈ ℝ N i ×N i of the communication matrix corresponding to the DG i . K P , K Q are the supporting gains of the integral to improve controller dynamic performance.
When the secondary controller reaches the steady-state,ẋ(t ) converges to an equilibrium point, that is,ẋ (t ) = 0. Therefore, the following condition holds: Recall from theorem I that rank(L) = (N i − 1) and L 1 N = 0, and also G is the matrix of positive gains. Then the general solutions of the linear equation in Equation (16) can be expressed as It is followed from Equation (17) that at the steady-state It means that DGs share the load active and reactive power proportionally, and the proof of convergence is completed.

Communication time-delay compensation
The communication network is essential for the secondary control layer. The delay caused by this network is an unavoidable issue during data transmission. Such delay varies from several to 100 ms, depending on different transmission technologies and distances. The measured active, reactive power of DG i is transmitted to its neighbours in discrete-time steps T trans . Depending on the communication technology and distance, each DG unit receives the information with a different transmission delay. As illustrated in Figure 6, the measured active power P 2 from DG 2 is transmitted to its neighbours (DG 1 and DG 3 ) at different times, resulting in unexpected errors between the actual measured value and the one received through a communication network. These errors reduce the dynamic and steady-state performance of the controller, cause low-frequency oscillations at the VSC outputs, and even result in system instability.
The consensus-based distributed control algorithm considering communication time-delay can be represented as follows: Improving the time-delay margin can be done by optimising controller parameters with the cost of lower controller performance. However, the unstable issue still exists while increasing the time-delay. Therefore, the time-delay compensation is necessary to balance the trade-off between controller performance, delay margin, and system stability margin. In this study, the compensation method based on the lead-lag filter (the DC block in Figure 1) is proposed to reduce the phase lag caused by communication time-delay [25]. The transfer function of the proposed compensator is given by where T lead , T lag are the time constants of the lead and lag component which is defined based on the oscillation frequency of the input, respectively. K lead > 1, 0 < K lag < 1 are the filter gains and generally are chosen so that K lead . K lag = 1. The secondorder lead compensator is used to provide more phase lead, while the lag compensator improves stability margin for the controller.
In this study, we assume that the time-delay d is bounded between a known interval [ d _min , d _max ]. The compensator is then designed based on the phase lag caused by the average delay d _ave = d _min + d _max 2 . The phase lag caused by the timedelay d _ave is given by where d is the frequency of the oscillation caused by d _ave .
The lead component of the compensator is first designed to achieve the desired phase lead. Then the parameter of the lag component is tuned to improve the stability margin and dynamic performance. The detailed guideline for choosing parameters of the compensator can be found in [26]. MGs. The methods in [16,27,28] presented a potential control method for the power-sharing issue, namely, virtual impedance. However, no result of power-sharing performance is presented. The hierarchical control structure for VOC-based DG presented in [16] used a centralised control approach for the secondary control layer and only considered simple single-bus MG. On the contrary, the proposed method introduced a novel hierarchical control structure adopting a wellknown finite-time average consensus distributed protocol to guarantee the power-sharing among DGs in complex MGs. It makes the proposed method more meaningful and practical. In addition, the goal of this study is not to compare all existing methods that could be used, but to find a reliable solution for power-sharing control in VOC-based multi-bus MGs. Therefore, no comprehensive comparison has been carried out.

SMALL-SIGNAL STABILITY ANALYSIS
In this section, an eigenvalue-based small-signal analysis is performed in order to analyse impact on stability of secondary controller parameters, and of communication time-delays. First, the state-space model of a multi-bus MG is achieved through linearisation of equations describing components in the system, such as (i) inverters with VOC-based primary control, (ii) loads, (iii) electrical topology of the system described through buses (nodes) and branches, and (iv) secondary controller with communication-linked topology. Then the results of the stability analysis are used to investigate the impact of controller parameters and time-delays on the system stability, as well as to optimise the controller parameters.

Small-signal dynamic model of a multi-bus MG with time-delayed controllers
In the considered model, an islanded MG consists of N VOCbased DGs, M buses connected through B branches, as shown in Figure 7. The LCL filter is approximated as a first-order L filter in the frequency range of interest. For ease of analysis, the loads are modelled as equivalent serial RL impedances, that is, The small-signal analysis is performed in dq-frame. Then the active and reactive power outputs of a VOC-based DG, are expressed by Here The dynamics of DGs output currents flowing through Z c,i is modelled as the dynamics of an RL circuit for each ith output current and described through the well-known equation: where v m,i is the voltage at the bus mth of the network, to which the ith DG is connected. Similarly, the load currents i L and the currents flowing through branches between the buses i xy , for each mth bus The electrical topology of the network is described through the nodal admittance matrix Y ∈ ℝ M ×M creating a nodal equation for an islanded multi-bus MG in the form of I = YV bus (25) where V bus is the matrix of complex bus voltages In Equation (26), complex currents and voltages are converted to dq-frame components, and each element of complex admittance matrix Y is converted to conductance Gsusceptance B matrix as follows: Linearising Equation (26) around the equilibrium point, one obtains Δ i dq = Y dq Δv dq , where based on [29], the dqvoltages of mth bus are given by Equations (28) and (29) represent voltages at each bus in the network, which are defined by different current components depending on the elements connected to the bus. Here, a socalled virtual resistor r N is assumed between each node and the ground to prevent a potential numerical problem. The criteria to choose the value of r N to prevent its side effects is exclusively presented in [29].
Considering the proposed secondary controller in Equations (14) and (15), the linearisation of the secondary control law is obtained as follows: where d i is the ith diagonal element of the degree matrix D. Δp i and Δq i are the resulting linearised equations for output active and reactive power of ith DG in Equations (21) and (22).   computing a reduced set of its roots, by using a finite-elementbased method as extensively described in [25,30]. The resulting eigenvalues are then used to perform eigenvalue-based stability analysis to evaluate the impacts of secondary controller parameters and communication time-delays on the system stability. It should be noted that, the values of the time-delays in all communication links among DGs are considered equal, regardless of the distance between DGs.

Stability analysis results
The above analysis is applied to a multi-bus MG shown in Figure 11(a). The communication network is shown in Figure 11(b). The parameters of the tested MG are presented in Tables 1 and 2. The parameters of the proposed secondary controller are first chosen by a trial-error method based on the results of the time-domain simulations to simplify the controller design process. The value K P = 0.045 and K Q = 6 × 10 −6 yield good transient and steady-state performance; hence, they are chosen as a base value for the stability analysis. Trace of the dominant oscillatory mode when K P = 0.045 and K Q varies from 3 × 10 −7 to 1.2 × 10 -5 Figures 8 and 9 show the trace of the most dominant oscillator mode when varying K Q and K P from the base value, respectively. Since the multi-bus MG with VOC-based DGs is a highly nonlinear system, changing one parameter results in the movement of more than one mode. However, for ease of presentation, the most dominant oscillator mode that has significant influence in the system stability is shown. The results show that 1. with K Q = 6 × 10 −6 , the dominant oscillator mode moves from the far left of the stable region to the unstable region when K P increases from 0.0025 to 0.1125. The dominant oscillator mode crosses the zero axis at K P = 0.0675 indicating that the system becomes unstable if K P > 0.0675. In addition, the system has higher damping and stability margin at K P = 0.00225, in comparison with K P = 0.045. However, steady-state and transient performance is significantly reduced. This result is almost consistent with the timedomain simulation. 2. Similar to the previous case, the stability margin of the system is decreased when K Q increases from 3 × 10 −7 to 1.2 × 10 −5 , while keeping K P constant at 0.045. The system becomes unstable at K Q = 8.4 × 10 −6 .

Impact of controller parameters
According to the above analysis, it is concluded that, in order to maintain system stability, the parameters of the proposed secondary controller has to be satisfied with the following condition: K P < 0.0675 and K Q < 8.4 × 10 −6 . To balance the requirement of steady-state and transient performance, as well as provide a sufficient stability margin for the tested system, the value of K P and K Q is chosen as 0.045 and 6 × 10 −6 , respectively.

4.2.2
Impact of time-delays Figure 10 presents the trace of the dominant oscillatory mode when the communication time-delay d varies from 1 to 100 ms (here, the secondary controller parameters are K P = 0.045 and K Q = 6 × 10 −6 ). As shown in Figure 10, in the case of small time-delays, the set of chosen parameters of the proposed CDP yields a high stability margin for the tested system. However, when d increases, the stability margin decreases as the dominant oscillatory mode moves from the stable to the unstable region. From d ≥ 57 ms, the system becomes unstable as the dominant oscillatory mode crosses the zero axis. Therefore, it can be concluded that the delay margin for the chosen parameters is 57 ms. This result is almost consistent with the time-domain simulation result (see Figures 16(a) and (b), the delay margin from the time-domain simulation is around 55 ms as the output power of DGs starts oscillating). Based on this resulting delay margin, a lead-lag compensator is designed to increase the delay margin to the desired value. It is noted from the above analysis that both controller parameters and communication time-delays influence the overall system stability and performance. A well-tuned set of controller parameters results in better steady-state and transient performance, with the cost of a smaller time-delay margin. Whereas, a higher time-delay margin significantly degrades system transient performance and even destabilises the whole system. Therefore, the controller design procedure should first focus on system performance, and then if the delay margin cannot be satisfied, a time-delay compensator is necessary.

SIMULATION RESULTS AND DISCUSSION
In this section, the time-domain simulations are carried out in both Matlab/Simulink and real-time Opal-RT platform to demonstrate the performance of the proposed average consensus-based distributed protocol (in terms of steady-state error and overshoot) and delay compensation method (in terms of reducing adverse impacts of communication time-delay and increasing time-delay margin). The tested nine-bus system is presented in Figure 11, which consists of five VOC-based DGs and nine loads. The feeders are represented by different serial RL impedances. Figure 11(b) illustrates the distributed communication network and the neighbours of each DG. The parameters of the power stage, VOC-based primary and secondary controllers are presented in Tables 1 and 2, respectively. Based on the analysis in Section 4, the parameters of the secondary controllers are tuned to achieve good dynamic and steady-state performance without considering communication time-delay, that is, the system has a relatively small time-delay margin. Then the compensator is designed to increase this timedelay margin and improve overall system stability.
In the subsequent sections, three case studies are carried out to validate the performance of the active damping method, the distributed average consensus control protocol and time-delay compensator, respectively.

5.1
Offline simulation

Active damping
In this section, the effectiveness of the proposed active damping is validated. The value of the virtual resistance is kept constant ( R vr = 0.01 Ω), while the value of virtual inductance L vr is increased from 0 to 3.1427 mH. The load L 9 , which is located near the DG 5 is connected at t = 1 s to add a large disturbance into the system. Figure 12 presents only the dynamic of the active power output of DG 5 since it is most influenced by the load disturbance. As seen from the results, in the case without active damping, the overshoot occurred when L 9 is connected is remarkably high (ΔP% = 100 × P max −P ave P ave where P max is maximum overshoot of the active power, P ave is the active power at the steady-state). Meanwhile, the overshoot is significantly decreased when increasing the virtual inductance (7.853% and 3.42% with L vr = 2.5142 mH and L vr = 3.1427 mH, respectively). The voltage drop ΔV drop % ≈ 2.08% is observed in case L vr = 3.1427 mH, in comparison with the case of without the active damping (see Figure 13). This voltage drop is analogous with the analysis in Section 3.1.

Power-sharing accuracy control
In this subsection, three case studies have been conducted to validate the performance of the proposed CDP under different  Table 2 to achieve optimal performance. The performance of the proposed controller is validated under sudden load changes as follows: 1. At t = 0-1 s, the system is engaged with only primary control and eight loads (L 1 to L 8 , the total load required is ∑ P L = 41 kW + 8.5 kVar). 2. At t = 1 s, the proposed CDP controller is activated. 3. At t = 10 s, load L 9 is connected to the MG (the total load required is ∑ P L = 61 kW + 13.5 kVar). 4. At t = 20 s, load L 2 and L 5 are disconnected (the total load required is ∑ P L = 48 kW + 10 kVar). Figures 14 and 15 show the dynamics of the power outputs of DGs under different load conditions. As can be seen from Figure 14, without the proposed secondary controller (t = 0-1 s), there is a significant active power-sharing error at the output terminal of DGs as the result of differences between equivalent impedance seen from an output of each DG. However, when the proposed secondary controller is enabled, this active power-sharing inaccuracy is nullified (t = 2 s, total power generation ∑ P = 37.9 kW + 7.3 kVar), even when the loads are suddenly connected (t = 10 s, total power generation ∑ P = 50.7 kW + 11.7 kVar) or disconnected (t = 20 s, total power generation ∑ P = 41.6 kW + 8.9 kVar) at different locations of the MG. It should be noted that there is a difference in load demand and generation due to the use of impedance-type loads. The highest overshoot occurred at DG 5 when load L 9 is connected, while the undershoot at the output of DG 1 is higher than other DGs when load L 2 is disconnected. There are two main reasons for this overshoot: (i) At the first few cycles after the load changes, the proposed CDP does not react due to the delay of the data transmission (see Figure 6), resulting in only the VOC-based primary controllers take action to regulate power outputs of DGs to new values that are different with the average value at the steady-state (similar to the period t = 0-1 s in Figure 14). (ii) As the result in Section 3.1 indicats, the location where the load is connected or disconnected also has impact on the transient behaviour of the system. Similarly, it can be observed from Figure 15, the proposed CDP controller properly reduces the reactive power-sharing error to 0.8% with longer settling time (in comparison with the active powers) in all the load cases. The reason behind this phenomenon is that the gain K Q of the secondary controller is chosen relatively small to prevent unexpected oscillations which may occur in the DG output power and limit the third-order harmonic in the DG output voltage (the virtual capacitance of VOC is sensitive to oscillations and significantly affects the third harmonic limit of the VOC voltage).
In the second case study, the time-delays of all communication links are assumed to be equal, regardless of the distance between DGs. For ease of presentation, only the dynamic performances of DG 4 power outputs of are presented in Figure 16. It can be seen from Figures 16(a) and (b) that when the proposed secondary controller is activated (at t = 0.5 s), the power outputs of DG 4 exhibits a low frequency and stable oscillation at the time-delay t d = 55 ms (the blue dotted line). When the time-delay increases to t d = 95 ms, the system becomes unstable, indicated by growing oscillation (the green dotted line). Meanwhile, the proposed lead-lag compensator can effectively damp the oscillation caused by the communication time-delay t d = 95 ms and stabilise the system (the solid red line). These results confirm the effectiveness of the proposed compensation method in mitigating the adverse effect of communication time-delay on the system dynamic and stability.  In the third case study, the performance of the proposed compensation method is validated under non-uniformed communication time-delays. The time-delay of communication links are provided in Table 3.

Plug-play function
In this case study, the performance of the proposed secondary control is validated under DG connection/disconnection. DG 5 is assumed to be plugged in and plugged out at t = 10 s and t = 20 s, respectively. It is noted that when a DG is disconnected, all the communication links connected between this DG and its neighbours are also lost, and vice versa. The proposed CDP located at each DG frequently updates the status of its neighbours by information exchanges through a communication network to calculate the appropriate Laplacian matrix for the control algorithm. To connect/reconnect a DG to an energised MG, a simple pre-synchronisation control based on Proportional-Resonant (PR) method is used. The purpose of this synchronization method is to ensure that the voltage output of the connecting DG is nearly synchronised with those of the operational DGs, which is closed to it, that is, ensuring the voltages at both sides of the circuit breaker are synchronised in term of magnitude and phase angle. The detailed design of this synchronization method is out of the scope of this study. The power output of DGs is presented in Figures 17 and 18. As can be seen from the results, before DG 5 is connected (before t = 2 s), the proposed secondary control effectively confines the power output of four DGs to an average value so that they share the total load power equally. When DG 5 is connected to the MG (at t = 10 s), the communication link is set up between DG 4 and DG 5 which forces the CDP of DG 4 to update the status of its neighbours and recalculate appropriate Laplacian matrix. All DGs then automatically readjust their active and reactive power outputs to find a new global average value. After a short transient period, the system converges to a new equilibrium point where five DGs share the load power equally. When DG 5 is disconnected at t = 20 s, the communication link between DG 4 and DG 5 is lost. However, since the communication network still satisfies the spanning-tree condition, the proposed secondary controller is still able to find a new equilibrium point in which four remaining DGs increase their power output to maintain the total load power.

Real-time simulation results
In this section, a part of the multi-bus MG presented in Figure 11, which consists of three DGs (DG 1 , DG 2 and DG 3 ) and three loads (L 1 , L 2 L 3 ), is used to carry out the CHiL real-time validation. The parameters of the physical system are shown in Table 4. The 100-ms time-delays are used for all communication links. The experiment is implemented on the OPAL-RT 5707 platform shown in Figure 19, in which the hierarchical controller

CONCLUSION
This study proposes a hierarchical control structure based on CDP to control load power-sharing among VOC-based DG in a multi-bus MG. The adaptive VOC is used to regulate the active and reactive power outputs of the DG to follow commands from the CDP-based secondary control layer. The eigenvaluebased small-signal analysis is implemented to analyse the impact of controller parameters and communication time-delays on the stability of multi-bus MGs with general topologies. The simulation results show that (1) the proposed RL active damping significantly reduces overshoot and improves transient behaviour of the DG power output under significant load disturbances. (2) The proposed secondary controller can effectively eliminate the power-sharing inaccuracy caused by the mismatches between the equivalent impedances seen from the output terminal of DGs in multi-bus MG.
(3) The plug-play function of the proposed secondary controller makes it possible to maintain the system stability and guarantees that DGs share the load power in proportion to their rated power under large disturbances and the communication topology changes. (4) The results of the eigenvalue-based small-signal analysis can be used to identify optimal value for controller parameters and delay margin that keeps the system stable.