{'fraction_non_alphanumeric': 0.026549021152558396, 'fraction_numerical': 0.009611218340095325, 'mean_word_length': 4.951242381622128, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Performance Evaluation of Distributed Energy Resource Management Algorithm in Large Distribution Networks

This paper presents performance evaluation of hierarchical optimization and control for distributed energy resource management system (DERMS) in large distribution networks via an advanced hardware-in-the-loop (HIL) platform. The HIL platform provides realistic testing in a laboratory environment, including the accurate modeling of a full-scale distribution system of 11,000 nodes, the DERMS software controller, and 90 power hardware photovoltaics (PVs) and battery inverters. The applied DERMS algorithm is designed based on a realtime optimal power flow algorithm and implemented with acceleration design that performs fast dispatch of simulated PVs and real physical hardware DER devices every 4 seconds.


INTRODUCTION Distributed energy resource management system (DERMS)
is an emerging technology that integrates distributed energy resources (DERs) into the distribution grids at the feeder level in a coordinated manner, benefiting both utilities and customers [1]. DERMS features the core capabilities of DERs aggregation for grid services, the translation of different protocols, the simplification of DERs as single entity, and the optimization of individual and groups of DERs to save costs, reduce wear, and optimize asset values [2]. Thus, DERMS have been extensively researched and developed today, with utilities having begun to deploy DERMS technology to manage DERs, including Arizona Public Service's Solar Partner program [3], Austin Energy's Sustainable and Holistic Integration of Energy Storage and Solar Photovoltaics project [4], and Holy Cross Energy's high-impact DERMS project [5]. Energy management system (EMS) vendors also develop commercial products for DER management, such as utility DERMS from Schneider [6] and AutoGrid DERMS for DER harness to enhance grid operations [7]. To move the DERMS technology forward, research and evaluations are needed to ensure that the DERMS work as expected before field deployment to de-risk new technology integration.
Numerical simulation is the first step to a proof of concept and to evaluate the performance of DERMS in an ideal environment and scenarios. Hardware-in-the-loop (HIL) testing is the next step and a more effective method for testing DERMS because the DERMS controller can dynamically interact with the simulated distribution system and with hardware DER inverters with real-time measurements and dispatched power set points as if the DERMS controller were interacting with real-world systems in the field.
A generic test bed for evaluating coordinated control among advanced distribution management systems, DERMS, DERs, and legacy utility equipment controllers was developed in [8] to provide a realistic laboratory testing environment. This work builds on the generic test bed with a focus on evaluating the voltage regulation performance in large distribution networks and showcasing its ability to simulate an advanced DERMS algorithm's interaction with a simulated power system of a high penetration level of solar photovoltaics (PV) and a large amount of hardware DER inverters.
The main contributions of this paper are summarized as follows: 1) we implement a scalable and fast optimal power flow (OPF) algorithm integrated with a state estimation solver for DERMS to control a large distribution network of high DER penetration with fast DERs dispatching every 4 seconds; 2) we perform power-hardware-in-the-loop (PHIL) testing of 90 hardware DER inverters through standard communication protocols, which is a first of its kind with the largest number of DER devices and points of common coupling (PCCs) to demonstrate real responses of hardware inverters and the stability and dynamics of the DERMS controller; and 3) we develop an HIL framework integrating distribution system model, DERMS controller and hardware DER inverters to efficiently and effectively evaluate the DERMS algorithm in a realistic laboratory environment, which supports early stage validation and provides development references for researchers and engineers working in DERMS area.
The rest of this paper is organized as follows. Section II describes the voltage regulation problem and the OPF algorithm to be implemented. Section III presents the four main components of the HIL setup. Section IV details the key implementation aspects, Section V shows the experiment results, and Section VI concludes this work.

A. Problem Formulation
We consider a radial power distribution system of nodes and the following voltage regulation optimal power flow (OPF) problem at time : where is a convex cost function of net active and reactive power injection within feasible operational range , is a linearized power flow model based on LinDistFlow model [9]  with iteration index and a constant step size . Here, and are the dual vectors associated with the left-hand and right-hand sides of the inequality constraints, respectively, and and are the projection operators upon the overall node feasible set under Cartesian product and the nonnegative orthant. By properly choosing the step size , the gradient dynamics (2) converges asymptotically to the optimal point of the OPF problem (1) [10].
The computational bottleneck of the gradient algorithm (2) lies in the coupling part of , whose complexity increases extensively as larger networks are considered. This makes real-time large system OPF solving difficult. To improve the computational efficiency, we apply the hierarchical distributed algorithm developed in [10]. We first divide the distribution system into subnetworks featuring subtree topology, indexed by , and then explore the structure of the system matrix to simplify the computation of the coupling terms for certain node within subtree as: Compared with the left-hand side of Eq. (3), the second term on the right-hand side of the equation concerning neighboring subtrees reduces and recycles a great amount of computation and speed up the overall computation without losing optimality [10], allowing real-time implementation of the gradient dynamics (2) in large distribution networks.

III. DESCRIPTION OF THE HIL SETUP
To validate the proposed algorithm in a more realistic testing environment, a HIL platform with real DER hardware is developed to evaluate the responses of distributed control algorithms with real-time measurements and hardware DERs. The HIL platform consists of four major components: the co-simulation platform, the DERMS algorithm, the communication interface, and PHIL as seen from Fig. 1. Specifically, Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS) [11] is used to co-simulate the distribution system partially in OpenDSS and partially in OPAL-RT. The DERMS implements the proposed algorithm (2)-(3) including a network controller that monitors system voltages and generates control signals for local controllers to decide power setpoints for loads and PVs. The PHIL is a key part of this project, with the goal of evaluating the stability and performance of the DERMS controller dispatching a large amount of real hardware inverters. The communications interface is a gateway for data exchange between the software DERMS controller and the hardware DER inverters. All four main components are integrated through HELICS framework.

A. Co-Simulation Platform
As shown in Fig. 2, the distribution network is constructed by connecting an IEEE 8,500-node test feeder and a modified Electric Power Research Institute (EPRI) Ckt7 test feeder at the substation. The primary side of the feeder is modeled in detail, whereas all the loads/PVs on the secondary side are lumped into their corresponding secondary distribution transformers, resulting in a 4,521-node three-phase system with 538 controllable nodes and a peak load of 11.58 MW.
We co-simulate the power flow of the entire network in two parts. The first part covering the majority of the network and 532 controllable nodes (marked by red dots in Fig. 2) is simulated in OpenDSS. The second part (marked by green dots in Fig. 2), being a branch connected to the first part of the network and containing 6 nodes equipped with hardware, is simulated in a digital real-time simulator OPAL-RT and will be seen as one equivalent node at PCC to OpenDSS. Particularly, in OPAL-RT, the power flow of the branch is modeled using eMEGASIM, an electromagnetic transient (EMT) simulator. The root node of the branch is modeled by a controlled voltage source, whose voltage magnitude and phase angle come from OpenDSS in real time, and whose source impedance is calculated based on short-circuit impedance at the branch PCC in OpenDSS [12]. The measured power at the branch head is sent back to OpenDSS as a dynamic load, thus closing the co-simulation loop. Apart from the real-time simulation of the power system model, OPAL-RT is also used to interface with power hardware DER inverters through analog inputs/outputs and replicate the hardware devices dynamics in real time. We use yearly load with hourly resolution based on the EPRI Loadshape_Ckt5 residential load data, and create the PV profiles with 1-min resolution using synthetic and representative data [13]. We apply a quasi-steady-state time-series simulation in OpenDSS with a simulation time step of 4 s and an EMT real-time simulation in OPAL-RT with a simulation time step of 100 μs. B. DERMS Algorithm DERMS implements the hierarchical distributed OPF solver introduced in (2)-(3) to solve the optimal voltage regulation problem (1), integrated with a state estimation solver [14] that provides an accurate and fast system voltage estimation based on limited voltage measurement sensors. To this end, we first divide the distribution network into four big non-overlapping subtree areas containing and the remaining reduced network. In the test, the cost functions are uniformly set to to penalize the deviation of power input from the initial values and , are box constraints, and and are uniformly set to 0.96 p.u. and 1.036 p.u., respectively. The simulation results in [10] show that, compared with centrally coordinated implementation (2), this hierarchical implementation reduces the computational time for one iteration from about 4 s to 1 s under similar setups: a four-time acceleration without losing optimality. This 1 s-periteration speed of OPF solver, together with SE solver that takes about 2 s for every scenario, makes fast online implementation of such optimization-based voltage regulation possible.

C. DER Assets and PHIL
PHIL is used to integrate the actual DER inverter hardware with the DERMS controller. Specifically, the DERMS dispatches the power set points to the hardware inverters, and the test bed enables measuring and replicating the actual responses and feeding the measurements back to the DERMS control. There are 90 DER inverters installed at six DER racks, with 15 inverters connected at each DER rack. Each rack represents a PCC connected at a simulated node in the OPAL-RT branch. Each rack has twelve 320 W SunPower PV microinverters that are grouped together. Rack #1-4 each has one 3kVA SMA PV inverter, one 5kVA Fronius PV inverter, and one LG battery with a 5kVA SolarEdge battery inverter. Rack #5 has two 3kVA SMA PV inverters and one Tesla battery with a 5kVA SolarEdge battery inverter, and rack #6 has one 5kVA SMA PV inverter, one 3.8kVA Fronius PV inverter and one LG battery with a 5kVA SolarEdge battery inverter. Two PV emulators with multiple modules are used to power the DC side of the SMA and Fronius PV inverters, and each module follows a V-I curve to emulate the operation of maximum power point tracking of a solar panel. For the PV microinverters, the DC side is powered by a tuneable DC power supply. All the hardware inverters are configured to work in PQ dispatch mode and communicate with DERMS.
Each DER rack is interfaced with the branch simulated in OPAL-RT through a grid simulator, which features powerelectronics-based power supply and independent three-phase control. This allows two grid simulators to support all the six single-phase PCCs. The simulated voltages in OPAL-RT are scaled down and sent out through analog outputs to the grid simulators. These scaled voltages are then reconstructed by grid simulators to physical voltages (240 V) and fed to the hardware inverters. At each PCC, the inverter outputs the desired amount of active and reactive power, and the terminal voltage and the lumped current are measured by a potential transformer (PT) and current transformer (CT), respectively, and sent back to OPAL-RT via analog inputs. In OPAL-RT, the voltage and current are scaled up to represent the actual measured voltage and current at the PCC. Finally, the calculated active and reactive powers are scaled up to the simulated capacity and fed to the controlled-current source to close the PHIL loop [15].

D. Communications Interface
Last but not least, a communication interface is essential in HELICS to interact between the DERMS controller and the hardware inverters. Among the 90 DER inverters, SunPower PV microinverters communicate with the external controllers via Secure Shell protocol, and the rest inverters, including SMA, Fronius, and SolarEdge, communicate via ModBus protocol. For those inverters using ModBus protocol, the computer is defined as the ModBus master, and inverters are defined as ModBus slaves. Based on the pre-testing, PV microinverters in four racks respond much slower than the other inverters. To dispatch all inverters from a central computer and allow for enough waiting time for all inverters, two time resolutions are used: 120 s for 48 PV microinverters and 10 s for 42 inverters (24 PV microinverters, and 18 SMA, Fronius and SolarEdge inverters in six racks). Note that 120 s and 10 s are the time resolutions that allow the inverters to be dispatched and receive feedback, achieving real-time operation of the communication interface. Fig. 3 illustrates the communication interface. The first three steps define the interface functions, the Internet Protocol (IP) addresses, and the settings of all the inverters and related actions. The next two run actions, i.e., run ModBus_fast (10 s) and run ModBus_slow (120 s), interact with the inverters. In the run action, the active and reactive power references for each inverter are passed from the DERMS to the communication agent. The communication agent then calls the communication interface functions, reaches each hardware inverter through the IP address of the inverter, writes the registers for the active and reactive power references, and reads the registers for the active and reactive power measurements as well as the state of charge (SOC) of the battery inverters.

IV. IMPLEMENTATION OF THE INTEGRATED PLATFORM
In this platform, HELICS [11] is the key tool that integrates all the hardware and software pieces together, allocates the execution time of each piece, and synchronizes the execution and the data transfer among them. Fig. 4 shows the schematic diagram of the agents in HELICS and the interactions between HELICS and the other hardware setup. Five agents are developed in the HELICS framework: the OPAL agent, the OpenDSS agent, the DERMS agent, the Locals agent, and the Communication agent. The execution time step for each agent is 0.1 s for the OPAL agent, 4 s for the OpenDSS agent, 4 s for the DERMS and Locals agents, and 10 s and 120 s for the Communication agent.

A. Data Exchange
All agents are value federates, and the values are transferred as JSON strings. Data exchange inside HELICS is performed by publishing and subscription actions, and data exchange between agents in HELICS and OPAL-RT is carried out based on a mapping dictionary that defines the variable name for each data exchange path. Note that the communications between the HELICS computer and the OPAL-RT is set up through User Datagram Protocol (UDP), with predefined Save restuls port number and address, and the OPAL agent calls the UDP socket function for communications and defines the data encoding and decoding for data transfer.

B. Agents Operation
As detailed in [15], the OpenDSS agent is the time flag that defines the starting time of the HELICS simulation and the execution of the OpenDSS agent, and it continuously runs at the next intervals; the rest of the agents start at the same starting time stamp as the OpenDSS agent and repeat with their own execution time intervals. Because agents are federates running in series, data exchange action between agents are slightly shifted in each agent, with minimal waiting time from the start of the execution. To guarantee real-time simulation, each agent needs to complete the computation within the defined execution time. This is achieved through observing the operation process in the log files, counting the time needed for each execution, tuning the execution times, and optimizing the code to achieve real time in each agent and the overall real-time operation of HELICS.
The OpenDSS agent integrates the distribution system to run power flow by calling the OpenDSS simulator, provides the feedback measurements for the DERMS agent (voltages and measured power of loads) and Locals agent (measured power of PV), receives the optimal dispatched power references from the Locals Agent to apply to all the simulated DERs, and runs the co-simulation with OPAL-RT.
The DERMS agent is the central controller, and it includes state estimation for voltage reference prediction and the network controller. State estimation receives voltage measurement from 3% of all nodes and pseudo measurements from all loads from the OpenDSS agent and the OPAL-RT agent, runs the algorithm, and predicts the voltage reference for the network controller. In the network controller, dual variables of all controllable nodes are calculated according to the estimated voltages from the state estimation.
The local agent receives measurements from multiple agents (dual variables from the DERMS agent, power measurements of DERs from the OpenDSS agent and the OPAL-RT agent, and the state of charge of six battery inverters from the communication agent) and calculates and sends the optimal power references to the simulated DERs in OpenDSS and hardware DER inverters via the Communication agent.

C. PHIL Integration and Integrated Test
The simulated DER capacities for the PCCs with hardware are 31.3 kVA, 40 kVA, 20.8 kVA, 45 kVA, 50 kVA, and 36 kVA, which are larger than the actual capacities of the hardware inverters connected at each PCC; thus, the active and reactive power references of the PV inverters for each PCC are scaled down according to the total capacity of the connected hardware PV inverters and shared proportionally among the PV inverters at each PCC. The active power reference for the battery inverter at each PCC is also scaled down at the same rate as the PV inverters because the lumped power at each PCC will be scaled up with a rate of the reciprocal of the scaled-down rate. At the OPAL-RT side, the active and reactive power at each PCC is filtered with a low-pass filter and then scaled up to the simulated capacity.
An integration test is then performed to have all the elements running together. Special caution needs to be taken for startup and shutdown of the hardware inverters and other supporting equipment to avoid any harmful transients or undesired response from the inverters (e.g., a time-out error). Reference [15] outlines the safety measures during startup and shutdown as well as the operation procedures to have all the elements run smoothly and safely with the stable power system model and DERMS control, hardware inverters and supporting equipment.

V. EXPERIMENTAL RESULTS
This section presents the laboratory experimental results that demonstrate the voltage regulation performance of the hierarchical DERMS algorithms dispatching 532 simulated PV inverters in OpenDSS and 90 hardware DER inverters connected at 6 PCCs. A 2-hour window from 11:00 to 13:00 is selected with 1) smooth solar irradiance in the first hour and 2) fast-changing solar intermittence in the second hour. This serves as a representative scenario to evaluate the DERMS performance under different solar irradiance. Baseline and Control Setup: For comparison, the baseline scenario without DERMS control (PV working in unity power factor) is simulated; and the minimal, average, and maximal of all the voltage measurements are presented in Fig. 5 (a). Note that the dynamics exhibited in the voltage measurements are caused by PV fluctuations. The results show that the highest voltage is greater than the safe operation limit (1.05 p.u.). For the case with DERMS control, the upper and lower limits for the voltage set points are selected as 0.96 p.u. and 1.036 p.u., respectively. The voltage measurements with DERMS control are presented in Fig. 5 (b), which shows that all the voltages are regulated within the target limits. In particular, the voltages at the beginning of the test exhibit significant improvements compared to the baseline scenario. Total PV Outputs: The measurements of total PV outputs are shown in Fig. 6. PV_P_Baseline is the total available active power in the baseline with zero reactive power, and PV_P_meas and PV_Q_meas are the measured total active and reactive power with DERMS control, respectively. Compared to the baseline scenario, there is a large amount of PV active power curtailment and reactive power absorption to regulate the system voltages.-the significant amount of reactive power absorption at the beginning of the test is an especially brutal force to regulate the system voltage within the limits. Overall, the calculated total curtailment is 6.55% of all the solar energy generated (MWh) in the baseline scenario.
Total PV generation: (a) total available active power and measured active power output and (b) measured reactive power output.
Hardware Inverters' Responses: Fig. 7 shows the experimental results of PHIL testing of all 6 PCCs with 90 DER hardware inverters to demonstrate the real dynamics and response of the hardware interacting with the DERMS controller and the tracking performance of the hardware inverters. The results show the active and reactive power reference from the DERMS (P_ref, Q_ref), and the closed-loop measured PHIL active and reactive power injection (P_meas, Q_meas) for each PCC. Results show that the closed-loop power outputs at each PCC track the dispatched power references very closely. The initial SOC of the batteries in six racks are 77.5%, 79.5%, 62.5%, 63.5%, 53.1% and 42%. The local controller tries to maintain each battery with 60% SOC in local level without contributing to voltage regulation at system level, and it only controls the active power output of the battery inverter. This results in the first two batteries discharge active power, the third and the fourth batteries remain almost unchanged, and the last two charge active power. To balance to total output of PCC, the PV curtailment level is affected by the battery status: a PCC with a discharging (resp. charging) battery requires higher (resp. lower) level of PV curtailment. Therefore in Fig. 7(a), we observe similar active power outputs form PCC 1 and 2, PCC 3 and 4, and PCC 5 and 6, respectively; PCC 5 and 6 have the lowest level of PV curtailment. Because battery inverters do not inject any reactive power, the reactive power for all PCC have similar shapes whose specific values depend on their capacities and locations; see Fig. 7 (b).
Experimental results of six PCCs (active power (left) and reactive power (right)).
Simulated PV vs. PHIL: Finally, we select the simulated PV with the highest local voltage (P/Q_meas_x) and a PV at random location (P/Q_meas_y) from OpenDSS to investigate their active and reactive power output dynamics. The responses of the active power of the simulated PVs are similar to the hardware ones connected at PCC 5 and 6 as shown in Fig. 7 (a). The reactive power outputs of these two PV are similar to all the hardware ones shown in Fig. 7 (b). The comparison of the responses of the simulated PVs with the hardware ones shown in Fig. 7 confirms the correct responses of the hardware DER inverters and overall DERs' responses.
Measured (a) active and (b) reactive power of the selected PV.

VI. CONCLUSIONS
This paper presented the performance evaluation of a DERMS control algorithm for fast DER dispatch using an advanced HIL platform. The HIL platform includes co-simulation of the distribution feeder, the software DERMS controller, power hardware DER inverters, and a communication interface. HELICS is the key tool to integrate all the software pieces and hardware devices together and allow the software controller to interact with the real-time simulation model and hardware inverters as if the controller were interacting with a real-world system. The implementation of such an integrated platform is presented to give readers a helpful reference for developing such a platform. The experimental tests demonstrate that the DERMS controller functions well in both smooth solar and intermittent solar to maintain system voltages within the target limits. The hardware inverters' responses also validate the stability and functionality of the DERMS controller.