{'fraction_non_alphanumeric': 0.028622107554623882, 'fraction_numerical': 0.008465693783761993, 'mean_word_length': 4.898002853067047, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An ADMM-based Coordination and Control Strategy for PV and Storage to Dispatch Stochastic Prosumers: Theory and Experimental Validation

This paper describes a two-layer control and coordination framework for distributed energy resources. The lower layer is a real-time model predictive control (MPC) executed at 10 s resolution to achieve fine tuning of a given energy set-point. The upper layer is a slower MPC coordination mechanism based on distributed optimization, and solved with the alternating direction method of multipliers (ADMM) at 5 minutes resolution. It is needed to coordinate the power flow among the controllable resources such that enough power is available in real-time to achieve a pre-established energy trajectory in the long term. Although the formulation is generic, it is developed for the case of a battery system and a curtailable PV facility to dispatch stochastic prosumption according to a trajectory at 5 minutes resolution established the day before the operation. The proposed method is experimentally validated in a real-life setup to dispatch the operation of a building with rooftop PV generation (i.e., 101 kW average load, 350 kW peak demand, 82 kW peak PV generation) by controlling a 560 kWh/720 kVA battery and a 13 kW peak curtailable PV facility.


I. INTRODUCTION
Due to the displacement of conventional generation in favor of production from renewables, decentralized control schemes for distributed energy resources (DERs) have gained considerable attention in the recent literature to support grid operation. Control frameworks for DERs have been focusing on achieving targets at both the local level, e.g., voltage control and congestion managements [1]- [3], and system level, e.g. primary and secondary frequency regulation [4]- [7]. Other reported methods proposed open-loop control of DERs by broadcasting electricity price signals, as in [8], and virtual power plant strategies to enable control by explicit power setpoints [9], [10]. A concept which has emerged in the recent literature is dispatching the active power flows of stochastic resources according to a trajectory established before the operation thanks to controlling energy storage systems, as in [11], [12], in combination with flexible demand [13]- [16], and also accounting for grid constraints [17].
The advantage of dispatching traditional stochastic resources is that it inherently reduces the amount of regulating power required to operate the grid without the necessity of coordination between the local system and grid operators. With respect to control strategies for virtual power plants, which normally consists in myopically tracking a power set-point, the dispatch problem as defined in [11] implicitly includes an energy management policy that does represent a key feature in the context of managing the flexibility of energy storage systems.
In this paper, we describe the formulation and experimental validation of a control framework to coordinate the operation of heterogeneous DERs to dispatch the active power flow at the grid connection point (GCP) of an active distribution network (ADN) according to a trajectory, called dispatch plan, determined the day before the operation. The framework consists in two algorithmic layers running at different paces. The lower layer, executed at 10 s resolution, has the objective of pursuing an accurate tracking of the dispatch plan at the GCP. The upper layer, executed once each 5 minutes and implemented through distributed optimization, has the objective of coordinating available neighboring DERs such that enough power capacity is available in real-time to achieve a successful dispatch. In the existing literature, distributed optimization has been applied to meet manifold objectives such as solving optimal power flow problems [18], optimal dispatch of photovoltaic (PV) inverters in residential distribution networks [19] and demand response strategy with electric vehicles (EVs) [20]. Unlike centralized methods, it is highly scalable, an appealing feature in the context of rapidly growing distributed energy networks, and it exhibits better privacy and security properties compared to centralized schemes. Controlling and coordinating multiple units in real-time can be effectively achieved through distributed methods, thanks to the Douglas-Rachford splitting [21] which divides the problem into small objectives and solve it through an aggregator. For distributed methods, on the contrary to dual decomposition that employs the subgradient projection technique with quite slow convergence, the Douglas-Rachford splitting technique is faster [22] and efficient even when applied to non-linear objectives. In this paper, the alternating direction method of multipliers (ADMM) [23], a special case of Douglas-Rachford splitting, is applied to solve the distributed optimization problem. The proposed algorithmic toolchain is tested in a real-life experimental setup to dispatch the operation of a group of stochastic prosumers by controlling a battery energy storage system (BESS) and a curtailable rooftop PV facility.
A similar approach was proposed in [13] to control the operation of a BESS and a building with flexible demand (electric space heating). With respect to [13], in this paper we apply ADMM, which represents more agnostic formulation since all DERs share the same information.
The paper is organized as follows: Section II states the problem we intend to solve, Section III describes the formulation of the proposed framework, Section V presents the experimental results and Section VI summarizes the contributions of this paper and states the conclusions.

II. PROBLEM STATEMENT
The objective of the proposed control strategy is to dispatch the active power flow of a distribution network according to a deterministic profile, called dispatch plan, established the day before the operation. The dispatch plan is a sequence of average power flow values at 5 minute resolution. It is denoted by P disp and, in this work, it is assumed known and computed with the procedure described in [11]. In brief, the dispatch plan consists in the sum of two terms: the forecast of the prosumption underneath the distribution system (i.e., intuitively, it is the best guess one could do to dispatch stochastic prosumption), and the offset profile which is with the specific objective of restoring a suitable level of flexibility in the available storage resources 1 . It is noteworthy that in the current formulation, we do not include grid constraints (e.g., see [9], [17]), which will be considered in future works. In other words, we assume that the target grid, as the one considered in the real-life experimental setup, is robust and not subject to voltage and line ampacity constraints violations.
In real-time, the problem is to compensate the average power mismatch between the dispatch plan set-point and the measured stochastic realization, on a 5 minute basis. This is achieved by the coordinated control of multiple resources thanks to applying distributed optimization. Although the proposed formulation is generic enough to accommodate the use of different kinds of flexible resources, in this paper it is formulated for the case of a curtailable PV facility and battery energy storage system (BESS). The choice of these kinds of units is motivated by the fact that they are both well-established technologies, characterized by a high level of maturity and foreseen to undergo a massive growth in the near future. Fig. 1 shows the real-life experimental setup used to test and validate the proposed control: it consists in a radial distribution feeder interfacing a heterogeneous mix of demand and generation (office buildings with uncontrollable rooftop PV installations) and two controllable resources as explained in Section IV.

III. METHODS
The objective is to coordinate the operation of and control multiple resources to compensate the mismatch between the dispatch plan set-point and the measured average power consumption on a 5 minute basis. In our case, the formulation is carried out by considering a curtailable PV facility and a BESS because they are the unit available in the experimental setup used for the real-life validation. Nonetheless, the setup is scalable and can be augmented to consider other controllable resources. The control framework consists in two real-time algorithms executed at different paces: • a lower level tracking problem, executed at 10 s resolution, to achieve a fine tracking of the dispatch plan by controlling the BESS's active power set-point. This is achieved with MPC with the formulation proposed in [11], and it is not a contribution of this work. • an upper level coordination mechanism, running at 5 minutes resolution, to coordinate the operation between elements. Its role is essentially implementing an energy management strategy to, i), make sure that enough power capacity is available for the faster control loop to compensate for the power mismatch, and, ii), longer-term managing the BESS state-of-charge (SOC) such that enough flexibility is available to compensate for the energy error during the remaining part of the day. The latter control loop is the main contribution of this paper and consists in an optimization problem formulated and solved for each controllable device with a coupling constraint on the energy error. In the following formulation, the upper level problem is responsible for computing set-points for both the PV plant and battery system.
It is worth noting that decoupling the control actions into two discerned time scales is practical for two reasons: i), the distributed optimization coordination mechanism is slower to be solved than the faster pace power set-point tracking (especially because of the communication latency when agents are implemented on different machines); ii), due to technological limitations or inherent process uncertainties, certain devices (like PV plants and fuel cells) are not curtailable/controllable with high accuracy, see e.g. [24]. Therefore, their use is more likely for energy management rather than precise power point tracking. On the other hand, resources like grid-connected battery systems are able to achieve accurate power control and are suitable for fine power point tracking. Overall, the proposed solution (i.e., fast pace control coupled with slower distributed optimization problem) allows accommodating both kinds of resources in a cooperative and thoughtful manner.
In the following of this section, the model predictive control problem is first formulated in a centralized way. Later in this section, it is shown how it is decomposed until having one problem per each controllable unit, and how it is solved by applying the ADMM algorithm.

A. Centralized model predictive control
Let the index i denote the rolling current 5 minute interval, N the number of 5 minutes interval in 24 hours, j = i, . . . , N a 5 minute time index spanning from the current time until the end of the day, the sequence e j the forecasted deviation between the dispatch plan set-point and forecasted realization for the remaining part of the day, B o j and G o j the battery and PV plant set-point trajectories, respectively, and G j the maximum theoretical PV power plant output. The sequences e j and G j are calculated by applying forecasting tools and are assumed given in the following formulation. For our specific application, the latter is determined with the physical-based modelling tool-chain proposed in [25], as a function of global horizontal irradiance forecast. In the following, we focus on the formulation of the optimization problem in a centralized manner. It is aimed at determining trajectories B o j and G o j for the remaining part of the day j = i . . . , N in order to compensate for the dispatch plan mismatch e j while performing minimal amount of curtailment subject to PV and battery system constraints. The PV system constraint is that the active power should be within 0 and the theoretical maximum PV power production G j . For the battery, the constraints are that the power should be within the four-quadrant apparent power converter capability, and the battery SOC within the bounds (SOC min j , SOC max j ) which can be time variant to account for dynamic constraints. In this formulation and experiments, the battery converter is operated at the unitary power factor, so the apparent power constraint reduces to the active power being between plus/minus the converter apparent power rating 2 , denoted by B nom . Battery SOC is normally modelled considering the charging/discharging efficiency of the system, nevertheless, in the current formulation we neglect it because the considered experimental unit has a round-trip efficiency on the AC side close the unit (in the range 97-99% according to the power) 3 . The dynamic model of the battery's SOC is: where the ratio 300/3600 is the share of 5 minutes period in an hour, and E the battery nominal energy capacity in kWh. The SOC value at time interval i + 1 is calculated by applying (1) recursively to propagate the current battery stateof-charge SOC i : where the bold typeface notation B i,j denotes the sequence Formally, the centralized optimization problem is: subject to: SOC min In words, it determines the PV trajectory at minimum curtailment and the BESS power trajectory respectful of battery's constraints to satisfy the tracking error on the shrinking horizon from i to N . The optimization problem (4)- (8) is centralized because, to be solved, it requires all the information from the controllable resources. By exploiting well-known results from distributed optimization theory, it is possible to decompose the centralized problem into smaller ones, which can be solved iteratively until reaching a consensus on a coupling constraint -in this case, the dispatch constraint (5).

B. From the centralized to distributed optimization problem and ADMM
Let g j (·) be a barrier function with zero cost when the tracking error constraint (5) is respected and infinity otherwise: Let G j , B j be the variables that mimic the behavior of the original variables G j , B j , the so-called copied variables. The centralized objective can be re-written by moving the system constraints into the objective function by using the barrier function g j (·). It is: subject to: Constraints (11) and (12) can be moved in the cost function by using two sequences of Lagrangian multipliers, denoted by y Gi,N and y B i,N , referred to as dual variables in the following. The augmented Lagrangian cost function is obtained by moving the equality constraints (11)- (12) in the cost function (10). It is: The ADMM consensus and sharing problem [23] consists in the following three steps.
1) Original variables updates: Let u Gi,N = y Gi,N /ρ and u B i,N = y B i,N /ρ be the scaled dual variable for the PV and battery problems. The update of the decision variable of the PV power plant is: subject to (6). For the battery, it is: subject to (7) and (8).

C. Implementation
The updates of the original variable G i and B i in (14) and (15) are computed in parallel. The updates of the copied variables G i and B i in (16) require gathering the local solutions, therefore it is solved in a centralized manner by the aggregator. Once the dual variables u Gi and u Bi are computed with (17) and (18), they are disseminated to the subsystems together with the copied variables. The iterations are repeated till convergence. The convergence criterion is met when the primal residual norm r k and dual residual norm s k are both smaller than a dynamic feasibility tolerances calculated ad described in [23]. For the penalty parameter ρ k in (21), we follow a selfadaptive scheme [26], where τ incr and τ decr effectuate an adjustment scheme via multiplying ρ k by τ incr when the primal residual norm is larger than the dual residual norm, and dividing ρ k by τ decr in the opposite case [23]. It is to retain the primal and dual residual norms within a factor of µ times one another as they both converge to zero. We fix µ = 10 and τ incr = 2 and τ decr = 2 as reported in [26].
At each computation i, prosumption forecast and PV generation forecasts are necessary to update the sequence e i,N . The former are generated with a persistent predictor, the latter are computed by applying a physical-based modelling toolchain (transposition + PV plant models) as a function of global horizontal irradiance and air temperature predictions 4 . The procedure describe in [27] is used to transpose horizontal irradiance forecasts into tilted irradiance values, while the fiveparameter cell model proposed in [28], extended to the whole PV array, is used to model the PV plant. Also, the current battery SOC is necessary to update the initial condition of the state-of-charge integral model. The flow chart depicting the real-time operation procedure is sketched in Fig. 2. In the flow diagram, controllers running at two time samples: i) faster MPC controller executed each 10 s and ii) slower ADMM based coordination mechanism computing PV set-points each 5 minute. The algorithm is implemented on a computer equipped with an Intel i7 processor. Statistics on the computational burden of the algorithm are discussed in the Results section.

IV. EXPERIMENTAL SETUP
The proposed control framework is validated experimentally in the real-life setup sketched in Fig. 1, which includes office buildings with rooftop PV installations (i.e. uncontrollable prosumption), a curtailable PV facility, and a grid-connected BESS. Characteristics of these units are summarized in Table I. The active power flow of the distribution network is monitored by sensing the consumption at the GCP with a PMU-based metering system. The BESS is controllable by sending active/reactive power set-points to the power converter over a Modbus interface, and the PV plant is controllable by sending active power set-points to the converter over CAN communication.

V. EXPERIMENTAL RESULTS AND DISCUSSION
The experimental results for one day of operation are shown in Fig. 3. In particular, Fig. 3a shows the dispatch plan (in black), the prosumption realization (dashed red) and the realization at the GCP (gray shaded area): the prosumption realization differs from the dispatch plan due to forecasting errors, whereas the realization at the GCP, which is corrected by controlling the contribution of the battery and curtailable PV facility, achieves a good tracking of the dispatch plan. Fig. 3b shows the battery injection (in the upper panel), and the SOC evolution and its bounds (bottom panel, full and dashed line, respectively), which are an input of the decision problem. In this case, SOC bounds are deliberately constrained at time 20h to reproduce a situation where the flexibility is constrained (due to, e.g., the need of providing additional service or a foreseen contingency situation, like maintenance to battery modules, or simply to emulate a situation where the battery capacity is saturated). It is noteworthy that SOC evolution is always within the allowed bounds. Fig. 3c shows the PV curtailment action, in particular the theoretical PV maximum power point (in red), the PV converter set-point (black) and measured PV active power measured at the converter grid connection point. As visible, during the first part of the day, the PV set-point corresponds to the maximum available power, indeed the PV plant produces close to the theoretical limit: the small differences between the two profiles are due to the fact that maximum power point operation is achieved by MPPT algorithms (maximum power point tracking), which normally rely on perturb-and-observe strategies and not on a physical model-based toolchain, as we do. As visible in Fig. 3c, the PV power is curtailed around midday. This is due to the distributed optimization policy, which -as explained in the next paragraph -decides to implement curtailment in order to satisfy the constraints of the optimization problem. To evaluate whether the curtailment action determined by the distributed optimization problem was necessary, we playback the experimental measurements of the prosumption realization in a ad-hoc simulation framework 5 where the feeder dispatch is enforced by controlling the battery only. In other words, we want to verify if battery SOC constraints are still respected in the same stochastic conditions but without leveraging the controllability of the curtailable PV facility. The evolution of the SOC is modelled as in (1). Fig. 4 compares the experimental SOC (dashed red, from the battery management system, which includes ADMM action), the simulated SOC with ADMM (shaded gray band), the simulated SOC without ADMM action, and the SOC upper and lower bounds (dashed blue and black lines). The close matching between the trajectories of the experimental and simulated SOC with ADMM denotes that the SOC estimation model (3) are in agreement and validates the reliability of the used simulation playback approach. As visible in Fig. 4, the experimental SOC and simulated SOC without ADMM matches until approximately midday, the time when the PV curtailment action begins (from Fig. 3c). After midday, the two trajectories diverge because in the latter case the battery has to charge more in order to track the dispatch plan. Nevertheless, in the former case, the battery SOC respect the SOC upper bound constraint, whereas the latter strategy (without ADMM) fails at time 20:00 UTC. We can therefore conclude that the curtailment action determined by the formulation with distributed optimization was necessary and finally accomplished the target of respecting BESS constraints. Numerical results comparing the control performance with and without ADMM are shown in Table II. They denote that the distributed optimization control, even if it sacrifices PV generation, it achieves to respect BESS capacity constraints and that it is able to harmonize the operation of the controllable resources to achieve to dispatch stochastic prosumption.  Table III shows the statistics on the tracking error for the case where there is no control at all (no dispatch), dispatch strategy without ADMM upper layer coordination strategy, and dispatch with ADMM. In this case, the dispatch strategy with achieves the best tracking performance with a RMS error less than 0.5 kW over 24 hours.
Finally, Table IV shows mean, standard deviation and maximum value of the computation time necessary to finalize a single iteration, the number of total iteration required to convergence to a solution and the reached accuracy 6 . The mean time required to reach a solution is 1.01 × 12.69 = 12.82 seconds, denoting that the ADMM is more suitable to perform short-term energy management, as proposed in this paper, rather than real-time power control.

VI. CONCLUSIONS AND FUTURE WORK
In this paper, we proposed and experimentally validated a control and coordination framework for distributed energy resources. It consisted in two layers. The lower layer is a realtime MPC executed at 10 s resolution to achieve fine tuning of a given energy set-point. The upper layer is a slower MPC coordination mechanism based on distributed optimization and solved with ADMM. It runs each 5 minutes and it has the objective of coordinating the power flow among the resources such that enough power and energy is available in real-time to achieve a pre-established energy trajectory.
The setup was tested in a real-life setup to dispatch the operation of stochastic prosumption (e.g. office buildings with 101 kW average load, 350 kW peak demand and 82 kW peak PV generation facility) according to a dispatch plan at 5 minutes resolution, established the day before the operation. The experimental controllable elements are a 720 kVA/560 kWh battery energy storage system and a 13 kWp curtailable PV facility.
The experimental results showed that: • the inclusion of the ADMM-based coordination mechanism successfully achieves to curtail PV generation in contingency situation (e.g., loss of battery capacity) and respect battery state-of-charge constrains; • the mean time to convergence to a solution in the proposed setup was 12 seconds, therefore suitable for shortterm energy management; • imagining to cluster controllable resources into two classes (accurate and with fast actuation, like gridconnected BESS, and inaccurate and slow reaction, like PV, due to be subject to solar irradiance and MPPT dynamics), the proposed framework allows to cope with both of them and coordinate them in a cooperative and fruitful manner to track a shared control objective.
The future work is in the direction of integrating more controllable elements in the setup.