Power Management of the DC Bus Connected Converters in a Hybrid AC/DC Microgrid Tied to the Main Grid

In this paper, a centralized control strategy for the efficient power management of power converters composing a hybrid AC/DC microgrid is explained. The study is focused on the converters connected to the DC bus. The proposed power management algorithm is implemented in a microgrid central processor which is based on assigning several operation functions to each of the generators, loads and energy storage systems in the microgrid. The power flows between the DC and AC buses are studied in several operational scenarios to verify the proposed control. Experimental and simulation results demonstrate that the algorithm allows control of the power dispatch inside the microgrid properly by performing the following tasks: communication among power converters, the grid operator and loads; connection and disconnection of loads; control of the power exchange between the distributed generators and the energy storage system and, finally, supervision of the power dispatch limit set by the grid operator. Record Type: Published Article Submitted To: LAPSE (Living Archive for Process Systems Engineering) Citation (overall record, always the latest version): LAPSE:2020.0747 Citation (this specific file, latest version): LAPSE:2020.0747-1 Citation (this specific file, this version): LAPSE:2020.0747-1v1 DOI of Published Version: https://doi.org/10.3390/en11040794 License: Creative Commons Attribution 4.0 International (CC BY 4.0) Powered by TCPDF (www.tcpdf.org)


Introduction
Most countries are dependent on fossil fuels and nuclear energy for electric power generation. However, due to the increasing energy demand and the proliferation of new forms of energy generation which are cheaper and environmentally-friendly, many distributed generation (DG) systems have been integrated into the power grid. Some DGs consist of Renewable Energy Sources (RES), such as Photovoltaic (PV), wind, biomass and geothermal [1]. The DGs are the basis of Microgrids (MGs), which can operate as a single power system that provides a safe and reliable operation at certain voltage and load levels. MGs may work in island-mode or in grid-connected mode, so that they can connect to DGs placed at various locations and inject their energy to the grid if it is needed [2]. The transition between these two operation modes is a process that can destabilize the voltage at the MG buses and damage the MG. In [3], a methodology to recover the MG operation during this transition was presented, along with the main technical problems which should be taken into account. There are three basic MG topologies that can be classified according to the nature of their voltage: DC microgrid (DC MG), AC microgrid (AC MG) and hybrid AC/DC microgrid [4], which is a microgrid with AC and DC buses. Hybrid AC/DC microgrids are currently of great interest to researchers and are considered the distribution and transmission systems of the future, because they enable the coexistence of both AC MGs and DC MGs. The main drawback of the hybrid AC/DC microgrid is the protection strategy because it is more complex than the traditional MG [5,6]. The large amount implementation of load-shedding hysteresis levels in cases where the aim is to keep the battery energy backup as high as possible without exceeding a certain power limit imported from the main grid. This strategy is usually the preferred one when the electricity tariff is low [27,28]. Moreover, the experimental validation of the centralized power management algorithm in a hybrid AC/DC microgrid is shown. The power management algorithm has been implemented in a MGCP based on TMS320F28335 DSC. Both, the control and the communications of each power converter have been implemented by means of TMS320F28335 DSCs.
This paper consists of five sections. In Section 2, a description of the hybrid AC/DC microgrid under study is provided. In Section 3, several concepts of the power management algorithm are explained. In Section 4, simulation and experimental results at different scenarios of the MG are presented. Section 5 contains the conclusions of the study.

Description of the Hybrid AC/DC Microgrid under Study
The hybrid AC/DC microgrid is depicted in Figure 1. The parameters of the communication system inside the MG are shown in Table 1. The MG under study is based on a single DC bus and a single AC bus, connected to the Point of Common Coupling (PCC) of the public grid by means of a static switch. The connection between the DC and AC buses is performed by the ILC, allowing a bidirectional power flow. In grid connected mode, the ILC may work as a current source that injects power to the grid synchronously with the AC bus voltage. An anti-islanding protection, based on [29], has been performed on the DSP of the MGCP. In that case, the operation of the distributed generators connected to the AC bus changes to droop mode so that they can regulate the voltage at the AC bus. The ILC keeps controlling the voltage at the DC bus.

Communication Parameters between the MGCP and the Grid Operator
High-level control EDL,P Grid-to-MG ,P MG-to-Grid The MGCP sets the operation functions of the power converters, loads and the ESS, depending on the MG scenarios. These scenarios depend on the internal and external changes that affect the power dispatch, such as changes in the solar irradiation, the load, the ESS and the power limit established by the public grid operator.
The MGCP optimizes power sharing by applying several control actions to the microgrid devices: (i) to connect/disconnect the loads as a function of the generated power and the available energy in the batteries; (ii) to share the available power between the priority loads [30] and the ESS; (iii) to adjust the hysteresis levels for avoiding oscillation in the DC bus due the connection-disconnection of loads and (iv) to accomplish the power limits established by the grid operator. Note that the grid operator can establish different power exchange limits at any moment by means of serial communication. In fact, the power generated by the energy sources connected to the DC bus must be limited by the MGCP, in order to prevent an excessive power injection to the public grid beyond the limit set by the grid operator.
The MGCP defines the internal functionality depending on the possible scenarios of the MG. The communications allow control of the PV DGs, the ESS and the load connection/disconnection. In Figure 1, a 10 kW ILC, which connects the AC bus and the DC bus, can be observed. The AC bus is single phase and works in grid-connected mode with a grid voltage: V Grid = 230 V rms and F Grid = 50 Hz ± 1 Hz. In the MG under study, two additional elements are connected to the AC bus: a 5 kW AC DG, and a 4 kW AC load. The nominal DC bus voltage is V DC = 420 V, being regulated by the ILC. Three elements are connected to the DC bus: a 3 kW bidirectional DC/DC converter connected to a battery bank and two 5 kW DC/DC converters connected each one to one PV array. The voltage at the battery bank (V Bat ) ranges from 192 V to 252 V, whereas the voltages at the PV arrays (V PV1 and V PV2 ) vary from 306 V to 378 V. Additionally four 'shed-able' 2 kW DC loads are connected to the DC bus. The loads can be connected or disconnected to/from the DC-bus by means of individual switches controlled by the MGCP (Sw1 to Sw4).

Parameters of the MGCP
In this section, several concepts and parameters of the MGCP are explained in order to define the features and control functionalities of the proposed algorithm.

High-Level Control Limits
The grid operator establishes a tertiary high-level control strategy which controls the power flow between the MG and the main grid. That power flow imposes a limit of the power injected from the MG to the main grid or vice versa. The limits established from the high-level control are: The EDL is a digital flag that is inside the MGCP which indicates that there is an energy dispatch limit in the MG, set by the grid operator. The EDL allows the MGCP to set a suitable control strategy by taking into account the values of the maximum power extracted/injected from/to the grid to/from the MG. When EDL = Off, there is no energy dispatch limit, and the MGCP can inject or extract unlimited power to/from the grid. In the opposite case (EDL = On), the MGCP establishes a set of power management criteria which depends on the load connected to the AC or DC buses, the power available in the MG and the SOC of the batteries.

Maximum Power Extracted from the Grid
The power flow scenarios between the grid and the MG are shown in Figure 2. Two general cases are possible: P Grid < 0 and P Grid > 0, being the power flow from the main grid to the microgrid or vice versa. ParameterP Grid-to-MG is established by the grid operator and represents the maximum power that can be extracted from the main grid to the MG, |P Grid | ≤P Grid-to-MG .

Maximum Power Injected to the Grid
ParameterP MG-to-Grid stands for the maximum power that can be injected from the MG to the main grid. This parameter is established by the grid operator, imposing the condition, P Grid ≤P MG-to-Grid .

Parameters of the MGCP
The MGCP establishes some parameters for the secondary control strategy, which is responsible for the power flow between the AC bus and the DC bus of the MG. The MGCP must limit the power generated by the RESs, if the available power is higher than that necessary at the MG buses.
Maximum Power Extracted from the AC Bus to the DC Bus Measured at the AC Side of the ILC The power that flows from the grid to the MG is depicted in Figure 2a. In that case (P Grid < 0 and P ILC_AC < 0), the value of P ILC_AC can be calculated by Equation (1). The parameterP ILC_AC | Grid-to-MG stands for the maximum power which can be extracted from the AC bus to the DC bus. This power is measured at the AC side of the ILC (2). The value ofP ILC_AC | Grid-to-MG depends on the MGCP, because the value ofP Grid-to-MG is set by the MGCP. The absolute value of P ILC_AC must meet the condition expressed by Equation (3) at any time, taking into account the rated power of the ILC.
Maximum Power Injected from the DC Bus to the AC Bus Measured at the AC Side of the ILC The power that flows from the MG to the grid is depicted in Figure 2b. In that case (P Grid > 0 and P ILC_AC > 0), the value of P ILC_AC can be calculated by Equation (4). ParameterP ILC AC | MG-to-Grid stands for the maximum power which can be injected from the DC bus to the AC bus, measured at the AC side of the ILC (5). The maximum power injected from the DC bus to the AC bus by the ILC must meet the conditions of Equation (6).
PV Power Generated in the DC Bus The power outputs generated by the PV DGs connected to the DC bus are measured individually. Parameter P PV is the overall PV power generated in the DC bus of the MG. The total power generated by two PV DC/DC converters connected to the DC bus is shown in Equation (7).
Power Consumed by the Loads Connected to the DC and AC Buses The power consumed by the loads connected to the DC bus is P DC Load = I DC Load ·V DC and to the AC bus is P AC Load = I AC Loadrms ·V Grid rms .

Maximum Power Consumed by the Loads Connected to the DC Bus
ParameterP DC Load stands for the maximum overall power which the DC loads are allowed to consume. The load shedding functionality at the DC bus performed by the MGCP depends on this parameter.P DC Load ≤ P ILC Rated establishes an upper limit for the maximum power as a function of the ILC power rating.

PV Power Limit
Parameter P PV_Lim is the maximum power that should be extracted from the PV sources at any time, so that it can be consumed by the DC loads and by the batteries (P ESS > 0) and/or it injected into the grid. P PV_Lim is represented by Equation (8)

PV Generation Power Available in the DC Bus
Parameter P AvailableDC_MG is the extra power available from the PV DGs of the DC bus after feeding the load connected in the DC bus. The available PV generation power is defined by Equation (9).

DC Load Switch
The flag of DC load switch takes two possible states, Sw Load = On and Sw Load = Off, depending on the connection or disconnection of loads to the DC bus, respectively.

DC Load Hysteresis
Parameter DC Load_hyst is calculated as 10% of the overall power consumed by the DC loads, DC Load hyst = 0.1·P DC Load . DC Load_hyst is the hysteresis level which has been established for avoiding erratic connection/disconnection of the loads.

Power Consumed for the Batteries to C10
Parameter PESS C10 is the maximum power consumption for the charge of the batteries of the ESS, PESS C10 = (V Bat ·I C10 )/η ESS . It has been established that the batteries are charged with a current equal to I C10 = C 10 /10, where C10 the specified battery capacity (measured in A·h) for a discharge time of 10 h.

Power Management Algorithm
Several calculations and functions are necessary for the suitable power management of the MG control algorithm. These calculations and functions depend on the SOC of the battery, the availability of power in the buses, the limits set by the grid operator and the status of Sw Load .

Operation Functions of the MGCP
The power management algorithm embedded in the MGCP executes 12 operation functions according to the various operating scenarios. The operation functions of the MGCP and their interactions with the power converters of the MG are described in the following paragraphs.
Operation Functions in DC Load Connection Mode (Sw Load = On) Function 1 (F1): All DC loads are fed. When SOC ≤ SOC Full (SOC Full = 100%), the DC/DC converter of the ESS charges the batteries from the DC bus with a current (I C10 ). The PV DGs work at their maximum power point (MPP), so that MPPT = On. If there is not enough power available from the PV DGs connected to the DC bus, the ILC can extract the rest of the power from the AC bus with the only restriction being |P ILC AC | ≤ P ILC Rated , taking into account that EDL = Off. Function 2 (F2): All DC loads are fed. When SOC ≤ SOC Full ; the DC/DC converter of the ESS charges the batteries from the DC bus with a current equal to I C10 . The PV DGs work at their MPP (MPPT = On). In this case, the PV DGs connected to the DC bus may produce excess power which can be injected into the AC bus by the ILC if necessary, with the only limitation being its rated power: Function 3 (F3): All DC loads are fed. When SOC ≤ SOC Full ; the DC/DC converter of the ESS charges the batteries from the DC bus with a current equal to I C10 . The PV DGs do not work at their MPP (MPPT = Off ). In this case the PV DGs connected to the DC bus produce a limited amount of power, because the power which can be injected to the AC bus by the ILC is limited by the grid operator. The power injected from the DC to AC bus by the ILC is given by:   Function 7 (F7): All DC loads are fed. While SOC ≤ SOC Full , the DC/DC converter of the ESS charges the batteries from the DC bus with a current whose value is shown by Equation (10) which is smaller than I C10 . The PV DGs work at their MPP (MPPT = On). If there is not enough power available from the PV DGs, the ILC can extract the rest of power from the AC bus subject to the following limit: |P ILC AC | ≤P ILC AC | Grid-to-MG .
Function 8 (F8): All DC loads are fed. When SOC ≥ SOC MIN , the DC/DC converter of the ESS operates as a controlled current source discharging the batteries to the DC bus. In F8, the PV DGs work at their MPP (MPPT = On). The sum of the power coming from the ESS and from the PV DGs is not enough to energize the DC loads, so that the required extra power can be transferred from the AC bus to the DC bus through the ILC. That extra power is limited in order not to override the power which can be absorbed by the DC loads. Equation (11) shows the expression of the discharge current. In this case, the extra available power is negative (P AvailableDC_MG < 0), because the power coming from the PV DGs is not enough to energize the DC loads. The power flows in the MG when F8 is active are shown in Figure 3b.
Function 12 (F12): All DC loads are fed. When SOC ≤ SOC MAX , the DC/DC converter of the ESS charges the batteries with a current smaller than I C10 , given by Equation (10). The PV DGs work at their MPP (MPPT = On). If the power coming from the PV DGs is not enough to energize the DC loads, the required extra power can be transferred from the AC to the DC bus through the ILC.

Power Management Algorithm of the MG
The flow diagram of the power management algorithm is shown in Figure 5. Comp.4 is a logic variable calculated as an OR function. The flags, Sw Load and EDL, are fundamental parameters for the power dispatch in the MG. When EDL = Off, there is no energy dispatch limit, so that functions F1 or F2 can be applied. When EDL = On and Sw Load = On, the MGCP applies functions F3 to F9. The flag Sw Load can be turned Off by F4; after that, the MGCP can apply functions F10 to F12. The functions are implemented so that the power transfer limits between both buses are not exceeded. The calculations performed by the power management algorithm, Cal.0 to Cal.4, are shown in Equations (12)- (15) and allow the power availability of both buses to be checked, taking into account their power dispatch limits.
Equation (13) stands for the power availability in the DC bus coming from DGs and batteries plus the maximum power which can be extracted from the AC bus to the DC bus.
Equation (14) stands for the maximum power that can be injected from the DC to the AC bus plus the power consumed for charging the batteries at a current (I C10 ).
Equation (15) stands for the power available in the DC bus plus the maximum power which can be extracted from the AC bus to the DC bus.

Simulation Results
The proposed power management algorithm has been simulated by means of PSIM™ [31] under various scenarios. This study is focused on the particular case in which the MG is operating in grid connected mode. The characteristics of the power electronic converters comprising the MG are listed in Table 2. The simulation scenarios of the MG are explained in Table 3. It is worth pointing out that step changes of irradiation shown in Table 3 do not correspond to reality, but they allow us to study the behavior of the MG and the stability of the buses in very extreme cases. In order to check of the proposed algorithm in different situations with a short simulation time, the algorithm was run in simulations at 25 Hz. The duration of the operation functions F4 and F10 is one clock cycle (40 ms), because their main function is to change the load shedding functionality. It is assumed that the ESS is initially discharged (SOC ≤ SOC MIN ). A selected number of possible scenarios have been studied in order to demonstrate the suitable behavior of the MG in its most common and critical situations. In the scenarios under study, step changes of the irradiation, the DC load and the EDL were considered, as can be observed in Table 3. The behavior of the proposed algorithm and the application of particular functions F1 to F12 by the MGCP can be observed from the following graphs: Figure 6 depicts the behavior of the currents, I Bat , I PV = I PV1 + I PV2 , and of the SOC versus time. The evolution of the powers, P Bat , P PV , P DCLoad , P ILC_AC and P Grid , can be observed in Figure 7. Figure 8 provides detail about the most sudden transients of I ILC_AC , V DC and P ILC_AC , which take place throughout the whole simulation, corresponding to the time span, 34.8 s to 35.4 s. The analysis is performed according to the following time intervals: Interval 1 (0 ≤ t < 1 s): This interval is divided into two subintervals. 0 ≤ t < 40 ms: At t = 0 s, the ESS is initially discharged (SOC ≤ SOC MIN ). The irradiation is 300 W/m 2 and the overall DC load absorbs 8 kW. Due to the fact that the PV available power, P PV , at that low irradiation level is not enough to feed the loads, the MGCP applies function F4, internally activating flag Sw Load = Off. 40 ms ≤ t < 1 s: After to F4, F11 is applied to disconnect two DC loads (overall DC load = 4 kW), and the batteries are charged with a current given by Equation (10). Interval 2 (1 s ≤ t < 10 s): At t = 1 s, the irradiation undergoes a change from 300 W/m 2 to 600 W/m 2 , whereas the SOC keeps growing below SOC MAX . The MGCP goes on applying F11. The PV generation is increased and F11 connects an additional 2 kW DC load (overall DC load = 6 kW) to the DC bus. The MGCP makes both PV DC/DC converters operate at their MPP, whereas the DC bus voltage is regulated to 420 V by the ILC.
Interval 3 (10 s ≤ t ≤ 18 s): This interval is divided into five subintervals. 10 ≤ t < 10.2 s: At t = 10 s, the irradiation decreases from 600 W/m 2 to 400 W/m 2 , whereas the SOC keeps growing below SOC MAX . The MGCP maintains F11. The power generated by the panels, P PV , with this irradiation is insufficient to feed three loads, and F11 disconnects one load (DC load = 4 kW) in the DC bus. 10.24 s ≤ t < 15.4 s: At t = 10.24 s, the generated PV power at the current irradiation level is not enough to feed all the DC loads, so that the MGCP applies F8 in order to get additional power from the ESS, and the battery bank is discharged at a current given by (11). F8 connects all DC loads (8 kW) to the DC bus and extracts power from the AC bus taking into account the limit that the maximum power that can be extracted of the same (|P ILC AC | ≤ (P ILC AC | Grid-to-MG ), and the ESS injects the current required by the DC bus to feed the DC loads. 15.44 s ≤ t < 18 s: At t = 15.44 s, the MGCP applies F11. F11 disconnects two DC loads (overall DC load = 4 kW), so that the batteries are charged with a current given by (10).
Interval 4 (18 s ≤ t < 20 s): At t = 18 s, the irradiation undergoes a linear change of 400 W/m 2 to 800 W/m 2 , being SOC < SOC MAX . The generated PV power and the extracted power from the AC bus are enough to feed all DC loads. Due to limitations on the amount of power that can be interchanged between the buses, the MGCP applies F12, and the batteries are charged with a current given by Equation (10). F12 connects all the DC loads and also sets the PV sources at their MPP.
Interval 5 (20 s ≤ t < 28 s): This interval is divided into three subintervals. 20 ≤ t < 20.04 s: The irradiation keeps a constant 800 W/m 2 value, whereas SOC remains below SOC Full . At t = 20 s, the load connected to the DC bus decreases from 8 kW to 4 kW. The PV-generated power (P PV ) at the current irradiation is enough to feed all DC loads. The MGCP applies F10 which internally activates the flag, Sw Load = On. 20.04 ≤ t < 23.7 s: At t = 20.04 s, MGCP applies F5. F5 sets the charge the batteries with a current (I C10 ). The PV sources work at their MPP. The ILC injects the power excess to the AC bus.
23.7 s ≤ t < 28 s: Both the irradiation (800 W/m 2 ) and the DC load (4 kW) remain constant, whereas the SOC has reached 100%. The power generated by the panels is higher than that necessary for feeding the DC loads: P PV > 4 kW. The MGCP applies F9 to stop charging the batteries and to set the PV generators outside their MPP (MPPT = Off ). In this case, (P ILC AC ≤P ILC AC | MG-to-Grid ).
Interval 6 (28 s ≤ t < 35 s): The irradiation and the SOC remain constant: 800 W/m 2 and 100%, respectively. EDL switches from On to Off. The MGCP applies F2, and the ILC injects power into the grid to its rated power, if necessary (P ILC AC ≤ P ILC Rated ). At t = 30 s, MPPT switches from Off to On.
Interval 7 (35 s ≤ t < 40 s): The irradiation undergoes a change from 800 W/m 2 to 100 W/m 2 . The MGCP applies F1, so that the ILC can extract power from the grid (|P ILC AC | ≤ P ILC Rated ) when MPPT = On.

Experimental Results
The experimental power electronic converters, whose characteristics are summarized in Table 2, were built to validate the proposed power management algorithm. The following devices have been connected to the DC bus of the MG available in the lab: a 3 kW battery ESS, a 2.5 kW PV source and four electronic switches to connect/disconnect four DC loads of 0.6 kW (P DC Load = 2.4 kW). Figure 9 shows a picture of the experimental setup. The batteries were emulated by a bidirectional DC source/battery emulator, model TC.GSS-Bidirectional-DC-PSU, from Regatron. The PV array was emulated by means of a 10 kW PV array simulator, TerraSAS ETS1000/10, from Ametek (Berwyn, PA, USA). Three experiments were carried out. The experimental scenarios are summarized by Table 4. Figures 10  and 11 depict the waveforms of the currents, voltages and powers of the power converters that form the DC bus of the MG, with Figure 10 corresponding to Experiment 1 and Figure 11 corresponding to Experiment 2. Figure 12 corresponds to Experiment 3. Experiment 1 and Experiment 2 show the behavior of the system with the same change in the irradiation level at the PV source, but with a different SOC of the ESS. The available power injected from the AC bus to the DC bus by the ILC is P ILC_DC = −1 kW.

Experiment 1:
The ESS is initially at an SOC ≥ 80% (charged). The four loads remain connected throughout the whole experiment, as can be seen in Figure 10. (P DC_Load = 2.4 kW). The hysteresis level for comparisons with power thresholds is DC Load_hyst = 0.24 kW.
Interval1 1 (0 s < t < 8 s): The irradiation level is 100 W/m 2 and the PV source works at its maximum power point (MPP), providing P PV = 0.14 kW to the DC bus. That irradiation is not enough to feed all of the loads. Taking into account that the ESS is charged (SOC ≥ 80%), the MGCP transfers the maximum possible power from the AC bus (P ILC_DC = −1 kW) to the DC bus through the ILC and applies F8. This keeps all the DC loads connected and orders the ESS supplying all the power required by the DC bus, P Bat = −1.26 kW.
Interval 2 (8 s < t < 11 s): The irradiation increases from 100 W/m 2 to 800 W/m 2 in 3 s. The MGCP keeps F8 activated and the power delivered by the ESS can be reduced.
At t = 8.6 s, MGCP detects increasing generation, and the PV source works at its MPP, delivering P PV = 0.64 kW. The MGCP keeps F8 activated and transfers the maximum possible power from the AC bus (P ILC_DC = −1 kW) and keeps all of the DC loads connected. The ESS supplies the power required by the DC bus; the power delivered by the ESS is reduced to P Bat = −0.76 kW.
At t = 10.5 s, the PV source works at its MPP delivering P PV = 1.64 kW, with P ILC_DC = −1 kW. At this moment, the MGCP detects that the available power at the DC bus to fed all the DC loads is higher than the hysteresis level (Cal.1 > DC Load_hyst ). The MGCP changes from F8 to F7. F7 forces the ESS to change its operation to energy storage mode; the batteries are charged with a current given by Equation (10). The MGCP changes the setpoint of the ESS charge current, I Ch_ref , until the available power generation is stable (At t = 11.6 s, P Bat = 0.5 kW). The power flows in the MG when the MGCP changes from F8 to F7 are shown in Zoom 1 of Figure 10. Interval 3 (40.4 s < t < 44.2 s): The irradiation decreases from 800 W/m 2 to 100 W/m 2 in 3 s. The MGCP keeps F8 activated and the power delivered by the ESS can be reduced. The power flows in the MG when F8 is active are shown in Zoom 2 of Figure 10. Experiment 2: The ESS is initially at an SOC ≤ 20% (discharged). Interval 1 (0 s < t < 7 s): The irradiation level is 100 W/m 2 , and the PV source works at its maximum power point (MPP), providing P PV = 0.14 kW to the DC bus. That irradiation is not enough to feed all of the loads. Considering that the ESS is discharged (SOC < 20%), the MGCP transfers the maximum possible power from the AC bus (P ILC_DC = −1 kW) to the DC bus through the ILC and applies the load shedding functionality, F11. Taking into account that the available power at the DC bus (1.14 kW) is not enough to feed two loads, F11 connects only one DC load (0.6 kW). The rest of the available power is used for charging the batteries at P Bat = 0.54 kW. The power flows in the MG when F11 is active are shown in Zoom 1 of Figure 11.
At t = 8 s, the PV source works at its MPP, delivering P PV = 0.6 kW, whereas P ILC_DC = −1 kW. At this moment, the MGCP detects that the available power at the DC bus, taking into account the hysteresis level is enough to feed two of the loads. F11 connects two loads and changes the setpoint I Ch_ref of the ESS from 2.9 A to 0.78 A, where P Bat = 0.15 kW. Note that at t = 8 s, after the connection of the two loads, only |P ILC_DC | ≤ 0.75 kW is taken from the AC bus. This ensures a minimum level of power is available in the DC bus.
At t = 9.8 s, the PV source works at its MPP, delivering P PV = 1.7 kW, where P ILC_DC = −1 kW. At this moment, the MGCP detects that the available power at the DC bus to feed all the DC loads is greater than the hysteresis level (DC Load_hyst ). The MGCP applies function F10 which internally activates the flag, Sw Load = On. After that, the MGCP starts a transition from F10 to F7. F7 connects all the DC loads and changes the setpoint of the ESS to I Ch_ref = 1.82 A until the available power generation is stable at the instant t = 11.4 s, where P Bat = 0.35 kW. At t = 9.8 s, the MGCP applies function F10 during an execution cycle of the algorithm, i.e., for 73 ms. After that, function F7 is applied.  Interval 3 (39.2 s < t < 42.8 s): The irradiation decreases from 800 W/m 2 to 100 W/m 2 in 3 s. Note that at t = 40 s, the MGCP applies function F4 which internally activates the flag, Sw Load = Off. Then, the MGCP starts a transition from F4 to F11. The MGCP keeps F11 activated and the power delivered by the ESS can be reduced. The power flows in the MG when the MGCP starts a transition from F4 to F11 are shown in Zoom 2 of Figure 11. Experiment 3: The operation functions broadcasted by the MGCP to the MG elements have a communication delay which depends on the RS485 communication system. In the experimental MG, the computing time of one operation function and its delay to be broadcasted and processed by one of the elements is lower than 74 ms, as can be observed in Figure 12.

Discussion
In Figure 7, the power exchange between devices of the MG is shown. In the first part of interval 5 (20 < t < 23.7 s), the MGCP causes the battery system to be charged to its maximum capacity, PESS C10 , using the power available from the PV DGs. In the second part of interval 5 (23.7 s ≤ t < 28 s), the MGCP limits the generation from the PV DGs, setting their operation points out of the MPP (MPPT = Off ).
The ILC controls the DC bus voltage, because the AC bus works in grid connection mode. The ILC also carries out the synchronization of the AC bus with the grid, causing the current, I ILC_AC , flowing through the ILC to/from the AC bus to have low distortion and to be synchronized with the grid voltage, V Grid , when the MG exports/imports power to the grid. Figure 8 shows the waveforms of I ILC_AC and of V Grid in both situations, where a smooth transient, a good synchronization and a low distortion of I ILC_AC can be observed in the transition from exporting to importing power to/from the AC bus. A smooth transient of the DC bus voltage, V DC , is also observed in that transition at t = 35 s, which is the most sudden transient during the whole study, producing a transient undervoltage of ∆v DC = 34 V, i.e., less than 10% of the DC bus voltage. It should be considered that the power, P ILC_AC , interchanged between the ILC and the AC bus, undergoes an abrupt change from 3.8 kW to −3.2 kW (7 kW step) at t = 35 s, provoked by a fast irradiation decrease. Figure 10 shows the power exchange among the MG devices in Experiment 1. In time intervals 1 and 3, the MGCP applies the operation function F8. In this case, the demand of the DC bus is higher than the sum of the available PV power and the power import limit established by the grid operator. In that case, the MGCP requests the ESS to extract energy from the batteries to temporary feed the DC bus. This functionality reduces the cost of the electric bill.
The power flow in the MG after the application of the load shedding functionality can be observed in the zoom areas of Figure 11. No oscillations during those transients are observed.
In Experiment 3, the overall computing + transmission + processing delay of one operation function is 74 ms, where the ESS is at a distance of 2 m from the MGCP. According to the TIA/EIA-485-A standard, the maximum bandwidth at a 1.2 km distance is 100 kbps, which is much higher than the 9600 bps used in the experimental microgrid. The delay of a CAT5e twisted pair wire is less than 10 µs/km [32]. Therefore, if the distance between the ESS and the MGCP increases to 1 km, taking into account that the messages between the MGCP and the ESS run through the twisted pair four times (see the green and pink waveforms of Figure 12), the overall delay would increase to about 40 µs, i.e., about 0.05% of the total delays considered in the tests (73.6 ms). Further, the proposed algorithm is executed every second in the microgrid under study, so that the communication delays produced by moderate distances up to a few kilometers are not critical.

Conclusions
A new algorithm for the efficient management of the power converters of the hybrid AC/DC microgrid working in grid-connected mode has been presented. The algorithm is based on categorizing the devices according to their type: generation, storage, interlinking converter and load. Twelve operations functions have been defined and programmed in a Microgrid Central Processor for managing the power flow in the MG. The choice of the active operation function depends on the status of the distributed generators, the loads, the energy storage system and the energy dispatch limits between the AC and DC buses established by the grid operator. The MGCP broadcasts the set points of each converter through a RS485 communications system. The experimental and simulation results confirm that the proposed power management algorithm allows a suitable power balance among the MG devices when changes in PV generation, load demand and state of charge of the ESS occur. At any time, the power dispatch limits set by the public grid operator can be accomplished.

Conflicts of Interest:
The authors declare no conflict of interest. Reference of the charge current of the battery bank I Dis_ref

Nomenclature
Reference of the discharge current of the battery bank I PV1 , I PV2 Current supplied by the PV arrays 1 and 2 P PV_Lim Limit of the PV power generation I DCLoad Total current consumed by the DC loads S W1,2,3,4DC_Load Switches of the DC loads (loads 1 to 4) EDL Energy dispatch limit P Grid-to-MG Maximum power drawn from the grid to the hybrid AC/DC microgrid P MG-to-Grid Maximum power injected to the grid from the hybrid AC/DC microgrid P ILC AC | Grid-to-MG Maximum power drawn from the AC bus to the DC bus measured at the AC side of the ILĈ P ILC AC | MG-to-Grid Maximum power injected from the DC bus to the AC bus, measured at the AC side of the ILC P ILC Rated Rated power of the ILĈ P DC Load Maximum power consumed by the DC loads P AvailableDC_MG Power available at the DC bus of the MG DC Load_hyst Power hysteresis level used by the load shedding functionality

PESS C10
Power drawn by the ESS from the DC bus at a charge current of the battery bank equal to I C10