An Average Consensus Algorithm for Seamless Synchronization of Andronov-Hopf Oscillator Based Multi-Bus Microgrids

This study proposes a hierarchical control structure for a smooth transition of multi-bus microgrids from islanded mode to grid-connected mode. The proposed control structure uses an average consensus protocol for the secondary control layer and Andronov-Hopf virtual oscillator control as a primary controller. The proposed method enhances the power-sharing accuracy among DGs in normal operation. A synchronization strategy is embedded into the secondary control layer in synchronization mode to force the MG-side voltage at the connection point to synchronize with the grid-side voltage. The inﬂuence of the secondary controller and communication time-delay on system stability and performance is analyzed with small-signal analysis. The proposed method is validated via control-hardware-in-the-loop (CHiL) using a real-time Opal-RT platform.


I. INTRODUCTION
The growth of economic and environmental concerns is pushing the conventional centralized power systems to evolve toward a distributed, local paradigm with innovative business models. This trend aims at integrating more distributed generation (DG) close to the consumers' area, thus increasing the system reliability, quality and reduce the cost. DGs and the local consumers in the same geographic location form a small-scale power system named a Microgrid (MG) [1]. The most important feature of MGs is the capability to operate in both autonomous (islanded) and grid-connected modes. In islanded mode, MGs lose the stable voltage and frequency support from the utility grid and needs to balance the load demand and power generation by themselves. This load/generation balancing results in the voltage asynchronism that may cause severe problems at the moment of The associate editor coordinating the review of this manuscript and approving it for publication was Tariq Masood . reconnection to the main grid [2], such as power oscillations or significant inrush current flowing through the static switch. Therefore, to ensure an uninterruptable and reliable power supply, as well as to maintain system stability, a smooth transient is required, i.e. the MG voltage must be synchronized with the main grid voltage before reconnection.
Generally, power-electronic-based interfaces of DGs (also known as Voltage Source Converter -VSC) in a MG are controlled by a hierarchical control structure. An example of a droop-based hierarchical control structure is depicted in Fig. 1a, in which the synchronization mechanism is embedded in the secondary control layer. The main drawbacks of this control structure are the complexity of multiple control layers and the slow dynamic response due to the time-scale separation between control layers. To overcome the limitations of conventional droop-based control structure, several improved methods have been proposed, such as in [3], [4]. In [3], an improved droop control based on the virtual power source and composite virtual impedance is presented VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ to enhance the accurate reactive power sharing and reduce the coupling of DG power outputs. In [4], the authors proposed two additional correction terms of voltage reference to simultaneously provide economic load sharing and global bus voltage regulation. Recently, virtual oscillator control (VOC) has been introduced and expected to provide better overall performance than the conventional droop control method [5]. A possible control hierarchy of VOC-based MGs is shown in Fig. 1b, in which the functions of the converter control layer also involve the power-sharing capability and voltage, frequency regulation. As VOC technology shows promising advantages over droop control, this work focuses on its application in multi-bus MGs and designing a suitable synchronization solution to seamlessly synchronize a multibus MG to the main grid. Various synchronization techniques have been proposed in the literature, which can be categorized in different ways.
In this work, we analyze two groups of synchronization solutions considering MG topology as follows: i) synchronization of an individual DG to an energized grid, or MG with a single DG, or a master DG in MG using master-slave control strategy [5]- [8], and ii) synchronization of MGs with several DGs and complex topologies, i.e., multi-bus MGs. The solutions for the first group are relatively simple, in comparison with the second group since the synchronization control signal only needs to send from the synchronization controller to a single (master) DG. In [5], a simple synchronization control method is embedded into the VOC system to connect/ disconnect a single VOC-based DG to/from an energized microgrid, by enforcing DG output voltage to be equal to the grid-side voltage at the connection point. However, this method is not suitable for synchronizing an MG with several VOC-based DGs to the main utility grid since it requires a centralized communication network to send time-domain voltage signals to every single DG. Also, in the multi-bus MG application with local loads connected near DG locations, enforcing all DG output voltages to be equal to grid-side PCC voltage may significantly influence the power flow on the network. A universal integrated synchronization and control method that is analogous to the virtual synchronous machine technique is proposed in [6] to synchronize a single DG to the main grid. However, the power reference signals need to be set equal to zero during the transition process, making it not applicable for synchronizing an energized multi-bus MG to the main grid. In [7], a frequency-locked-loop (FLL)-based synchronization method is used in MG with master-slaver configuration. However, the change of control mode may cause large transient oscillations in a short period. The PLLbased synchronization method is presented in [8] to generate synchronization reference signals (frequency and voltage) for the master inverter. However, this method still has issues related to the PLL technique, e.g., nonlinearity characteristics, inherently noise sensitive, expensive, and difficulty in implementation.
The synchronization solutions for group ii) are more challenging than for group i) because a multi-bus MG comprises multiple DGs with distinct characteristics and a lot more communication links between them (in the case of hierarchical control structure). Improper design of synchronization algorithms may result in failure to synchronize, causing severe system oscillations and even destabilizing the whole system. In practice, the MG synchronization is controlled by a signal from the synchroscope with synchcheck relay, which closes the static switch when the synchronization requirements are fulfilled. However, this method usually involves human activities that cause inconsistent results. An active synchronization method using MG central controller is proposed in [9] for a multi-bus MG. However, the centralized method is vulnerable to single-point failure and can increase investment costs when the number of DGs increases. In [2], a distributed synchronization framework is proposed for reconnecting a multi-bus MG to the utility grid. The synchronization signals are sent to several DGs (usually called leading DGs), and the consensus-based distributed protocol regulates the frequency and voltage of all DGs to enforce the voltage at the MG-side of the static switch (SS) to slowly synchronize with the one at the main grid side. The distributed active synchronization strategy in [10] takes into account both fundamental and negative and zero sequence components of the voltage so that the transient of the synchronization method is not affected by distorted loads. This paper presents the design of an autonomous synchronization method for the multi-bus MG controlled with VOC, which is based on an average consensus distributed protocol (CDP). With the proposed method, all DGs adjust their active, reactive power output in a cooperative manner to regulate the voltage of MG to track the main grid voltage. The main contributions of this paper are as follows: i) an average consensus distributed protocol that uses only a spare communication network is proposed to achieve the load power-sharing among DGs and autonomous synchronization simultaneously; thus, the problem related to singlepoint failure no longer exists, ii) An improvement of the Andronov-Hopf Oscillator (AHO) [11] is presented to control DGs in both islanded and grid-connected multi-bus MG, and iii) the proposed synchronization framework does not require direct frequency and phase angle measurement to track magnitude, frequency, and phase angle of the grid voltage. It should be noted that there are different distributed methods that might be suitable for the mentioned synchronization issue, such as delay-tolerant power compensation control [12], and event-triggered method [13]. However, the goal of this study is not to compare all the available methods, but to find a simplest and most reliable method for ensuring proper synchronization of AHO-based MGs to the main grid. Therefore, the CDP is chosen.
The remainder of this paper is organized as follows: in section II, a hierarchical control structure of a multi-bus MG with the detailed modification of AHO is presented. Section III briefly presents standard requirements and the basis of synchronization process. The proposed distributed synchronization framework is developed in section IV. Section V validates the performance of the proposed method. Section VI concludes the paper.

II. HIERARCHICAL CONTROL STRUCTURE OF A MULTI-BUS MICROGRID
The structure of a multi-bus MG with N DG units is presented in Fig. 2. DG units connect to each other and to the main utility grid through a physical network. The loads can be connected locally near the DG area or at a common bus between two DG units. The hierarchical control structure of each DG adopted in this work consists of two main layers, i.e., the primary and secondary control. The primary control layer uses improved AHO to stabilize the local voltage and frequency, and provides a desired power-sharing mechanism.
The average consensus distributed protocol is adopted as secondary control layer to implement: i) a correction mechanism to nullify the power-sharing inaccuracy caused by impedance mismatches, nonidentical feeder impedance and parameter drifts, ii) an autonomous synchronization strategy under the request from higher control level which is not a scope of this work. The proposed hierarchical control structure uses only low bandwidth, spare communication network to exchange information between a DG and its neighbors (in case of autonomous MG operation) and between leading DGs and synchronization controller SC (during the synchronization process). The neighboring relation of each DG can be defined either by electrical topology or other topologies considering economic aspect and must fulfill requirements of the graph theory (see Section 4.2 for the detail). Fig. 3 presents a single-line diagram of the tested multibus MG in which the utility grid is connected to the MG via the SS. The utility grid is assumed to be the swing bus, which imposes fixed nominal voltage and frequency, and the DGs are operated in the grid-supporting mode. The blue dashed line represents the communication between DGs and the utility grid. The status of SS defines the operating mode of MG, i.e., when SS closes, MG is connected to the utility grid, and vice versa. In islanded mode, the loads cause the MG voltage (magnitude and frequency) to deviate from the nominal values and consequently influence the mismatch v between voltages at two sides of the SS, i.e., the voltage at bus A and B in Fig. 2. The error term v contains information of both voltage magnitude, frequency and phase angle deviation.

III. BASIS OF SYNCHRONIZATION IN MULTI-BUS MG
The value of v at the moment of reconnection defines the consequent level of the asynchronism, ranging from small power oscillations, overvoltage, significant inrush current to system instability, and equipment damage. To prevent the adverse impacts of the asynchronism on system stability and quality, it is required to keep the value of v within a strict limit for a specific time period before reconnecting the MG to the utility grid. As the tested MG has the average DG rating from 0 to 500 kVA, the synchronization requirement according to the IEEE Standard 1547.2-2008 are as follow: the maximum allowed tolerances of the voltage magnitude and phase angle are ±10%, ± 20 degree, respectively; and the frequency tolerance is 0.3 Hz.
The basic concept of autonomous synchronization is to force the voltage deviation v to stay within the standard limit before closing the SS. The information of v is preprocessed by using a simple calculation (see Section 4.2) and sent to the CDP of one or several leading DGs while the rest of DGs remain information exchange with its neighbors. The detail of these control signals and corresponding modifications of the CDP control laws are presented in the next sections.

IV. PROPOSED DISTRIBUTED HIERARCHICAL CONTROL FRAMEWORK
In this section, the proposed control framework is presented in detail. First, the basis of AHO with its potential technical challenges in the multi-bus MG scenario is discussed. The necessary modification is presented to improve controller performance and the possibility of adopting AHO into multibus MGs. Then, the synchronization control strategy based on average consensus distributed protocol is proposed to actively synchronize the MG voltage with the main utility grid before closing the static switch.

A. ANDRONOV-HOPF OSCILLATOR CONTROL
AHO is an advanced VOC strategy that has been developed and is expected to solve the shortcomings of previous VOC methods in the literature [14]. In comparison, the main advantages of AHO are: i) the elimination of third-order harmonics in the oscillators voltage signal and thus the removal of a design trade-off between transient performance and voltage quality, ii) the embedment of setpoints for power dispatching makes AHO suitable for both grid-connected and islanded operation. Fig. 4 shows the general structure of AHO applied to a three-phase VSC-based DG. Unlike Van der Pol type VOC, AHO uses both alpha and beta components of the orthogonal errors between the filter inductor current i α,β and current reference i * α,β , i.e., i = i α,β − i * α,β , so that it is applicable for three-phase application even under unbalanced conditions. The rotating matrix cos (ϑ) −sin (ϑ) sin (ϑ) cos (ϑ) plays a key role in defining the droop relation between AHO output voltage and frequency and active, reactive power generation. The value of ϑ is chosen based on the grid impedance angle. The dynamic of AHO can be briefly explained as follows. To achieve the desired oscillator dynamic of the capacitor voltage, a nonlinear state-dependent voltage, and current source v m and i m are used in the AHO circuit to force the oscillation to its asymptotic trajectory by absorbing and injecting energy. Applying Kirchhoff's current and voltage law to the AHO circuit in Fig. 4, the equations that govern the dynamics of AHO are formulated as follows: Here, v m = ξ ω n 2X 2 n − x 2 εi L and i m = ξ εω n 2X 2 n − x 2 v C , where X n defines the amplitude of the oscillators limit cycle, ω n is the nominal system frequency and ξ governs the speed of convergence to steady-state.
x is the Euclidean norm of vector From (1) and (2), and the elemental definitions of voltage magnitude, angle, active and reactive power in αβ coordinate, the dynamic model of AHO in terms of voltage magnitude V C and phase angle θ is derived as follows: where V n is the nominal RMS voltage magnitude, K v and K i are voltage and current scaling factors to couple AHO input and output to physical electrical feedback signals, respectively. The active, reactive power setpoints P ref and Q ref from system control level are used to calculate the current reference signals. The detailed derivation of (3) and (4), as well as the design specifications, can be found in [14].
In literature, AHO only prioritizes the power dispatch in grid-connected operation based on commands from upper control level. On the contrary, the islanded operation, especially the power-sharing among DGs and seamless synchronization for reconnection with the main grid, has not been mentioned. With our proposed algorithm, we are addressing both applications.
In this section, we conduct a comprehensive discussion on the islanded operation of a multi-bus MG with AHO-based DGs. In islanded mode, the power reference signals of all DGs are set equal to 0, i.e., P ref = Q ref = 0. By doing this, the dependency of AHO on reference signals from the control center is neglected. The load power is shared among DGs in proportion to VSC-rated powers, achieved by appropriately setting AHO parameters. By setting the derivativesv C = 0 andθ = ω, the equilibria of voltage and frequency of VSC in islanded mode are defined as follows: Equations (5) and (6) show the relation between AHO output voltage magnitude and frequency corresponding to a specified active, reactive power output. The accuracy of the load power-sharing is dependent on the ratio of equivalent impedances seen from the DGs, and requires that it is proportional to the desired power-sharing ratio. In an LV multi-bus MG, the equivalent impedance is challenging to obtain, or even unknown because of its complex topology and the diverse position of the loads. Hence, the power-sharing inaccuracy is inevitable and needs to be compensated. Also, (5) and (6) indicate the deviation from the nominal values of V C and ω proportional to the active and reactive power output, causing the MG to lose synchronism with the main grid. Consequently, it is required to have an SC to guarantee a fast and seamless transition between islanded and gridconnected modes. In this paper, the control strategy is integrated into the AHO circuit to adaptively regulate the internal parameters of AHO (V n and ω n ) based on desired control requirements. Therefore, the following modifications of (5) and (6) are made: Here, V n and ω n are determined by the following adaptive control law to regulate AHO power output: where K V and K ω are the control gains that determine the convergence speed of the proposed method. The control laws in (9) and (10) regulate the magnitude and phase angle of AHO voltage output and consequently force the power output of the DGs to follow the setpoints P ave and Q ave which are defined by the proposed CDP. The functions of the power setpoints are: i) to guarantee accurate power-sharing among DGs in normal islanded operation, and ii) synchronization with the main grid for a seamless transition from islanded to gridconnected operation. The details of the CDP are presented in the subsequent section.

B. PROPOSED DISTRIBUTED FRAMEWORK FOR POWER-SHARING CONTROL AND SYNCHRONIZATION
An illustration of the proposed controller is shown in Fig. 5. Each DG, as presented in Fig. 5, has access only to its local measurement. The proposed CDP of DG i receives information of the neighboring power output (P j , Q j ) through the communication network. The filtered power output of DGs, P j and Q j , is calculated by using instantaneous power concept in alpha/beta coordinates. The proposed control strategy has two main functions, based on the operation mode of the MG. In normal islanded operation, CDP detects power-sharing errors among DGs, and reaches a global consensus average value by iteratively exchanging and updating the power setpoints. In synchronization mode, the voltage magnitude and phase angle error between the grid (bus A) and MG sides (bus B) of the static switch are sent to the CDP of one or several leading DG(s) while the rest of the DGs remain information exchange with only its neighbors. The additional synchronization control signals δ v , δ ω and δ θ force the CDP VOLUME 9, 2021 The average consensus distributed control algorithm is based on graph theory. The following paragraph introduces the basics of Graph Theory and its application in the distributed average consensus control for multi-bus MG.
Considering a directed graph G with N nodes and m edges, an adjacency matrix A = a ij ∈ R N ×N showing the connection between node i and node j, in which a ij = 1 if there is a communication link and a ij = 0 otherwise. The graph G has a spanning tree as a sub-graph of G if the corresponding Laplacian matrix L of G is defined as is the in-degree matrix and N i = {j ∈ N : (i, j) ∈ m} is the neighbors of node i. A spanning tree is required in order to guarantee at least one communication link to each node. Based on information exchange between each node and its neighbors, a distributed average consensus control forces the state of all nodes in the network to reach a common equilibrium point. Assuming x 2 (0) , . . . ,x N (0)] T is the initial condition of each node in the network, as long as there exists a spanning tree of the graph G, after a finite step K , the value of all nodes converges to an average value defined as follows: Applying graph theory to a multi-bus MG, the communication network is considered as an undirected graph in which each DG is represented as a node, and a communication link between DG i and DG j is an edge. A discrete-time representation of CDP for a DG i is as follows: where, x is the local information of the states (active and reactive power) of DG i and DG j at the step k, respectively. The gain K i = K iP K iQ T and K j = K jP K jQ T is chosen according to the power sharing ratio P i K iP = P j K jP , and Q i K iQ = Q j K jQ . If there is a communication link between DG i and DG j , the factor µ ij = 1, while µ ij = 0 otherwise. The weighted factor G i plays a significant role in guaranteeing system stability during the information exchange and increase the convergent speed.
When the communication network of a multi-bus MG has a spanning tree, the proposed CDP drives the states of DGs toward an average consensus value after a finite step K, as follows: Applying (13) into control law in (9) (10), the value of V n and ω n is adaptively adjusted and the power outputs of all DGs in MG reach the average consensus value.
In synchronization mode, the voltage at bus A and B are centrally measured and sent to the SC located at the static switch for data pre-processing. Then, the control signals from the SC are sent to the CDP of one or several leading DG(s) while the rest of the DGs remain information exchange with its neighbors. The magnitude δ V , angular frequency δ ω and phase angle δ θ of this voltage error are achieved by the following equation: The magnitude difference can be calculated easily by using (14). However, due to the periodic feature of the off-nominal sine wave, the measured phase angle varies between [−π, π] with the abrupt changes at the value of −π and π. Therefore, directly using the measured phase angle as an input for a controller may result in unexpected oscillations and longer settling time. Instead, in this paper, an alternative approach is proposed as follows.
Let the three-phase voltages at bus A be v A_a = Using Clarke Transformation yields: and By using (17) and (18), the following expression can be derived: Dividing two side of (19) for |V A | |V B | yields: It can be seen from (20) that the right term sin [(δ ω ) t + (δ θ )] contains information of not only the phase angle difference but also the frequency mismatch between the voltage at bus A and bus B. It is obvious that sin [(δ ω ) t + (δ θ )] = 0 if both δ ω and δ θ equal to zero. Therefore, the term sin [(δ ω ) t + (δ θ )] can be used as a control variable for frequency and phase angle tracking.
In the proposed active synchronization control strategy, to force the bus B voltage to track that of bus A, the magnitude tolerance δ V is added into the active power control law of CDP of one or several leading DG(s). Meanwhile the angular frequency tolerance δ syn is added to reactive power control law as follows: Here, K | V | and K |ω−θ| are the corresponding coefficients for voltage magnitude and angular frequency tracking, respectively. The synchronization control is activated if γ syn = 1, and is deactivated otherwise.
As seen from (21) and (22), when the synchronization mode is activated, the active and reactive power control laws of the proposed CDP now include tracking errors from (14) and (20). The CDP of the leading DG(s) only shift up/down their operating curves according to the received synchronization signals, i.e. K | V | |δ V | and K |f −θ| sin [(δ ω ) t + (δ θ )]. The remaining DGs then follows the change of the leading DG(s) in a distributed manner. At the steady-state of the synchronization process, |δ V | = 0 and δ syn = 0; then, the control law in (21) and (22) becomes the original control of active power sharing control in (9) and (10). Therefore, the power-sharing function of the CDP is not affected. A brief flow chart of the proposed algorithm is presented in Fig. 6. The initial values of active and reactive power of DG i (P i (0), Q i (0)) and power information from its neighbors are used to calculate the references for power outputs of DG i in the next iteration. After a finite iteration K, the power outputs of DG i reach an average consensus value defined by (13). The synchronization request forces the proposed CDP of DG i to update the algorithm to find a new equilibrium point where the voltages at both sides of the static switch are synchronized. The proposed method continuously observes the status of DGs in MG by checking the status of the communication links and perform necessary modifications, e.g., if the communication between DG i and DG j is lost, the CDP of DG i removes DG j from the list of neighbors and implements algorithm with a new set of inputs.

C. SMALL-SIGNAL STABILITY ANALYSIS OF SECONDARY CONTROL FOR POWER SHARING
An eigenvalue-based small-signal analysis is performed in this section to analyze the impact on the stability of secondary VOLUME 9, 2021 controller parameters and communication delay for powersharing capabilities. The analysis is performed on a multi-bus MG consisting of N VOC-based DGs, M buses connected through B branches (see [15] for the detailed configuration of the model). The model of the considered MG for smallsignal stability analysis is achieved through linearization of equations of the components of the system, including VSCs with VOC-based primary control, the electrical topology of the system described through and branches and buses (nodes) with RL loads, as well as the secondary controller with communication links topology. The proposed synchronization algorithm is excluded from this stability analysis as being beyond the scope of the small-signal model, and the synchronous conditions are assumed setting |δ V | = 0 and δ syn = 0.
The linearization of the proposed secondary controller in (21) and (22) around a specific operating point yields the following: where N i is a set of neighbors of the i-th DG; p i , p j and q i , q j are linearized equations for the active and reactive power of i-th and j-th DG, respectively, which are derived from the equations to define power injection of DG i to the rest of the grid through an equivalent impedance Z c,i = R c,i + sL c,i , as follows: Using a linearized model of a multi-bus MG exclusively presented in [15], the AHO model in (7) and (8), and the linearized model of the proposed secondary controller in   24), as well as on linearized output currents of DGs, load currents, and branch currents. The matrices A 0 and A 1 are the state matrices of the same size corresponding to ordinary and delayed state variables τ d , respectively. A 0 and A 1 can be derived by calculating partial derivatives ∂F ∂X of the nonlinear system. In order to analyze the stability of the timedelayed system ẋ (t), its eigenvalues need to be calculated from the roots of the following transcendental characteristic equation: By using (27) and the parameters shown in Table 1 and 2, the root locus of the dominant eigenvalues of the 5-DG/9-bus MG is provided in Fig. 7 and the dependency of the delay margin on the parameters of the proposed method is shown in Fig. 8. Fig. 7 only shows the dominant eigenvalues that has a significant impact on system stability when varying the secondary controller parameters K V and K ω . Initial values 0.005 and 0.03 of K ω and K V have been chosen as yielding  feasible operation and reasonably good performance. Further tuning of these values is possible based on the analysis below. The results show that:

1) IMPACT OF CONTROLLER PARAMETERS ON STABILITY MARGIN
When K ω = 0.005, and K V increases from 0.03 to 0.171 (see Fig. 7a), the stability margin of the system increases at first (the dominant eigenvalues move to the far left of the stable region) and then decreases (the dominant eigenvalues move to the unstable region). The dominant eigenvalues cross the zero axis at K V = 0.165 indicated that the system becomes unstable when K V ≥ 0.165. When K V = 0.03, the stability margin quickly reduces when K ω increases from 0.005 to just 0.007 (see Fig. 7b). The system becomes unstable when K ω ≥ 0.0065. The above analysis shows that the control parameter K ω has more impact on the system stability than K V . It is consistent with the basic theory of the VOC as K ω influents the frequency of the VOC, thus the synchronization characteristic of VOC is affected.

2) IMPACT OF CONTROLLER PARAMETERS ON DELAY MARGIN
In this case study, we use the concept of delay margin (τ max ) [16] to evaluate the impact of the communication time delay on system stability. Delay margin is the maximum delay, for which the system is stable. Higher delay margin might be desired in case of lower quality communication infrastructure that presents higher communication latency. Fig. 8 shows the change of the delay margin when both secondary control parameters K V and K ω vary around values from the previous section, that is, around 0.03 and 0.005, respectively. The delay margin corresponding to a given pair of secondary control power-sharing parameters is determined by deriving eigenvalues of delayed system and observing for what delay the eigenvalues related to communication time delay enter the right half-plane. Fig. 8 indicates that both K V and K ω have some impacts on the delay margin. The value of K V affects more significantly and lower K V increases the delay margin. Similarly, lower K ω increases delay margin, but only in the region of lower K V values, while the impact is minor for higher K V . The highest delay margin (165 ms) in the analyzed region can be obtained for smaller values of both K V and K ω and the lowest delay margin (94 ms) for higher K V , but also for lowest K ω . It should be noted that for some values of these parameters, which provide a higher delay margin, the dynamic response of the secondary control might be slower, what on the other hand, might be undesired depending on the design. Therefore, in general, both margin delay and dynamic response of the system have to be considered in the design process. Additionally, delay margin can be increased VOLUME 9, 2021 with additional delay compensation methods in the primary and secondary controllers.

V. SIMULATION RESULTS AND DISCUSSION
In this section, we validate the performance of the proposed CDP for both power-sharing and synchronization in terms of steady-state error and dynamic performance, by using timedomain simulations in the real-time Opal-RT platform. The tested 9-bus MG shown in Fig. 3 consists of 5 AHO-based DGs and 9 loads. The feeders are represented by different serial RL branches. The blue-dotted lines represent communication link among DGs and between leading DG(s) and SC. Fig. 9 presents a photo of the experimental setup implemented at the laboratory of the institute for Automation of Complex Power System (ACS) -RWTH Aachen University. The parameters of the power stage and proposed controller are presented in Table 1 and 2, respectively. The choice of these parameters for VOC-based DGs is based on [17] and explained there in more detail. The value of the coefficients of the proposed synchronization control are K | V | = 200, and K |f −θ| = 4000, respectively. The grid is modeled as an ideal three-phase voltage source connected in series with an impedance Z N = 0.1 + j 0.1 . In the beginning, the MG operates under islanded mode without the proposed secondary controller. CDP then is activated at time t = 2 s to improve power-sharing accuracy among DGs. At time t = 8 s, the request to connect to the main grid is sent from the upper control level, resulting in the activation of the proposed synchronization approach. The MG is connected to the main grid at time t = 16 s.  A is 1.0 pu. The proposed CDP and synchronization control are activated at t = 2 s and t = 8 s, respectively. The simulation results are shown in Fig. 10 and Fig. 11. Fig. 10 shows the frequency, phase angle, and magnitude of the voltage at bus A and B, respectively. When the proposed synchronization control is activated, the voltage frequency and magnitude at the bus B quickly tracks the utility grid voltage in around 2.5 seconds with a negligible transient. The phase angle difference between MG side voltage and main grid voltage when the proposed control is activated (t = 8 s) is 24 degree. After 1.6 seconds after the proposed control is enabled, the phase angle difference drops well below 1 degree. Fig. 11 presents the variation of the DG power outputs under the activation of the proposed CDP and synchronization control. As Fig.11 shows, before t = 8 s, all DGs share the load power equally as an effect of the proposed CDP. When the proposed synchronization control is activated, both active and reactive power output of DGs simultaneously converges to new equilibrium points so that the voltage at bus B synchronizes with that of bus A.
As the proposed synchronization controller sends the same additional control signals to the input of all CDP, the DG power outputs show identical transient behavior. At t = 16 s, MG is smoothly connected to the utility grid. Small transients in a short time of the power outputs of all DGs indicate that the inrush current flowing through the SS is significantly small during the connection process.

B. CASE 2: DISTRIBUTED SYNCHRONIZATION
In this case study, the synchronization signals are assumed to be received only by the CDP of the DG 3 . The initial conditions of the MG are the same as case 1. The objective of this case study is to validate the performance of the proposed synchronization control under a fully distributed manner where DG 3 is the only leading DG, communicating with SC. Whereas the communications of other DGs keep unchanged. Simulation results of the voltage and power variations are presented in Fig. 12 and Fig. 13, respectively.
As Fig. 12 shows, when the proposed synchronization control is enabled at t = 8 s, the voltage at bus B closely track the voltage at bus A with slightly longer transient, in comparison to case 1. Simulation results also show a small overshoot in case of frequency, and negligible undershoot in case of phase angle. However, these transients vanish quickly, and after 1.8 seconds, the phase angle difference drops well below 1 degree. The simulation results in Fig. 13 show that the highest overshoot is observed in both active and reactive power output of DG 3 since the control law of the CDP corresponding to DG 3 is influenced directly by the proposed synchronization control, while the other DGs receive the setpoints already averaged by at least CDP of the leading DG. The transient effects of the proposed CDP vanish completely in around 3 seconds after the control is enabled, and at the same time, the power outputs of all DGs converge to a new equilibrium point to share the load equally. The synchronization requirements from IEEE Standard 1547.2-2008 and from [10] are then fully satisfied, and MG can be smoothly connected to the main grid.
The above analysis shows that there is a trade-off between technical and economic perspectives when using the proposed secondary control approach. Better dynamic performance is achieved with the high density of the communication network, which might generate higher investment costs and exposition to problems with communication failure, security or compatibility. The proposed distributed approach provides a slower dynamic response, but equally accurate steady-state performance with a minimum number of required communication links. It might make the proposed approach more practical in systems where distributed communication or a certain degree of it is necessary.

C. CASE 3: INFLUENCE OF COMMUNICATION TIME-DELAY
This case study aims at demonstrating the performance of the proposed synchronization control strategy under the occurrence of the communication time-delay between DGs and between leading DG(s) and SC.
In this scenario, the time-delays of communication links are presented in Table 3. These delays are assumed realistic in a good quality communication infrastructure, but not a lowlatency infrastructure dedicated for DG-to-DG communication. The rest of the simulation conditions are the same as those in Case 2. Simulation results are presented in Fig. 14. The simulation results show that even with a large time delay, the dynamic response of the proposed CDP is reduced by less than 1% (in terms of overshoot and settling time), compared to the case without communication time-delays. The MG voltage is still successfully synchronized with the utility grid in around 6 seconds, and the MG can seamlessly connect to the main grid from time t = 12 s. Therefore, the proposed method is robust under considerable communication time delay.

VI. CONCLUSION
This paper proposes a hierarchical control strategy for powersharing and for a smooth transition of multi-bus MGs from islanded mode to grid-connected. The strategy includes an AHO-based primary control layer jointly with secondary control layer, which adopts an average consensus distributed protocol towards achieving proportional power-sharing among DGs and simultaneously synchronization to the external grid. Specifically, the proposed control strategy aims to reduce inaccuracy in power-sharing in normal operation and furthermore synchronizes voltage at both sides of the static switch in synchronization mode that allows the MG to seamlessly connect to the main grid without direct frequency and phase angle measurements. The eigenvalue-based small-signal stability analysis is performed to analyze the dependency of the controller parameters and communication time-delay on the system dynamics.
The results in real-time simulation in the Opal-RT platform show that: 1) In normal islanded operation, the proposed control strategy can effectively eliminate the powersharing errors among DGs caused by the different line impedances and load locations. The active powersharing inaccuracy is nullified, while there is a minor steady-state error of 0.7% in reactive power-sharing. 2) The proposed distributed control strategy enables the MG-side voltage to synchronize with the grid-side voltage in synchronization mode. The magnitude and frequency difference between the voltage at two sides of SS are eliminated in about 3 seconds. Meanwhile, the phase angle difference is dropped from 24 degree to less than 1 degree with the effect of the proposed method, thus allowing MG to seamlessly connect to the main grid.
3) The performance of the proposed distributed control strategy is slightly less than the centralized control method, in terms of settling time. However, this performance reduction (e.g., the settling time in a centralized case is 2.5 seconds, while in the proposed method is 3 seconds) may be counterbalanced by the technical and economic advantages of the distributed solution.
The eigenvalue-based stability analysis presents the approach to controller parameters fitting in order to accomplish prospective requirements of system dynamics and communication infrastructure. The results of the analysis can be used to verify the system stability with a certain set of controller parameters and communication time delays, and to optimize controller parameters and delay margin that keeps the system stable. In addition, the small-signal model is developed independently on the number and location of DGs, loads, and branches. Thus, it can be used in various structures of radial multi-bus MGs.
An important direction for future research is to improve the proposed control strategy under unbalanced load conditions, as such loads are common in low-voltage MGs. Furthermore, the stability analysis should be extended to transient stability analysis in order to include large deviations like synchronization actions or significant imbalances. The implementation of Power Hardware-in-the-Loop (PHiL) in laboratory environment additionally to the provided CHiL is also an essential step to prove the practical application of the proposed method.