Data-driven Local Control Design for Active Distribution Grids using off-line Optimal Power Flow and Machine Learning Techniques
Data-driven Local Control Design for Active Distribution Grids using off-line Optimal Power Flow and Machine Learning Techniques
Abstract—The optimal control of distribution networks often communication infrastructure and usually leverage the per-
requires monitoring and communication infrastructure, either formance of powerful optimization-based control techniques.
centralized or distributed. However, most of the current distri- The capabilities of extensive monitoring and communication
bution systems lack this kind of infrastructure and rely on sub-
optimal, fit-and-forget, local controls to ensure the security of infrastructure allow for system-wide optimal operation by
the network. In this paper, we propose a data-driven algorithm coordinated control of DERs [2], [3]. This type of control has
that uses historical data, advanced optimization techniques, and lately attracted significant attention thanks to advances in com-
machine learning methods, to design local controls that emulate putational power, wireless communication, and new theoretical
the optimal behavior without the use of any communication. developments in approximations of the nonlinear AC power
We demonstrate the performance of the optimized local control
on a three-phase, unbalanced, low-voltage, distribution network. flow equations [4], [5]. A lot of methods rely on semi-definite
The results show that our data-driven methodology clearly relaxations, e.g. [4], which find global optimal solutions in
outperforms standard industry local control and successfully many practical cases with specific conditions, but not in the
imitates an optimal-power-flow-based control. general case [6]. Lately, many researchers started dealing with
Index Terms—data-driven control design, decentralized con- multi-phase systems, e.g. [7], [8]. A very efficient method is
trol, active distribution networks, OPF, backward forward sweep presented in [8] based on linear manifold approximants, while
power flow, machine learning, distributed energy resources in [7] the authors use an iterative algorithm to solve the OPF
as a nonconvex quadratically constrained quadratic program.
I. I NTRODUCTION However, they do not model explicitly the power losses in LV
Some of the most notable developments foreseen in power grids, neither consider uncertainties.
systems target Distribution Networks (DNs). In the future, Nevertheless, the infrastructure required for this type of
DNs will host a large percentage of Distributed Generators control is rarely available in DNs, and the financial benefit for
(DGs), including Renewable Energy Sources (RES), to sup- investing in such capabilities not clear. Decentralized control
ply a growing share of the total demand. These units, in strategies, e.g. [9], [10], tackle power quality and security
combination with other Distributed Energy Resources (DERs) problems using only local measurements. These type of con-
such as electric vehicles, Battery Energy Storage Systems trols are widely used in DNs today and have been embedded
(BESSs) and Flexible Loads (FLs), will elevate the role in several grid codes. The benefit of these methods lies in the
of Distribution System Operators (DSOs), allowing them to simplicity and the relatively low cost of implementation. No
provide ancillary services and support the bulk transmission communication infrastructure is needed, keeping the required
system [1]. However, this new paradigm introduces significant investment at a minimum. However, these methods usually
challenges to the DN operation [1]. employ a one-size-fits-all approach, where the same control
Traditionally, to address these challenges, DSOs have relied parameters are employed in all DNs, different generator types,
only on grid reinforcement and ignored the flexibility offered and operating conditions. This approach can lead to unforeseen
by DERs. This approach is now unable to cope with the new problems, especially in a rapidly changing environment.
challenges while keeping the cost for the consumer low and Finally, distributed approaches, e.g. [11], [12], use limited
achieving high security and reliability goals. It is apparent that communication between different DERs to coordinate them
DSOs need to operate DNs actively, involving DERs to ensure and achieve a close-to-optimal operation. While these methods
secure, reliable and cost-effective operation. try to bridge the gap between local and centralized meth-
Based on the communication infrastructure available for ods, they still require some communication infrastructure and
controlling the DERs, operational schemes can be broadly usually employ consensus-based control algorithms which are
classified as centralized, distributed and decentralized or lo- sensitive to communication delays and errors.
cal. Centralized schemes require extensive monitoring and Lately, data-driven methods have attracted a lot of attention
in the power systems area [13]–[17]. In [13], data-based meth-
S. Karagiannopoulos and G. Hug are with the Power Systems Labora- ods are used to solve a distributionally robust OPF problem.
tory, ETH Zurich, 8092 Zurich, Switzerland. Email: {karagiannopoulos | The method is based on a model predictive control algorithm
hug}@eeh.ee.ethz.ch.
P. Aristidou is with the School of Electronic and Electrical Engineering, that utilizes forecast error training datasets, and the focus is
University of Leeds, Leeds LS2 9JT, UK. Email: [email protected] on obtaining closed-loop control policies which are robust to
2
Centralized Optimized
Seasonal
Chance- Optimal DER Local control local controls
historical data Validation
Constrained setpoint data training for real-time
with uncertainty
OPF operation
Fig. 1. Overview of the proposed data-driven control design method.
sampling errors in the data. In [14], the authors demonstrate controllable loads in our methodology with a simple rule-based
the method to mitigate overvoltages, assuming balanced phase real-time control scheme. Finally, in [19] we utilized Support
loading. However, this approach requires a centralized scheme Vector Machines (SVMs) to derive local volt-var curves, but
as well as reliable and accurate monitoring and communication we accounted ex-post for the needed monotonicity and slope
infrastructure. Using machine learning techniques to represent constraints of the final curves.
the optimal behavior is studied in [15]–[19]. Reference [15] In this paper, we consider reactive power control, active
uses non-linear control policies to calculate the real-time power curtailment, controllable load shifting and battery en-
reactive power injections of the inverter-based DGs. Although ergy storage systems. The local schemes are derived by several
it uses a linearized version of the grid, assumes balanced machine learning techniques, such as segmented regression
operation and focuses only on one measure, i.e. reactive power and SVMs as regressors and classifiers. More specifically, the
control, this scheme is very flexible due to the various kernel contributions of this paper can be summarized as follows:
functions which are able to model complex and non-linear • A computationally tractable off-line centralized control
behaviors. In [17] and [16], multiple linear regression is used algorithm based on a three-phase, multi-period, Chance-
in an open-loop fashion to calculate a function for each inverter Constrained Optimal Power Flow (CC-OPF), considering
that maps its local historical data to pre-calculated optimal RES uncertainty and unbalanced operation.
reactive power injections. However, both references consider • A novel data-driven local control design methodology for
only reactive power control, neglecting possible combinations the optimal operation of several types of DERs, using
with other available controls, and reference [17] assumes a different regression and classification ML techniques.
balanced DN, i.e. using a single-phase representation. It should be noted that in this work, we use the centralized
The focus of this work is on distribution grids where scheme off-line, i.e. it does not require real-time monitoring
communication and monitoring infrastructures have not been and communication infrastructure. Instead, we use historical
deployed yet. Thus, in this paper, we propose a data-driven values collected in the past. Although any OPF formulation
control design method to derive optimized local controls for suitable for DNs can be used to derive the optimal DER
several types of DERs. However, it should be mentioned that setpoints, the proposed formulation allows us to use a tractable
even in an environment with deep penetration of communi- three-phase multi-time OPF formulation that can consider
cation capabilities, local controls are valuable as they provide uncertainties and various models of DERs.
a scalable approach to efficiently utilize an increasingly large The remainder of the paper is organized as follows: In
number of distributed resources. The methodology is sketched Section II, we present the mathematical formulation of the
in Fig. 1 and detailed hereafter. CC-OPF algorithm used to obtain the optimal DER setpoints.
First, we use a model of the DN under study along with Then, in Section III, we describe the ML methods used for
historical generation and consumption data. Then, we employ deriving the optimized local control schemes of the DERs.
an offline centralized optimization algorithm to compute the In Section IV, we introduce the case study and simulation
optimal DER control setpoints for different operating condi- results that show the performance of the optimized controllers.
tions. The objective of the offline algorithm is to minimize Finally, we draw conclusions in Section V.
the system losses and adjustments of DER resources while
ensuring system security and power quality. The formulation II. C ENTRALIZED C HANCE -C ONSTRAINED OPF
takes into account the uncertainty coming from RES and the In this section, the centralized CC-OPF scheme used to
unbalanced, three-phase, operation. Finally, we use Machine compute the optimal DER setpoints for different operating
Learning (ML) techniques applied on the optimal setpoints ob- conditions is presented. The objectives and constraints of the
tained from this optimization to design local DER controls for OPF-based algorithm are vital for the overall methodology as
the real-time operation of the DN. In this way, we derive sim- they will be reflected in the generated optimal DER setpoint
ple and efficient optimized local controls that can mimic the data and will in turn influence the local control design.
behaviour of centralized optimization-based schemes, without It should be noted that having enough data to run an OPF
the need of any communication infrastructure. is critical to the process. The data can be gathered using low-
This paper extends and completes our previous work cost energy monitoring devices and if some data are missing or
in [18]–[20]. In [18], we presented the idea of designing noisy, we can extrapolate using historical data, public domain
customized control schemes for each DER based on off- information, or information from neighbouring systems.
line centralized optimization. However, we only considered
reactive power control and active power curtailment, and the A. Centralized OPF
derivation of the local volt-var curves was not based on ML 1) Objective function: The objective function selected in-
techniques, but on rule-based heuristics. In [20], we added cludes minimizing the cost of DER control and the network
3
losses, over all of the network nodes (Nb ), phases (z) and 3) Power flow constraints: The non-linear AC power-flow
branches (Nbr ) for the entire time horizon (Nhor ). This is equations that model the DN network make solving the OPF
described by: problem computationally challenging. Since the OPF will be
used to process several scenarios in a multi-period framework,
Nhor X Nb
it is necessary to use some approximations to increase its
X X
min CP ·Pcurt,j,z,t +CQ ·Qctrl,j,z,t computational performance. For this reason, the iterative Back-
u
t=1 z∈{a,b,c} j=1
ward/Forward Sweep (BFS) power flow [24] method is used in
Nbr
this work, extending the formulation presented by the authors
X X
+ CP ·Ploss,i,z,t ·∆t (1) in [20], [25], [26] for a three-phase, unbalanced system.
z∈{a,b,c} i=1 Following our previous work [26], a single iteration of the
BFS power-flow method is used to replace the AC power-
+ CH · ||ηV ||∞ + ||ηI ||∞ + ||ηVUF ||∞
flow constraints in the OPF formulation. This is written as
(j = 1, . . . Nb , z ∈ {a, b, c}):
where u is the vector of the available active control measures !
and ∆t is the length of each time period. The curtailed power (Pinj,j,z,t + jQinj,j,z,t )∗
Iinj,j,z,t = ∗
of the DGs connected at phase z, at node j and time t V̄j,z,t
max max
is given by Pcurt,j,z,t = Pg,j,z,t − Pg,j,z,t , where Pg,j,z,t is the Ibr,t = BIBC · Iinj,t
maximum available active power and Pg,j,z,t the active power
injection of the DGs. The use of reactive power support ∆Vt = BCBV · Ibr,t
Qctrl,j,z,t = |Qg,j,z,t | for each DG connected to phase z of node j Vt = Vslack − ∆Vtap · ρt + ∆Vt
and time t is also minimized; Qg,j,z,t represents the DG reactive ρmin ≤ ρt ≤ ρmax , (3)
power injection or absorption. The coefficients CP and CQ ∗
where V̄j,z,t is the voltage of phase z, at node j at time t,
represent, respectively, the DG cost of curtailing active power ∗
indicates the complex conjugate and the bar indicates that the
and providing reactive power support (DG opportunity cost
value from the previous iteration is used (details will be given
or contractual agreement). The assumption that CQ CP
later); Iinj,t and Ibr,t are respectively the vectors of the three-
is made, which prioritizes the use of reactive power control
phase bus injection and branch flow currents; and, BIBC
over active power curtailment. In our case, we follow the
(Bus Injection to Branch Current) is a matrix with ones and
method of [21] and perform Kron’s reduction in order to
zeros, capturing the three-phase topology of the DN (including
use a three-phase three-wire power flow representation. In
any single-phase laterals); ∆Vt is the vector of voltage drops
this case, the phase voltages and currents are obtained with
over all branches and phases; BCBV (Branch Current to
acceptable accuracy, but as it is shown in [22], calculating the
Bus Voltage) is a matrix with the complex impedance of the
losses using the current magnitude squared times the resistance
lines as elements (including mutual coupling); Vslack is the
formula, leads to high overestimation of the correct total
three-phase voltage in per unit at the slack bus (here assumed
losses. Thus, in this case, one can calculate the total losses, by
to be {1 < 0◦ , 1 < −120◦ , 1 < 120◦ }); ∆Vtap is the voltage
using the difference between input and output power in each
magnitude change caused by one tap action of the On-Load
phase [23]. Thus, Ploss,i,z,t = |Re(Sif ,z,t + Sit ,z,t )|, where Sif ,z,t
Tap Changer (OLTC) transformer and assumed constant for
and Sit ,z,t represent the apparent power flowing into branch
all taps for simplicity; and, ρt is an integer value defining the
i from each end; if and it are the sending and receiving
position of the OLTC position. The parameters (ρmin , ρmax ) are
ends of the branch. Finally, CH is a large penalty associated
respectively the minimum and maximum tap positions of the
with violating the security and power quality constraints. It is
OLTC transformer.
used in conjunction with the variables (ηV , ηI , ηVUF ) to relax
This convex formulation provides a good approximation to
respectively the voltage, thermal or balancing constraints and
the nonlinear AC OPF [2], is computationally tractable even in
avoid infeasibility. When one of these limits is binding, the
a three-phase model [26], and results in AC feasible solutions
output of the overall objective function gets dominated by
which can account for uncertainties, see [25] and Section II-B.
this term and might lose a real monetary meaning (unless the
4) Thermal loading and voltage constraints: The constraint
cost of violating the security and power quality constraints is
for the current magnitude for branch i and phase z at time t
quantified and monetized by the DSO).
is given by
2) Power balance constraints: The power injections at
every node j, phase z and time step t are given by |Ibr,i,z,t | ≤ Ii,z,max + ηI,i,z,t , ηI,i,z,t ≥ 0 (4)
ch dis
where Ibr,i,z,t is the branch current; Ii,z,max is the maximum
Pinj,j,z,t = Pg,j,z,t − Plflex,j,z,t − (PB,j,z,t − PB,j,z,t ) (2a) thermal limit; and, ηI,i,z,t is used to relax the constraint when
Qinj,j,z,t = Qg,j,z,t − Plflex,j,z,t · tan(φload ) + QB,j,z,t (2b) the thermal constraints cannot be met.
Similarly, the voltage constraints are given by
where Plflex,j,z,t and Plflex,j,z,t · tan(φload ) are the active and
Vmin − ηV,j,z,t ≤ |Vj,z,t | ≤ Vmax + ηV,j,z,t , ηV,j,z,t ≥ 0 (5)
reactive node demands (after control) of constant power type,
with cos(φload ) being the power factor of the load; QB,j,z,t where (Vmax , Vmin ) are respectively the upper and lower ac-
ch dis
the reactive power of the BESS and, PB,j,z,t and PB,j,z,t are ceptable voltage limits and ηV,j,z,t is used to relax the constraint
respectively the charging and discharging BESS active powers. when the voltage constraints cannot be met.
4
Unfortunately, (5) is non-convex due to the minimum c) Battery Energy Storage Systems: Finally, the con-
voltage magnitude requirement. In order to avoid the non- straints related to the BESS are given as
convexity, we rotate the three voltage phases {a, b, c} by R = bat bat bat bat bat
{1 < 0◦ , 1 < 120◦ , 1 < −120◦ } so that they lie close to the SoCmin · Ecap,j,z ≤ Ej,z,t ≤ SoCmax · Ecap,j,z (10a)
bat
reference axis 0◦ and we define the same feasible space for Ej,z,1 = Estart (10b)
each of the three phases (see [26] for more details) dis
PB,j,z,t
bat bat ch
Ej,z,t = Ej,z,t-1 + (ηbat · PB,j,z,t − ) · ∆t (10c)
ηbat
(
|RVj,z,t | ≤ Vmax + ηV,j,z,t
(6) ch
0 ≤ PB,j,z,t bat
≤ Pmax , dis
0 ≤ PB,j,z,t bat
≤ Pmax (10d)
Re {RVj,z,t } ≥ Vmin − ηV,j,z,t
ch dis ch dis
PB,j,z,t + PB,j,z,t ≤ max(PB,j,z,t , PB,j,z,t ) (10e)
5) Balancing constraint: A balancing constraint is used to QB,j,z,t ≤ (Smax ) − max((PB,j,z,t ) , (PB,j,z,t )2 )
2 bat 2 ch 2 dis
(10f)
improve the power quality of the DN by balancing the three
phase voltages. We use the IEC unbalance definition [27], bat
where Ecap,j,z is the installed BESS capacity connected to
[28] of Voltage Unbalance Factor (V U F ), which is given by phase z at node j; SoCmin bat
and SoCmaxbat
are the fixed minimum
V U F (%) = 100% |V −|
|V+ | , where V− and V+ are respectively and maximum per unit limits for the battery state of charge;
the negative and positive sequence derived by symmetrical bat
and, Ej,z,t is the available energy at node j, phase z and time
component analysis. t. The initial energy content of the BESS in the first time
The balancing constraint for node j and time t is given by period is given by Estart , and (10c) updates the energy in the
V U Fj,t (%) ≤ V U FMAX , where V U FMAX is the acceptable storage at each period t based on the BESS efficiency ηbat ,
voltage unbalance factor (e.g. 2% for 95% of the week ac- time interval ∆t and the charging and discharging power of
ch dis
cording to EN50160 [29]). Since this constraint is non-convex, the BESS PB,j,z,t and PB,j,z,t . The charging and discharging
we approximate V U F by the negative voltage sequence [26], powers are defined as positive according to (10d), while (10e)
assuming the positive voltage sequence is very close to 1 pu, is re-casted as mixed-integer constraint with 2 binaries for
i.e. V U Fj,t ≈ |V-,j,t |. This gives each time step, and ensures that the BESS is not charging and
discharging at the same time.
|V-,j,t | ≤ V U FMAX + ηVUF,j,t , ηVUF,j,t ≥ 0 (7)
where ηVUF,j,t relaxes the constraint when it cannot be met. B. Accounting for Uncertainty through Chance Constraints
6) DER constraints: To account for the effect of generation uncertainty and to
a) DG limits: In this work, without loss of generality, we limit possible adverse effects on the security constraints, we
only consider inverter-based DGs such as PVs. Their limits are reformulate the problem using chance constraints. Chance-
thus given by constrained optimization problems aim to keep the probability
of certain random events below targeted values. In this work,
min max
Pg,j,z,t ≤ Pg,j,z,t ≤ Pg,j,z,t (8a) we assume that the PV power injection is the only source of
Qmin
g,j,z,t ≤ Qg,j,z,t ≤ Qmax
g,j,z,t (8b) uncertainty. However, load uncertainty can be also included in
a similar way. The interested reader is referred to [31] for a
min max
where Pg,j,z,t , Pg,j,z,t , Qmin max
g,j,z,t and Qg,j,z,t are the upper and lower general overview of risk-aware control under uncertainties.
limits for active and reactive DG power at each node j, phase 1) Formulation of the Chance Constraints: The branch
z and time t. These limits vary depending on the type of current flows and the voltage magnitudes are functions of the
the DG and the control schemes implemented. Usually, small power injections and are hence directly influenced by the PV
DGs have technical or regulatory [30] limitations on the power power uncertainty. Thus, we model the corresponding voltage
factor they can operate at or reactive power they can produce. and current constraints as chance constraints that will hold
This restriction can be included by linking the active and with a chosen probability 1 − ε, where ε is the acceptable
reactive power limits in (8) through the maximum power factor violation probability. E.g., the maximum voltage magnitude
value. constraint is reformulated as P {|Vbus,j,t | ≤ Vmax } ≥ 1 − ε [32].
b) Controllable loads: Moreover, we consider flexible To solve the resulting CC-OPF, we need to reformulate
loads which can shift a fixed amount of energy consumption the constraints in a tractable form. This can be achieved by
in time. The behavior of the loads is given by using an analytical form assuming a certain distribution of
the forecast error [33], or a distribution-agnostic method [13],
Nhor
X [33]. In this work, we follow [34], [35] that rely on an iterative
Plflex,j,z,t = Pl,j,z,t + nj,z,t · Pshift,j,z , nj,z,t = 0 (9)
solution scheme that fits very well with the iterative nature of
t=1
the BFS-OPF. The core idea is that the chance-constrained
where Plflex,j,z,t is the controlled active power demand at phase problem can be cast as a deterministic problem with tightened
z of node j and at time t, Pshift,j,z is the load that can be constraints. The tightenings represent security margins against
shifted (assumed constant) and nj,z,t ∈ {−1, 0, 1} is an integer uncertainty, i.e., uncertainty margins, which drive the trade-
variable indicating an increase or a decrease of the load when off between cost and system security, and are functions of
shifted from the initial demand Pl,j,z,t . We assume that the final the optimization variables. The iterative scheme alternates
total daily energy demand needs to be maintained. between solving the deterministic problem with a given set of
5
k
Initialize: do this, several operating scenarios are selected from seasonal
k = 0, Vbus = {1<0◦ , 1<−120◦ , 1<120◦ }
m = 1, Ωm−1
ibr = Ωm−1
Vi =0 historical data. Then, the CC-OPF of Section II is used to
compute off-line the optimal DER setpoints. The selection of
Run three phase the scenarios is critical, since they will form the basis for the
Uncertainty tightenings
Evaluate Ωm m
V i , ΩIbr and load. By changing the local control schemes based on the
and check tightenings season, e.g. using the actual date, or when the topology of
the DN changes, one can easily derive a behavior close to the
optimal during the whole year.
m−1
max|Ωm Ω
V i − ΩV i | ≤ ηV
&
No max|Ωm m−1 Ω
ibr − Ωibr | ≤ ηI B. Derivation of DG local controls
For the DGs, we derive optimized local controls for Active
Yes Power Curtailment (APC) and Reactive Power Control (RPC).
These controls take the form of simple, piece-wise linear char-
Stop
acteristic curves (such as in [18]), much like the local control
Fig. 2. Proposed centralized CC-OPF scheme for the computation of the schemes used today in industry. Unlike the current industry
optimal DER setpoints.
standards, these characteristics might have an arbitrarily large
number of piece-wise linear segments and are optimized for
uncertainty loop by m. The iterative procedure continues until each individual DG and DN.
all parts of the algorithm have reached convergence. Defining the location of the break-points and the slope
The convergence characteristics of the proposed method are coefficients is a non-linear and non-differentiable problem.
analyzed in [25], [32]. In [25], we show that the algorithm Thus, we employ the method in Algorithm 1 coming from [37]
works well for practical cases where the OPF solution does that iteratively refines the location of the break-points while
not change significantly, i.e. does not show sudden changes solving a constraint residual sum-of-squares (RSS) optimiza-
from iteration to iteration. In this case, the tightenings do tion problem for the slope coefficients.
not change much, and convergence is reached after a few
iterations. However, there might be cases where the algorithm
does not converge. As explained in [32], subsequent iterates in Algorithm 1 Local DG control design (x ∈ {p, q})
the algorithm might cycle between repeated points that have Input: Optimal DG setpoints
large differences in the associated tightenings. In that paper, Output: Optimized local characteristic curve
the authors followed a cut-and-branch approach to interrupt 1: Set ns , initialize the break-points s, i = 1, RSS0 = 1000
the cycling and enforce convergence. In our case, when we 2: Iterate:
are faced with non-convergent cases, the algorithm uses an T
X ns
X
2
acceleration factor changing the solution less aggressively to RSSi := min Pg,t · (xt − x̃t ) + γk2
avoid oscillations between repeated points, but at the cost of x̃0 ,β,s,γ
t k=1
increasing the needed number of iterations. subject to
ns
III. O PTIMIZED LOCAL CONTROL DESIGN
βk · (vt − sik ) · I(vt >sik ) +
P
x̃t = x̃0 +β0 · vt +
In this section, we describe the core idea of the paper as ns
k=1
summarized in Fig. 1. First, we discuss what kind of data are γk · I(vt >sik )
P
−
needed to perform the offline CC-OPF, which is explained k=1
Monotonicity and slope constraints
in detail in Section II-A. Then, after deriving the optimal
3: Update si+1
k = βγkk + sik and iteration index i = i + 1
DER setpoints, we explain how we design the individual local
4: Until: |RSSi − RSSi-1 | < 0.0001
controls for each DER using various ML techniques.
5: Post-process the derived characteristic curves to be com-
A. Optimal DER setpoint data generation plete for all voltage values.
The first step is to generate the optimal DER setpoint data Return: Break-points s and slope factors β for each DG as
that will be used for the training of the local controls. To {P, Q}DG =f (V )
7
First, we define the number of break-points ns and initialize node (Pg ) and the local voltage measurement (V ). We then use
them. Then, we use the iterative steps 2 − 4, where we solve these local features, in their actual or a higher dimensional
the residual sum of squares problem using the active power space through Kernels, to create a model that mimics the
injections as weights in the objective function, fitting the linear optimal response by the CC-OPF setpoints.
equivalent estimation model taking into account monotonicity In order to derive the best SVM model, we test three
and slope constraints. As inputs, we use the voltage vt for different Kernels: the linear ( Φ, ΦT in which case C in
each sample t, ∀t = 1, . . . , T . Then, we fit the linear model the objective function is a free parameter), the polynomial
based on the known breakpoints sik , ∀k = 1, . . . , ns at the ((γ Φ, ΦT + r)d where C and the polynomial order d are
current iteration i, the left slope β0 and difference-in-slopes free parameters) and the Radial-Basis Function (RBF) Kernel
T 2
βk . The indicator function I(·) becomes one when the inside (e(−γ|Φ−Φ |) where C and the kernel scale γ are free param-
statement is true. Finally, x̃0 is the model intercept and γ eters). Assuming a regression function f (Φ) = w, Φ + b,
a parameter which updates the location of the breakpoints we solve the convex optimization problem shown in Step 2,
towards the optimal one. for all these Kernels in order to identify the most suitable
Omitting the indices for clarity, the key idea is to substitute one. The constant C, also called box constraint, takes positive
the non-linear function β · (v − s) · I(v > s) where both the values and penalizes the observations that lie outside the region
difference-in-slope and the break-points are unknown, with its defined by , helping to prevent overfitting (regularization).
Taylor expansion using fixed break-points at each iteration i The value of C assesses the trade-off between the flatness of
β · (v − si ) · I(v >si ) − γ · I(v >si ) [37]. the regression function and the amount up to which deviations
The same method is used both for the APC and RPC curves, larger than are tolerated. Finally, we keep the model with
using respectively the PV optimal active (p) and reactive (q) the kernel resulting in the lowest overall out-of-sample error
setpoints from the CC-OPF. through a 5-fold cross validation process.
C. Local control of Battery Energy Storage Systems D. Local control of Controllable Loads
Due to the more complex behavior of BESSs, e.g. inter- For the controllable loads, we use an SVM model as a
temporal constraints, we chose an SVM regression model classifier, where we define three classes yc ∈ {−1, 0, 1} for
to approximate the optimal setpoints of active and reactive the ‘load decrease’, ‘no shifting’ and ‘load increase’ cases,
power for the BESSs. An SVM regression model calculates respectively. As features we use Φ = [V, Pg ], where V
a function, which deviates from the training data by a value is the local voltage measurement and Pg the active power
no greater than a predetermined margin ( in Algorithm 2), injection of the PV at the same node. Intuitively, high PV
and at the same time is as flat as possible. SVM models are injections increase local voltages triggering a load increase
very powerful because they can also model nonlinear functions action. The optimization problem is similar to the BESS case,
(or decision boundaries). This is achieved, by mapping the with G(Φ) = sign(f (Φ)) being the classifier.
training set from the input space into higher dimensional SVMs are able to deal with datasets with imbalanced class
spaces, called feature spaces, by performing a non-linear observations. This can be done by assigning different values
transformation using suitably chosen basis functions (kernels). for the box constraint (constant C) for ‘positive and ‘negative
Then, they solve the linear model in the new space problem, classes, i.e. changing the misclassification penalty for each
which describes a nonlinear behavior in the original (input) class. This is equivalent to changing the class observation
space [38]. The procedure of training the SVM controllers frequencies, i.e. oversampling the minority class. For example,
follows [19] and is summarized in Algorithm 2. We use if Cpos = 2 · Cneg this is in principle equivalent to training a
as features (Φ) the local active and reactive power demand standard SVM with C = Cneg after considering the positive
(Pload , Qload ), the active power injection of the PV at the same training samples twice. Such an approach implementing the
so-called class-weighted SVM has been introduced in many
references such as [39]. In our model, the classes of ‘load
Algorithm 2 Local BESS control design (x ∈ {p, q}) increase’ and ‘load decrease’ are balanced by design, due to
Input: Optimal BESS setpoints constraints (9), that impose preservation of the daily load.
Output: SVM model for the real-time BESS response Thus, since only the class no load shifting can comprise
1: For each BESS unit form Φ = [V, Pload , Qload , Pg ] and different amount of observation samples, we considered a
assume a function f (Φ) = w, Φ + b. different weight in this classification class.
2: Apply the linear, polynomial and radial-basis function
kernels to Φ. IV. C ASE S TUDY - R ESULTS
T
Solve: min 21 wT w + C (ξ + ξ ∗ )
P
To analyze the performance of the proposed control design
w,b,ξ t=1
subject to algorithm, we use a typical European radial LV grid [21],
x − w, Φi − b ≤ + ξ, ∀ (Φi , x) sketched in Fig. 3. The neutral is assumed to be earthed in
w, Φi + b − x ≤ + ξ ∗ , ∀ (Φi , x) several points, and due to the short lengths of cables the
3: Identify the kernel with the lowest out-of-sample error
capacitance is neglected. The pole grounding impedance is
40 Ω corresponding to distributed neutral earthing, and the
Return: {P, Q}B =f (V, Pload , Qload , Pg )
transformer grounding impedance 3 Ω. Following [21], the
8
PV 3 PV 5 PV 7 PV 10 PV 12
PV 16 PV 17 PV 18 PV 19
14 15 16
1
Qg /Qmax (p.u.)
LV 13 18
1 2 0.5
3 4 5 6 7 8 9 10 11
0
a,b,c
12 17 19 −0.5
−1
0.85 0.9 0.95 1 1.05 1.1
Fig. 3. Typical residential European LV grid [21]. Voltage magnitude (p.u.)
Fig. 4. Individual local characteristic curves for reactive power control of the
effect of the ground return path is considered in the primitive PV units at phase C.
impedance matrices. The interested reader is referred to [23]
for modeling details. use forecast error distributions from [42], and draw 1000
The load and PV panels are distributed to the three phases samples from the 9-hour ahead forecast error distribution of
unevenly, in order to simulate unbalanced conditions. More the summer power profiles similar to [25]. We assume a perfect
specifically, the total load taken from [21] is shared 25%-60%- spatial correlation, implying that all PVs follow the same
15% among the three phases. The installed PV capacity, is set distribution. An acceptable violation probability of = 5% is
PV
to Srated = 150% of the total maximum load of the entire used. Then, from theKaragiannopoulos
generated optimal
Stavros | 4/22/2018DER
| 1 setpoint data, we
feeder to the PV nodes = [3, 5, 7, 10, 12, 16, 17, 18, 19], and is derive the local controls as described in Section III. Figure 4
shared 25%-25%-50% among the three phases. shows the individual local characteristic curves derived with
Furthermore, a BESS is located on node 19 of phase C Algorithm 1 for the RPC of the PV units in phase C. It can be
with capacity 12 Srated
PV PV
kWh, where Srated is the rated power of seen that the units closer to the secondary of the substation,
the PV unit at that particular node. A flexible load of 5 kW i.e. 3, 5 and 12 show a capacitive behavior optimizing the
connected to phase C of Node 16, whose total daily energy losses, while the ones facing overvoltage problems at the end
consumption needs to be constant. Please note that we assume of the feeder, e.g. 16 and 19, show an inductive behavior at
single-phase connections for both the loads and the PV panels. smaller voltages than the maximum of 1.04 p.u.
For comparison, we perform three different investigations
To obtain BESS and controllable load models that behave
for the operation of the system:
well on unseen data, we perform cross-validation (or out-
• Method 0: The DGs are operating according to the
of-sample testing), which is a re-sampling procedure to test
German grid-code rules [30], and no other DERs are the models performance on new data. This procedure helps
allowed to be controlled by the DSOs. This corresponds identifying overfitting or selection bias issues and to provide
to the current practice in industry. intuition on how the model generalizes to an independent
• Method 1: All DERs are controlled based on the OPF-
dataset. In both SVM models, we followed a 5-fold cross-
based algorithm described in Section II assuming perfect validation procedure, partitioning the sample data into 5 sets
communication and monitoring infrastructure. As this of 144 samples. We train the SVM models using 4 folds,
serves as the benchmark of the best achievable perfor- and use the remaining to measure the performance. Finally,
mance, we consider perfect measurements and predictions after combining (averaging) the results of multiple rounds of
for the whole time horizon without any uncertainty.
• Method 2: All DERs are operating according to the 1
individual controls derived in Section III.
no load shifting
The implementation was done in MATLAB. For the cen- load decrease
0.8
Local PV injection (p.u.)
tralized OPF-based control, YALMIP [40] was used as the load increase
modeling layer and Gurobi [41] as the solver. The results were
obtained on an Intel Core i7-2600 CPU and 16 GB of RAM. 0.6
TABLE I
S UMMARIZED MONTHLY RESULTS FOR ALL METHODS ( ONLY THE
LARGEST OBSERVED VALUE IS LISTED )
Method 0 1 2
Losses (%) 4.60 4.42 4.45
|V |max (p.u.) 1.069 1.04 1.045
|I|max (%) 119.94 100 99.49
V U Fmax (%) 1.81 1.98 2.33
Pcurt (%) 0 1.08 2.03
Voltage (p.u.)
injections higher than 0.3 p.u. the load is increased to reduce
the local voltage in combination with the other available
measures. In low PV injections, e.g. during evening hours, the 1.04
load is decreased to maintain the total daily demand constant,
or is not shifted. 1.02
B. Results 1.02 1
Table I summarizes the results from applying the three 24 48 72 96 120 144 168 192 216 240
methods in real-time operation for a test period of one month. Time (h)
Method 1 corresponds to the benchmark as it satisfies all Fig. 7. Voltage magnitude evolution at phase C of Node 19.
security constraints and minimizes the objective function.
1 02 1 2 |I|ma
Thermal loading (%)
In this paper, we propose a data-driven local control design [17] O. Sondermeijer, R. Dobbe, D. Arnold, and C. Tomlin, “Regression-
methodology to derive local DER controls that can mimic the based Inverter Control for Decentralized Optimal Power Flow and
Voltage Regulation,” IEEE PES General Meeting, 2016.
centralized controller optimal behavior, without the need for [18] S. Karagiannopoulos, P. Aristidou, and G. Hug, “Hybrid approach
monitoring and communication infrastructure. This is based for planning and operating active distribution grids,” IET Generation,
on using ML techniques to derive optimized local controls Transmission & Distribution, pp. 685–695, Feb 2017.
[19] F. Bellizio, S. Karagiannopoulos, P. Aristidou, and G. Hug, “Optimized
based on historical data processed through a CC-OPF. The local control schemes for active distribution grids using machine learning
controllers are simple to compute, understand, and implement. techniques,” in IEEE PES General Meeting, June 2018.
Yet, we have shown through the examples used that the [20] S. Karagiannopoulos, P. Aristidou, and G. Hug, “Co-optimisation of
Planning and Operation for Active Distribution Grids,” in Proceedings
proposed local controls can tackle security problems in an un- of the 12th IEEE Power and Energy Society PowerTech Conference,
balanced and challenging environment while at the same time Manchester, Jun 2017.
optimize its operation. Future work will focus on comparing [21] K. Strunz, E. Abbasi, C. Abbey, C. Andrieu, F. Gao, T. Gaunt, A. Gole,
N. Hatziargyriou, and R. Iravani, “Benchmark Systems for Network
data-driven control schemes using other ML techniques, and Integration of Renewable and Distributed Energy Resources,” CIGRE,
subsequently, on assessing risks and challenges of using such Task Force C6.04, no. 273, pp. 4–6, 4 2014.
schemes at operating conditions, which were not seen in the [22] L. Ochoa, R. Ciric, A. Padilha-Feltrin, and G. Harrison, “Evaluation
of distribution system losses due to load unbalance,” Power Systems
training dataset. Computation Conference, Liège, Belgium, 2005, vol. 5, no. August, p. 4,
R EFERENCES Nov 2005.
[23] W. H. Kersting, Distribution System Modeling and Analysis, 2002.
[1] N. Hatziargyriou, O. Vlachokyriakou, T. Van Cutsem, J. Milanović, [24] J. H. Teng, “A direct approach for distribution system load flow
P. Pourbeik, C. Vournas, M. Hong, R. Ramos, J. Boemer, P. Aristidou, solutions,” IEEE Transactions on Power Delivery, vol. 18, no. 3, pp.
V. Singhvi, J. dos Santos, and L. Colombari, “Task Force on Contribution 882–887, 2003.
to Bulk System Control and Stability by Distributed Energy Resources [25] S. Karagiannopoulos, P. Aristidou, L. Roald, and G. Hug, “Operational
connected at Distribution Network,” IEEE PES, Tech. Rep., 2017. Planning of Active Distribution Grids under Uncertainty,” in IREP 2017,
[2] P. Fortenbacher, M. Zellner, and G. Andersson, “Optimal sizing and X Bulk Power Systems Dynamics and Control Symposium, Aug 2017.
placement of distributed storage in low voltage networks,” in Pro- [26] S. Karagiannopoulos, P. Aristidou, and G. Hug, “A Centralised Control
ceedings of the 19th Power Systems Computation Conference (PSCC), Method for Tackling Unbalances in Active Distribution Grids,” in
Genova, Jun 2016. in Proceedings of the 20th Power Systems Computation Conference
[3] S. Karagiannopoulos, P. Aristidou, A. Ulbig, S. Koch, and G. Hug, “Op- (PSCC), Dublin, June 2018.
timal planning of distribution grids considering active power curtailment [27] P. Pillay and M. Manyage, “Definitions of Voltage Unbalance,” IEEE
and reactive power control,” IEEE PES General Meeting, 2016. Power Engineering Review, vol. 21, no. 5, pp. 49–51, 2001.
[4] J. Lavaei and S. H. Low, “Zero duality gap in optimal power flow [28] IEC 61000-3-14:, “Electromagnetic compatibility (EMC) - Part 3-14:
problem,” IEEE Transactions on Power Systems, vol. 27, no. 1, pp. Assessment of emission limits for harmonics, interharmonics, voltage
92–107, 2012. fluctuations and unbalance for the connection of disturbing installations
[5] D. K. Molzahn and I. A. Hiskens, “Sparsity-Exploiting Moment-Based to LV power systems.” Tech. Rep., 2011.
Relaxations of the Optimal Power Flow Problem,” IEEE Transactions [29] EN 50160, “Standard EN 50160, voltage characteristics of electricity
on Power Systems, vol. 30, no. 6, pp. 3168–3180, Nov 2015. supplied by public electricity networks,” 2010.
[6] D. K. Molzahn, B. C. Lesieutre, and C. L. DeMarco, “Investigation [30] VDE-AR-N 4105, “Power generation systems connected to the LV
of Non-zero Duality Gap Solutions to a Semidefinite Relaxation of distribution network.” FNN, Tech. Rep., 2011.
the Optimal Power Flow Problem,” in 2014 47th Hawaii International [31] D. Bienstock, M. Chertkov, and S. Harnett, “Chance-Constrained Op-
Conference on System Sciences. IEEE, jan 2014, pp. 2325–2334. timal Power Flow: Risk-Aware Network Control under Uncertainty,”
[7] A. S. Zamzam, N. D. Sidiropoulos, and E. Dall’Anese, “Beyond Relax- SIAM Review, vol. 56, no. 3, pp. 461–495, Jan. 2014.
ation and NewtonRaphson: Solving AC OPF for Multi-Phase Systems [32] L. A. Roald, D. K. Molzahn, and A. F. Tobler, “Power System Opti-
With Renewables,” IEEE Transactions on Smart Grid, vol. 9, no. 5, pp. mization with Uncertainty and AC Power Flow: Analysis of an Iterative
3966–3975, Sep 2018. Algorithm,” in IREP 2017, X Bulk Power Systems Dynamics and Control
[8] S. Bolognani and F. Dörfler, “Fast power system analysis via implicit Symposium, Aug 2017.
linearization of the power flow manifold,” in Proc. 53rd Annual Allerton [33] L. Roald, F. Oldewurtel, B. Van Parys, and G. Andersson,
Conference on Communication, Control, and Computing, 2015. “Security Constrained Optimal Power Flow with Distributionally
[9] R. Tonkoski, L. A. C. Lopes, and T. H. M. El-Fouly, “Coordinated Robust Chance Constraints,” aug 2015. [Online]. Available:
active power curtailment of grid connected PV inverters for overvoltage http://arxiv.org/abs/1508.06061
prevention,” IEEE Transactions on Sustainable Energy, vol. 2, no. 2, pp. [34] L. Roald, F. Oldewurtel, T. Krause, and G. Andersson, “Analytical refor-
139–147, 2011. mulation of security constrained optimal power flow with probabilistic
[10] P. Kotsampopoulos, N. Hatziargyriou, B. Bletterie, and G. Lauss, constraints,” in Proceedings of the 10th IEEE Power and Energy Society
“Review, analysis and recommendations on recent guidelines for the PowerTech Conference, Grenoble, Jun 2013.
provision of ancillary services by Distributed Generation,” in IEEE [35] L. Roald and G. Andersson, “Chance-Constrained AC Optimal Power
IWIES, 2013, pp. 185–190. Flow: Reformulations and Efficient Algorithms,” Jun. 2017. [Online].
[11] S. Bolognani and S. Zampieri, “A distributed control strategy for Available: https://arxiv.org/abs/1706.03241
reactive power compensation in smart microgrids,” IEEE Transactions [36] J. Schmidli, L. Roald, S. Chatzivasileiadis, and G. Andersson, “Stochas-
on Automatic Control, vol. 58, no. 11, pp. 2818–2833, Nov. 2013. tic AC optimal power flow with approximate chance-constraints,” in
[12] F. Olivier, P. Aristidou, D. Ernst, and T. V. Cutsem, “Active management IEEE Power and Energy Society General Meeting (PESGM), Jul 2016.
of low-voltage networks for mitigating overvoltages due to photovoltaic [37] V. M. R. Muggeo, “Estimating regression models with unknown break-
units,” IEEE Transactions on Smart Grid, vol. 7, no. 2, pp. 926–936, points,” Statistics in Medicine, vol. 22, no. 19, pp. 3055–3071, oct 2003.
March 2016. [38] T. Hastie, R. Tibshirani, and J. Friedman, The elements of statistical
[13] Y. Guo, K. Baker, E. Dall’Anese, Z. Hu, and T. Summers, “Data- learning: data mining, inference and prediction. Springer, 2009.
based distributionally robust stochastic optimal power flow, Part I: [39] E. E. Osuna, R. Freund, and F. Girosi, “Support Vector Machines :
Methodologies,” IEEE Transactions on Power Systems, 2018. Training and Applications,” MIT, vol. 9217041, no. 1602, 1997.
[14] ——, “Data-based distributionally robust stochastic optimal power flow, [40] J. Löfberg, “Yalmip : A toolbox for modeling and optimization in
Part II: Case studies,” IEEE Transactions on Power Systems, 2018. matlab,” in In Proceedings of the CACSD Conference, Taiwan, 2004.
[15] A. Garg, M. Jalali, V. Kekatos, and N. Gatsis, “Kernel-Based [41] I. Gurobi Optimization, “Gurobi optimizer reference manual,” 2016.
Learning for Smart Inverter Control,” July 2018. [Online]. Available: [Online]. Available: http://www.gurobi.com
https://arxiv.org/pdf/1807.03769.pdf [42] “MeteoSwiss - Federal Office of Meteorology and Climatology.”
[16] R. Dobbe, O. Sondermeijer, D. Fridovich-Keil, D. Arnold, D. Callaway, [Online]. Available: http://www.meteoswiss.admin.ch/
and C. Tomlin, “Data-Driven Decentralized Optimal Power Flow,”
2018. [Online]. Available: http://arxiv.org/abs/1806.06790
11