Consensus-based distributed control scheme for PCC voltage harmonic mitigation and enhanced power sharing in islanded microgrids

In the islanded microgrid, it is necessary to distribute the harmonic powers correctly among generators and mitigate the voltage harmonics at the point of common coupling (PCC) for effective microgrid operation. These control objectives are hard to satisfy at the same time with only one virtual impedance component. To simultaneously improve the microgrid voltage quality and share the distortion powers, a consensus-based distributed power-sharing scheme is proposed along with PCC harmonics mitigation. In the proposed control scheme, the controllable parts of output impedance at the fundamental and harmonic frequencies are separately tuned by simple integral controllers without depending on feeder impedance parameters. Compared to conventional control schemes, the proposed method is less complicated while ensuring a high voltage quality despite sudden changes in load power. A small-signal state-space model of the microgrid is analysed to validate the stability of the proposed control scheme, and its effectiveness is veriﬁed by experiments with a scaled-down microgrid system.


INTRODUCTION
Microgrid is a low-voltage electrical distribution network that is composed of multiple parallel distributed generators and loads [1]. The microgrid can be worked in either grid-connected mode or in islanded mode to provide reliable power supply to the loads with low cost [2,3]. In islanded mode, the required load power must be shared among parallel distributed generators (DGs) according to their power ratings to avoid overload condition for each generator, and it is also important to minimize the total harmonic distortion (THD) at the point of common coupling (PCC).
In order to share the load power, the real power-frequency (P-ω) and reactive power-voltage magnitude (Q-V) droop controllers are conventionally adopted because the droop control algorithm can be easily realized in a decentralized way by measuring only the local inverter voltage and current [4,5]. Even though the active load power is always accurately shared in steady state with the droop controller, it is hard to share the reactive power accurately when the feeder impedances are dif-  [6,7]. In order to achieve accurate reactive power sharing with conventional droop controllers, virtual impedance has been introduced to compensate for the impedance difference [8], and many enhanced generator virtual impedance schemes have been proposed with the aid of communication links [9][10][11][12].
When non-linear loads are extensively connected in the microgrid system, harmonic power sharing should be considered for effective DG utilization. Similar to the situation of the reactive power sharing, it is also difficult to realize accurate harmonic power sharing by using conventional droop controllers, and virtual impedances at harmonic frequencies have been used for accurate harmonic power sharing. For instance, large harmonic virtual impedances were inserted at the generator outputs to attenuate the mismatches in harmonic feeder impedances [13,14]. Unfortunately, the voltage at the PCC becomes severely distorted because of the significant voltage drops through the harmonic virtual impedances. In [15], authors added a disturbance term associated with the harmonic power to the conventional droop controller, and the virtual impedance was adjusted based on the real power variation. But, the correct power sharing cannot be realized if the load power varies during virtual impedance adjustment. To improve the power sharing during load variation, equivalent impedance is reshaped by tuning the generator notch filters at the relevant harmonic frequencies [16]. However, the performance of power sharing depends on the accuracy of feeder impedance estimation, which is hard to apply in a microgrid with a large number of generators. To solve these problems, harmonic virtual impedances were regulated by using a centralized control scheme with the aid of a microgrid central controller [17] or consensus control scheme [18], and the harmonic power-sharing error was noticeably minimized.
Together with accurate power sharing, a passive damping method was presented to reduce the PCC voltage distortion [19]. However, the control system becomes expensive and complex due to the additional damping circuit. A harmonic droop controller was proposed without any additional hardware devices, but the impact of feeder impedances was not considered [20]. To mitigate the feeder impedance influence, negative virtual impedances at the selected harmonic frequency were inserted into the inverter output to realize non-linear load power sharing [21,22]. However, they are not easy to apply for practical microgrid systems because these control methods require exact feeder impedances. A harmonic control loop was integrated into the voltage controller along with the impedance adjustment, and accurate power sharing with improved PCC voltage was obtained in spite of the system parameter variations [23]. Nevertheless, the PCC voltage quality is not compensated sufficiently to comply with IEEE 519 standards because its THD is higher than 5% [24].
To further improve the PCC voltage quality, some methods have been reported using PCC voltage information. An enhanced hierarchical control scheme was developed, in which an additional control loop was inserted into the local controller for reducing PCC voltage harmonics [25,26]. But, the control scheme becomes very complicated due to many park/reverse park transformations. To address this issue, other authors in [27] proposed a harmonic droop controller based on the centralized approach to indirectly regulate the inverter equivalent impedance. Nevertheless, this controller is sensitive to communication link failure because point-to-point communication links between a microgrid central controller and all generators are needed. Instead of point-to-point communication links, a decentralized islanding power-sharing method was presented in [28]. In this method, an outer voltage control loop is implemented in the microgrid central controller to directly regulate the PCC voltage, and the local generator unit is operated as a current control mode to regulate the output power. Although the PCC voltage quality is effectively improved, the powersharing errors cannot be fully eliminated due to the mismatched feeder impedance. To overcome this issue, an optimal virtual resistor was introduced to stabilize the output harmonics [29]. But, the optimal resistor calculation requires an additional load current sensor to extract the load harmonic current, which is difficult to implement in a practical system.
To overcome the drawbacks of conventional methods, this paper proposes a consensus-based voltage harmonic mitigation to enhance the PCC voltage quality with low THD (<5%) FIGURE 1 Typical islanded microgrid configuration together with balanced harmonic power sharing for islanded microgrids. In the proposed scheme, the inverter output impedance is continuously tuned to eliminate the mismatches in feeder impedance at both fundamental and selected harmonic frequencies. Thanks to the balanced system impedance, the proposed scheme can realize accurate harmonic mitigation and power sharing at the same time even if the load conditions change abruptly. In addition, the prior values of feeder impedances and the load current sensor are not required in the proposed control scheme, and it is easily applied in a practical system with a large number of generators. A small-signal system model was developed to examine the stability of the microgrid under control parameter variation. Experiments with a scaleddown microgrid testbed were carried out to validate the feasibility and correctness of the proposed control scheme.
The rest of this paper is outlined as follows. The microgrid configuration and analyses of distorted power sharing and voltage harmonics are described in Section 2. Section 3 presents a proposed consensus-based distributed control scheme along with the microgrid small-signal model. In Section 4, a series of experiments are carried out to evaluate the proposed control performance. Finally, concluding remarks are shown in Section 5.

2
ISLANDED MICROGRID ANALYSIS Figure 1 shows a typical islanded microgrid configuration, where power-electronics-based generators are parallelly connected to the PCC through feeders. Each generator is composed of a renewable energy-based DC source, an DC-AC converter, and an LC/LCL filter. Fundamental and harmonic powers are generated by linear and non-linear loads that are attached to the PCC bus. Additionally, a power quality central controller (PQCC) is used for monitoring the PCC voltage power quality. The PQCC and generators communicate with their neighbours through a sparse communication network.

Real and reactive power sharing
In islanded microgrids, P-ω and Q-E droop controllers are used to regulate the frequency (ω i ) and voltage magnitude (E i ) of the ith generator based on the real power P i and reactive power Q i as follows [8]: where ω 0 and E 0 are the nominal values of the generator angular frequency and voltage magnitude; m i and n i are the droop coefficients of the P-ω and Q-E droop controllers, respectively. By controlling the output voltage frequency and magnitude in Equations (1) and (2), the droop control voltage (V droop,i ) is obtained as follows [9]: .
The conventional droop controller in (3) has a small computation because it only requires local power measurement. However, the conventional droop control method cannot share the reactive power accurately because it does not consider the effect of the feeder impedance mismatches. To proportionally share reactive power in the islanded microgrid, the fundamental impedance (L f vir,i ) is emulated at the generator output, and the voltage reference in (3) is modified as follows [11]: where V f re f ,i is the voltage reference at the fundamental frequency for the generator voltage control loop, I f od ,i is the conjugated generator current at the fundamental frequency, which is obtained by delaying I f o,i for a quarter fundamental cycle [30].

Analysing of PCC voltage harmonic mitigation and harmonic power sharing
In order to analyse the islanded microgrid easily, the simplified equivalent circuit of two generators is established using the Thevenin theorem, as shown in Figure 2. The generator is modelled by a voltage source in series with the output impedance. An output filter inductor is used in each generator, so the physical feeder impedance between generators is mainly inductance. When analysing the equivalent circuit in Figure 2 at the harmonic frequency, the voltage source is neglected because the droop controller only regulates the fundamental voltage component. Meanwhile, the value of output impedance is varied at the individual harmonic frequency.
Based on Figure 2, the equivalent circuit of the microgrid at the specific h-order harmonic frequency is established, as shown  Figure 3. The non-linear load power is modelled as a current source (I h Load ) and the physical feeder impedance among generators is defined as L h phy,i . We assumed that the output impedance at the h-order harmonics consists of two controllable virtual impedances (L h H ,i and L h C ,i ), so the output impedance is derived as follows: where Z h Out ,i is the output impedance, and L h H ,i and L h C ,i are the harmonic power regulating and PCC voltage harmonic compensating parts, respectively.
With the separated virtual impedances in (5), it is possible to find proper values of L h H ,i and L h C ,i for both accurate power sharing and harmonic voltage mitigation. From Figure 3, the harmonic equivalent impedance (L h eq,i ) is a combination of physical, power regulation, and harmonic mitigation parts: The ith generator harmonic current (I h o,i ) is obtained as follows: where V h PCC and ω are the PCC h-harmonic voltage and system angular frequency, respectively.
The harmonic power H h i of ith generator is determined according to the IEEE 1459-2010 standard as follows [31]: where V f o,i is the generator voltage at the fundamental frequency. By substituting (7) into (8), (9) is obtained: From (9), the mismatched power sharing between generators 1 and 2 (ΔH h 12 ) is obtained as follows: where H h * ,i is the rated power of the ith generator at the h-order harmonic frequency. To eliminate the power-sharing error in (10) (ΔH h 12 = 0), the following condition needs to be satisfied: By substituting (6) From (12), in order to minimize the interference in L h Consequently, L h H ,1 and L h H ,2 in (12) are rewritten as follows: On the other hand, the PCC voltage at the h-order harmonic frequency in Figure 3 is derived as follows: By substituting (15) to (6), the relationship between the harmonic equivalent impedance (L h eq,i ) and desired PCC voltage When the harmonic load power is accurately shared by means of the virtual impedances in (11), the condition in (17) is achieved: By substituting (17) into (16), (18) is obtained: (14) and (18), L h C ,1 and L h C ,2 are derived as Finally, the virtual impedances to achieve the harmonic power sharing and the PCC voltage harmonic mitigation are obtained by substituting (14) and (19) into (5): From (20), L h vir,1 and L h vir,2 can be found to meet the conditions in (11) and (16)  and I h Load . Hence, by properly controlling the generator output impedance, accurate power sharing and PCC voltage harmonic mitigation can be realized at the same time.

PROPOSED OUTPUT IMPEDANCE CONTROL SCHEME
To mitigate the PCC voltage distortion while maintaining accurate harmonic power sharing, some additional information is required, such as the feeder impedances and load current (L h phy,1 , L h phy,2 , I h Load ). Unfortunately, it is not easy to obtain this information. To address this issue, an advantaged impedance control scheme was proposed recently [27]. But this method is sensitive to communication link failure because it is based on a centralized control approach, which requires a point-to-point communication link between the microgrid central controller and each generator. Therefore, we propose a distributed control scheme to regulate L h H ,i and L h C ,i without the required information about feeder impedances and load currents by means of consensus algorithms.

Consensus control basis
Based on graph theory, a consensus-based controller is realized by using only a sparse communication network [32]. In a consensus-based controller, a control state x i is assigned to each node i on a graph, and each node can use its information and that of its neighbour j (j ∈ N i ) to update the value of state x i . The consensus update rule for a regulator synchronization problem [33] or tracking synchronization problem [34] are determined in (21) and (22), respectively: where a ij is the connection status between nodes i and j. a ij = 1 shows that node i is communicating with node j, while a ij = 0 indicates that there is no exchanged information between them. g i is the pinning gain, and g i = 1 if node i receives the information of x ref from the root nodes that contain the reference x ref , otherwise g i = 0. If the network contains a spanning tree, the state x i of all the nodes in (21) converges to a common value in the regular synchronization. In the tracking synchronization, the state x i of all the nodes in (22) will synchronize to the reference value x ref .

Proposed consensus-based distributed control scheme
For a general microgrid application, a system with n units and sparse communication links among generators is considered. Figure 4 shows the proposed control diagram of the ith generator with the aid of the PQCC. From Figure 4, the output impedance at h-order frequency is adaptively tuned by the proposed impedance controller to balance the equivalent impedance among generators, so that the PCC voltage quality and harmonic power-sharing performance are improved.

3.2.1
Output impedance regulation for accurate harmonic power sharing The condition to properly share the harmonic power in (11) is modified for a microgrid system with n generators as follows: In order to realize (23) in a distributed manner, the consensus protocol in (21) However, it is difficult to implement the controller in (24) since the equivalent impedance L h eq,i is an unknown variable. From (10) where k h H is a positive gain that determines the convergence rate of H h i ∕H h * ,i .

Output impedance regulation for PCC voltage distortion mitigation
The compensated output impedance (L h C ,i ) for PCC voltage harmonic compensation in (13) can be written for a microgrid system with n generators as follows: where From (27), to determine the proper compensation coefficient C h re f , information about the physical feeder impedances is needed, which is not easy to obtain. To deal with this problem, the PQCC detects the individual PCC voltage components at h-order frequency and then calculates the distortion index (HD h PCC ) as follows [24]: where V f PCC and V h PCC are the voltage magnitudes at the fundamental and h-order harmonic frequencies, respectively. Then, C h re f is obtained by means of a proportional-integral (PI) controller as follows: where k h P and k h I are the gains of the PI controller, and HD h re f is the allowable harmonic distortion limit on the PCC voltage. The PQCC sends the value of C h re f to its generator neighbours to implement the proposed control algorithm.
At a generator local controller, to realize (26) in a distributed manner, the consensus protocol in (22) is applied with where k h C is a positive gain to regulate the convergence rate of H h * ,i L h C ,i . By substituting (25) and (30) into (5), h-harmonic virtual impedance L h vir,i is obtained and voltage reference at the h-order harmonics is determined as follows: where I h od ,i is a delayed signal of I h o,i , which is generated by delaying I h o,i for a quarter of the h-order harmonic cycle [30]. Based on the virtual impedance in (32), inverter voltage reference is developed as following: In order to regulate the inverter output voltage for tracking the voltage reference, a multiloop voltage controller is adopted [15]: where K ih is the gain of the resonant controller in the outer voltage control loop, b is the bandwidth of the resonant controller, and K pV and K pI are proportional gains.

Small-signal analysis with microgrid state-space model
The microgrid stability and dynamics were studied by modelling a microgrid using a small-signal approach [12]. In order to reduce the harmonic power ripple and the harmonic distortion, Equations (8) and (28) are changed to Equations (36) and (37), respectively, by considering a low-pass filter as follows: where ω c is the cut-off angular frequency of the low-pass filter. The small-signal variations of the harmonic power (ΔH h i ) and the harmonic distortion (ΔHD h PCC ) are obtained by linearizing Equations (36) and (37), respectively: where ∆ represents a small-signal disturbance around an equivalent point of the microgrid. Similarly, by linearizing Equation (29), ΔC h re f is established as follows: The small-signal variations of the two virtual impedance parts, ΔL h C ,i and ΔL h H ,i , are obtained from Equations (25) and (30), respectively: The small-signal variation of the output current at the horder harmonic frequency (ΔI h o,i ) is derived by linearizing Equation (7): From (7), the PCC harmonic voltage for the microgrid with n generators is determined as follows: The small-signal PCC harmonic voltage (ΔV h PCC ) is achieved by linearizing (44) as follows: where i = V h PCC ∕ L h eq,i , i = 1, 2, ⋯, n. By using Equations (38) to (45), the microgrid state-space model is obtained after some manipulations as follows: where x MG is a state variable defined by ΔC h re f ] T . For simplicity, the microgrid with three generators in Figure 5 is considered in this paper, and its parameters are listed in Table 1. The detailed state matrix A MG is given in the Appendix. After substituting the given parameters into statespace model in (46), the systems eigenvalues are solved using the eigenvalue function in MATLAB. To examine the influence of control gains on the microgrid stability, the root locus diagrams under variations of k 3 I , k 3 P , k 3 H , and k 3 C are plotted in Figures 6-9, respectively. Figure 6 shows the location of microgrid eigenvalues on the complex plane when increasing k 3 I from 0 to 20 with 20 intervals. From Figure 6, all eigenvalues are kept in the left half plane, so we can say that the microgrid is stable. The stability of the system mainly depends on the dominant poles λ 1 , λ 2 , and λ 3 , which follow the direction of the arrows as k 3 I increases. As k 3 I increases, the conjugated poles λ 1 and λ 2 move towards the imaginary axis, while pole λ 3 goes toward the real axis, resulting in faster settling time but more oscillation. Figure 7 illustrates the root locus diagram with variation of k 3 P from 0 to 1. The increase in k 3 P mainly influences the eigenvalues λ 1 , λ 2 , λ 3 , and λ 5 . The conjugated poles λ 1 and λ 2 go far away from the vertical axis and the real poles λ 3 and λ 5 shift toward the right half plane. The value of k 3 P should be greater than 0.1 so that λ 1 and λ 2 are located in the right half plane and that system stability is ensured. Figure 8 depicts the response of the system to the variation of k 3 C from 0 to 100. When k 3 C is small, the dominant poles λ 1 -λ 2 are close to the vertical axis, indicating a reduced phase margin. When k 3 C is increasing, these dominant poles move far away from the vertical axis, indicating faster dynamic performance and improved stability. However, further increasing k 3 C , λ 1 and λ 2 becomes less dampened and λ 3,5-6 approaches the vertical axis, which reduces the system stability. Figure 9 demonstrates the influences of k 3 H on the microgrid stability. When increasing the gain k 3 H from 0 to 0.05, the dynamic performance is increased together with improved system stability, but the system damping is reduced.
From the detailed small-signal analysis above, to achieve the desired system damping and stability performance, the control gains for the third-order harmonics, k 3 I , k 3 P , k 3 C , and k 3 H , are selected as 15, 0.24, 10, and 0.008, respectively. Similarly, the control gains for the fifth-order and seventh-order harmonics, To examine the impact of the communication link delay, we assume that the harmonic power-sharing data of all generators have a constant time delay (t Delay ), and the equivalent impedances are modified from the Equation (42) by consider- where ΔH h i DL = ΔH h i (t − t Delay ). By using equations from (38) to (47), the microgrid state-space model including the communication delay is obtained after some manipulations: In order to find the eigenvalues for a specific communication time delay, the solution of (49) is obtained by means of the numerical approach in [35]. Figure 10 shows the trajectories of all eigenvalues when the communication delay (t Delay ) is increased from 0 to 200 ms. As shown in Figure 10, all eigenvalues move toward the right half plane when t Delay increases, and the system becomes unstable when t Delay > 90 ms. Thus, microgrid system becomes unstable when the communication delay is longer. In this study, we choose the communication delay to be 20 ms ( t Delay = 20 ms) in order to guarantee the microgrid is stable.

EXPERIMENTAL VERIFICATION
To avoid hardware complexity, we used a simple downscaled microgrid with three identical generators, as shown in Figure 5. A photo of the laboratory testbed is shown in Figure 11. A precision power analyser (PPA5530THD) was used to measure the THD value of the PCC voltage. The control algorithm was implemented using a 200 MHz digital signal processor (TMS320F28379D). The parameters of the microgrid testbed and controller used in the experiment are listed in Table 1. Low bandwidth communication is adopted to share the information among generators. For simplicity, this paper considers all distributed generators to have the same communication delay time, and it is emulated by using a zero order hold with a time interval of 20 ms (t Delay = 20 ms) [36]. The experimental performance of the proposed control system is shown in Figures 12-18, where each stage is defined as follows: Stage 1: The microgrid is initially controlled by the conventional droop controller to share the power among generators.
Stage 2: The proposed power sharing and harmonic output impedance controller are activated at t 1 to mitigate the voltage harmonics and suppress the power-sharing error at the same time.
Stage 3: Linear load 2 is connected to the microgrid testbed to evaluate the fundamental power-sharing performance. In Figure 12a-e, during the conventional droop operation (t < t 1 ), the reactive power and the selected third-, fifth-, and seventh-harmonic powers are not shared equally among three generators. In contrast, when adjustable output impedance parts are triggered at t 1 , the proposed control scheme accurately shares reactive and selected harmonic powers. Figure 13 shows the current-sharing performance of three generators. In Figure 13b, it is obvious that output currents of generators 1, 2, and 3 have a high current difference without the proposed control scheme. Meanwhile, inaccurate current sharing among DG units is minimized when applying the proposed scheme, as shown in Figure 13c.
To verify the power-sharing performance during the load condition changes, linear load 1 and non-linear load 2 were connected to the microgrid system at t 2 and t 3, respectively, as shown in Figure 14a-e. Thanks to the proposed output impedance regulation, all three generators maintain accurate, real and reactive power sharing despite the sudden changes in load power, as shown in Figure 14a,b. Besides, the same balanced third-, fifth-, and seventh-harmonic powers are guaranteed among the three generators in Stage 2 and Stage 3 (see Figure 14c-e). In addition, the proposed control scheme maintains accurate current sharing even though linear and non-linear loads are suddenly connected to the microgrid as shown in Figure 15.
The harmonic mitigation performance with the proposed control scheme is shown in Figure 16a,b. The scenarios of proposed control activation and load power variation are the same as in Figures 12 and 14, respectively. Without the harmonic  4.3% for the third harmonic, 2.85% for the fifth harmonic, and 1.75% for the seventh harmonic. After activating the proposed control scheme, the third-, fifth-, and seventh-harmonic distortions (HD 3 PCC , HD 5 PCC , and HD 7 PCC ) are greatly reduced to 1.5% (see Figure 16a). By adjusting the output impedance adaptively, accurate harmonic power sharing is ensured regardless of the sudden load change in Stages 3 and 4, as shown in Figure 16b. Figure 17 shows the microgrid voltage quality at the PCC bus. In Figure 17a, the microgrid voltage at the PCC is greatly dis- torted before harmonic mitigation with THD = 6.21%, and its voltage quality is significantly improved with a small THD value (THD = 3.8%) after applying the proposed method (see Figure 17b,c). The voltage THD value is maintained with a smaller value than the requirement of the IEEE 519-1992 standard (i.e. THD < 5%). Therefore, we can say that the proposed control scheme is suitable for the improvement of the microgrid voltage quality. Figure 18a-c show seventh-order harmonic power-sharing performance in order to evaluate the impact of communication delay with t Delay = 20 ms, t Delay = 50 ms, and t Delay = 100 ms, respectively. In Figure 18a,b, the harmonic power-sharing error converges to zero in the steady state, so that the system is stable when t Delay = 20 ms and t Delay = 50 ms. Meanwhile, the harmonic power-sharing error oscillates when t Delay = 100 ms. From Figure 18, we can say that the system becomes unstable

CONCLUSIONS
This paper analysed the improper harmonic power-sharing and voltage harmonic issues caused by mismatched feeder impedances. To fully address these issues, a consensus-based distributed power-sharing scheme along with harmonics mitigation was developed. In the proposed control scheme, the output impedance at the harmonic frequency is individually tuned, so the equivalent impedances among generators are balanced, and the mismatched feeder impedances are effectively suppressed. As a result, all generators can properly distribute the harmonic load power, and a nearly sinusoidal PCC voltage with THD < 5% is achieved. In addition, the desired powersharing performance and PCC voltage quality were maintained despite sudden changes in load power thanks to the adaptive output impedance. Furthermore, the information about feeder impedances and load currents are unnecessary in the proposed control method, which makes it easy to implement in a practical microgrid system. The correctness of the proposed control scheme was confirmed by an experiment on a scaled-down microgrid system.

APPENDIX 1
The matrix A MG in (46) is expressed as: where: