Data-driven Local Control Design using Optimization and Machine Learning Techniques

The optimal control of distribution networks often requires monitoring and communication infrastructure, either centralized or distributed. However, most of the current distribution systems lack this kind of infrastructure and rely on suboptimal, fit-and-forget, local controls to ensure the security of the network. In this paper, we propose a data-driven algorithm that uses historical data, advanced optimization techniques, and machine learning methods, to design local controls that emulate the optimal behavior without the use of any communication. We show the performance of the optimized local controls on a three-phase, unbalanced, low voltage, distribution network and compare against an Optimal Power Flow-based controller and an industry standard local control.


I. INTRODUCTION
Some of the most notable developments foreseen in power systems target Distribution Networks (DNs). In the future, DNs will host a large percentage of Distributed Generators (DGs), including Renewable Energy Sources (RES), to supply a growing share of the total demand. These units, in combination with other Distributed Energy Resources (DERs) such as Electric Vehicles (EVs), Battery Energy Storage Systems (BESSs) and Flexible Loads (FLs), will elevate the role of Distribution System Operators (DSOs), allowing them to provide ancillary services and support the bulk transmission system [1]. However, this new paradigm introduces significant challenges to the DN operation [1].
Traditionally, to address these challenges, DSOs have relied only on grid reinforcement and ignored the flexibility offered by DERs. This approach is now unable to cope with the new challenges while keeping the cost for the consumer low and achieving high security and reliability goals. It is apparent that we need to operate DNs actively, involving DERs to ensure secure, reliable and cost-effective operation.
Based on the communication infrastructure available for controlling the DERs, operational schemes can be broadly classified as centralized, distributed and local. Centralized schemes require extensive monitoring and communication infrastructure and usually leverage the performance of powerful optimization-based control techniques. This type of control has lately attracted significant attention thanks to advances S. Karagiannopoulos  in computational power, wireless communication, and new theoretical developments in approximations of the nonlinear AC power flow equations [2], [3]. The capabilities of extensive monitoring and communication infrastructure allow for system-wide optimal operation by coordinated control of DERs [4], [5]. Nevertheless, the infrastructure required for this type of control is rarely available in existing DNs, and the financial benefit for investing in such capabilities is not yet clear.
Decentralized control strategies, e.g. [6], [7], on the other hand tackle power quality and security problems using only local information to modify the DER behavior. These type of controls are widely used in DNs today and have been embedded in several grid codes. The benefit of these methods lies in the simplicity and the relatively low cost of implementation. No communication infrastructure is needed, keeping the required investment at a minimum. However, these methods usually employ a one-size-fits-all approach, where the same control parameters are employed in all DNs, different generator types, and operating conditions. This approach can lead to unforeseen problems, especially in a rapidly changing environment.
Finally, distributed approaches, e.g. [8], use limited communication between different DERs to coordinate them and achieve a close-to-optimal operation. While these methods try to bridge the gap between local and centralized methods, they still require some communication infrastructure and usually employ consensus-based control algorithms which are sensitive to communication delays and errors.
In this paper, we propose a data-driven control design method to derive optimized local controls for several types of DERs that can be used when no communication infrastructure is available. The proposed methodology is sketched in Fig. 1. First, we use a representative model of the DN, along with historical generation and consumption data, and employ an offline centralized optimization algorithm generating the optimal DER setpoints for different operating conditions. The objective of the offline algorithm is to minimize the system losses and adjustments of DER resources while ensuring system security and power quality. The formulation takes into account the uncertainty coming from RES and the fact that the DN usually is an unbalanced, three-phase system. The optimal setpoints obtained from this optimization are used to design local DER controls for the real-time operation of the DN, employing Machine Learning (ML) techniques. This methodology allows deriving simple and efficient optimized local controls that can mimic the behaviour of centralized optimization-based schemes, without the need of any communication infrastructure.
The main idea was initially presented in [9], [10]. This paper significantly extends the authors' previous work in [9], [11], [12]. More specifically, the contributions of this paper are: • A novel data-driven local control design methodology for the optimal operation of several types of DERs, using ML techniques. • A centralized control algorithm based on a three-phase, multi-period, Chance-Constraint Optimal Power Flow (CC-OPF), considering RES uncertainty and unbalanced operation. Another approach proposing the use of data-driven local control design has been proposed in [10]. In that paper, multiple linear regression is used in an open -loop fashion to calculate a function for each inverter that maps its local historical data to pre-calculated optimal reactive power injections. However, only reactive power control is considered, neglecting possible combinations with other available controls, and assuming a balanced DN, i.e. using a single-phase representation.
The remainder of the paper is organized as follows: Section II presents the mathematical formulation of the CC-OPF algorithm used to obtain the optimal DER setpoints. Then, Section III describes the ML methods used for deriving the optimized local control schemes of the DERs. Section IV introduces the case study and simulation results that show the performance of the optimized controllers. Finally, conclusions are drawn in Section V.
II. CENTRALIZED CHANCE-CONSTRAINED OPF In this section, the centralized CC-OPF scheme used to compute the optimal DER setpoints for different operating conditions is presented. The objectives and constraints of the OPF-based algorithm are vital for the overall methodology as they will be reflected in the generated optimal DER setpoint data and will in turn influence the local control design.
A. Centralized OPF 1) Objective function: The objective function selected includes minimizing the cost of DER control and the network losses, over all of the network nodes (N b ), phases (z) and branches (N br ) for the entire time horizon (N hor ). This is described by: min u Nhor t=1 z∈{a,b,c} Nb j=1 C P ·P curt,j,z,t +C Q ·Q ctrl,j,z,t where u is the vector of the available active control measures and ∆t is the length of each time period. The curtailed power of the DGs connected at phase z, at node j and time t is given by P curt,j,z,t = P max g,j,z,t − P f g,j,z,t , where P max g,j,z,t is the maximum available active power and P f g,j,z,t is the actual in-feed. The use of reactive power support Q ctrl,j,z,t = |Q f g,j,z,t | for each DG connected to phase z of node j and time t is also minimized. The coefficients C P and C Q represent, respectively, the DG cost of curtailing active power and providing reactive power support (DG opportunity cost or contractual agreement). The assumption that C Q C P is made, which prioritizes the use of reactive power control over active power curtailment. The losses considering all branches and mutual coupling at time t are calculated with P loss,i,z,t = |I br,i,z,t | 2 · R br,i,z , where |I br,i,z,t | is the magnitude of the current flow in branch i and R br,i,z its resistance. Finally, C H is a large penalty associated with violating the security and power quality constraints. It is used in conjunction with the variables (η V , η I , η VUF ) to relax respectively the voltage, thermal or balancing constraints and avoid infeasibility. When one of these limits is binding, the output of the overall objective function gets dominated by this term and might lose a real monetary meaning (unless the cost of violating the security and power quality constraints is quantified and monetized by the DSO).
2) Power balance constraints: The power injections at every node j, phase z and time step t are given by P f inj,j,z,t = P f g,j,z,t − P f lflex,j,z,t − (P ch B,j,z,t − P dis B,j,z,t ), where P f g,j,z,t and Q f g,j,z,t are the active and reactive power injections of the DGs; P f lflex,j,z,t and P f lflex,j,z,t ·tan(φ load ) are the active and reactive node demands (after control), with cos(φ load ) being the power factor of the load; Q B,j,z,t the reactive power of the BESS and, P ch B,j,z,t and P dis B,j,z,t are respectively the charging and discharging BESS active powers.
3) Power flow constraints: The non-linear AC power-flow equations that model the DN network make solving the OPF problem computationally challenging. Since the OPF will be used to process several scenarios in a multi-period framework, it is necessary to use some approximations to increase its computational performance. For this reason, the iterative Backward/Forward Sweep (BFS) power flow [13] method is used in this work, extending the formulation presented by the authors in [11], [14], [15] for a three-phase, unbalanced system.
Following our previous work [15], a single iteration of the BFS power-flow method is used to replace the AC powerflow constraints in the OPF formulation. This is written as whereV * j,z,t is the voltage of phase z, at node j at time t, * indicates the complex conjugate and the bar indicates that the value from the previous iteration is used (details will be given later); I inj,t and I br,t are respectively the vectors of the threephase bus injection and branch flow currents; and, BIBC is a matrix with ones and zeros, capturing the three-phase topology of the DN (including any single-phase laterals); ∆V t is the vector of voltage drops over all branches and phases; BCBV is a matrix with the complex impedance of the lines as elements (including mutual coupling); V slack is the threephase voltage in per unit at the slack bus (here assumed to be {1 < 0 • , 1 < −120 • , 1 < 120 • }); ∆V tap is the voltage magnitude change caused by one tap action of the On-Load Tap Changer (OLTC) transformer and assumed constant for all taps for simplicity; and, ρ t is an integer value defining the position of the OLTC position. The parameters (ρ min , ρ max ) are respectively the minimum and maximum tap positions of the OLTC transformer.
This convex formulation provides a good approximation to the nonlinear AC OPF [4], is computationally tractable even in a three-phase model [15], and results in AC feasible solutions which can account for uncertainties, see [14] and Section II-B.

4) Thermal loading and voltage constraints:
The constraint for the current magnitude for branch i and phase z at time t is given by where I br,i,z,t is the branch current; I i,z,max is the maximum thermal limit; and, η I,i,z,t is used to relax the constraint when the thermal constraints cannot be met. Similarly, the voltage constraints are given by where (V max , V min ) are respectively the upper and lower acceptable voltage limits and η V,j,z,t is used to relax the constraint when the voltage constraints cannot be met. Unfortunately, (5) is non-convex due to the minimum voltage magnitude requirement. In order to avoid the nonconvexity, we rotate the three voltage phases {a, b, c} by R = {1 < 0 • , 1 < 120 • , 1 < −120 • } so that they lie close to the reference axis 0 • and we define the same feasible space for each of the three phases (see [15] for more details)

5) Balancing constraint:
A balancing constraint is used to improve the power quality of the DN by balancing the three phase voltages. We use the IEC unbalance definition [16], [17] Voltage Unbalance Factor (VUF), given by V U F (%) = 100% |V−| |V+| , where V − and V + are respectively the negative and positive sequence derived by symmetrical component analysis.
The balancing constraint for node j and time t is given by V U F j,t (%) ≤ V U F MAX , where V U F MAX is the acceptable voltage unbalance factor (e.g. 2% for 95% of the week according to EN50160 [18]). Since this constraint is non-convex, we approximate VUF by the negative voltage sequence [15], assuming the positive voltage sequence is very close to 1 pu. This gives where η VUF,j,t relaxes the constraint when it cannot be met. 6) DER constraints: a) DG limits: In this work, without loss of generality, we only consider inverter-based DGs such as PVs. Their limits are thus given by where P min g,j,z,t , P max g,j,z,t , Q min g,j,z,t and Q max g,j,z,t are the upper and lower limits for active and reactive DG power at each node j, phase z and time t. These limits vary depending on the type of the DG and the control schemes implemented. Usually, small DGs have technical or regulatory [19] limitations on the power factor they can operate at or reactive power they can produce.
b) Controllable loads: Moreover, we consider flexible loads which can shift a fixed amount of energy consumption in time. The behavior of the loads is given by where P f lflex,j,z,t is the controlled active power demand at phase z of node j and at time t, P shift,j,z is the load that can be shifted (assumed constant) and n j,z,t ∈ {−1, 0, 1} is an integer variable indicating an increase or a decrease of the load when shifted from the initial demand P f l,j,z,t . We assume that the final total daily energy demand needs to be maintained. c) Battery Energy Storage Systems: Finally, the constraints related to the BESS are given as where E bat cap,j,z is the installed BESS capacity connected to phase z at node j; SoC bat min and SoC bat max are the fixed minimum and maximum per unit limits for the battery state of charge; and, E bat j,z,t is the available energy at node j, phase z and time t. The initial energy content of the BESS in the first time period is given by E start , and (10c) updates the energy in the storage at each period t based on the BESS efficiency η bat , time interval ∆t and the charging and discharging power of the BESS P ch B,j,z,t and P dis B,j,z,t . The charging and discharging powers are defined as positive according to (10d), while (10e) ensures that the BESS is not charging and discharging at the same time.

B. Accounting for Uncertainty through Chance Constraints
To account for the effect of generation uncertainty and to limit possible adverse effects on the security constraints, we reformulate the problem using chance constraints. The resulting CC-OPF solution is based on [14], but extended to three-phase unbalanced systems. In this work, we assume that the PV power injection is the only source of uncertainty. However, load uncertainty can be also included in a similar way.
1) Formulation of the Chance Constraints: The branch current flows and the voltage magnitudes are functions of the power injections and are hence directly influenced by the PV power uncertainty. Thus, we model the corresponding voltage and current constraints as chance constraints that will hold with a chosen probability 1 − ε, where ε is the acceptable violation probability. E.g., the maximum voltage magnitude constraint is reformulated as P {|V bus,j,t | ≤ V max } ≥ 1 − ε.
To solve the resulting CC-OPF, we interpret the probabilistic constraints as tightened deterministic versions of the original constraints following the work of [20], [21]. The tightening represents a security margin against uncertainty, i.e., an uncertainty margin. Thus, we express (4) and (6) as where Ω lower V , Ω upper V are the tightenings for the lower and upper voltage magnitude constraints and Ω Ibr are the tightenings of the current magnitude constraints. The procedure in explained in more detail in [14].
2) Uncertainty margin evaluation based on Monte Carlo Simulations: In this paper, we use a Monte Carlo approach to evaluate the uncertainty margins. The uncertainty margins are considered constant within the OPF solution, but then evaluated outside of the OPF solution. The advantages of this method lie in the ability to use the non-linear AC power-flow and to have any uncertainty probability distribution.
First, empirical distributions for the voltage and current chance constraints are formed at each time step according to the Monte Carlo simulations. To enforce a chance constraint with 1 − probability we need to ensure that the 1 − quantile of the distribution remains within the bounds. Thus, the tightening corresponds to the difference between the forecasted value with zero forecast error and the 1 − quantile value evaluated based on the empirical distribution resulting from the Monte Carlo Simulations, e.g. |V 0 bus,j,t | and |V 1-% bus,j,t | for the voltage constraints. The empirical uncertainty margins to be used in the next iteration are then given by Ω upper V j,t = |V 1bus,j,t | − |V 0 bus,j,t |, Ω lower V j,t = |V 0 bus,j,t | − |V bus,j,t |, where superscript 0 indicates the current or voltage magnitude at the operating point with zero forecast error.
3) Iterative Solution Algorithm: Since the uncertainty margins rely on the selected DER setpoints, an iterative algorithm is used to solve the problem [21], [22]. It alternates between solving a deterministic OPF with tightened constraints, and calculating the uncertainty margins Ω lower Ibr . When the change in the tightening values between two subsequent iterations is below a threshold (η Ω V , η Ω I ), then the algorithm has converged.

C. Solution Algorithm
In this section, we summarize the proposed solution method for the centralized CC-OPF scheme, sketched in Fig. 2. First, the initialization stage sets the uncertainty margins to zero and initializes the voltage levels of the three phases to a flat voltage profile. At the core of the proposed methodology lies the formulation of the three-phase multi-period centralized CC-OPF, which is summarized as subject to (2), (3), (7) − (12).
The CC-OPF calculates the optimal DER setpoints based on a single sweep of the BFS algorithm. The BFS powerflow algorithm then runs until convergence for the obtained control settings. The CC-OPF is then performed again using the updated voltages from the full BFS. These inner iterations are carried out until convergence. After the multi-period OPF has converged, the uncertainty margins are evaluated in the outer loop as described in Section II-B. The iteration index of the OPF loop is denoted by k and the iteration of the uncertainty loop by m. The iterative procedure continues until all parts of the algorithm have reached convergence.

III. OPTIMIZED LOCAL CONTROL DESIGN
In this section, we describe the process of deriving the individual local controls for each DER.

A. Optimal DER setpoint data generation
The first step is to generate the optimal DER setpoint data that will be used for the training of the local controls. To do this, several operating scenarios are selected from seasonal historical data. Then, the CC-OPF of Section II is used to compute the optimal DER setpoints. The selection of the scenarios is critical, since they will form the basis for the training of the local schemes.
The DSO does not know the exact generation of all PVs in the LV system in the operational stage (as this would require detailed monitoring of all PVs). However, the DSO is aware of the installed DG capacity and the PV generation can be estimated with some uncertainty, using historical expected PV injection data and the installed capacity. These estimates are used in the CC-OPF solution. Initialize: Run three phase multi-period OPF with one BFS iteration Run BFS power flow until convergence Evaluate Ω m V i , Ω m Ibr and check tightenings Multiperiod BFS-OPF Uncertainty tightenings Optimal Setpoints Fig. 2. Proposed centralized CC-OPF scheme for the computation of the optimal DER setpoints.

B. Derivation of DG local controls
For the DGs, we derive optimized local controls for Active Power Curtailment (APC) and Reactive Power Control (RPC). These controls take the form of simple, piece-wise linear characteristic curves (such as Fig. 3), much like the local control schemes used today in industry. Unlike the current industry standards, these characteristics might have an arbitrarily large Algorithm 1 Local DG control design (x ∈ {p, q}) Input: Optimal DG setpoints Output: Optimized local characteristic curve 1: Set n s , initialize the break-points s, i = 1, RSS 0 = 1000 2: Iterate: Defining the location of the break-points and the slope coefficients is a non-linear and non-differentiable problem. Thus, we employ the method in Algorithm 1 coming from [23] that iteratively refines the location of the break-points while solving a constraint residual sum-of-squares (RSS) optimization problem for the slope coefficients.
First, we define the number of break-points n s and initialize them. Then, we use the iterative steps 2 − 4, where we solve the residual sum of squares problem using the active power injections as weights in the objective function, fitting the linear equivalent estimation model taking into account monotonicity and slope constraints. As inputs, we use the voltage v t for each sample t, ∀t = 1, . . . , T . Then, we fit the linear model based on the known breakpoints s i k , ∀k = 1, . . . , n s at the current iteration i, the left slope β 0 and difference-in-slopes β k . The indicator function I(·) becomes one when the inside statement is true. Finally,x 0 is the model intercept and γ a parameter which updates the location of the breakpoints towards the optimal one.
Omitting the indices for clarity, the key idea is to substitute the non-linear function β · (v − s) · I(v > s) where both the difference-in-slope and the break-points are unknown, with its Taylor expansion using fixed break-points at each iteration i β · (v − s i ) · I(v >s i ) − γ · I(v >s i ) [23].
The same method is used both for the APC and RPC curves, using respectively the PV optimal active (p) and reactive (q) setpoints from the CC-OPF.
Identify the kernel with the lowest out-of-sample error Return: {P, Q} B =f (V, P load , Q load , P P V )

C. Local control of Battery Energy Storage Systems
Due to the inter-temporal constraints and more complex behaviour of BESSs, a Support Vector Machine (SVM) regression model was chosen to approximate the optimal setpoints of active and reactive power for the BESSs. The procedure of training the SVM controllers follows [12] and is summarized in Algorithm 2. We use as features (Φ) the local active and reactive power demand, the active power injection of the PV at the same node and the local voltage measurement. We then use these local features, in their actual or a higher dimensional space through Kernels, to create a model that mimics the optimal response by the CC-OPF setpoints.
In order to derive the best SVM model, we try three different Kernels: the linear ( Φ, Φ T in which case C in the objective function is a free parameter), the polynomial ((γ Φ, Φ T +r) d where C and the polynomial order d are free parameters) and the Radial-Basis Function (RBF) Kernel (e (−γ|Φ−Φ T |) 2 where C and the kernel scale γ are free parameters). Assuming a regression function f (Φ) = w, Φ + b, we solve the convex optimization problem shown in Step 2, for all these Kernels in order to identify the most suitable one. The constant C penalizes the predictions outside the region defined by , and the slack variables (ξ) are used to allow for some prediction errors. Finally, we keep the model with the kernel resulting in the lowest overall out-of-sample error through a 5-fold cross validation process.

D. Local control of Controllable Loads
For the controllable loads, we use an SVM model as a classifier, where we define three classes y c ∈ {−1, 0, 1} for the 'load decrease', 'no shifting' and 'load increase' cases, respectively. As features we use Φ = [V j,z,t , t ti=1 n j,z,ti ], where V j,z,t is the local voltage measurement and t ti=1 n j,z,ti the cumulative sum of the load changes from the first period until time t. The later feature shows the lack or surplus of energy until time t. It should be noted that the sum should be zero at the end of the day, thus a large deviation during the day will strongly affect the controllable load decisions. The optimization problem is similar to the BESS case, with G(Φ) = sign(f (Φ)) being the classifier.

IV. CASE STUDY -RESULTS
To analyze the performance of the proposed control design algorithm, we use a typical European radial LV grid [24], sketched in Fig. 4. The neutral is assumed to be earthed in several points, and due to the short lengths of cables the capacitance is neglected.
The load and PV panels are distributed to the three phases unevenly, in order to simulate unbalanced conditions. More specifically, the total load taken from [24] is shared 25%-60%-15% among the three phases. The installed PV capacity, is set to S PV rated = 150% of the total maximum load of the entire feeder to the PV nodes = [3,5,7,10,12,16,17,18,19], and is shared 25%-25%-50% among the three phases.
Furthermore, a BESS is located on node 19 of phase C with capacity 1 2 S PV rated kWh, where S PV rated is the rated power of the PV unit at that particular node. A flexible load of 5 kW connected to phase C of Node 16, whose total daily energy consumption needs to be constant. Please note that we assume single-phase connections for both the loads and the PV panels.
We perform three different investigations for the operation of the system: • Method 0: The DGs are operating according to the German grid-code rules [19], and no other DERs are allowed to be controlled by the DSOs. • Method 1: All DERs are controlled based on the OPFbased algorithm described in Section II assuming perfect communication and monitoring infrastructure. As this serves as the benchmark of the best achievable performance, we consider perfect measurements and predictions for the whole time horizon without any uncertainty. • Method 2: All DERs are operating according to the individual controls derived in Section III.
The implementation was done in MATLAB. For the centralized OPF-based control, YALMIP [25] was used as the modeling layer and Gurobi [26] as the solver. The results were obtained on an Intel Core i7-2600 CPU and 16 GB of RAM.

A. Derived local control
To derive the local control schemes of all DERs, we use a 30-day summer dataset with forecasts of the PV production. Then, the algorithm described in Section II is used to generate the optimal DER setpoint data. The operational costs are assumed to be C P = 0.1 CHF kWh and C Q = 0.01 · C P . The BESS, CL, and OLTC costs are considered in the planning stage [11] and their use does not incur any operational cost to the DSO. Finally, C H = 1000 · C P is used to avoid infeasible solutions. For the CC-OPF, we use forecast error distributions from [27], and draw 1000 samples from the 9-hour ahead forecast error distribution of the summer power profiles similar to [14]. We assume a perfect spatial correlation, implying that all PVs follow the same distribution. An acceptable violation probability of = 5% is used. Then, from the generated optimal DER setpoint data, we derive the local controls as described in Section III. Figure 5 shows the individual local characteristic curves derived with Algorithm 1 for the RPC of the PV units in phase C. It can be seen that the units closer to the secondary of the substation, i.e. 3, 5 and 12 show a capacitive behavior optimizing the losses, while the ones facing overvoltage problems at the end of the feeder, e.g. 16 and 19, show an inductive behavior at smaller voltages than the maximum of 1.04 p.u. For the BESS models, derived with Algorithm 2, the RBF kernel functions resulted in the best behavior in terms of outof-sample validation procedure with the following parameters: constant C = 0.8013, = 0.08, γ = 1.7, showing an overall RM SE of 0.158.
Finally, for the controllable loads, the method detailed in Section III-D gives a classifier with overall accuracy of 96.5%. Figure 6 shows the decision boundaries that define the three classes in the space of the two features.

B. Results
Table I summarizes the results from applying the three methods in real-time operation for a test period of one month. Method 1 corresponds to the benchmark as it satisfies all security constraints and minimizes the objective function. Method 0 (standard industry practice) results in higher losses than the OPF-based approach, due to increased needs for reactive power by the PV units, without solving the overvoltage, overload, or balancing issues. Finally, Method 2 mitigates adequately the overvoltages and overloads to values acceptable by grid codes, while being capable of mimicking the OPFbased control without the need of communication. Moreover, it significantly improves the balancing problems with only small violations during 5 hours in the month, which is also acceptable as defined by the grid codes. Figure 7 displays the real-time control behaviour of the BESS and PV unit at Node 19, phase C, operating according to Methods 1 and 2. It can be seen that the proposed local control (Method 2) of the BESS and PV is more conservative than the OPF-based approach (Method 1) where the PV unit  absorbs the maximum reactive power for most voltage levels due to the overvoltage problems. This conservative behavior is due to the CC-OPF approach we employ (Section II) to generate the data used for deriving the controls of Method 2.
On the contrary, the OPF-based control (Method 1) uses the actual data, assuming full knowledge of the network, load and production values through an ideal communication system without delays. Despite this, the response using the proposed local controls mimics the OPF response in a satisfactory way.
Finally, Fig. 8 shows the evolution of the voltage at Node 19 over the whole month. It can be seen that operating with the current regulations (Method 0) leads to frequent overvoltages. On the contrary, the OPF-based approach (Method 1) and the proposed local control satisfy the voltage security constraints. Similar observations can be made for the thermal loading, shown for cable 2-3 in Fig. 9.
V. CONCLUSION Future DNs will increasingly rely on the active control of DERs for the security, reliability, and optimal operation of the grid. While centralized, OPF-based controllers can provide optimal operation, they rely on expensive monitoring and communication infrastructure -currently not available in most   DNs. At the same time, the inexpensive, traditional, local controllers cannot cope with the rapidly changing environment and increased DER penetration.
In this paper, we propose a data-driven local control design methodology to derive local DER controls that can mimic the centralized controller optimal behavior, without the need for monitoring and communication infrastructure. This is based on using ML techniques to derive optimized local controls based on historical data processed through a CC-OPF. The controllers are simple to compute, understand, and implement. Yet, we have shown through the examples used that the proposed local controls can tackle security problems in an unbalanced and challenging environment while at the same time optimize its operation.