Consensus-Based Single-Phase Control of Three-Phase Inverter for Current Sharing in Three-Phase Four-Wire Isolated AC Microgrids

This work proposes a novel secondary control system based on the Consensus algorithm to balance the RMS current between the distributed generation (DG) phases in an isolated four-wire Microgrid (MG) containing unbalanced and non-linear loads. The control strategy proposes using a droop control per phase to regulate the voltage magnitude, whereas the harmonic current sharing is performed using the virtual impedance concept. Additionally, the proposed control scheme guarantees voltage regulation, causing the MG to operate at its nominal voltage value. In addition to sharing the RMS value of the current, the consensus algorithm also provides the equal sharing of the RMS value of the harmonic current between each phase of the DGs that comprise the MG and also ensures that the harmonic distortion of the voltage in the PCC of each DG remains within limits defined by the standards and recommendations. Simulation results demonstrate the functioning and effectiveness of the proposed control strategy.


I. INTRODUCTION
Nonlinear and unbalanced loads are characteristic of any modern power system. Regarding isolated Microgrids (MGs), these loads can cause several problems, such as producing oscillating torque in electric motors [1], [2], increasing losses, and decreasing the lifetime of equipment connected to an MG. The presence of unbalanced loads in isolated MG produces different current amplitude values in the phases of distributed generation (DG) units, which can cause current overloads and can consequently cause the circuit breaker to trip, disconnecting the DG and reducing the power The associate editor coordinating the review of this manuscript and approving it for publication was Zhixiang Zou . dispatch capacity inside the MG. In more severe cases, there could be a cascade shutdown of the other MG distributed generators [3].
On the other hand, non-linear loads produce harmonic currents that interact with the line impedances causing distortions in the voltage waveforms along the MG. These harmonic distortions in voltages and currents produce additional losses in conductors and transformers. As for the transformers, the quantity of loads that drain distorted currents results in the appearance of additional losses, which raise the temperature and consequently compromise the insulation of the transformer.
Among the methods discussed in the literature to implement the distributed approach, the Consensus algorithm has been emphasized due to its flexibility, scalability, plug-andplay operation and communication fault tolerance [24].
Sharing unbalanced currents can be achieved by applying control systems based on sequence components using modified droop control, as demonstrated in [12], [17], and [23]. On the other hand, in islanded MGs, the sharing of unbalanced or harmonic currents between DGs is commonly performed by adjusting the waveform of the voltage generated by each DG using the concept of virtual impedances [4], [9], [10], [11], [13], [14], [15], [16], [18], [20], [21]. For instance, to reduce the current harmonic distortion in a given DG, these harmonics on the voltage waveform should be imposed to reduce the effect of the voltage drop on the line impedances between the DG and the point of common coupling (PCC) of the MG [4], [10], [11], [13], [14], [15], [16], [18], [21], [22]. The same procedure can be used to share unbalanced currents, in other words, making the voltages at the point of coupling of the DGs unbalanced [9]. Similarly, in [21] and [22] the simultaneous sharing of harmonic and unbalanced currents is performed by synthesizing virtual impedances between the DG and the PCC.
In works such as [20], [21], and [22], harmonics and unbalances are shared using the Consensus algorithm by distributing unbalance and harmonic powers between DGs. However, in these works, the angles of sequence current components are not considered in the sharing strategy, which deals only with the magnitude of the negative and zero sequence currents. Therefore, at the end of the regulation process, all DGs supply the same magnitude for the negative and zero sequence currents. However, the magnitude of the total current of a particular phase of a DG is different from the magnitude of the current in this same phase in another DG.
This problem was partially solved in [23] by considering a three-phase three-wire MG (without a neutral conductor). In [23], independent droop controllers are used for each phase of the DGs instead of implementing a three-phase Q-E droop control as [20], [21], and [22]. However, [23] does not address scenarios composed of three-phase four-wire networks with the presence of a neutral conductor, nor does it address the operation of the control system when non-linear loads that generate harmonic currents are connected to the isolated microgrid. In the abc coordinates, the equalization of the current of each phase is addressed in [25], The equalization of the current of each phase in the abc coordinates is addressed in [25], considering a three-phase four-wire MG (with return conductor). However, the reference [25] does not manage the sharing of harmonic currents.
Therefore, the contribution of the present work is the proposition of a new distributed control system based on the Consensus algorithm applied to isolated MGs composed of four-wire DGs. The proposed control system can equitably share unbalanced and harmonic currents between the DG phases. This ensures that the total current of the phases has the same value in all DGs that comprise the MG. Thus, each DG will contribute to efficiently sharing the current equally, according to its rated capacity.
The rest of this paper is organized as follows. Section II presents the proposed strategy for sharing harmonics and equalizing the RMS current. The proposed distributed control strategy is validated in Section III using simulations. Finally, Section VI presents the conclusions reached in this paper.

II. PROPOSED CONTROL STRATEGY
This section discusses the conventional droop control in three-phase inverters (DGs) and the control system based on per-phase droop for balancing the currents in each phase of the DGs and the harmonic current sharing strategy.

A. CONVENTIONAL DROOP CONTROL
The reference voltage of a droop-controlled three-phase voltage source DG is conventionally given by (1) and (2). Where m i and n i are the droop coefficients for voltage and frequency, and ω n and E n are, respectively, the nominal values of frequency and voltage. Hence, the reference frequency is given by ω * i , and the voltage magnitude reference is given by E * i . These two references are the same for the three phases of the three-phase DG. Therefore, the reference voltage is balanced and sinusoidal.
Considering that the DG is conveniently controlled, that is, that the internal voltage and output current control loops are dimensioned coherently, it can be said that, in the steady state, the output voltage of the three-phase converter will follow the voltage reference, so that the voltage magnitude on each phase will be equal to the reference magnitude (E iabc ≈ E * iabc ) and that the output voltage frequency will be equal to the reference frequency (ω i ≈ ω * i ). Thus, for a properly designed three-phase DG, droop control generates balanced voltages at the output of the DG. However, when unbalanced loads are connected to the MG, the current provided by the DGs presents high unbalance levels. In this case, some of the phases of the DG may operate overloaded or cause the activation of its protection system, disconnecting the DG from the MG. Therefore, it is important to equitably share the current required by the loads (linear and non-linear) of the MG between the DG units. Thus, unbalances should be inserted in the voltage generated by the DG to minimize imbalance in the currents.
In [23] it was demonstrated that the control based on the magnitude of the negative sequence components does not guarantee the correct sharing of the currents in the abc coordinate system because it does not consider the angle between the voltages. Therefore, applying a per-phase droop control was proposed to generate unbalanced voltages in each DG phase and ensure the sharing of unbalanced currents between the DG phases.

B. PROPOSED STRATEGY FOR PHASE CURRENT SHARING AND VOLTAGE AND FREQUENCY REGULATION
The present work proposes to change the traditional droop control to generate an independent voltage reference for each phase of the four-wire three-phase DGs. The frequency is the same for all phases of the i-th DG, given by (3). While the magnitude of phase voltages is given by (4).
The voltage reference for the i-th DG is then defined based on (3) and (4) as: In (3), the variable i indicates the adjustment of the frequency reference value, which is performed by the secondary control layer that uses the Consensus algorithm to keep the MG operating frequency close to the nominal value, as follows: where the terms j belong to the set N = {1, . . . , x} with x equal to the number of DGs in the MG. The term a ij represents the weight assigned by the communication matrix between DGs. More information about the communication structure to implement consensus-based distributed control schemes can be found in [23], [24], and [28]. The variables β ia , β ib and β ic in (4) are used to correct the voltage magnitude reference value of each of the phases of each DG, and these values are also adjusted by the secondary control through the Consensus algorithm, as follows: The consensus algorithm implemented by (7) is responsible for equalizing the RMS value of the phase current of the i-th DG (I ia , I ib and I ic ) related to the value of the phase current of the neighboring DGs (I ja , I jb and I jc ). This consensus control looks for a common operating point (a consensus point) for the current of each phase that is shared among all DGs. As the current sharing of each phase implies changing the voltage magnitude of each phase of the DG -by changing β ia , β ib and β ic in (4) -there is an imbalance in the three-phase voltage of the DG. Finally, the constant gain k u i adjusts the dynamic response of the current sharing algorithm (7). In summary, (7) adjusts the magnitude of the reference voltage and, consequently, the output voltage of each DG, which becomes slightly unbalanced to reduce the current unbalance at the output of each DG.
The control of the voltage magnitude average value of each DG (Ē i ), which is calculated according to (8), is performed through the Consensus algorithm given by (9). In this case, the objective of the secondary control is to keep the average magnitude value of the phase voltages of each DG (Ē i ) close to the nominal value of the voltage (E n ) in the steady state. Additionally, the β i values are kept the same for all DGs through the second term on the right side of (9).
where β j refers to the adjustment of the average value of the voltage in the neighboring DGs, while k E i is the constant gain that adjusts the dynamic response.

C. STRATEGY FOR SHARING HARMONIC CURRENTS
Sharing the harmonic currents of a given phase between the DGs that comprise the MG can be performed by the application of the virtual impedance method [21]. This reproduces, in the voltage waveform synthesized by the DG, the harmonics existing in the current waveform that circulates in the output of the DG. When the harmonic virtual impedance adjustment is performed, it modifies the level of harmonics in the voltage and, consequently, the level of harmonics that circulates through a given phase of a given DG. The use of resistive virtual impedance is performed according to (10). Where R h ia , R h ib and R h ic are the value of the virtual resistance of each phase of the DG and v * ia , v * ib and v * ic represent the voltage references obtained from the per phase droop control given in (5). The harmonic currents at the output of each phase of the i-th DG are provided by i iah , i ibh and i ich .
An adaptive band-stop filter (11) is used to extract the harmonics, adjusted to have a bandwidth of B = 0.2 Hz centered on the network frequency ω o = ω * i . The network frequency is taken to be ω * i , obtained based on (3).
The adjustment of the harmonic virtual impedance is performed using the proposed Consensus algorithm (12) to share the harmonic currents between the DGs.
In (12), I iah , I ibh and I ich represent the value of the harmonic current RMS at the output of the i-th DG, while I jah , I jbh and I jch are the RMS values of the harmonic currents at the output of neighboring DGs, located in the same MG. To prevent the total harmonic distortion (THD) from exceeding the limits recommended in standards, such as IEEE Std 1547-2018 [26], a term is introduced in (12) that is weighted by the coefficient α h . This ensures that the voltage distortion measured at the output of the i-th DG (THD Vi ) is not greater than the voltage distortion tolerated by the standard (THD * V ). The term a ij represents the weight assigned by the communication matrix between the converters; Figure 3 shows this. Figure 1 presents the proposed control scheme for sharing unbalanced currents, harmonic currents and voltage regulation for an isolated MG with three-phase four-wire DGs using the abc coordinate system. Control layers 0, 1 and 2 are implemented for each DG (in that figure, the implementation of the proposal considering the i-th DG is illustrated). A communication network is used so the DGs share the local quantities calculated at each network cycle. Unlike centralized controls, this work proposes using a distributed control approach, in which references are calculated and defined locally. Thus, the distributed control by Consensus causes all DGs to converge to a common point of operation. Figure 1 shows that in layer 0, the local quantities are calculated, such as three-phase active power P i , the reactive powers per phase Q ia , Q ib , Q ic and the RMS value of phase currents I ia , I ib and I ic . Also, layer 0 shows the harmonics of the DG output current (i iah , i ibh and i ich ), calculating the RMS value of these currents and performing the local control of voltage and current of the DG.

D. OVERVIEW OF THE PROPOSED CONTROL SYSTEM
The local voltage and current control are based on the harmonic resonant proportional controller with adaptive tuning frequency [27]. Frequency adjustment is performed using (3), getting ω c = ω * i . The transfer function of the voltage controller is given by (13), while the current controller is given by (14). 3,5,7,9,11 k pvh + k rvh s  3,5,7,9,11 k pih + k rih s In layer 1, phase droop control is implemented for Q -E and three-phase droop control for frequency P -ω. The algorithm for sharing unbalanced currents and steady-state voltage regulation (4) is implemented in this control layer. Additionally, sharing of harmonic currents (RMS value) per phase is implemented according to (10).
Layer 2 implements the Consensus algorithm based on local parameter measurements carried out at Layer 0, and remote measures carried out by neighboring DGs. The Consensus algorithm adjusts the current sharing control dynamics through the variables β ia , β ib , β ic and R h ia , R h ib , R h ic , and also adjusts the voltage regulation dynamics through the variable β i . Figure 2 displays an overview of the isolated MG (threephase four-wires) used to validate the proposed control by carrying out the simulations. It shows that a non-linear and unbalanced load is connected to the MG, whose current must be shared between the three DGs. Every DG is controlled according to the schematic proposed in Figure 1. The MG was simulated in the PLECS R software using the parameters described in Table 1 and Figure 3.

III. SIMULATION RESULTS
The consensus algorithm depends on the information exchanged between the DGs of the MG. The interconnection scheme and adjacent communication matrix A are presented in Figure 3. This work assumed a bidirectional and ideal communication link. Due to the slow dynamics of the Consensus algorithm, delays can be disregarded in this study without impairing the functioning of the proposed control scheme.
Several situations were configured to occur at specific time intervals to verify the effectiveness of the proposed control strategy, as described below: • Stage 1: Secondary control only regulating frequency. • Stage 2: Voltage reference step (from 110 V to 120 V) and enabling the secondary control to    Figure 4 shows the average of the RMS voltage of the phases of each three-phase DG, given byĒ i , as well as the active power and frequency of each DG.  The secondary control is activated at the beginning of stage 2 (t ≥ 10 s), providing only the voltage regulation of the DGs; that is, the secondary control executes the Consensus algorithm presented in (10). Thus, β i acts in (3), causing it to reach the nominal voltage (120V). It is noteworthy that, at this simulation time, a new voltage reference was assumed to demonstrate the performance of the voltage regulation control. Figure 4 shows the dynamic behavior of the voltage.  During stage 3 (t ≥ 20 s), the phase current sharing is enabled by activating the secondary control given by (7) to adjust the coefficients β ia , β ib , and β ic based on the Consensus algorithm of layer 2 of Figure 1. Figure 5 illustrates the behavior of the phase currents of each DG. Note that the phase currents are now shared between the respective phases of the MG DGs, thus achieving a common value for each phase.
The behavior of the collective current (I i = I 2 ia + I 2 ib + I 2 ic ) of each DG is shown in Figure 6, which indicates that each DG injects exactly the same three-phase current in the MG. The average of the RMS values of the voltage of the DGs is slightly altered during the sharing of unbalanced currents, as seen in Figure 4 since the voltages per phase in the DGs are changed independently, as each DG is connected to the MG through of a different line impedance, which causes the voltage to be generated in phase a of DG 1 not the same as the voltage that will be generated in phase a of DG 2 and DG 3.
In stage 4 (t ≥ 30 s) the sharing of harmonic current between the phases of the DGs is activated, causing each phase of the DGs to process the same RMS harmonic current value as shown in Figure 7. The adjustment of the harmonic impedance of each phase of the DG R h ia , R h ib , R h ic is performed according to (13), thereby generating the voltage reference (11) for harmonic injection in the output voltage of each DG.
In the fifth stage of the simulation (t ≥ 40 s), at t = 40 s, a load step is applied to phase c of the system to validate the current sharing control responses. There is an increase in the active power generated by the DGs and an increase in the RMS value of the phase current. However, as seen in Figure 5 and Figure 7, both phase currents and harmonic currents remain at the same values.
It is noteworthy that the current sharing does not change the active power in the three DGs. At t = 10 s, there is an increase in active power in all DGs because there was a change in the reference voltage from 110 V to 120 V. At t = 40 s, there is a change in the load, according to the circuit shown in Figure 2, with the closing of the key represented by ''S w1 ''.   Figure 8 shows the dynamic behavior of the secondary control system based on the Consensus algorithm, with the values of the coefficients β ia , β ib , β ic and β i . At t > 10 s the reference voltage is reset to 120 V, increasing the β i value. At t > 20 s, the sharing of current per phase of the DGs starts, causing the coefficients β ia , β ib and β ic to be readjusted. This action slightly changes the coefficient β i of each DG. However, the consensus is reached and, as seen in Figure 5, the phase currents of each DG are equalized. Figure 9 shows the reactive power of each inverter. It is observed that the deviation in the voltage of each inverter due to the equalization of the currents performed through the Consensus Algorithm (β ia , β ib and β ic ) leads to changes in the value of reactive power. Figure 10 shows the individual voltage distortion factor for each phase of each of the DGs (THD V ). It shows that the THD V exceeds the limit established in this case analysis (THD V must be less than 4%) as soon as harmonic current sharing is enabled at t > 30 s. This increase in THD V is due to the insertion of harmonics in the phase voltage of the DGs so as to reduce current distortion, that is, to reduce the harmonic content of the current.
In stage 6 (t > 50 s), the limitation of the THD V produced by each phase of the DGs is enabled by activating the first term on the right side of (13). The analysis of Figure 9 shows that as soon as the THD V limitation is activated, the voltage harmonic distortion is reduced to values smaller than 4%. However, the harmonic current distortion increases, evidenced in the RMS value of the harmonic current shown in Figure 7, and an increase in the mismatch of harmonic current is noted. This cost-benefit ratio is inherent to controls that use virtual impedance. Figure 9 shows that the voltage distortion of phase a is more pronounced than the voltage distortion of the other phases. However, the activation of the THD V limitation is reflected in the other phases, causing the distortion to decrease even in DGs where the voltage distortion was already within the established limit. Notwithstanding this coupling between the phases, the consensus algorithm achieves the goal of reducing voltage distortion.

IV. CONCLUSION
This article proposed a new distributed control strategy based on the Consensus algorithm for sharing harmonic and unbalanced currents between three-phase 4-wire DGs connected to isolated MGs. The literature review carried out in the introduction section showed that, thus far, strategies capable of sharing the phase current between the phases of 4-wire three-phase DGs had not been discussed, especially when the isolated MG current is unbalanced and distorted.
The results showed that the proposed approach was able to share the RMS current values between the DGs with zero error, either for the harmonic currents or for the total current of each phase, even in situations where the connection impedances between the DGs and the MG PCC show different values. This is also the case in situations where the MG current is unbalanced and distorted.
Moreover, it was demonstrated that standards and recommendations regarding harmonic voltage distortion can be met by using the limits established in the secondary control based on the Consensus algorithm.