Reactive Power Sharing and Voltage Harmonic Distortion Compensation of Droop Controlled Single Phase Islanded Microgrids

When paralleling multiple inverters that are capable of operating as an island, the inverters typically employ the droop control scheme. Traditional droop control enables the decentralized regulation of the local voltage and frequency of the microgrid by the inverters. The droop method also enables the inverters to share the real and reactive power required by the loads. This paper focuses on some of the limitations of parallel islanded single phase inverters using droop control. Algorithms with the aim to address the following limitations in islanded operation were proposed: reactive power sharing and reduction of the voltage harmonic distortion at the point of common coupling (PCC). Experimental results were then presented to show the suitability of the proposed algorithms in achieving reactive power sharing and in improving the voltage harmonic distortion at the PCC.


I. INTRODUCTION
P ARALLEL inverters forming a microgrid are capable of operating as an island through the use of the droop control algorithm [1]- [15]. Traditional droop control enables the decentralized regulation of the voltage and frequency of the microgrid by the inverters. The droop method also enables the inverters to share the real and reactive power required by the load, although there are some limitations in this area. The main advantage of the droop method is that all of this functionality can be achieved through local measurements. Although the droop method has some operational limitations, this method is widely accepted in literature as one of the best solutions that is currently available for the decentralized control in microgrids [10]- [15].
The droop control technique enables the inverters to supply real and reactive power to the load by voltage and frequency deviations. However, a seamless transfer to grid-connected operation cannot occur due to these deviations and consequently, traditional droop control can be only applied to islanded microgrids [7]. In addition, these deviations can limit the power sharing accuracy and may also affect the stability of the microgrid [16].
Power sharing of the local loads is an important consideration in the deployment of decentralized systems. The inverters should ideally share the real and reactive power demand from the local loads according to the power rating of the inverters. When using droop control, the power sharing is defined through appropriate choice of the droop gains. However, any mismatches in the line impedances and the inverter output filters causes different operating conditions at the point of interface of each inverter to the microgrid. Since the reactive power output of each inverter depends on the voltage amplitudes due to the Q − E droops, the reactive power sharing between the inverters becomes compromised. On the other hand, the real power sharing capabilities are not affected by these mismatches as long as the frequency of the microgrid is not affected. The frequency of the microgrid remains constant throughout the whole microgrid once steady state conditions are achieved provided that the local load demand does not exceed the maximum apparent power rating of the inverters connected to the microgrid. Hence, the real power supplied by the inverters is shared accurately between the inverters even when mismatches are present. Hence, a additional reactive current supplied by each inverter can be observed due to these mismatches which reduces the power handling capabilities of the inverters [15].
A resistive-inductive virtual impedance loop was proposed with the aim to improve the power sharing in [7], [8], [12], [13], [16]- [19]. The virtual impedance loop adjusts the output impedance of the inverters by measuring the voltage and current at the output of the inverter. However, to ensure that power sharing is improved, the virtual impedance loop must be adjusted individually for each inverter such that the output impedance for all the inverters is equal. In practice this approach does not account for the mismatches due to the line impedances and the time variations of the output filter components. Thus, power sharing between the inverters still cannot be achieved although an improvement can be obtained. Other solutions that aim to achieve p.u. power sharing are available. In [3]- [5], [20], [21] it is proposed that the power sharing can be improved by adjusting the inverter droop gains. However, high droop gains can also compromise the stability of the microgrid [15]. Another line of thought promotes the use of a microgrid central controller (MGCC) to optimize the operation of the droop algorithm through noncritical communications. A hierarchical structure, in which the MGCC can be used to restore the frequency and voltage when synchronizing the microgrid to the mains, was proposed in [2] and [7]. Using the algorithms proposed by the authors, restoration of the voltage and frequency of the microgrid can be achieved. However, reactive power sharing cannot be obtained since the mismatches in the outputs of the inverters would still be present.
Parallel droop controlled inverters with LCL output filters have a small inertia and effectively form a weak grid. Any harmonic currents that flow in these grids distort the voltage at the point of common coupling (PCC) due to the voltage drop that develops across the grid side inductors. These voltage harmonics may cause stability issues due to any resonances present on the microgrid [22]. In addition, standards require that the voltage total harmonic distortion (THD) of the microgrid must be less than 2.5% [23]. Harmonic damping techniques must be considered to ensure that the microgrid complies with these standards. Traditional techniques involve the installation of passive or active filters to selectively dampen the harmonics. However these can compromise the stability of the grid or increase resonance problems. Hence inverter-based control strategies can be used to improve the power quality of the microgrid [22].
The authors in [24] propose a compensation scheme in which a sinusoidal voltage is produced at the PCC by operating the inverter using non-sinusoidal pulse width modulation (PWM) control. The proposed algorithm regulates the voltage harmonics at the PCC. The introduction of multiple inverters each with this capability could pose a serious problem towards the stability of the complete system. A harmonic conductanceharmonic VAr droop (G − Q droop) was proposed by the authors of [9], [22], [25] so as to reduce the harmonics present in three-phase systems. The G − Q droop dampens the harmonic resonances and distributes the harmonic filtering among the inverters. The authors of [22] use a droop gain for all the harmonic power supplied by the inverter while the authors in [9] and [25] apply selective harmonic compensation. The introduction of an additional droop control loop makes the design of the droop gains of the inverters even more complex as this loop may affect the dynamics of the real and reactive power sharing loop. This paper focuses on some of the limitations of the droop control algorithm for decentralized islanded operation. Algorithms with the aim to address the reactive power sharing problem and to reduce the voltage THD at the PCC in islanded operation were proposed and verified experimentally. The paper is organized as follows. In Section III, a description of the proposed inverter primary control structure including the capacitive virtual impedance loop was given that addresses the voltage harmonic problem at the PCC. Section IV contains a description of the secondary reactive power sharing, voltage and frequency restoration loops and a description of the secondary voltage harmonic compensation loop that was proposed to dampen further the voltage harmonics at the PCC. A summary of the experimental results was given in Section V, showing the suitability of the proposed algorithms in improving the performance of the islanded microgrid.

II. HIERARCHICAL MICROGRID ARCHITECTURE
In general, microgrids have a hierarchical control system which consists of a primary, secondary and tertiary control layers [2], [7], [13]. The block diagram of the hierarchical architecture considered for the single phase microgrid is shown in Fig. 1. The islanded microgrid consists of two parallel inverters, each with an LCL output filter. A local non-linear load, consisting of a single phase rectifier with smoothing capacitor, was connected to the microgrid through switch S2. For islanded operation, the static switch (SS) is open and the inverters operate autonomously to regulate the local microgrid voltage and frequency. Switch S1 at the output of inverter 2 allows for synchronization of the inverter via a phase-locked loop (PLL) to the voltage at its respective PCC before it is connected to the microgrid, to minimize the transients that occur.
The primary control layer consists of the control algorithms implemented in the inverters connected to the microgrid. These control loops enable the decentralized regulation of the voltage and frequency of the microgrid and real power sharing of the local loads in islanded mode. The secondary control layer consists of management and optimization algorithms to optimize the operation of the microgrid. These control algorithms are implemented in the MGCC, to which the SS and the inverters in the microgrid send and receive data via a low bandwidth bidirectional communications link. The traffic along the communications link is minimal since only optimization parameters are transmitted to the inverters. This ensures that the MGCC is not critical for the operation of the microgrid such that if a fault occurs in the MGCC or the communications system, the operation of the microgrid is not compromised. The tertiary control layer considers the  interaction between multiple microgrids at the MGCC level and the utility grid and was not considered at this stage.

III. INVERTER PRIMARY CONTROL STRUCTURE
The block diagram of the primary control loops implemented in the inverters for islanded operation is illustrated in Fig. 2. The controller evaluates the real and reactive power output of the inverter from measurements of the local voltages and currents. The voltage reference input to the inner control loops is then determined by the droop control algorithm.

A. Outer Droop Control Loop
In islanded mode, the inverter behaves as a voltage source inverter (VSI) so as to regulate the voltage and frequency of the microgrid. Real power is supplied to the loads by using real power against frequency P −ω droops while the reactive power is supplied to the loads by using reactive power against voltage Q − E droops. The inputs to the droop controller are the real and reactive power measurements determined by integrating the product of I o , V c and qV c and averaging the result over a mains cycle as shown in Fig. 3. The droop control functions in islanded mode can be mathematically expressed by: where P is the real power output of the inverter; Q is the reactive power output of the inverter; G p (s) = sm d + m and G q (s) = sn d + n are the real and reactive power droop controllers where m and n are the P − ω and Q − E droop gains and m d and n d are the P − ω and Q − E derivative gains. PD control was used for the Q − E and P − ω droop controllers since the integral term would cause the microgrid to become unstable. The real and reactive power references of the inverters P* and Q* respectively, are set to zero during islanded operation. This occurs since inverters output the real and reactive power outputs as required by the load. The gains of the P − ω and Q − E controllers are designed to achieve minimal deviations from the nominal values of E and ω. The droop gains for the inverters operating in the islanded microgrid, denoted by m n and n n respectively (where the subscript n is an integer denoting an inverter in the microgrid),  are typically related to the maximum power ratings of the inverters. Hence, m n and n n can be determined from:

Inner Loops
where ∆ω is the maximum frequency deviation allowed by the inverter, ∆E is the maximum voltage deviation allowed by the inverter, P M ax is the maximum real power output of the inverter and Q M ax is the maximum reactive power output of the inverter. This enables inverters with different capabilities to share the per unit (p.u.) real and reactive power demanded by the load when the microgrid reaches steady state. The condition for p.u. power sharing between the inverters can be defined by m 1 P 1 = m 2 P 2 = m n P n for the real power and n 1 Q 1 = n 2 Q 2 = n n Q n for the reactive power.

B. Inner Control Loops
The voltage reference waveform, synchronized to the microgrid voltage if available, is then generated from the output of the droop controller. The inner control loops that were considered for the single phase inverters, consist of a voltage loop and an inner current loop. Both control loops are based on the stationary reference frame and make use of Proportional-Resonant (PR) controllers [26], [27]. The transfer functions of the non-ideal PR controller can be given by [26]: where K p is the proportional gain term, k i is the resonant gain term, ω c is the resonant bandwidth control term and ω is the resonant frequency. The non-ideal transfer function was preferred since the controller provides a finite gain at ω and the bandwidth at the resonant frequency can also be controlled. The ideal transfer function introduces an infinite gain at ω and hence can cause stability problems. The transfer functions of the voltage and current controllers can be given by: where K pV and K pI are the proportional gain terms, k iV h and k iIh are the harmonic resonant gain terms, ω cV h and ω cIh are the harmonic resonant bandwidth control terms and ω h is the resonant frequency at the harmonic where ω h = hω and hence depend on the frequency droop. The PR transfer functions for the voltage and current controllers, (6) and (7) respectively, were obtained directly from (5). The term h=1 in (6) and (7) represents the fundamental frequency ω of the controller that is determined by the droop control algorithm. In addition, selective harmonic compensation was included by the additional resonant terms for each harmonic compensated by the capacitive virtual impedance loop (3 rd up to the 9 th harmonic). These were included so as to provide closed loop control of the selected harmonics. In order to analyze the closed loop response and determine the controller gains, a block diagram of the inner control loops was obtained as shown in Fig. 4. A damping resistor, R, was included to reduce the selectivity of the output LCL filter. From Fig. 4, the closed loop transfer function (CLTF) of the inner loops can be expressed by: where Z L (s) = sL 1 + R 1 and Z C (s) = (sCR + 1)/sC. Note that the (s) argument was dropped for simplicity since all terms are functions in the Laplace domain. Therefore, the CLTF of the inner loops can be simply represented by a two-terminal Thevenin equivalent circuit denoted by: where G(s) is the voltage gain transfer function and Z o (s) represents the output impedance transfer function.

C. Capacitive Virtual Impedance Loop
Instead of introducing additional passive or active filters to selectively attenuate the harmonics at the PCC of the local load (PoL), a capacitive virtual impedance loop [28] was proposed by the authors so as to dampen the voltage harmonics. The basic principle of the capacitive virtual impedance loop is to compensate for the non-linear inductive voltage drop by introducing a capacitive component which is equal in magnitude but has an opposite phase shift. Effectively the output voltage of the inverter V c (s) is distorted to reduce the distortion of the voltage after the filter V o (s). The simplified Thevenin's Fig. 4. Block diagram of the inner control loops. L 1 is the inverter side inductance, C is the filter capacitance, R 1 is the inverter side choke resistance and R is the damping resistance, V ref is the voltage reference obtained from the droop control loop, i L is the current through L 1 , io is the current through L 2 and R is the damping resistance. equivalent circuit of the inverter with an LCL output filter is shown in Fig. 5a. The proposed capacitive virtual impedance X Ch cancels the effect of the inductive impedance X Lh as shown in Fig. 5b. The block diagram of Fig. 6 shows how the virtual impedance loop interacts with the inner control loops of the inverter. The voltage across the capacitor of the output filter can now be expressed as: where V * ref (s) is the reference voltage that is determined by the outer droop control loop, V ref (s) is the compensated input to the inner loops and Z d (s) is virtual impedance transfer function. Hence, V ref in (9) now includes the capacitive voltage drop due to the virtual impedance. The virtual impedance transfer function Z d (s) consists of a series of band-pass filters, tuned at each harmonic frequency that is required to be dampened (3 rd , 5 th , 7 th , and 9 th ), cascaded with a capacitive impedance block. Z d (s) can be expressed by: where k ih are the harmonic resonant gains, ω ch are the harmonic resonant bandwidths, ω h is the n th harmonic frequency and k Ch is the gain at the n th harmonic. Assuming that the bandwidth ω ch at the n th harmonic frequency is determined such that the interaction with the adjacent harmonics is negligible, then the magnitude and phase contribution of Z d (s) at each of the n th harmonic frequencies can be designed by considering the effect of each harmonic separately to determine the controller gains and then substituting in (11). Z d (s) at the n th harmonic can be denoted by:  The gain k Ch can be determined from the magnitude of (12) at ω = ω h :

Secondary Control
where |Z d (ω)| ω=ω h is equal to the magnitude of the impedance of the grid side inductance at the n th harmonic frequency. From (12), the phase angle at n th harmonic frequency is −90 o . A resistive virtual impedance R V is typically included so as to improve the stability of the microgrid and the power sharing between the micro-sources [7], [8], [13], [17]. Z d (s) with the additional R V can be denoted by: where R V acts on all the frequencies and thereby effects the magnitude and phase of the band pass filters determined in (11). Assuming that the bandwidth ω ch at the n th harmonic frequency is determined such that the interaction with the adjacent harmonics is negligible, then the magnitude and phase contribution of Z d (s) at each of the n th harmonic frequencies can be designed by considering the effect of each harmonic separately to determine the controller gains and then substituting in (14). Z d (s) at the n th harmonic can be denoted by: The gain k Ch can be determined from the magnitude of (15) at ω = ω h : From (15), the phase angle at n th harmonic frequency is given by: There exists a design compromise when using (16) and (17) to achieve the desired phase angle and magnitude at the n th harmonic. Hence, the addition of the resistive virtual impedance reduces the effectiveness of the capacitive virtual impedance at the compensated harmonic frequencies since the desired gain at the desired phase cannot be obtained with virtual impedance given by (14).

IV. SECONDARY CONTROL STRUCTURE
The frequency and voltage deviations from the nominal values due to the droop algorithm depend on various factors including the load impedance, the number of inverters connected to the microgrid and the droop gains used. Due to the decentralised operation, the inverters can only measure the local voltage and current waveforms. The stability of the microgrid can be compromised if the inverters adjust their output voltages and frequencies in an attempt to restore the microgrid without any feedback from the other inverters in the microgrid while operating autonomously.
The block diagram of the proposed complete microgrid setup together with the secondary control loops implemented in the MGCC are illustrated in Fig. 7. Experimental results with non-linear loads connected to the microgrid were obtained that show the suitability of the proposed hierarchical architecture.

A. Reactive Power Compensation Loop
The block diagram of the reactive power sharing algorithm, implemented in the MGCC, is illustrated in Fig. 7. The inverters transmit the value of their respective reactive power output to the microgrid (Q 1 and Q 2 ) to the MGCC. The MGCC determines the total reactive power supplied by the inverters in the microgrid while considering the different Q−E droop gains of the inverters. This reactive power value is broadcast to all the inverters in the microgrid and each inverter determines the respective reactive power demand (Q * 1 and Q * 2 ) by dividing the received value with its droop gain, so as to achieve p.u. reactive power sharing. Hence, the reactive power demand for each inverter can be calculated by: where Q total is the reactive power supplied by all the inverters in the microgrid, Q * x is the reactive power demand for inverter x, n x is the droop gain of inverter x, and k i=1 1 n i is the summation of the inverted droop gains of the inverters connected to the microgrid. Eqn (18) is a general equation to determine the reactive power demand from the inverters connected to the microgrid and applies for any combination of droop gains, whether the inverters have identical droop gains or not [29], [30]. Thus when the inverters are connected to the microgrid for the first time, each inverter must transmit to the MGCC the value of its droop gain, so as to enable an accurate estimation of the reactive power demand. The reactive power of the inverters is then regulated via a PI controller, one for each inverter, which provides an additional change in the voltage amplitudes of the inverters, ∆E 1 and ∆E 2 respectively. Since the reactive power flow depends mainly on the voltage amplitudes, the additional voltage deviations cause the reactive power outputs to be shared between the inverters. The reactive power sharing compensator for any inverter x, can be expressed by: where k pQS and k iQS are the gains of the reactive power sharing PI controller and ∆E x is the additional voltage deviation that must be added to the droop control output. E x must be limited by the inverter so as not to exceed the maximum amplitude deviations. Simulation results for the reactive power sharing loops were also presented in [29] and [30].

B. Voltage Restoration Loop
The voltage restoration algorithm, was also implemented in the MGCC and cascaded with the reactive power compensation algorithm as shown in Fig. 7. The SS monitors the microgrid PoL voltage and provides the MGCC with the measured rms voltage via a low bandwidth communications link. The MGCC then regulates the microgrid voltage via a PI controller which provides an additional change in the reactive power demand ∆Q rest that is added to the total reactive power calculated by the reactive power compensation loop. The additional ∆Q rest introduces an additional offset in the output voltage of all the inverters, thereby increasing/decreasing the microgrid voltage. The amplitude restoration compensator can be expressed by: (20) where k pE and k iE are the gains of the voltage restoration PI controller, E * M G is the desired microgrid voltage and E M G is the measured microgrid voltage. The simplified block diagram for a single inverter, including the cascaded secondary loops that was used to determine the controller gains for the voltage restoration and reactive power sharing loops is given in Fig.  8.

C. Frequency Restoration Loop
The frequency restoration algorithm was implemented in the MGCC as shown in [7]. The SS monitors the microgrid frequency and provides the MGCC with the measured PCC frequency via a low bandwidth communications link. The MGCC then regulates the microgrid frequency via a PI controller. The frequency restoration compensator can be expressed by: where k pF and k iF are the gains of the frequency restoration PI controller, ω * M G is the desired microgrid frequency and ω M G is the measured microgrid frequency.

D. Secondary Harmonic Compensation
In addition to the capacitive virtual impedance used in the inverter primary control loops, a secondary voltage harmonic compensation loop was implemented so as to attenuate further the voltage harmonics at the PCC. The proposed secondary compensation loop is shown in Fig. 7. The voltage harmonics at the PCC, v pcc , are monitored by the SS and than the magnitude and polarity of the harmonics (|V 3rd |, |V 5th |, |V 7th | and |V 9th |) are extracted by multiple second order generalized integrators (MSOGI's) [31]. These voltage harmonic values are then transmitted to the MGCC, where a P controller for each harmonic was used to determine the voltage harmonic compensation values (|V C3rd |, |V C5th |, |V C7th | and |V C9th |). One should note that if an integral term is added to the P controller, the microgrid becomes unstable. The output of the P controllers was then sent to the microgrid inverters where the harmonic voltage waveforms v h are generated based on the local phase information. This is then applied to the reference voltage obtained from the droop control algorithm and the capacitive virtual impedance loop.

V. EXPERIMENTAL RESULTS
The hardware setup shown in Fig. 9, consists of two 2.2kW FC302 Danfoss Inverters with LCL output filters and a local non-linear load (a single-phase full-bridge rectifier with capacitive smoothing). The nominal parameters for the output filter are given by: L 1 = 3.6mH, R 1 = 0.04Ω, L 2 = 0.9mH, R 2 = 0.01Ω, R = 1Ω and C = 25µF . A dSPACE DS1103 PPC Controller was used to implement the control algorithms. The sampling frequency of the voltage and current measurements and the frequency of the control algorithms and the PWM gate signals is 12kHz.
The inverter inner and outer control loops were implemented in a dSPACE DS1103 controller. Since the frequency ω of the microgrid voltage, varies due to the droop control, the PR controller resonant frequencies were designed to adapt to the varying droop frequency. The PR controller gains that were designed are: K pV = 0.5, K pI = 2, k iV = 0.2ω h , k iI = 0.2ω h , ω cV h = 0.001ω h and ω cIh = 0.001ω h . The bode plot of the inner control loops is shown in Fig. 10. In addition the capacitive virtual impedance loop and the outer droop control loop for islanded operation were also implemented. For the experimental results given in this section, a P − ω droop gain of m = 0.008rad/W.s and a Q − E droop gain of n = 0.01V /V Ar were considered for both inverters. These gains were determined from (3) and (4).
To analyze the effects of the secondary control loops on the microgrid, the compensation algorithms were turned on when the microgrid achieved steady state conditions. The bandwidth of the inner reactive power sharing loop was designed to be faster than that of the outer voltage restoration loop for a more robust implementation. The controller gains that were designed are: k pF = 0.1, k iF = 1.5, k pE = 80, k iE = 100, k pQS = 0.001 and k iQS = 0.016.
The secondary control loops were turned on at t = 3.1s causing the average real power output of each inverter to increase from an average of 212W to 219W as shown in Fig. 11. The real power sharing between the inverters was not affected since the non-linear load shown in Fig. 9 does not exceed the maximum apparent power rating of each inverter. The increase in the real power outputs of the inverters is a   Fig. 11. Real power output of the inverters when supplying the non-linear load in Fig. 9. The secondary control loops were turned ON at t = 3.1s with the microgrid at steady state. direct consequence of the reactive compensation and voltage restoration algorithms. The compensation algorithms cause the output voltages of the inverters to adjust such that the reactive power output is shared between the inverters. This adjustment is possible since the voltage at the load in an islanded microgrid is dependent on the inverter output voltages and thus the voltage magnitude at the PCC increases from the uncompensated case. Hence the power dissipated in the resistor at the output of the rectifier also increases which causes the output power of each inverter to increase.
When the secondary control loops were turned on at t = 3.1s, each inverter supplied a reactive power of approx. -34VAr after a settling time of 3s as shown in Fig. 12. Without compensation, the reactive power was not shared and the inverters supplied 50VAr and -100VAr respectively. Hence, reactive power sharing was achieved with the introduction of the reactive compensation loop and the additional reactive current supplied by each inverter due to the mismatches in the output components was also minimized. The frequency and voltage deviations inherent to the droop algorithm are equal to ∆f = 0.27Hz and ∆E = 4.7V as shown in Fig. 13 and Fig.  14 respectively. The frequency of the microgrid was restored to the nominal value after a settling time of 3s as shown in Fig.  13. Similarly the microgrid voltage was restored to the nominal value after a settling time of 8s as shown in Fig. 14. Hence, the proposed algorithms achieve the requirements of equal reactive power sharing, voltage and frequency restoration according to the design constraints considered, thereby indicating the  Fig. 9. The secondary control loops were turned ON at t = 3.1s with the microgrid at steady state.  Fig. 13. Frequency of the microgrid measured at the PoL when supplying the non-linear load in Fig. 9. The secondary control loops were turned ON at t = 3.1s with the microgrid at steady state. effectiveness of the algorithms.
Additional tests were performed to verify the effect of the primary capacitive harmonic compensation algorithm on the voltage harmonics at the PCC. Simulation results for the operation of the capacitive virtual impedance loop were described by the authors in [28]. A comparison of the voltage harmonics obtained experimentally for the setup shown in Fig.  9 for the parallel inverters supplying the non-linear load is shown in Fig. 15. The voltage THD was reduced from 3.2% to 1.5% thereby indicating the effectiveness of the proposed primary compensation algorithm. The load voltage and current after the introduction of the primary harmonic compensation can be observed in Fig. 17.
When the secondary control loops were enabled, the voltage harmonics were further dampened as shown in Fig. 16 and steady state was achieved in less than 1s. The voltage THD was reduced from 1.5% for the case where only the primary compensation was used to 1% for the case where the secondary loops were enabled, thereby indicating the effectiveness of this algorithm.

VI. CONCLUSION
This paper considered the islanded operation of single phase microgrids and presented solutions to address the reactive power sharing problem and the voltage THD at the PCC due to local non-linear loads. Secondary control loops were proposed to achieve the reactive power sharing while restoring the voltage and frequency deviations due to the droop control. The  Fig. 9. The secondary control loops were turned ON at t = 3.1s with the microgrid at steady state. proposed control loops adjust the reactive power outputs of the inverters and the microgrid voltage through voltage deviations ∆E x that are added to the droop control algorithm. Restoration of the microgrid frequency was carried out by adding a frequency deviation determined by the MGCC to the frequency output of the primary droop controller. Experimental results which demonstrate the dynamic operation of the secondary control loops when turned on at steady state conditions were given. Prior to compensation, the inverters supplied 50VAr and -100VAr respectively while with compensation the reactive power was shared after a 3s and each inverter supplied a reactive power of approx. -34VAr. Hence, with the proposed control loop the additional reactive current supplied by each inverter due to the mismatches in the output components was minimized.
A capacitive virtual impedance loop was proposed so as to dampen the voltage harmonics (3 rd up to the 9 th ) at the PCC. The voltage THD at the PCC was reduced from 3.2% to 1.5% when both inverters were supplying the non-linear load. In addition, a secondary voltage harmonic compensation loop was also proposed to reduce further the voltage harmonics at the PCC. With this additional algorithm, the voltage THD was further reduced to 1%. The results achieved through experiments have shown the suitability of the proposed algorithms in attenuating the voltage harmonics.  Fig. 9. The secondary control loops were turned ON at t = 3.1s with the microgrid at steady state.