Real-Time Power Management for Microgrids With Dynamic Boundaries and Multiple Source Locations

The dynamic boundary concept enables more ﬂexible and efﬁcient operation of microgrids with distributed energy resources (DER) that are intermittent in nature. As the integration of renewables continues to accelerate, an adaptive power management module that enables dynamic boundary operations in microgrids with an increasing number of source locations is essential for the fast and low-cost deployment of microgrid controllers. The power management module introduced in this paper is capable of handling the increased complexity in topological variations and transitions stemming from dynamic boundaries and multiple source locations. This includes real-time operation of multiple islands with dynamic boundaries, initiation of topological transitions (merging and separation of islands), and automatic source coordination for power sharing and frequency regulation. All functions in the power management module are designed to be automatically adaptable to arbitrary microgrids with non-meshed topologies so that the deployment of the controller at new microgrid sites can be expedited with a reduced cost. The module has been implemented on NI’s CompactRIO system as an essential part of an MG controller and tested on a converter-based hardware testbed (HTB). Testing results validated the effectiveness of the algorithms under various operating conditions.


I. INTRODUCTION
To increase the efficiency and reliability of distribution network services, microgrids have been promoted in recent years as a highly controllable entity in grid-connected mode and a measure to reduce service disruptions in islanded mode, especially for critical loads. This has become practical with The associate editor coordinating the review of this manuscript and approving it for publication was Fabio Mottola . the rapid deployment of distributed energy resources (DERs) of various kinds, such as photovoltaic (PV) systems, wind turbines, backup generators, and battery energy storage systems (BESSs). Microgrids started with a fixed electric boundary and fixed point of common coupling (PCC), which establish a clear electric boundary between the utility and the microgrid. Microgrids were also designed to sustain selfsufficiency when islanded [1], [2]. This philosophy puts strict requirements on the sizing and operation planning of BESSs as they are expected to handle the intermittency in other DERs and loads that are stochastic in nature.
Microgrids with dynamic boundaries, on the other hand, enable more flexible operations by altering the electric boundaries to accommodate changes in loads, generation availability, and faults. With the increasing deployment of sectionalizing smart switches that are originally installed for fault isolation and load restoration, researchers envision more proactive control over the electric boundaries by fully utilizing the potential of these smart switches' capability of measurement, communication, and control. This enables increased utilization of renewable resources with reduced size of energy storage systems [3].
Related investigations on increasing the flexibility during load restoration and island formation have drawn attention in the research community. A flexible island forming strategy through clustering methods is proposed in [4] with consideration of the stochastic variations in loads and DERs. A load restoration strategy is given in [5] to mitigate the impact of fault events with active control over the operation modes of distributed generation resources and the determination of appropriate boundaries. Microgrid formation is further formulated as an optimization problem in [6] to maximize service to critical loads and to maintain frequency and voltage in appropriate ranges. In addition, strategies are proposed to improve system reliability and performance by taking advantage of operation modes and controls of DERs [7], [8], [9]. However, these studies are focused on optimization of the formation and economic operation of microgrids, instead of real-time islanded control of dynamic-boundary microgrids.
The restoration and control procedure proposed in [10] accommodates the concept of dynamic boundary in practical restoration and operation, but it requires heavy involvement of operator decisions and actions in the selection and implementation of boundary changes. The energy management tool developed in [11] incorporates the automated shedding of non-critical loads and PV curtailment, but the procedure is highly specific for certain operating scenarios and lacks the adaptability to dynamically changing topologies in dynamicboundary microgrids. To enable adaptive, automated dynamic boundary changes in real-time operation, a topology-adaptive controller is proposed in [2] and [12], [13], [14], [15], which maximizes the utilization of renewable energy sources by handling rapid changes with real-time (on a time scale of seconds) boundary shrinking and expansion capabilities. However, it assumed that there is only one source location accompanying the critical load section in the microgrid.
With the rapidly dropping price of DERs, a pronounced need for new DER deployment has been shown, and the reprioritization of more load sections is made possible by such developments. The need for multiple source locations, combined with the requirement for dynamic boundaries and adaptability to arbitrary non-mesh topologies, drastically increases the complexity of topological variations, the change in operation modes, and the coordination between different islands and sources. When islanded from the grid, a dynamic-boundary microgrid with multiple source locations can be operated as multiple single-source-location islands, a mix of multiple-source-location islands and singlesource-location islands, or a single merged microgrid with multiple source locations. At the same time, all islands are capable of expanding/shrinking their electric boundaries and merging/separating with/from other islands, leading to a wide variety of operation conditions and transitions. Research and development are lacking on adaptive, automated power management modules that are aimed at handling, in real-time, the increasingly complex topology changes and operation transitions arising from multiple-source-location dynamicboundary microgrids.
In addition, the coordination among DERs on power sharing becomes essential in microgrids with multiple source locations. Researchers investigated automated methods to fulfill power sharing objectives for interconnected microgrids, in both traditional AC microgrids [16], [17] and AC/DC hybrid microgrids [18], [19]. While these studies provided advanced solutions for power sharing in AC and hybrid microgrids with multiple source locations by dispatching power through advanced secondary controls over DERs or interlinking converters, they typically have dedicated designs for specific microgrids with fixed boundaries and lack the flexibility for topology variations. As the islands forming around multiple source locations expand, shrink, merge, or separate freely during islanded operation, the power sharing and frequency regulation functions should also be adaptive to such increased topological and operational variations.
To address the needs discussed above, a power management module is proposed and implemented to enable fully automated, highly adaptive, and real-time management of microgrids with dynamic boundaries and multiple source locations. For brevity, the term 'sub-MG' will be used in the following text to represent any partial islands in a microgrid, including both single-source-location islands and multiplesource-location islands. The module addresses the following challenges: a) The increased complexity of operation scenarios and transitions accompanying the topological changes in the operation of microgrids with dynamic boundaries and multiple source locations. This affects all functions in the module, including dynamic boundary, sub-MG merging/separation, and power sharing. b) The flexibility requirement on the algorithms to be automatically adaptable to arbitrary non-mesh topologies for handling wide variations in the topology in multiple-source, dynamic-boundary microgrids. This also facilitates expedited, low-cost deployment of the controller with a reduced cost at new microgrid sites with different topological configurations. c) The real-time execution requirement of the power management functions on practical hardware controllers.
Correspondingly, the power management module is equipped with the following novel features: VOLUME 10, 2022 a) Topology awareness and analysis based on linear programming, which is suitable for practical hardware implementation to support real-time, simultaneous management of dynamic boundaries of multiple sub-MGs forming around multiple source locations. b) Automatic merging and separation of the sub-MGs and adaptability to topology variations under various operation conditions and transitions. c) Automatic power sharing and secondary frequency regulation with real-time adaptability to topological variations d) Fast, low-cost deployment at new microgrid sites as a result of the built-in adaptability of the module to arbitrary non-mesh topologies.
The rest of the paper is organized as follows: Section II gives an introduction to the structure and modules of the microgrid central controller. Section III discusses in detail the structure, function blocks, and algorithms of the power management module. Section IV presents testing results on the converter-based hardware testbed (HTB), and section V concludes the paper with a summary and future work.

II. STRUCTURE OF THE FLEXIBLE MICROGRID CONTROLLER
The microgrid controllers developed at the University of Tennessee aim to facilitate fast, scalable, and low-cost deployment of microgrid solutions [20]. The control solution is hierarchically structured with a microgrid central controller (MGCC) and several local controllers (MGLC) depending on the number and location of controllable DERs. The MGCC has a comprehensive set of function modules to cover the operation of a microgrid with dynamic boundaries, including model management, topology identification, black start, power management, planned/unplanned islanding, reconnection, PV/load forecasting, energy management, relay protection, data logging, etc. Fig. 1 shows an overview of the function modules in the MGCC, where they are categorized into four groups based on their functionalities, namely communication, situational awareness, control, and auxiliary modules. The data flow between these categories is indicated by arrows of different colors. More details about the design of the central controller, the data flow, and the coordination among the function modules can be found in the [12]. A few modules related to real-time control are introduced as follows:

A. TOPOLOGY IDENTIFICATION
The flexible operation of the microgrid starts from the real-time topology awareness made possible by the Topology Identification module. It automatically updates (sub-)MG topology matrices based on the statuses of smart switches. These matrices will be fed to other real-time control modules like power management, reconnection, planned islanding, etc.

B. POWER MANAGEMENT
The power management module is designed to maintain the balance of active and reactive power by managing the dynamic boundaries and the operation of DERs. The module takes various inputs from topology identification, measurements on smart switches and DERs, and commands from the finite state machine to provide real-time, coordinated power management.

C. PLANNED ISLANDING
The Planned Islanding module separates a microgrid from grid interfaces with minimal transients. It also coordinates with the power management module to split a (sub-)MG into multiple sub-MGs when the total generation is insufficient to support the merged operation.

D. RECONNECTION
The Reconnection module resynchronizes a (sub-)MG to a grid interface through an available grid interface. It also coordinates with the power management module to merge multiple (sub-)MGs when necessary.
The MGLCs are designed to bridge the MGCC and various commercial DER installations, including PVs, BESSs, backup generators, etc. MGLCs perform local active and reactive power control, signal conversion, data acquisition, and data logging.  The controllers have been implemented on the National Instruments' CompactRIO systems (MGCC on CompactRIO 9039, MGLC on CompactRIO 9035), which are controller platforms for prototyping and testing of various engineering systems [21]. Such hardware controller platforms provide precise real-time control capabilities, come in a compact size for quick deployment, and can withstand harsh environments in the field. The compromise, however, is the limited computational resources as compared to professional purpose-built workstations. Considering the computational complexity elicited by the adaptability to arbitrary topologies, the controller algorithms should be designed with efficient algorithms to meet the real-time execution requirement. The benefit from the arbitrary topology capability, on the other hand, is significant -the controller can be deployed at new sites with less time, effort, and reduced cost, compared to traditional controllers designed for specific microgrid sites.

III. POWER MANAGEMENT MODULE
In this section, the structure and algorithms of the power management module will be introduced in detail, including the overall data flow and details about the real-time topology-adaptive load combination algorithm to accommodate multiple source locations and facilitate flexible topological variations and mode transitions.

A. STRUCTURE AND DATA/LOGIC FLOW OF THE POWER MANAGEMENT MODULE
As a core module of the microgrid controller solution, the power management module is responsible for managing the dynamic boundaries and operation of DERs to balance the active and reactive power in all (sub-)MGs. It also controls PV curtailment/release and initiates the merging/separation process of (sub-)MGs when necessary. An overview of the module is depicted in Fig. 2, where the solid boxes indicate function blocks in the power management module and the dash boxes indicate function blocks from other modules that coordinate with power management.
• The 'Topology Awareness and Analysis' block provides its downstream function blocks with real-time matrices that contain topological information about the controllable areas. In case of fault events, the block will exclude areas locked out for isolating the fault, which helps coordinate the power management with protection systems [22].
• The 'Merging Initiation' and 'Separation Initiation' blocks monitor the topological and generation/demand information to initiate merging when multiple sub-MGs share boundary switches, or separation when the generation becomes insufficient to support a merged operation. The merging and separation initiation commands are sent to the Reconnection and Planned Islanding modules, respectively, to implement the process. The Reconnection and Planned Islanding modules were originally designed to synchronize or island from the grid interface. In the latest controller updated for multiple source locations, they have been enhanced with the capability to merge multiple islanded sub-MGs or separate merged (sub-)MGs [23].
• The 'Dynamic Boundary' block chooses optimal load combinations for all controllable sub-MGs to balance their active/reactive power by controlling the smart switches and the DERs. The block is triggered by boundary change criteria detailed in section III.B.
• The 'Energy Management Coordination' block fetches recommended load (switch) combinations from the Energy Management module based on its long-term optimization plans. When the recommended load (switch) combinations meet the short-term constraints defined in power management, the coordination block overwrites the switch commands from the Dynamic Boundary block to facilitate the long-term energy management goals.
• The Power Sharing and Secondary Frequency Regulation block is introduced to the power management module to 1) keep the system frequency at 60 Hz, and 2) actively control the sharing of loads across the participating sources in a (sub-)MG. This becomes feasible because of the communication readily available between the central controller and local controllers. The block adjusts the droop settings of various sources participating in frequency regulation based on their topological locations, power capacities, and energy availabilities.
Although primary frequency control is not listed as a block in the power management module, it is implemented VOLUME 10, 2022 in frequency-responsive DERs either as built-in or in the lower-level local controllers. The power management module introduced in this paper, as part of the higher-level central controller, includes only the secondary frequency control in terms of frequency regulation, and the coordination with the primary control is accomplished among the central controller and the local controllers. More details are provided in section III.C.
These function blocks are coordinated in a logic flow shown in Fig. 3. Details of the algorithms for determining the optimal load/switch combination, power sharing and sec-ondary frequency regulation, PV curtailment, BESS SoC considerations, etc., are discussed in III.B.

B. DYNAMIC BOUNDARY ALGORITHMS FOR ARBITRARY NON-MESH TOPOLOGIES
Since the controller targets a highly flexible and low-cost microgrid controller solution, the Dynamic Boundary block in the power management module is designed to be adaptable to arbitrary non-mesh topologies. A generalized, topologyadaptive algorithm is highly desirable since: a) The controller can be quickly deployed at new microgrid sites at a lower cost than comparable site-specific designed controllers.
b) Capability to handle complex topology changes due to merging and separation of sub-MGs when there are multiple source locations. c) High adaptability in extreme operation conditions where there are topology changes due to a fault, maintenance, etc.
It should be noted that the adaptability of the power management module introduced in this paper is limited to non-mesh topologies for two reasons: 1) Most of the distribution networks are with radial topologies. Even if some of the networks have loop topological structures, they are typically operated under non-mesh topologies to avoid circulating current and power. 2) Designing the function for meshed topologies will greatly increase the complexity of the algorithm, which is unnecessary in most cases and impedes the realtime implementation in hardware controllers. For microgrids with a particular need for meshed topologies, a rule-based algorithm can be integrated into the power management as a designated add-on to operate the loop. The loop will be treated as an equivalent node with an interface to the larger adaptively controlled microgrid.
To determine possible arbitrary topologies, the power management module first generates a load combination list that covers all combinations of load sections to be energized. Assuming the total number of non-critical load sections is n, the number of combinations will be 2 n since every load section has a binary status of either picked up or shed offline. However, not all these load combinations are feasible, depending on the real-time topology of the (sub-)MG at the time of decision making. All switches that connect the load section to a source location have to be closed before the load section can be picked up. For example, in Fig. 4(a), the load combination 2-3-4-5-10 is not feasible since load section 10 requires at least load sections 2, 4, and 6 to be energized (corresponding switches to be closed). Fig. 4(b) is a possible load combination since all load sections energized have routes to access the source location 1.
While such discretion is natural to human eyes, the controller should be carefully designed to understand arbitrary topologies and rule out the infeasible topology variations efficiently considering the limited calculation resources and the requirement for real-time operation. To this end, the shortest route algorithm is implemented as the first step to establishing the mapping between switch combinations and load combinations. This sets a foundation for screening the topological variations and determining the optimal boundaries.

1) SHORTEST ROUTE ALGORITHM
The shortest route algorithm searches for paths from one location to another with linear programming techniques [24], [25]. Applying the shortest route algorithm to find the routes between source locations and load locations allows the establishment of the mapping between switch combinations and load combinations. To start with, an input topology matrix from the Topology Identification module is obtained by the power management module for real-time awareness of the controllable area and assets. The matrix is in the following format: where each row represents a smart switch between the ''from'' node and ''to'' node. Property ''Type'' and ''Status'' indicate the type of the connection (to load, BESS, PV, GEN, etc.), and the ''Status'' indicates the real-time on/off status if it is a smart switch. The algorithm translates the matrix in Table 1 into an incidence matrix as in Fig. 5, where the numbering of rows represents the nodes, and the numbering of columns represents the switches. The entries in the matrix indicate the direction of the connection in relation to the nodes, with ''1'' indicating ''from'' the node, ''-1'' indicating ''to'' the node, and ''0'' indicating no connection to the node.
To find the shortest route in sub-MG k from node i to j, it can be formulated as an optimization problem with the incidence matrix: (2) where W k is the weight vector indicating the priority of the switches (and corresponding load sections), A k is the incidence matrix of sub-MG k, x k ij = x k 1 , x k 2 , . . . , x k q is the vector consisting of the on/off status of the switches, and . . , 0 is the constraint vector for the directed path i to j. Setting i to be a source location and j to be a load section allows the algorithm to find the route between the two locations. By applying such a technique to every source and load section, a complete mapping between the switch combinations and load combinations can be established. For areas where there are multiple source locations operated as a merged (sub-)MG, the shortest route algorithm is also leveraged to find the path between the source locations. This is to find the switches and load sections on the critical path that connects the source locations. These sections will be prioritized to keep the (sub-)MGs merged for higher reliability and efficiency. For example, the MG in Fig. 6 has a critical path 1-2-4-5-13 with load sections L2, L4, and L5 on the route. When there are more than two source locations, the algorithm iterates to include them in the critical path. The resulting critical path will be treated as an equivalent node during the merged operation. The power management will maintain the merged operation until the generation available drops to a level where it is insufficient to support all load sections on the path (L2, L4, and L5). In that case, a separation command will be sent to the Planned Islanding function to initiate the separation process, after which the original (sub-)MG will be operated as two separate sub-MGs.

2) GENERATING LOAD AND SWITCH COMBINATION LIST
After applying the shortest route algorithm to all load sections and sources, each load section is designated a specific VOLUME 10, 2022 route that connects it to a source location or an equivalent node representing a critical path. With such routes available, upstream switches and load sections can be identified for a target load section. The switch combination and load combination list can then be screened to ensure the effective connection of all selected load sections to at least one of the source locations. These load combinations, together with load data (real-time measurement for energized sections and load forecasting from the Energy Management module for deenergized ones), provide the dynamic boundary block with a list of boundary options with estimated active and reactive power demands. The power management further filters out boundary options with active power imbalance larger than a predefined threshold (detailed in the following content), or an unacceptable level of reactive power violating the BESS apparent power thresholds. The remaining boundary options after such a screening process are added to the boundary change candidate list.

3) BOUNDARY CHANGE TRIGGER AND DETERMINATION
To reduce unnecessary disturbances to the load sections, the boundary change is only triggered when certain criteria are met. In the controller, the trigger is set to be the active power mismatch between the demands and generation that is being buffered by the BESSs. Violation of the following inequivalent constraints will trigger the boundary change: where P k BESSdsc,i and P k BESSchg,i are the discharging and charging power thresholds for BESS i in (sub-)MG k. P k Load,p and P k Gen,q are load sections and distributed generations in the (sub-)MG. This criterion is being applied to all (sub-)MGs, and it requires real-time power measurements from all BESSs. In cases where there is no DER participating in secondary frequency regulation, the criterion can be further simplified to a formulation that requires only the measurement of frequency. For (sub-)MG k, the boundary change is triggered when the following is violated: where the notations used are the same as (3), and R k i is the slope reflecting the frequency droop sensitivity for DER i in (sub-)MG k. Reasons for why this formulation is not recommended for (sub-)MGs where there are secondary frequency regulations include: 1) the frequency measurement error will have a large impact on the accuracy of the calculation due to the smaller frequency deviation achieved by the secondary frequency regulation; 2) the MGCC will have to collect information about the real-time droop characteristics from all generation sources participating in the secondary frequency regulation.
Once a boundary change is triggered, the controller will choose the switch (load) combination with minimum active power mismatch and no reactive power violations in the feasible boundary candidate list. In cases where the BESSs in the (sub-)MG have extreme SoCs, either near fully charged or fully discharged, the dynamic boundary block will prioritize load combinations that assist in the recovering of SoC to a normal range.
Other considerations the power management takes when determining the boundary include the coordination with the Energy Management module and microgrid protection systems. When the boundary candidate recommended by the Energy Management module falls within the feasible boundary change list, the power management module will prioritize the one recommended to facilitate the long-term goal of the Energy Management module. The adopted boundary will be maintained until it violates the short-term constraint, equation (3), because of variations in generation and demand during operation.
The coordination with microgrid protection systems, on the other hand, is accomplished through the Topology Identification module. Once the microgrid protection system detects a fault, it will send a lockout signal to the Topology Identification. The Topology Identification module will automatically exclude the switches being locked out due to the fault. With the updated real-time topology matrices, the power management will temporarily withhold its control over the affected switches to prioritize the actions from the protection system until the fault is removed.

C. POWER SHARING AND SECONDARY FREQUENCY REGULATION
Although the majority of the power imbalance is significantly reduced by changing the (sub-)MG boundaries, a minor power mismatch may still remain between the generation and demand. Such mismatch will create a frequency deviation from 60 Hz because of the droop characteristics of the primary frequency response implemented in the local controllers or as built-in functions in the internal control system of the  DERs. Secondary frequency regulation function is necessary to bring the system frequency back to 60 Hz by coordinating the primary frequency response characteristics in frequencyresponsive DERs. It is noted that the power sharing and secondary frequency response function in this power management module inherits the built-in adaptability and flexibility to the variations in topology and operating conditions. Since the BESSs are the frequency regulating sources, in this case, the secondary frequency regulation signals are distributed to them to move their droop curves up/down in a coordinated manner. This enables not only the frequency regulation but also active control of load sharing among the participating BESSs at the same time. Fig. 7 shows a group of power-frequency droop curves that can be used in a frequency responding BESS i in sub-MG k. They can be described as where f k is the frequency of (sub-)MG k, f 0 the nominal frequency (60 Hz), R k i the droop slope, and P k ref ,i the power reference point of BESS i in (sub-)MG k. Suppose the curve crossing P k ref ,i in Fig. 7 is the original power reference, moving it up to P k ref ,i or down to P k ref ,i will increase or decrease the load sharing of the BESS, respectively. In a (sub-)MG, the following equations and constraints shall be satisfied at all times: where f k , R k i , P k i , P k ref ,i , P k BESSdsc,i , P k BESSchg,i are nominal frequency of sub-MG k, the droop slope, power output, power reference point, discharging and charging power limit of BESS i in sub-MG k; P k Load,p and P k Gen,q represent the power demand of load sections and generation of non-frequencyresponsive DERs in sub-MG k. To dispatch the frequencyresponsive BESSs' loading based on their ratings, the power reference points of the frequency responding BESSs can be determined by minimizing the following objective function through simple linear optimization: where P k max,i equals either P k BESSdsc,i when demand exceeds generation, or P k BESSchg,i vice versa. The power management in MGCC periodically executes the power sharing and secondary frequency regulation block and distributes the updated droop curve parameters to MGLCs. As a result, the frequency responding BESSs will share the loading in proportion to VOLUME 10, 2022 their power ratings, as long as their outputs are within rated capacities, and they collectively compensate the total power mismatch required to maintain the (sub-)MG frequency at close to 60 Hz.

D. EXTREME POWER IMBALANCE CONDITIONS
In addition to the power sharing and secondary frequency regulation functions above, the power management module has built-in functions to handle extreme conditions, including PV curtailment and release, separation initiation, and SOC emergency control.
When all sub-MGs have expanded to their maximum boundaries and all mergeable sub-MGs have been merged, the microgrid will no longer be able to expand its boundaries to accommodate further increase in irradiance. If not properly controlled, the overcurrent protection in BESSs may be triggered as a built-in protection mechanism to avoid asset damage. Hence, the power management module will activate the PV curtailment function to temporarily reduce the charging power and prevent the BESSs from tripping themselves in such extreme conditions. The amount of PV generation curtailed is: where C k PV is the amount of curtailment in percentage for PV generation units in sub-MG k, P k PV −f is the full PV generation potential if not curtailed in sub-MG k, P k Load,p and P k Gen,q are the total load and total generation (except PV) in sub-MG k. The reason why the PV curtailment is designed to bring the BESS output to zero, instead of the maximum allowable BESS charging power, is that PV curtailment often happens when the solar generation ramps up rather quickly, and thus, the BESS should have enough safety margin under such extreme conditions. The power management, being a short-term balancing module, prioritizes the safe operation of the equipment and prevents BESS and other resources from tripping themselves under extreme conditions. Under normal operation, though, the power management will take recommendations from the Energy Management module to facilitate long-term goals, including desirable BESS SoCs. The curtailment will be released when the PV generation decreases to an acceptable level for the BESSs.
On the contrary, when the PV generation becomes too low to support a merged island on its minimum boundary, the power management will initiate the separation process to shed more load sections (those on the critical route that connects multiple source locations). The separation-related information about the relevant source locations, source types, and the critical routes will be shared with the Planned Islanding module to complete the separation process. Details about the separation process can be found in the paper [23].

A. CONVERTER-BASED HARDWARE TESTBED (HTB)
The MGCC and MGLCs are implemented on NI's real-time controller system, CompactRIO. Debugging and validation of the controllers are conducted on a converter-based hardware testbed (HTB). The HTB is comprised of a number of converters that are used to emulate various components, including generators, BESSs, PV systems, and loads ( Fig. 8(a)). All converters share a common DC link, and the connection on their AC side can be configured as needed to represent the power network the HTB attempts to emulate (Fig. 8(b)). The power flow in the HTB circulates through the DC link, generation emulating converters, AC link, load emulating converters, and back to the DC link. A picture of the HTB cabinets and the structure of the HTB testing platform are shown in Fig. 9.
By design, the HTB provides real current, voltage, and power in the hardware testing setup to mimic a real-world operation environment including measurement errors and physical communication networks. More details can be found in [26], [27], and [28]. This opens opportunities for not only validation of control functions, but also the measurement and communication systems. The testing results obtained in the testing are collected with hardware current/voltage sensors placed on terminals on the converters that emulate the generators, BESSs, PV, and loads. The data are transferred to the   microgrid controllers where they are logged and stored for extraction and analysis. Oscilloscope probes are also placed on critical points on the HTB to monitor and log the current and voltage waveforms.
The testing microgrid emulated on the HTB is a modified model based on the EPB microgrid at Chattanooga Airport, Tennessee, USA, as shown in Fig. 10. The main modification is the addition of a second source location to mimic potential multiple source developments, which requires the microgrid controllers to handle multiple sub-MGs and the associated topological variations/operations. The power base of the testing microgrid is 1 MW. The voltage base is 12.47 kV on the medium voltage side and 480 V on the low voltage side. Source location 1 in Fig. 10 is the existing source location in the EPB microgrid, where there is a BESS system of 510 kWh/560 kW, a PV farm of 2 MW, and a backup generator of 423 kW. The source location 2 has initially been a grid interface and is now modified to be the second source location with another BESS system of 510 kWh/560 kW. Load sections L1 and L6 are critical load sections with a VOLUME 10, 2022 Note that, while the generation sources in this testing setup are consistent with those in the field of the Chattanooga Airport microgrid, the topology and the PV generation profile used in this testing have been altered to create as many operating scenario variations as possible within the capability of the converter-based hardware testbed. The boundary change trigger thresholds based on BESS charging and discharging power, as defined in equation (3), are also intentionally set to a lower level (±200 kW) compared to the capacity to create operation scenarios of various boundary changes and operation transitions. These modifications enable comprehensive activation and validation of the various functions of the power management module. The actual design of the microgrid in the field, however, is an overarching effort that covers all subsystems, including recloser placement, resource sizing, grounding system, and protection system design, to achieve a balance between cost and reliability. We have had publications and are preparing a dedicated manuscript regarding the design topic to address specific concerns and opportunities in microgrid design arising from multiple-source-location dynamic-boundary microgrids [15], [20].
A graphical user interface has been developed to show the real-time status and measurement in the converter-based HTB on a desktop for monitoring and operation purposes, as shown in Fig. 11. The visualization presents load sections, lines, switches, and sources with blocks and bars that change their colors to indicate their operation status. There are also LED indicators and buttons for the status and initiation/termination of function modules in the MGCC and MGLCs. At the bottom of the visualization are scopes that plot real-time voltage, power, and frequency measurements collected from the sensors in the converter-based HTB. The testing results are recorded by the data logging module in the controllers, and oscilloscope probes are connected to the converters for the real voltage and current waveforms in the testing platform.

B. TESTING SCENARIOS AND RESULTS
To cover various operating conditions in the field, the test case was designed to have the PV generation ramp up and down to trigger actions from the power management module. The test case started with two separate sub-MGs and proceeded through boundary expansion, merging, PV curtailment and release, boundary shrinking, and separation. Fig. 12(a) shows a simplified representation of the initial topology of the MG with critical loads at locations 1 and 6. Critical load section L1 is accompanied by BESS-2 at location 12, and critical load section L6 is accompanied by BESS-1 at location 9, PV at location 10, and backup generator at location 11.
The designed testing scenario was driven by variations in the PV generation, which can be divided into a few stages as shown in Fig. 13.

1) STAGE 1: OPERATION OF SEPARATE SUB-MGs -BOUNDARY EXPANSION
After a black start, the MG is operated as two sub-MGs with minimum boundaries, where only the critical load L1 in sub-MG 2 and critical load L6 in sub-MG 1 are served. As the PV generation in sub-MG 1 ramps up, the BESS charging power equation (3) reaches 210 kW at t = 43 s (Fig. 13), which is larger than the boundary change trigger threshold P 1 BESSchg,1 of 200 kW. The power management takes the real-time topology matrices and determines the optimal boundary to include load sections L4 and L5 to lower the power imbalance. Hence, the commands are issued through communication to close switches S6 and S5 to expand the boundary of sub-MG 1. The PV generation continues to climb quickly and pushes more power into BESS 1. At t = 67 s, the total BESS charging power reaches 205 kW, which is larger than P 1 BESSchg,i = 200kW . It triggers another round of boundary change that leads to the pickup of load sections L3 and L7 at t = 69 s. L2 is picked up at t = 98 s as a response to the BESS charging power trigger threshold being crossed at t = 96 s. Fig. 14 shows the voltage and current waveforms captured by the oscilloscope during the boundary expansion of sub-MG 1. The green waveform is the current of the BESS 1, and the blue is the current of the PV. Each time the PV power ramps up, the PV current increases and pushes more power into the BESS1. When the power intake of BESS1 reaches the threshold, the power management module issues commands to pick up additional load sections in sub-MG 1 in order to reduce the power imbalance absorbed by the BESS, as indicated by the reduced BESS current (the green waveform) magnitude.

2) STAGE 2: MERGING
As a result of the expansion of sub-MG 1, the boundaries of the two sub-MGs reach each other at smart switch S1. The power management module detects the bordering boundaries and issues commands to the Reconnection module at t = 103 s to initiate the merging process on S1. The Reconnection module actively adjusts the frequency and voltage of the two sub-MGs to synchronize the voltages on the two sides of S1 until it can be closed with a minimal angle and magnitude difference. This can be observed by the weaving frequency curves of the two sub-MGs starting from t = 103 s, which indicates that the sub-MGs are adjusting their frequencies to synchronize the two islands. The merging process was completed at t = 139 s (36 s elapsed time).

3) STAGE 3: OPERATION OF MERGED SUB-MGs -PV CURTAILMENT AND RELEASE
The merged MG is operated as a single MG, and the topology is handled as discussed in section III.B.2. After the merging, the critical path connecting the source locations of the two sub-MGs, 1-2-3-4-6, will be treated as an equivalent node, of which the concept was explained in Fig. 6. As the PV continues to increase and the BESS power intake exceeds the total charging power threshold P merged BESSchg,i = 400kW at t = 163 s, the MGCC curtails the PV output at t = 165 s since the microgrid has reached the maximum electric boundary available. The percentage of curtailment is calculated with = 38.33%. The PV curtailment persisted for 12 seconds, as indicated by the two green dashed lines in the PV active power output plot in Fig. 13. The dip in PV power output at t = 176 s (the second green dashed line in the PV power plot) is a result of a decrease in PV irradiance. The PV active power output, however, ramps up immediately after the dip, at t = 177 s. This is the power management releasing the PV curtailment (C merged PV = 0%) because the reduced irradiance led to an acceptable level of PV generation for the BESSs (total charging power of 350 kW, less than the total threshold P merged BESSchg,i = 400kW ). The power management prioritizes full utilization of PV generation whenever it is safe for the operation of other microgrid assets. Fig. 15, with the explanatory labels and texts, shows the voltage and current waveforms captured during the PV curtailment and release process described above.

4) STAGE 4: OPERATION OF MERGED SUB-MGs -BOUNDARY SHRINKING
After the release of PV curtailment at t = 177 s, the PV generation continues the reduction to enable the testing of boundary shrinking and island separation. At t = 215 s the total BESS power output in the island, 505 kW, exceeds the discharging threshold P merged BESSdsc,i = 400kW . Since the two sub-MGs are operated as a merged island, the MGCC prioritizes the service to load sections L2, L3, and L4 on the critical path 1-2-3-4-6. To reduce the BESS active power output, the power management shrinks the boundary by shedding load sections outside the critical path, L5 and L7 as indicated by the red dashed lines at t = 217 s in Fig. 13.

5) STAGE 5: SEPARATION INITIATION
To mimic scenarios where the DER generation falls to a level that cannot support the minimum load sections required to sustain the critical path (in this case, L2, L3, L4), the backup generator was manually shut off after the PV generation fell to zero. This created an insufficiency in the generation, and the total BESS discharging power (490 kW) exceeded the merged island's boundary change trigger threshold P merged BESSdsc,i = 400 kW . The separation initiation block in the power management module hence sends the separation initiation command, along with relevant energy source information to the Planned Islanding module for further separation actions [23].
The maximum frequency deviation during the whole test happened at t = 77.8 s with f = 60.30 Hz when the two sub-MGs were operated separately, and the system frequency was more sensitive to disturbances because of smaller generation source capacities. The maximum frequency deviation is determined by the boundary change trigger threshold and the droop slopes, which can be adjusted to meet the conditions and requirements of specific sources and application sites.
It should be noted that the power sharing and frequency regulation block actively controls the sharing of power among participating DERs and regulates the frequency of the sub-MGs (or the merged MG) throughout the testing at a predefined time interval (every two seconds in the test cases). While in operation as two separate sub-MGs, the power sharing and frequency regulation block recognizes two individual groups of resources and regulates the frequency and power sharing in each island. When the sub-MGs are merged as one island, the power sharing and frequency regulation block regroups the frequency-responsive resources and executes regulations on all resources available in the merged MG.
Take the merged operation for example, as shown in Fig. 16. The PV generation dropped three times consecutively, at t = 187 s, t = 195 s, and t = 204 s, with 0.2 p.u. (200 kW) in magnitude each time. Since the two source locations are merged as one island, the impact of such a decrease is not as significant because the power deficiency was shared by the two BESSs, and thus no boundary change was triggered. Each 0.2 p.u. (200 kW) of power change led to a dip in frequency of ∼0.15 Hz, but the frequency was quickly brought back to 60 Hz as the power sharing and secondary frequency regulation block issued commands to MGLCs to adjust the droop curves in the BESS systems. By adjusting the droop curves, the block also controlled the load sharing among the two BESSs to be the same since they have the same power ratings.
In the HTB testing, the controller reacted as desired to the PV generation change that triggered a comprehensive set of operating conditions and transitions, including the boundary expansion, merging of sub-MGs, PV curtailment, PV curtailment release, boundary shrinking, and separation of sub-MGs. The controller maintained its situational awareness by automatically monitoring the topology of all sub-MGs. In addition to the automatic management of electric boundaries for multiple sub-MGs (or merged sub-MGs), the controller also automatically coordinated DERs in every sub-MG (merged sub-MGs) to regulate the island frequency. Instead of being hardcoded for a specific microgrid topology, the controller is designed to automatically adapt to arbitrary non-mesh topologies in real-time operations, which also makes the deployment of the controller at new microgrid sites fast and efficient with a lower cost due to the enhanced flexibility.

V. CONCLUSION
The power management module in this paper handles complex topology variations and operation scenarios associated with dynamic boundaries and multiple source locations. It automatically adapts to arbitrary non-mesh topologies so that the deployment process at new microgrid sites can be accelerated with reduced effort and cost. The built-in flexibility in algorithms allows a high degree of topological awareness, simultaneous operation of multiple sub-MGs, and automatic initiation of merging/separation of (sub-)MGs under varying operation conditions and topological changes. The module manages the dynamic boundaries for all (sub-)MGs based on the real-time active and reactive power generation/demand within the islands. In addition, a power sharing and secondary frequency regulation block has been integrated into the module. It adaptively groups and coordinates DERs based on the real-time topology and minimizes the system frequency deviations for each (sub-)MG. At the same time, it proactively distributes the loading across the participating sources within the corresponding (sub-)MGs in accordance with their ratings.
The controller described in this paper is being deployed at a community microgrid operated by EPB near the Chattanooga, Tennessee airport [20]. It continues to improve and cover more emerging needs from the field application, such as load imbalance monitoring and control, proactive reactive power balancing through switching capacitor banks, and coordination with utility SCADA/DMS and existing protection schemes. His research interests include power converter in grid applications, medium voltage multilevel converters, converter paralleling, and microgrids. VOLUME 10, 2022