A Communication-less Distributed Control Architecture for Islanded Microgrids with Renewable Generation and Storage

—For reliable operation of an islanded microgrid, at least one of its distributed resources should assume the responsibility of forming the off-grid power system. This responsibility is usually assumed by energy storage systems based on their capability of compensating the unbalance between generation and consumption. However, the storage units lose this capability when they reach the maximum and minimum limits of charge. Under these conditions, the regulation of the power grid may be assumed by another unit with enough capability or the power balance should be adjusted coordinately. This paper proposes a coordination architecture for islanded ac microgrids, which considers the appropriate charge proﬁles for battery-based energy storage systems. The architecture is based on distributed decision-making mechanisms, which use only local measurements for determining the operation mode of each unit independently. The coordination relies on a bus-signalling method, which enables the distributed units to have a global perception about the operation of the microgrid, without any communication infrastructure. The proposed architecture includes cooperative operation between distributed energy storage systems for achieving the equalization of the states of charge. Experimental results in a lab-scale microgrid with network conﬁguration validate the proposed strategy under different operational conditions.


I. INTRODUCTION
T HE use of variable renewable energy sources (RESs), such as photovoltaic (PV) and wind-turbine (WT) generators, has facilitated the electrification of remote sites such as telecommunication stations or small villages, thanks to the availability and low environmental impact provided by the primary energy resource [1]- [4].However, The unpredictable nature of the RESs requires the use of complementary energy storage systems (ESSs) for smoothing their variations and provide enough energy back-up in the off-grid system.Here, the microgrid concept appears for defining a controllable and coordinate integration of different kinds of distributed energy resources (DERs) within a small-scale power system.
In particular, islanded microgrids imply additional challenges compared to grid-connected systems, since the voltage and frequency are not imposed by the utility grid.Therefore, the responsibility for forming the local power-grid should be assumed internally by at least one of the DERs [5].
Commonly, the ESSs assume this responsibility based on their inherent capability of absorbing/delivering energy for keeping the power balance in the islanded grid.Meanwhile, variable RESs are operated following algorithms of maximum power point tracking (MPPT) in order to make a more efficient use of the primary energy resource.Nevertheless, the storage devices have limited capacity and any charge or discharge beyond specified limits may result in their fast degradation or damage.Under extreme conditions of charge, the ESSs may not be able to continue ensuring the power balance and forming the local power-grid, as is the case of battery-based ESS, which requires specific charging stages for prolonging their lifespan.
In islanded microgrids, battery-based ESSs, and particularly lead-acid batteries are still the most used, since they offer a good commitment between deep-cycle life, transportability, availability, and cost [1], [2], [6], [7].To prevent fast degradation of batteries, due to overcharge or deep discharge, a multi-stage charge profile is recommended by manufacturers in accordance with specific voltage limits.Normally, a second stage of charge is required in which the battery current is regulated for keeping the battery voltage in a constant value [7].In that case, the ESSs will have to give up their role of forming the common bus in the islanded microgrid due to a change their operation mode [8].Nevertheless, the regulation of the local grid may be assumed by another DER with enough capacity.Also, under deep-discharge conditions, the ratio between generation and consumption should be adjusted for avoiding further discharge.The aforementioned actions require a proper coordination between DERs and loads in order to keep the storage systems within safe operation limits and ensuring a reliable operation of the islanded microgrid.
The simplest way of enabling a reliable interaction between RESs and ESSs and ensuring safe operation of the storage devices is by keeping them within a partial state of charge (PSoC) as proposed in [9].In this way, the ESS may keep the grid-forming operation continuously, since its maximum limits of charge and discharge are never reached.However, due to the unpredictable operation of RESs, the microgrid will require oversized storage devices.Centralized strategies can ensure the operation of the ESSs within safe ranges by means of a continuous communication with all the DERs.The central controller is able to dispatch the generation profiles of the DERs based on optimized functions, which penalizes the charge or discharge of the ESS beyond certain limits as in [10], [11], or by making that the ESS compensates only transitory mismatches between generation and consumption.
To do that, the generation from RES is adjusted until the power contribution from the ESS is restored to zero as in [12].This fact results in an inefficient use of the primary energy resource and requires the integration of additional dispatchable sources.On top of that, the main drawbacks of centralized approaches are the dependence of the central control unit, which becomes a single point of failure in the coordination, and the use of dedicated communication channels, which are not always available for microgrids based on dispersed generators [13].
For distributed strategies, the interaction between units is commonly determined by the variation of the line frequency or voltage [14].Normally, ac microgrids use the frequency instead of voltage, since the voltage is typically less accurate for signalling due to line impedances and reactive power flows.Meanwhile, dc microgrids rely mainly on voltage signalling.In [15], [16] ac microgrids based on a single PV generator and a battery-based ESS use multi-segments adaptive power/frequency (P/f ) curves for enabling a seamless transition of the DERs between voltage control mode (VCM) and power control mode (PCM).The transitions are performed based on specific ratios between generation and consumption, instead of proper stages for charging the ESS based on batteries.Particularly in [15], the strategy requires additional droop controlled units for enabling the adaptive P/f behaviour.In [14] and [17], islanded microgrids based on a single (ESS + PV) configuration use a frequency bus-signalling strategy for avoiding that the storage system is charged or discharged beyond specific limits.Once the ESS reaches the limit of charge, a frequency pattern is generated by the ESS (operating as the grid-forming unit), which is recognized by the PV generator (operating in PCM) in order to adjust the generated power until it matches the power consumption such as in [17], or for turning off the PV generator such as in [14].Four drawbacks can be highlighted in the approaches proposed in [14], [17]: (i) a slow inertia is required for adjusting the generation in the RES unit, which may cause than the charge go beyond specified limits.(ii) a full charge of the battery is not ensured since the battery current is set to zero when the threshold SoC value is reached.This fact may cause fast degradation of Lead-acid batteries [7].(iii) the Lead-acid batteries are voltage limiting devices and their maximum limits should be defined by voltage levels instead of SoC values.The SoC value is commonly obtained from estimation methods which may be not accurate enough for ensuring safe operating limits [18].(iv) the strategies have been considered for a single ESS.However, when the number of distributed ESSs increases, the definition of voltage and frequency patterns becomes difficult unless uniform charge profiles are ensured for all the distributed ESSs, or dedicated communication channels are used for enabling a perfect synchronization between units [14].The last one is not a minor issue by considering that the current trend, is oriented to the use of distributed ESSs instead of a single ESS.In this way, each ESS can be optimized for the integration of new RESs [19], [20].
A coordination architecture for an islanded ac microgrids with distributed ESSs has been proposed in [21], which is based on seamless transitions between VCM and PCM in the DERs in accordance with particular operating conditions and a frequency bus-signalling method.This approach allows a faster transition between VCM to PCM for the ESSs, reducing the inertia that may cause overcharge in the storage devices.However, this architecture does not consider the different stages for charging batteries, actions for avoiding deep discharge of batteries, cooperative operation between ESSs, and does not present experimental results.Some coordination approaches for islanded dc microgrids have been considered recently in which the appropriate stages and transitions for charging distributed ESSs based on batteries are ensured, by means of centralized strategies as in [22], distributed strategies as in [23], and even by using power-line communication as in [24].Nevertheless, coordination strategies with appropriate charging stages for distributed ESSs based on batteries are seldom explored for ac microgrids.
This paper proposes a fully distributed control architecture for coordinating the operation of variable RESs and distributed ESSs within an islanded ac microgrid.The DERs are selfcontrolled and coordinated by their own decision-maker (DM) units, who determines independently the operation mode and the way of interaction of each DER, relying only on local measurements and information.The DM units contain the set of rules and actions to be performed by each DER in accordance to their own particular conditions and global operating conditions of the whole microgrid.The rules which determine the interaction of the DERs are defined by a knowledge-based inference system deployed as finite state machines in the DM units.Therefore, the operating modes of each DER and the whole microgrid are limited within a finite number of operation modes, which look for ensuring the appropriate charging profiles for ESSs based on Lead-acid batteries, without losing the control over the regulation of the islanded microgrid.In order to eliminate the dependence on communication channels, the common bus by itself is used as the communication medium.In the proposed strategy, both voltage and frequency signals are considered for establishing a bus-signalling method, which contains the information required by the DM units for coordinating the operation of the DERs.The bus signals are generated independently by the units on the grid-forming control and this control can be alternated between different kinds of units.This fact allows a modular and expandable operation of the islanded microgrid.Apart from that, the proposed strategy includes cooperative operation between DERs based on adaptive power sharing functions for: (i) equalizing the SoC between distributed ESSs, which allows the distributed ESSs to have uniform charge profiles, allowing the definition of unified patterns of voltages or frequency within the signalling strategy.(ii) achieving an active power curtailment in the generation distributed RESs proportional to their own maximum capability, which enables an efficient use of the primary energy resource.
Section II defines the islanded microgrid and the main objectives of the proposed coordination architecture.Section III explains the different operational modes defined for a reliable operation of the islanded microgrid under different conditions.Section IV defines the different elements that configure the coordination architecture.Section V introduces cooperative behaviours for parallel connected grid-forming units.Section
VI presents the main parameters and characteristics of the low-voltage ac microgrid, in network configuration, which is used as a case study.Also, stability issues under different topological operation modes are considered in this section.
Section VII shows experimental results and finally, section VIII presents conclusions.

II. ISLANDED MICROGRID AND COORDINATION GOALS A. Microgrid Structure
The network configuration of the islanded microgrid considered for this case study is shown in Fig. 1, in which the DERs and balanced loads are parallel connected in a common point of coupling.The microgrid is composed by two variable RESs (PV and WT), two distributed ESSs based on banks of valve regulated Lead-acid (VRLA) batteries, and a single load which represents an aggregation of distributed loads connected to the common bus through load switches.Nevertheless, the analysis can be scaled and expanded to microgrids with more DERs and loads.This is one of the inherent advantages of the proposed distributed architecture since it is highly modular and expandable.The DERs are interfaced with the ac grid by means of power electronic converters with LC filters (L 1 and C) and connected to the common bus through an output inductor (L 2 ) for emulating an inductive line impedance.Apart from that, each DER has its own primary controller, which enables autonomous operation of each unit based on specific operation modes [25].Additionally, the load control and metering unit shown in Fig. 1 is responsible for generating the control signal (S Load ) for connecting or disconnecting the load based only on local measurements.

B. Coordination Goals
First, it is important to define the common goals of the microgrid, which will be the base of the coordination architecture.In this case, two main goals are defined: 1) The operation of the islanded power grid should be reliable and stable under different ratios of generation and consumption.
2) The appropriate stages for charging ESSs based on batteries should be ensured.Based on the common objectives, it is possible to define the set of basic rules which will determine the interaction between the different DERs and loads in the islanded microgrid: 1) At least one DER has to assume the grid-forming control in order to ensure the regulation of the common bus and keep the power balance in the islanded power system.2) The grid-forming control should be alternated between ESSs and RESs based on their capacity and particular operating conditions as well as the operating conditions of the whole microgrid.
3) The RESs are more likely to operate following MPPT strategies in order to obtain from them the maximum amount of available energy.Because of that, they will only assume the grid-forming control when the ESSs are not able to continue storing energy.

C. Charging Profile of the Batteries
Lead-acid batteries are voltage limiting devices which cannot be charged or discharged beyond certain limits (typically defined by voltage values) under risk of degrading the performance or damaging the batteries.The values of the voltage thresholds are commonly defined by the manufacturers [7].Additionally.Lead-acid batteries require full charge stages between cycles of discharge for avoiding sulfation of the plates, which is detrimental to the performance and capacity of the storage device [7], [26], [27].Even if stages of full charge are not considered within discharge cycles, a periodic full charge should be scheduled as part of a proper maintenance of the batteries [9].
The best way of avoiding overcharge and at the same time ensuring a full charge of the batteries is by means of a twostage charging procedure as shown in Fig. 2. The first stage (0 to Time 1 in Fig. 2) provides the bulk of the charge, while a second stage (Time 1 to Time 2 in Fig. 2) provides enough saturation to the battery charge by means of a topping charge procedure, in which the battery voltage (V bat ) is kept in a constant value.In this stage, the battery bank draws as much current as needed to keep regulated the battery voltage, which requires an appropriate current control [26].Since the process of charging a battery is inefficient, it is necessary to return to the battery more than 100% of the energy, this excess of charge is provided during the saturation stage and typical values of overcharge may range from 5% to 30% [7], [27].The regulation value (V r ), which defines the limit for the second stage of charge, is selected in accordance with the guidance from manufacturers, typically around 2.45±0.05volts/cell [7].
Similarly, the battery manufacturers recommend a threshold voltage value in which continuing with the discharge of the batteries will lead to a detriment in the performance of the Fig. 3: Topological operation of the microgrid when all the DERs operate in CCM.battery [7].This value is known as the end-of-discharge (EOD) voltage.When the battery voltage reaches this limit, the load should be disconnected for avoiding further discharge of the ESSs as is shown in Fig. 2 at Time 3.

III. OPERATIONAL MODES OF THE MICROGRID
At the unit level, two basic operation modes can be assigned to the DERs in accordance to their primary control objective: (i) the voltage control mode (VCM) or grid-forming control, which will be assumed by the units responsible for forming, regulating and ensuring the power balance in the islanded power system.(ii) the current control mode (CCM) or gridfollowing control, which will be assumed by the units responsible for supplying or absorbing a specific amount of power [25], [28].Different combinations of operation modes at the unit level represent different topological operating modes for the microgrid.In the proposed microgrid based on four DERs, all of them with two possible operation modes, 16 possible topological combinations (2 4 ) can take place.By taking into account the objective 1) and the rule 1) the combination in which all the units operate in CCM, as shown in Fig. 3, is not suitable since there is not any DER operating as grid-forming.In Fig. 3 the grid-following units operating in CCM are represented by an admittance in parallel with a constant current source.The grid-following units can be either power sources (PS) (supplying power) or power loads (PL) (absorbing power), which are differentiated by the sign of the current and the real part of the parallel admittance [29].
In accordance with rules 2) and 3), the grid-forming control should be alternated between ESSs and RESs, and the RESs will only assume the grid-forming control when batteries are not able to continue with the regulation.Because of that, topological combinations in which ESSs and RESs share the regulation of the power grid are not considered within the operation of the microgrid.This fact bounds the operation of the islanded system within six different combinations, which can be analyzed in four topological circuit modes (TCM) as shown in Fig. 4, where the grid-forming units are represented by a voltage source in series with an output admittance.
Figs. 4a and 4c show that some units can share the responsibility for the common bus regulation.In these cases, conventional (P − ω) and (Q − E) droop controllers can be used for achieving good power sharing between gridforming units, without additional communication [30].To prevent coupling between active (P) and reactive (Q) power with respect to frequency (ω) and voltage amplitude (E) in resistive low-voltage microgrids, virtual inductances are commonly used [14], [21], [30].Also, inductive lines can be added for interfacing the conversion stage and achieving the desired P-Q decoupling.In this case, the inductors L 2 (see Fig. 4: Topological circuit modes for islanded microgrid.Fig. 1) have been added for enabling the inductive line.The droop control loops adjust the frequency and voltage amplitude generated by the grid-forming units in order to achieve the appropriate active and reactive power sharing in accordance with the following equations: where, (E) is the output voltage amplitude of the i-th inverter, P uniti and Q uniti are the active and reactive power flow, E * is the voltage amplitude reference, ω is the angular frequency of the output voltage, ω * is the reference of the angular frequency, and K p and K q are the droop coefficients.

A. Topological Circuit Mode 1 (TCM1)
At this mode (Fig. 4a), all the distributed ESSs are gridforming units, they are charged or discharged based on the unbalance between generation and consumption.The power is shared between ESSs by means of droop control loops.Meanwhile, RESs supply their maximum available power in accordance with the power reference imposed by their MPPT algorithm.TCM1 also represents the operation of the microgrid under load shedding, in this case, the load admittance will be equal to zero Y LOAD = 0.

B. Topological Circuit Mode 2 (TCM2)
This TCM considers the case in which one of the ESS has changed its operation mode (VCM to CCM) since the battery bank has reached the regulation value (V r ) and changes its operation to a topping charge stage.Under this stage, the behaviour of the ESS can be approximated by a power load (PL) as shown in Fig. 4b.Meanwhile, the other ESS is able to continue with the grid-forming control, since it still has the capacity to be charged.

C. Topological Circuit Mode 3 (TCM3)
In this case, all ESSs are under constant voltage charge (grid-following control).Then, RESs must assume the gridforming control as can be seen in Fig. 4c, providing that they have enough energy available to ensure the power balance of the power grid.In this case, droop control loops can also be used in order to share the power between RESs.Nevertheless, it is expected that the power participation of each RES will be proportional to its maximum power.

D. Topological Circuit Mode 4 (TCM4)
This TCM considers the case when the maximum available power from one of the RES falls below the power initially shared.Therefore, that RES returns to grid-following control.Meanwhile, the others RESs may still have enough capability to continue with the grid-forming control as can be seen in Fig. 4d.The distributed RESs will continue moving from the VCM to CCM until the last one is not able to continue balancing the power in the islanded system.At this point, the microgrid should return to TCM1 and the batteries re-assume the regulation of the islanded power grid.

IV. DISTRIBUTED CONTROL ARCHITECTURE
Once the TCMs of the microgrid have been specified for the different operating conditions, the next step is to define the events and conditions that will trigger the transitions between control modes at each DER.The coordination strategy should make decisions based on changing circumstances, and determine actions for adapting the operation of the distributed resources, complying with the common goals and rules.Since the proposed approach is completely distributed, the common bus voltage and local operating conditions at each DER are the only information available at each unit for determining the coordination actions.In general, to fulfil the objective 2) the transitions between control modes will be mainly determined by the proper charging stages of ESSs based on batteries.
A. Events for triggering transitions between control modes at each DER 1) Event 1 (Ev 1 ): Represents the transition from VCM to CCM in ESSs, which is triggered once the battery arrays Fig. 5: The effect in the power generation from RESs when a RES initially working in VCM reduces its maximum power below the current shared power (P M P P T i < P Resi ), (Ev 2 ).reach the regulation value (V bat = V r ) as can be seen in Fig. 2 at Time 1.By considering differences in the SoCs between distributed ESSs, it is possible that one of the ESS continues in VCM while the other ESSs moves to grid-following operation as happening in Fig. 4b (TCM2).When the last ESS reaches the regulation value and changes its operation to CCM, the RESs should assume the grid-forming control.Consequently, the microgrid should change its topological operation to TCM3 in order to ensure a reliable operation.
2) Event 2 (Ev 2 ): Represents the transition of the RESs from VCM to CCM, which is determined by the maximum available power at each unit.Since it is not possible to ensure that the distributed RESs keep the same maximum power during all the time, there may be the case in which the maximum power in a RES (P M P P T i ) drops below the current shared power (P Resi ), this is (P M P P T i < P Resi ).This behaviour is illustrated in Fig. 5 for a PV generator, where a PV unit initially working off-MPPT (point A) reduces its maximum available power due to a decrease in the solar irradiance (point B).Then, the RES unit has to change its control to a grid-following mode and supplies its maximum available power.Nevertheless, the other RESs may have enough energy available to continue with the regulation of the common bus and the microgrid can operate in TCM4.
When the available power of the last RES in VCM is not enough to keep the power balance, it will return to CCM, since (P M P P T i < P Resi ).Consequently, the ESSs (who are fully charged), may re-assume the grid-forming control.
3) Event 3 (Ev 3 ): Activates the transition from CCM to VCM for all the DERs.Since the grid-forming control will be alternated between ESSs and RESs, this event occurs when the units that had been playing the role of forming the local grid (either ESSs or RESs) lose their capability of continuing with their forming role.This fact may be due to the change in the charging stage (Ev 1 ) in all the ESSs or because the generation from RESs is not enough to ensure the power balance (Ev 2 ).In both cases, the units that had been playing the grid-forming role change autonomously their operation from VCM to CCM as was explained in events Ev 1 and Ev 2 .Therefore, for a short period, all the DERs will be in CCM and the microgrid will operate under the transitory topological circuit mode shown in Fig. 3, where there are not units responsible for forming the local grid.As a consequence, the frequency in the islanded power system (f ACbus ) will fluctuate, since the generation does not match the consumption.In this sense, the frequency value can be used for signalling the transitions between CCM to VCM in the DERs.This kind of signalling strategy has been commonly used as a passive islanding detection method for triggering the transition of a microgrid between grid-connected to islanded operation [31], [32].
Since normal frequency fluctuations may appear when the load is added or removed, or when there is a change in the power injection of a DER, a Non-Detection Zone (NDZ) is defined [33].The threshold limits of the NDZ cannot be set too small for avoiding transitions under normal frequency fluctuations but they should comply with international standards.The European Standard EN 50160 defines a frequency range of ±2% for an islanded system under normal operating conditions and allows a frequency range of ±15% under transitory conditions [34].Because of that, the NDZ has been defined between a range of ±3% (48.5 to 51.1), in this way the normal fluctuations will not trigger any transition, and only transitory fluctuations beyond the NDZ will be considered for triggering the transitions.Nevertheless, the frequency fluctuations are kept within proper ranges.
When the frequency exceeds the threshold of the NDZ (f t = 50 ± 3%), the event Ev 3 is configured and a transition signal should be activated in the corresponding DERs (ESSs change to VCM when the RESs were the former grid-forming units or RESs change to VCM when the ESSs were the former grid-forming units).The Fig. 6 illustrate the expected frequency response when the proper transition is activated at Ev 3 after the microgrid changes to the transitory topological circuit mode of Fig. 3 at t 1 .
The frequency is measured at each DER by means of synchronous reference frame Phase-Locked Loop (PLL) units, which have a very fast dynamic response and low overshoot under balanced grid conditions as the considered for this case study [28], [35], [36].Nevertheless, the measured value of the frequency experiences a smooth transition when the grid frequency undergoes variations as is shown in [35].This fact is particularly convenient for facilitating the detection of the threshold frequency at each DERs.
However, the event Ev 3 by itself does not provide enough information to the DERs about which kind of units should assume the grid-forming control, since during the transitory operation of Fig. 3, every DER will be in CMM.If only the Ev 3 is considered for triggering the transition between CCM to VCM, all the DERs will change simultaneously to VCM, which is against the rules 2) and 3).At this point, the challenge

RESs as grid-forming
Capacitive Inductive is to make that the right units assume the grid-forming control.
Since the frequency is already used one possibility is to use the voltage amplitude for creating a voltage signature that allows the DERs to recognize which kind of units (ESSs or RESs) were the former grid-forming units.

B. Conditions for transitions based on voltage bus-signalling
In order to define a voltage signature for signalling purposes, when ESSs are the grid-forming units the voltage at the common bus will be set above the nominal voltage (E nom ).This fact is called condition (Co 1 ).On the other hand, when RESs are the grid-forming units the voltage amplitude at the common bus will be set below the nominal value (E nom ) (condition Co 1 ).To achieve that, the conventional (Q − E) droop control loops in (2) can be modified as: where, (Q ESSi ) and (Q RESi ) represent the reactive power at each ESS and RES respectively, (sgn(Q ESSi )) and (sgn(Q RESi )) are sign functions for obtaining the nature of the reactive power (1 for inductive Q and -1 for capacitive Q).E adj is an adjustment value added to the droop control loop for compensating the effect of the reactive current through the output inductor (L 2 ) on the voltage amplitude, at the point of common coupling (V P CC ).For instance, when the ESSs have the grid-forming control the voltage amplitude in the common coupling point (V P CC ) may become smaller than (E nom ) if the microgrid load is highly inductive.On the contrary, when the RESs have the grid-forming control the voltage at the common bus (V P CC ) may become bigger than (E nom ) if the microgrid load is highly capacitive.The value of E adj can be estimated by considering the maximum reactive power (Q max ) and the voltage through the output inductor (L 2 ).The Fig. 7 illustrates the operation of the modified (Q − E) droop control loop, which has been proposed for creating the voltage signature within the bus-signalling strategy.

C. Load Shedding based on voltage bus-signalling
When the generation from RESs is not enough to supply the load demand, the ESSs will be discharged for compensating the power unbalance while the microgrid operates in TCM1.Nevertheless, the ESSs cannot supply an unlimited amount of energy.As mentioned before, the battery manufacturers define a threshold voltage value (EOD in Fig. 2), for limiting the depth of discharge of the batteries.After the EOD value, the load should be disconnected from avoiding deep discharge [7].
To comply with the fully distributed approach, the control and measurement unit of the load should determine the connection/disconnection of the load relying only on local information.Because of that, the common bus should broadcast the information that the ESSs have reached the EOD value.Either voltage or frequency patterns could be used for triggering the load disconnection.However, reducing or increasing the frequency is not an option since frequency thresholds near the NDZ were already defined for alternating the grid-forming control between DERs.Because of that, a voltage pattern for the common bus has been proposed as shown in Fig. 8, this pattern is generated by the ESSs under grid-forming control.
Once the battery voltage reaches the EOD value in the ESSs, a new event (Ev 4 ) is configured.At this time, the reference value E * in the primary controller of the ESS, will be reduced to a 15% of its nominal value (E nom ).The variation in the voltage reference will follow a linear behaviour with a negative rate of −15%/15s in order to get a smooth transition as shown in Fig. 8.Meanwhile, the local load control will recognize the variation in the voltage amplitude and will disconnect the load when the amplitude of the common bus voltage has dropped to a 10% of its nominal value.At this time the event (Ev 5 ) is configured and the load is disconnected.
On the other hand, the load can be reconnected when the voltage amplitude at the common point has been restored to a 90% of the nominal value E nom ( Ēv 5 ).The voltage reference will be restored to its nominal value when the SoCs of the ESSs become larger than 50%.This fact configures the event ((Ev 6 )) and the value of 50% is selected in order to provide a good operating margin to the ESSs for compensating any unbalance between generation and consumption.Similarly, for the voltage restoration process, a smooth transition in the voltage pattern is achieved by means of a positive rate of 15%/15s.Fig. 8 summarizes the behaviour of the proposed adaptive voltage pattern for load shedding and connection.In that figure, it is possible to realize that the disconnection of the loads is triggered by the voltage level as is recommend by the manufacturers, while the connection of the load rely on an estimated value of the SoC.
It is important to take into account, that the proposed strategy may have an important impact on the reactive power flow in the microgrid.this in the case that the ESSs do not reach the EOD value simultaneously, since the voltage reference E * will be different at the each ESS.This fact may cause an increase in the reactive power managed by the ESS that reaches first the EOD value, which can rapidly exceed  the rated capacity of the inverter.This issue can be solved by equalizing the discharge profiles of the distributed ESSs, which makes that the EOD value is reached almost at the same time in all of them.In this way, the proposed voltage pattern is uniformly generated by the distributed ESSs and an egalitarian reactive power sharing is kept.This particular behaviour will become clear later when the experimental results are shown.

D. Distributed decision-makers
As exposed before, a reliable operation of the islanded power system can be ensured within a limited number of wellknown topological operation modes.The islanded microgrid can continue operating in a specific topological circuit mode until some event causes a change in the control mode of a particular DER, which is reflected in a change in the TCM of the whole microgrid.In this sense, deterministic finite state machines (FSM) can contain all the information about the different events, transitions, and corresponding operation modes which should assume each DER in accordance to changing circumstances.
In order to comply with the distributed nature of the proposed coordination approach, independent decision-making (DM) units based on FSM will be deployed at each DER.Since the events and conditions for triggering the transitions between operation modes differ for ESSs, RESs, and loads, the FSM at each DM should be designed to fit with the nature of the corresponding unit.Table I summarizes the events (Ev i ) and conditions (Co i ), which are the input of the FSMs.
The decision-maker for ESSs is a hierarchical FSM with two states at the higher level for defining the control mode of the ESSs (grid-forming or grid-following), and two states in a lower level inside the grid-forming state (load connected (LC) and load shedding (LS)).The decision-maker has two outputs (S 1 ) and (S 2 ) which are the signal for enabling the transitions between the control modes of the ESSs and for defining the voltage reference respectively.Fig. 9a illustrates the state diagram for ESSs and Table II shows the corresponding transition tables for ESSs.
In the case of RESs, a FSM with two states and one output is enough for enabling the two control operation modes (gridforming (S 1 = 0) or grid-following (S 1 = 1)).The Fig. 9b Operation Mode Decision-Maker  shows the state diagram for RESs and the Table III shows its corresponding transition table.Similarly, Fig. 9c and Table IV show the state diagram and the transition table for the load control, which has two possible states defined by one output (load-on (S Load = 1) and load-off (S Load = 0)).

UNITS
Within the proposed distributed architecture, it is possible to define cooperative behaviours between parallel connected grid-forming units.For instance, ESSs can adjust their power participation in order to balance the stored energy (SoC equalization) and ensure similar charging profiles for the distributed ESSs.Similarly, RESs can adjust their shared power proportionally to their maximum available power.

A. Stored Energy Balance Between ESSs
The SoC equalization consists on equalizing the charging profiles for the distributed ESSs.This procedure brings additional advantages to the overall performance of the whole microgrid such as: i) reducing the uneven degradation of the distributed banks of batteries, ii) speeds-up the charge of all the distributed ESSs, and iii) allows a smooth transition between operation modes for distributed ESSs, since the different charging stages are achieved almost simultaneously for the distributed ESSs [37].
Commonly, for performing the SoC equalization the conventional (P − ω) droop control loops defined by ( 1) are complemented with adaptive strategies that modify or weight  the droop coefficient ( K p in (1)) in accordance to the differences in the SoC values.In this way, the proportion of power shared by each ESS is modified and consequently, the rates of charge and discharge can be adjusted for ensuring the equalization.In this sense, different strategies based on communication networks have been proposed for dc and ac microgrids such as in [38]- [41], which adjusting the value of the droop coefficients based on global information.Also, distributed SoC equalization approaches without any communication, applied mainly to dc microgrids, have been proposed in [13], [42], which weight the droop coefficient in accordance to adaptive charge and discharge curves obtained from exponential functions of the SoC.In general, those kind of adaptive curves are complex to tune and difficult to adapt for ac microgrids due mainly to stability constraints and that independent functions are required for the charging and discharging process [13], [29].
The basic idea behind the adaptive curves, is to obtain a SoC-dependent weighting function (W (SoC Bati )) for weighting the droop coefficient K p at each ESSs.Then, equation ( 1) can be re-written as: During the SoC equalization, it is expected that the ESS with the lowest SoC is charged faster.This can be achieved by setting a smaller value in the product (W (SoC Bati ) • K p ), which in turn increases the amount of power shared (P Bati ) by that ESS.On the opposite, a larger value in the product (W (SoC Bati ) • K p ) is required for reducing the amount of power shared by the ESS with the lowest SoC, during the process of discharge.To illustrate, Fig. 10 show the effects in the shared power by adjusting the weighting factor in the case that (SoC Bat2 > SoC Bat1 ) for charge and discharge.In Fig. 10a, As an alternative, knowledge-based fuzzy inference systems (FIS) can be used for obtaining the adaptive functions of the weighting factor (W (SoC)).This kind of approaches have been deployed previously for dc microgrids in [23], and since the adaptive curves are synthesized from qualitative knowledge without considering particular parameters of the storage devices or the microgrid, they can be easily adapted for ac microgrids.The inputs of the FIS are the SoC and the sign of the power at each ESS (sgn(P Bati )), which provides the information about the charging or discharging status of the ESSs.Figs.11a and  11b show the profile of the control curves for the adaptive weighting factor (W (SoC)) under charge and discharge.Each ESS has its own fuzzy system for obtaining locally the weighting factor (W (SoC)) based on it own SoC.The SoC is estimated by the ampere-hour (Ah) counting method [7], [17].Nevertheless, any other estimation method can be used.An inherent advantage of using the FIS is that the curves are normalized, which allow selecting the nominal value of the droop coefficient K p in accordance with operational or stability constraints.

B. Power Curtailment of RESs under Grid-Forming Operation
RESs assume the bus regulation when ESSs are not able to store more energy (ESSs are under constant voltage regulation), and the maximum power of RESs is larger than the current power consumption (TCM3).At this point, the power balance is shared between distributed RESs by means of conventional droop control loops (eq.( 1)) and the generation from RESs should be curtailed for keeping the power balance in the system.However, it is no possible to ensure that all the distributed RESs have the same maximum power (P M P P T ), therefore an equal sharing is not always feasible.Under this context, it is expected that the RES with more available power contributes with more power than the others.Therefore, the contribution of each RES in the power sharing may be adjusted by means of a weighting factor (W (P M P P T )) in its droop control loop.Then, equation ( 1) is modified as: where, P Resi is the actual value of the power supplied by each RES under grid-forming operation.
Taking into account that the proposed control architecture is completely distributed, the weighting factor (W (P M P P T )) should be obtained only from local measurements.By regarding that the value of the weighting factor must be inversely proportional to the maximum power, it is defined as: W (P M P P T ) = P base /P M P P T i (6) where, P base is selected in accordance with the maximum power rate of the RESs [23].However, the value of the (W (P M P P T )) should be bounded in order to avoid undesired dynamic response of the microgrid.This fact will become clear later when stability issues are considered.

VI. CASE STUDY ISLANDED MICROGRID
Table V summarizes the main parameters of the microgrid in network configuration selected for the case study.The islanded microgrid was initially dimensioned with a battery capacity of 10 Ah in each ESSs.However, in order to speed up the experiments, the capacity of batteries is set at 0.016 Ah.The batteries are modelled by means of detailed aggregated models, which take into account the fast and slow dynamic responses, and the output series resistor of the battery array [43], [44].For emulating the active power consumption in the microgrid a resistive load will be considered.A. Implementation of distributed primary controllers Figs. 12 and 13 show the scheme of the primary controllers for the ESSs and RESs respectively.The primary controllers are presented by means of functional blocks, which include the inner current control loops and outer voltage control loops, the proposed (P − ω) and (Q − E) droop control loops, the measurement block, and the operation mode decision-maker.The current control loop is the same for CCM and VCM, then, a smooth transition between control modes is achieved by setting the initial conditions of inactive PI controllers to the current value of the reference current.In this way, same conditions are ensured before and after the transitions, which avoids discontinuities at the reference current.The operation mode decision-making units presented on Fig. 9 generate the signals for activating the transitions between control modes.The reactive power Q will be managed and shared exclusively by the grid-forming units, then, the reactive power reference (Q * ) is set equal to zero for the grid-following units.

B. Stability Considerations
The stability of the microgrid relies mainly on the gridforming units.Therefore, their inner and outer controllers have been designed to provide active damping to the inverters grid side converters.The dynamic behaviour of the microgrid with parallel connected grid-forming units depends mainly on the interaction of the droop control loops, since the references for the sinusoidal voltage amplitude (E) and frequency (ω) in the grid-forming units are obtained directly from them [45].Particularly, the nominal values of the droop coefficients (K p and K q ) determine the dynamic behaviour of the islanded Operation Mode Decision-Maker  dq d d d d d d d d d d d d dq q q q q q  d d d d d d d d d d  abc   ref   q   dq d d d d d d d d d d d d dq q q q q q  d d d d d d d d d d  abc   dq d d d d d d d d d d d dq q q q q  d d d d d d d d d

ESS Primary Control
dq d d d d dq q q q q q q q q q d d d d d d d abc   Fig. 13: Scheme of the Primary control for RESs.
system [29].The small signal model of a single grid-forming unit can be obtained after linearising the equations ( 1) and ( 2) as proposed in [45]: where, the state variables are the small deviation around the equilibrium point of the output frequency (∆ω) and voltage (∆v di and ∆v qi ), by considering a d − q reference frame in which ( E = v d + jv q ).For a microgrid composed by several grid-forming units connected in parallel, and considering the integration of power sources (PS), power loads (PL) and the line impedances within the microgrid network, it is possible to obtain a more detailed small signal model, which symbolically can be written as: ).Interested readers about the parameters of the matrices may refer directly to [29].Fig. 14a shows the behaviour of the eigenvalues for the microgrid under TCM1 and TCM3 (two parallel connected grid-forming units), by varying the droop coefficient (K p ) from 5.60 * 10 −6 to 5.04 * 10 −5 rd/s/W and by keeping the value of (K q ) constant.For the defined range, the system has a resonant mode whose damping ratio (ζ) decreases when (K p ) is increased.In this case, a minimum damping ratio (ζ = 0.707) has been considered as acceptable for ensuring stable dynamic response of the system.Because of this, the maximum value for the (P − ω) droop coefficient is (K p(max) = 5.61 * 10 −5 rd/s/W ).For the ESSs the product (W (SoC Bati ) • K p (max)) is approximately bounded to the selected maximum value, since the (W (SoC)) vary between 0.1 to 0.9 as can be seen in Fig. 11.Then, a nominal value (K pESS = 5.61 * 10 −5 rd/s/W ) is established for ESSs.For RESs, the nominal value of the (P − ω) droop coefficient is established at (K pRES = 1.61 * 10 −5 (rad)/(s)/(W )) and consequently (W (P M P P T )) should be limited to 5 for do not exceed the value of K p (max).Fig. 14b shows the behaviour of the eigenvalues of the microgrid under TCM1 and TCM3 by varying the (Q − E) droop coefficient (K q ) from 1 * 10 −3 to 3 * 10 −3 V /(V Ar) and by keeping the (P − ω) droop coefficient (K p ) on the maximum value.In this case, the system becomes unstable for K q ≥ 2.3 * 10 −3 V /(V Ar).Therefore, the nominal value of the (Q − E) droop coefficient is selected at (K q = 1 * 10 −3 V /(V Ar))).Whit this value it is possible to estimate the maximum voltage deviation: where, (E adj = 3V ).This value was selected by taking into account that the voltage drop in the output inductor L 2 will be approximate ±3V in the case that (Q = Q max ).Therefore, under normal operation (load connected) ∆E < 0.05E nom as recommended by different grid codes.Similarly, Figs.15a and 15b show the behaviour of the eigenvalues for the microgrid under TCM2 and TCM4, by varying K p and K q respectively.As can be seen, the stability of the system is not compromised with the selected values of the droop coefficients.
Once the right nominal values of the droop coefficients have been selected for ensuring a stable operation of the microgrid, it is important to determine the local asymptotic stability of the equilibrium points, which ensure that all initial conditions after the transitions in the operation modes will result in trajectories that converge to the equilibrium points.In this sense, it is possible to determine the local stability of an equilibrium point by means of a linear approximation [46].Then a linear system will be derived for evaluating the local asymptotic stability of the grid-forming units under different initial conditions.
Since the generated voltage is aligned to the synchronous frame, the quadrature component of the voltage (v q = 0).Therefore, the instantaneous active and reactive power are: and the values obtained after the power calculation block are: where, ω f is the cut-off frequency of the measuring filter.By replacing the equations ( 12) and ( 13) in equations ( 1) and ( 2), and after linearisation at the equilibrium point (v di , i di , i qi , ω), it is possible to obtain the linear approximation as: It is straightforward to verify that the real parts of all eigenvalues of equation ( 14) are strictly less than zero (as occur also for the linear system in equation ( 8)), then, the equilibrium point of the linear approximation is asymptotically stable.By considering that, "the asymptotic stability of the linear approximation implies 'local' asymptotic stability of the original non-linear system" [46].It is possible to have an insight into the local asymptotic stability of the islanded microgrid after the transitions, mainly by considering that the deviations in voltage and frequency are kept within a 5% of the nominal values.
It is possible to perform a qualitative analysis of the evolution of the voltage amplitude E and frequency ω during the transitions in operation modes by plotting the phase portrait for the system in equation ( 14) (Fig. 16).This tool provides an insight into the dynamic behaviour of the microgrid by showing the trend of different trajectories under different initial conditions [46].As can be seen in Fig. 16 all the trajectories converge to the equilibrium point.

VII. EXPERIMENTAL RESULTS
The performance of the case study microgrid with the proposed coordination architecture was tested experimentally in an islanded ac microgrid laboratory platform.Fig. 17 shows a scheme of the experimental setup, which can be divided into two parts.The hardware part is composed of four inverters Danfoss (2.2 kW), LCL filters, measurement LEM sensors, and a resistive load.Meanwhile, the software part is implemented in a real-time simulation platform (dSPACE1006 control board), where the controllers, battery models, and renewable generation profiles are emulated.For the integration of RESs to a energized grid, it is commonly used a multi-stage converter in which one of the converters is responsible for the regulation of an intermediate dc-link, while the other follows the power reference obtained from the MPPT algorithm such as in [47].In the experimental configuration, the MPPT reference (P M P P T i ) is directly applied to the grid side converter, which is connected to a stiff voltage source that emulates the intermediate dc-link as can be seen in Fig. 17    TCMs and the cooperative behaviours between grid-forming units.Fig. 19 shows: (a) the voltages of the batteries V bat1 and V bat2 , (b) the SoC values, (c) the Error in the SoCs defined as: (Error(%) = SoC Bat2 − SoC Bat1 ), (d) the active power shared by each ESS (P Bat1 and P Bat2 ), (e) and (f) show the maximum power (P M P P T i ) and the generated power (P Resi ) for RES1 and RES2 respectively, (g) shows the load consumption profile, and (h) shows the reactive power managed by all the DERs Q ESS1 , Q ESS2 , Q Res1 , and Q Res2 .
Fig. 20 shows the voltage amplitude and frequency profiles for the experiment shown in Fig. 19.Here, it is possible to evidence the operation of the bus signalling method, where the frequency deviation is almost negligible in steady state and only transitory perturbations will trigger the changes in the DERs, and the voltage amplitude varies in accordance to the TCM of the microgrid.
From t 0 to t 1 : the microgrid operates in TCM1, since the batteries are partially charged (initial SoCs of (75%) and (85%) for ESS1 and ESS2 respectively) and the generation from RESs is P M P P T 1 = P M P P T 2 = 0W .During this period, the batteries will be discharged for supporting the load consumption.Fig. 19(d) shows how the power shared between ESSs is adjusted for equalizing the SoCs.
At t 1 : the maximum available power from RESs are increased (P M P P T 1 = 500W and P M P P T 2 = 250W ).Since generation is larger than consumption the batteries start to be charged and the microgrid continues in TCM1.From t 1 to t 3 it is possible to see how the power sharing is adjusted between the grid-forming units (ESSs) for equalizing the SoCs.Additionally, Fig. 20 shows that the voltage amplitude in the common coupling point (V P CC ) is bigger than the nominal voltage E nom , which indicates that ESSs are the current responsible for forming the islanded system (Co 1 = 1) in accordance with the proposed signalling strategy.
At t 2 : ESS2 reaches the regulation voltage V r , then, it changes its operation mode to CCM (this time can be seen in the zoom in boxes in Figs.19 and 20).Consequently, the microgrid changes its topology from TCM1 to TCM2.From t 2 to t 3 ESS1 will be the single unit in the forming task, then, its rate of charge increases and it will assume the managing of all the reactive power (Q).Meanwhile, the reactive power in ESS2 approaches the reference value (Q * = 0) as can be seen in the zoom-in box of Fig. 19(h).Thanks to the SoC equalization process, the operation of the microgrid under TCM2 is short and the transition in both ESSs is almost simultaneous as can be seen in the long time scale.At t 3 : ESS1 also reaches the regulation voltage V r , then, the microgrid changes its configuration to the TCM shown in Fig. 3.As a consequence, the frequency drops until the minimum limit of the NDZ as can be seen in Fig. 20 where the event Ev 3 is configured.Also, at the time that event Ev 3 occurs V P CC > E nom (Co 1 = 1), which means that only RESs will assume the grid-forming control (Fig. 9b).
From t 3 to t 4 : it is possible to see how the power is shared between RESs proportionally to their corresponding maximum available power.To be more precise, P Res1 > P Res2 because P M P P T 1 > P M P P T 2 .This cooperative behaviour is achieved by the action of the weighting factor W (P M P P T ).Additionally, in Figs.19(d) and 19(a) it is possible to see that the power consumption of the ESSs is reduced exponentially in order to keep the voltage of the batteries at a constant value.After t 3 the batteries will enter in a saturation stage in which more than 100% of the energy is returned to the battery for compensating energy losses during the charging stage.This overcharge during the saturation stage is recommended by manufacturers (see Fig. 19(b)) [7].Meanwhile.Fig. 20 shows that the voltage at the common bus is reduced below the nominal voltage (V P CC < E nom ), which means (Co 1 = Co 1 = 0) in accordance to the proposed signalling strategy.
At t 4 : P M P P T 2 is reduced to 50 W ,then, RES2 changes its control from grid-forming to grid-following, since P M P P T 2 < P Res2 (event Ev 2 ).As a result, the microgrid changes its topology to T CM 4and RES1 assumes the forming task of the local power grid and the management of the reactive power.Since the grid-following units do not contribute with reactive power managing (Q * = 0), the grid-forming units will be responsible for managing the reactive power consumed by the filter capacitors.Because of that, the grid-forming units will see a capacitive reactive power.From t 4 to t 5 RES1 manages all the reactive power, which is close to the maximum value Q max = −1500 VAr (Figs. 19(h)).Then, the voltage in the common coupling point increases due to the reactive current flowing through L 2 as can be seen in Fig. 20.However, the voltage is kept below the nominal value thanks to the adjustment value E adj added in equation (3).
At t 5 : P M P P T 1 = P M P P T 2 = 0W , then, P M P P T 1 < P Res1 (event Ev 2 ) and RES2 changes to grid-following control.As a consequence, all the DERs will be in CCM (Fig. 3).Fig. 20 shows the transitions for voltage amplitude and frequency after Ev 3 .As can be seen at Ev 3 the voltage V P CC < E nom ( Co 1 ), which means that only the ESSs will assume the grid-forming role and the microgrid returns to T CM 1. From t 5 to t 6 , it is possible to see the effect of circulating currents which increase the Error value temporarily.The circulating currents appear due to differences in the gridforming units at the time they are connected in parallel [48].The difference appears because the ESSs are not completely equalized and the open circuit voltages of the batteries are nor the same.In this case, larger differences will cause larger circulating currents after t 5 [37].Nevertheless, the SoC equalization based on FIS manages to reduce the Error value.
At t 6 : the ESSs reach the EOD value almost at the same time due to the equalization.However, because of small differences in the battery voltages of the ESSs (t 6 to t 7 in the zoom in box of Fig. 19(a)), the reduction in the reference voltage E * is not performed exactly at the same time.This fact causes differences in the reactive power sharing as can be seen in Fig. 19(h) due to the action of (Q − E) droop control loops.From t 6 to t 9 the common bus voltage (V P CC ) is reduced as can be seen in Fig. 20.Finally, at t 8 the load is disconnected (see Fig. 19(g) where P Load = 0), and in t 9 the reference value, in both ESSs, reaches its minimum value (E * = 0.85E nom ) and the voltage in the common bus stops its reduction as can be seen in Fig. 20(g).
At t 10 : The maximum available power from RESs is increased (P Res1 = P Res2 = 250W ), and the ESSs begin to be charged until t 11 where SoCs will be equal to 50%.At this point, the reference value starts its restoration (see Fig. 20.) and consequently the common bus voltage increases.Similarly to the voltage reduction process, small differences in the SoC values cause small deviations in the reactive power sharing.Here is where the SoC equalization takes importance since larger differences in the charging and discharging profiles cause larger differences in the reactive power sharing.
At t 12 : the amplitude in the common bus is greater than the 90% of its nominal value.Therefore, the load is connected, and the reference value E * continues its restoration until t 13 .
In the real implementation, it is not possible to ensure equal parameters for all the inverters.For that reason, in Fig. 19(h) shows that the reactive power flow Q is not equally shared between grid-forming units during TCM1 and TCM3.To solve this problem cooperative behaviours can be defined in order to adjust the reactive power sharing in future works.Another important point to highlight is that the SoC equalization allows unifying the charge and discharge profiles for the distributed ESSs.Therefore from a coordination point of view, the distributed ESSs can be seen as a single aggregated one.This fact can be seen in the voltage and SoC profiles in Figs.

B. Experiment 2.
The experimental results presented in the Fig. 21 compare the performance of the proposed voltage/frequency signalling when the grid-forming units have to deal with a capacitive reactive power (Fig. 21a) or an inductive reactive power (Fig.

Fig. 6 :
Fig. 6: Frequency response with and without transition between control modes after Ev 3 .

+
[Cs][Es][Hs][∆i P (S−L) ] where, [Y s] and [Hs] are the nodal admittance matrix and the forward current gain matrix of the microgrid network respectively, [Is] and [Es] are matrices with the values of current and voltages in the equilibrium point for the gridforming units, [∆i P (S−L) ] is the incremental current from the power sources and loads, and [Ks] is a transformation matrix for making ([∆E] = [Ks][∆X]
Fig.18shows an image of the experimental setup.A. Experiment 1.

Fig. 19 Fig. 17 :
Fig.19shows the experimental performance of the microgrid by considering coordinated transitions between all

TABLE I :
Description of Events and Conditions

TABLE II :
Transition Tables for ESSs

TABLE III :
Transition Table for RESs

TABLE IV :
Transition Table for Load Control

TABLE V :
Parameters of the Microgrid