Stochastic Optimization of PQ Powers at the Interface between Distribution and Transmission Grids

: This paper addresses the volt-var control of distribution grids embedding many distributed generators (DGs). Speciﬁcally, it focuses on the compliance of powers to speciﬁed PQ diagrams at the high voltage/medium voltage (HV/MV) interface while the voltages remain well controlled. This is achieved using a two-stage optimization corresponding to two different classes of actuators. The tap position of capacitor banks is selected on a daily basis, given a stochastic model of the input powers prediction, which allows infrequent actuation and increases the device lifespan. In a second stage, a conﬁdence level optimization problem allows to tune on an hourly basis the parameters of the DGs reactive power afﬁne control laws. Results on a real-size grid show that the combined tuning of these actuators allows the ability to comply with European grid codes while the control effort remains reasonable.


Introduction
The variability of active power flows in distribution grids increases with the insertion of distributed generators (DG). As a consequence, the voltages of distribution grids become more fluctuating but can be mitigated by controlling the DGs reactive powers. This leads the DGs, in addition to their active power production, to consume reactive power to compensate over-voltages, which increases the overall consumption of the distribution grid. On the other hand, the growing distance of underground cable generates massive reactive power. Although both problems yield adverse effects, they make the transmission grid voltage control more difficult. In order to reduce power changes at the high voltage/medium voltage (HV/MV) interface, European regulations, specifically the Demand Connection Code (DCC) [1] request that the distribution system operators (DSO) comply with a contractual PQ diagram ( Figure 1). Traditionally, capacitor banks (CBs) are used to compensate the reactive power consumption of distribution grids. However, in the context of future grids, their action might not be sufficient, specifically in the cases where the distribution grid produces reactive power, or where a consumption of reactive power stems from voltage control. Therefore, the control of HV/MV interface powers, which have to remain in the contractual diagram, should not rely on CBs alone, but needs to be also supported by the reactive power of some DGs. The optimal coordination of these actuators is the topic of this paper. The main difficulty consists of considering contractual and industrial constraints without undertaking any hardware or grid modification. First, CBs are very fragile and costly devices that should be actuated the least possible, and their lifespan is strongly correlated with the number of tap changes. In this paper, it was chosen that the tap change periodicity should be at most daily. Secondly, today's communication systems allow, at most, to send information to DGs on an hourly basis and the DG powers are limited by the contractual diagram represented in Figure 2. A reasonable choice is to keep the local droop structure for DG reactive power control and update the parameters to a supervision algorithm. Hence, the supervisory controller of the actuators displays two-time scales, an hourly one for the DGs reactive power controllers, and a daily one for CB control. P import P export Q import Q export 0.25 P max−import Q max = 0.48 P max Q min = −0.48 P max Forbidden area , point 1 Forbidden area , point 2 A day-ahead rolling window parameter optimization requires us to consider the predictions of power consumption and production. However, by nature, the renewable energies are intermittent and their forecasts are uncertain. A stochastic optimization [2] allows us to encompass the minimization of risks of failure at reasonable actuation prices. In the literature of distribution grid control algorithms, many papers which achieve volt/var stochastic optimization use scenarios or robust optimization in order to take uncertainties into account [3][4][5]. These papers do not require the probability density functions of the input variables; however, they provide little information about the stochastic properties of the voltages and powers inside the grid [6]. Contrary to these procedures, stochastic optimization avoids conservative gain tuning with an unnecessary safety margin, by considering probabilistic density functions and confidence levels as in [7][8][9]. However, these papers address voltage control issues and are not dedicated to HV/MV interface powers control. Few papers deal with the control of powers at the HV/MV interface. The papers [10,11] propose a centralized optimization of DGs local controllers in order to control the powers HV/MV interface but they do not consider capacitor banks. The paper [12] introduces a two-stage optimization of interface powers considering uncertainties. In this paper, the two-time scales are used to schedule the planning and perform the operational optimization, however the limitation of the number of CBs tap change and stochastic objective are not considered. To sum up, these papers focus on control of the HV/MV interface powers without taking advantage of the stochastic nature of the grid variables.
The paper [3] deals with the stochastic nature of the input variables using two time scales, the slow one encompassing capacitor banks and on load tap changer (OLTC) control, and the faster one dealing with reactive power reserves (DG control). However, the objectives and methods are quite different. The paper does not consider an interface PQ diagram. Moreover, the centralized optimization does not keep the industrial local droop-like reactive power control structure. As a result, only a constant reactive power value is supplied for each time interval, which makes it less compliant to disturbances or sparse communication. The optimization methods are based on scenarios instead of probability density functions and confidence levels which makes them efficient but more complex to work out.
Hence, this paper proposes a two-stage stochastic optimization to tune the parameters of the distribution grid HV/MV interface reactive power controllers. The hybrid optimization problem involves both discrete control variables (CBs tap positions), and continuous variables (parameters of DGs reactive power controllers). A model of the grid is proposed, and, under the assumption of truncated Gaussian inputs (production and consumption) powers, voltages and reactive power probability density functions are supplied. In a second time, a voltage control strategy is briefly recalled, which can be based on hourly control parameters updates such as in [9]. Next, the optimal CB tap position is selected using daily forecasts, and the limitations of a strategy using only a constant CB position is explained using PQ diagrams. Then, an optimization program is solved which tunes the parameters of the DG reactive power controllers using hourly forecasts. Finally, the method is applied to a case study.

Linear Power Flow Models of a Distribution Grid
The commonplace model of distribution grids displays nonlinear equations which make optimization routines very difficult to solve. In order to alleviate this complexity, accurate linear voltage estimations at the steady state were proposed by Bolognani and Zampieri [13,14], assuming a sinusoidal behavior of the voltages and currents which share a common frequency. An extension of this model to a full system [15] considers voltages ( V) and powers at the interface ( P HTB , Q HTB ) as linear functions of node load/production active ( P) and reactive ( Q) powers.
P HTB = C P P + D P Q + 1 P 0

HTB
(2) where A, B, C P , D P , C Q , D Q are constant matrices and 1 is the vector of all ones. These equations hold under mild assumptions [13,14] that apply to distribution grids as discussed in [15,16], who shows that the accuracy on node voltages remains below 0.001 p.u. and below 0.1 MVA for powers. The values V 0 , Q 0 HTB depend respectively on the OLTC and capacitor banks tap positions. These control variables are supervised by the distribution system operator, while the DGs reactive powers, which are the remaining control variables, are generally equipped with local control laws [17].
The distribution grid used in this paper is displayed in Figure 3. It is a real grid where two distributed generators (3 MW nominal power each) are added without modifying its topology in order to generate overvoltages. The grid has 3441 nodes, 690 loads, 21 generators (mainly PV), which are distributed on 27 feeders, each color in Figure 3 represents a feeder. The maximal consumption of loads is 94.7 MW and 38 MVAr. The nominal power of all generators is 35.5 MW. This network is quite representative of a real distribution grid. The idea is to check whether an appropriate control law allows to add two DGs without topological modifications.

Daily Stochastic Inputs in a Distribution Grid
The uncontrolled inputs of the network are the consumption and production powers which are very intermittent. Hence, it is important to consider and embed the error estimation of the forecast power into the control algorithm. Indeed, the statistical properties of the node voltages and the HV/MV reactive power can be inferred from the linear model (Equations (1)-(3)) along with forecasting data and model uncertainties. One can obtain not only the voltage expectations, but also their probability density functions and confidence levels.
Future productions and consumption are provided by short term (hourly) most probable forecasts [18,19]. As these forecasts are never accurate, uncertainties inferred from historical data are added (see Table 1). In the application case, daily consumption and production profiles are illustrated in Figures 4 and 5, they have an hourly basis.    Today, the DSOs usually optimize the parameters of the DGs reactive power controllers over a long horizon. As explained in the introduction, real-time control cannot be implemented in real-life distribution grids, and technological limitations make it preferable to keep traditional droop control structures and update periodically (e.g., hourly) their gains depending on the power inputs. This solution allows us to optimize the interface PQ powers without overloading the communication system. A faster update of parameters can improve the control performance, however it requires a more reliable communication system. However, as the CBs lifespan is strongly correlated to the number of tap changes, it is a reasonable assumption to allow, at most, one tap change to occur on a daily basis. Therefore, the daily profile used for CB control is built from the sum of the hourly forecasts used for DG reactive power control, Figures 6 and 7 display respectively the probability density functions of the consumption and the production during a full day.  These PDFs are represented by Gaussian mixture models over 24 h, combining the hourly Gaussian models proposed in [20]. The consumption consists exactly in a mean of PDFs of Gaussian variables whereas the production is physically bounded between 0% and 100% of its maximal value. In this latter case an important modeling error would be generated if pure Gaussian PDFs were considered. For example, a negative load factor can be remarked in Figure 7. Indeed, the probability density function of a Gaussian variable is supported on the whole real line, and, in some cases, nearly 50% of the density probability lies outside the physical bounds. Hence, the solution consists of using a truncated Gaussian variable instead [9]. Noting µ P and σ P the mean and standard deviation of the forecast power, the corresponding law has three parts: • A truncated Gaussian, with truncations 0 and 1, characteristics µ P , σ P : • A Dirac distribution at 0 with which area is the probability that the forecast is below 0 : • A Dirac distribution at 0 with which area is the probability that the forecast is above 1 : However, using truncated Gaussian probabilities in a model which will be incorporated into an optimization problem requires a complicated method to propagate truncations over the voltage nodes (for full details, see [9]). A simplified method consists of approximating node voltages by Gaussian variables, which can be achieved if the inputs (production and consumption powers) are themselves Gaussian, since the grid model used in this paper is linear (Equation (1)). It has been chosen to model the input distributions by a Gaussian law obtained with a maximum likelihood approximation. The moments of the distribution are given in Equations (7) and (8).
The mean and standard equation of a Gaussian law truncated in 0 and 1 are found in Equations (9) and (10) where x → φ(x) is the probability density function and x → Φ(x) the cumulative density function of the standard Gaussian law N (0, 1). Now, these equations can be used to display the node powers as stochastic Gaussian variables. Replacing into the linear model (Equations (1)-(3)) yields in turn Gaussian node voltages, Gaussian active and reactive powers at the transmission-distribution grids interface. The results of this method can be then analyzed hereafter on the studied distribution grid.

Two-Stage Optimization Tuning of HV/MV Reactive Power Control
First, it is important to notice that the voltage control inputs have a weak influence on the HV/MV interface reactive power, and, conversely, HV/MV reactive power controllers cause no change of voltage, as long as there is no saturation of the actuators (e.g., when the selected tap number is below the maximum tap). In this case, the actuators used to control the grid voltage are : • The OLTC which controls the voltage of the secondary node of the distribution transformer. The controller selects the tap which minimizes the difference between the voltage setpoint and the real secondary voltage. Actuation delays are generally added to avoid untimely tap changing and ensure the stability of the electrical system.

•
The reactive powers of DGs located in mixed feeder (with both loads and DGs). These DGs are not usually very influential due to their low impact on voltage changes and risks of over-voltage. Their controllers can be either piecewise linear (with a deadband) or linear with the power and the voltage.
The actuators used to control the interface reactive power are : • The capacitor banks which are located at the secondary node of the distribution transformer. Their controller selects a tap for a duration of 24 h.

•
The reactive powers of DGs located in dedicated feeders (which embed only DGs). The cables within these feeders are typically sized to avoid overcurrent issues. As a consequence, there are no voltage issues in dedicated feeders. For these DGs, the controllers are affine with the power (it is possible to show that it is useless to use a linear function with the voltage) and can be updated every hour. Now, the optimization procedure can be achieved independently for each family of actuators (either for voltage or HV/MV reactive power control). This paper proposes a stochastic optimization of the HV/MV interface reactive power considering that the voltage control issue has already been addressed by a classical or advanced algorithm.

Voltage Control
Voltage control in distribution grids is a widely discussed problem in the literature. This paper is not dedicated to voltage control and any algorithm can be used as long as the parameters remain unchanged during at least one hour.
The European grid code Requirement for Generators [21] defines general guidelines for PQ diagram constraints of distributed generators. These constraints can be customized and adapted to each country. In France, this yields the DG PQ diagram given in Figure 2. This diagram displays reactive power bounds at −0.35P N i and 0.4P N i . The value of tan(phi) = Q/P which minimizes the voltage issues can be inferred directly. Hence, the value tan(phi) = −0.35 is used for voltage control. In the case where this control law is not able to reach an operating point in the diagram (e.g., P i = 0.2P N i , Q i = 0.1P N i ), another control law such as an appropriate Q = f (U) can be used instead [9]. Figure 8 displays the minimum and maximum possible voltages along the 24 hourly windows. In the case study, the node voltages remain between the specified bounds (−0.95; 1.05 p.u.). Designing a sophisticated controller is not necessary to meet the voltage specifications, but the corresponding control effort is important, specifically at daytime with a high production rate, as can be seen in Figure 9.  In order to reduce the reactive power effort, many other control algorithms can be used. As an example, a stochastic optimization based on hourly forecasts has shown nice results and reduced drastically the DGs effort. This method consists in the optimization of the parameters of DGs controllers on a hourly basis using confidence level optimization. The optimization criterion is a weighted sum of confidence levels that node voltages remain within prescribed bounds, of confidence levels that node PQ powers remain within prescribed domains and of the actuation efforts. The DGs controllers can be chosen as linear or piecewise linear. Since the inputs are Gaussian and the power flow model is linear, the model of the node voltages probability density functions are either Gaussian or a sum of truncated Gaussian depending on the DG control structure. The linear case is detailed in [20] and the piecewise linear case in [9].

Optimization Strategy
After the voltage control is achieved, the HV/MV reactive power control can be carried out. The first step is to select, from daily powers profiles, the CB tap position that maximizes the confidence level that the HV/MV interface remain within the PQ diagram Figure 1. During this tuning procedure, the reactive powers of the DGs of dedicated feeders are not called for. In a second step, DG reactive power control parameters are tuned to further minimize PQ diagram outage using hourly forecast.

PQ Diagram Constraints for Fixed Capacitor Bank Tap Position
There are a limited number of CB tap positions, and one can easily consider their daily influence on the PQ diagram at the HV/MV interface. Figures 10 and 11 display the PQ diagram at the interface when the capacitor banks tap position is respectively 0 and 6 (maximum value), which can be compared to the DCC constraints represented in Figure 1.  It is worthy to note that no fixed tap position allows to meet the DCC constraints. When the CBs are idle (position 0), the PQ diagram does not meet the DCC constraints, as the reactive power upper bound is reached. Whenever all CBs are actuated, at the maximum tap position, the stochastic diagram is shifted below, leaving a strong probability for the distribution grid to export reactive power towards the transmission grid.
As the number of tap positions (the discrete optimization variable) is small, finding the optimal tap can be achieved easily by computing the confidence level of the DCC diagram violation for each position, as displayed in Figure 12 and comparing the different values. The optimal tap position is the tap 1, which yields PQ specifications violation risks to 6%. This is above the requested maximum level which is 5%. Hence, it is necessary to coordinate CB tap control with DGs reactive power controllers. A fine look at the time profiles allows to analyze the source of PQ diagram specifications violations and set the DGs activation periods which correspond to different configurations:

•
The consumption exceeds 48% of the maximal power ( time windows 20 h and 21 h). The DG droop controllers may inject reactive power to decrease the reactive power consumption in the grid.

•
On the contrary, when the consumption is quite low (P HTB < 0.25 × P max ), reactive power can be exported to the transmission grid (hourly windows 3, 4, 5 and 6 h). On the contrary, DGs can be requested to compensate the phenomenon by consuming reactive power.
This subsection shows how to perform the first stage of the optimization routine, that is to select the CB tap position that minimizes PQ diagram outage at the HV/MV interface. Once this tap is selected, the second stage consists in tuning the DG reactive power control parameters using confidence level optimization.

Setting a Confidence Level Optimization Problem to Tune DGs Reactive Power Controllers Parameters
In this second stage, the DGs reactive power controllers parameters are updated hourly to minimize the risk of outage of the specified HV/MV interface PQ diagram. The objective of this optimization is to tune the parameters of each DG. It is recalled that the DG local control laws are affine : i . This stochastic optimization program considers sub-objectives which involve means, variances and confidence levels:

•
Maximize confidence levels λ i such that the DG power at node i remains within the contractual PQ domain ; • Maximize confidence level ν such that the powers at the HV/MV interface ( P HTB , Q HTB ) remain within the PQ diagram specified in the grid codes, see Figure 1.
• Minimize the variance of the reactive power at the HV/MV interface var(Q HTB ).
The global objective is a weighted sum of these sub-objectives: Equation (11).
The optimization program embeds additional specific constraints described hereafter: • Confidence levels λ i should be above a specified minimal value λ s for all nodes.

•
Confidence levels δ l should be above a specified minimal value δ s for all nodes (that is the confidence levels that the line currents are lower than the maximum authorized current). This constraint is always verified in this study, whatever the consumption or production rates.

•
Confidence level ν should be above a specified minimal value ν s .
In this study, the values λ s = δ s = ν s = 0.95 are considered. The selection of the weighting factors is done using a Pareto front study in the same way as [9], leading to the following numerical values in Equations (15)- (18).
The previous optimization problem is applied to the case study. The DG effort contribution is restricted by the producers PQ capability diagram. When the production is above 20%, the reactive power is bounded within [−0.35; 0.4] p.u., the limitations shown in Figure 2 are even more severe when the production is weaker. Similar to the stochastic optimization of the voltage control addressed in [20], this problem is convex and can be solved using a classical interior point method (Matlab routine). Table 2 displays the optimized droop gains and constant terms and the corresponding DCC diagram outage risk when reactive powers are zero. In order to balance control efforts, these should be identical for all DGs. In this table, it can be seen that DGs reactive power controllers are not activated except for the time windows 20 h and 21 h. For both times, the initial outage risks are higher than 1%, which greatly contributes to the overall risk. Hence, the optimization routine should pay a special attention to decrease the outage risks in these time windows. At time 20 h, a constant reactive power demand Q 0 i = 0.235 reduces the risk from 0.0185 to 0.0072. At time 21 h, the active power is low (lower than 0.2 pu) and a maximum droop gain value is selected. On a daily basis, in this case, the diagram outage risk is lowered from 6% to 4.7% and complies with the optimization program constraints. The corresponding DG efforts are displayed in Figure 13. The optimized PQ diagram at the HV/MV interface can be seen in Figure 14, which shows that the outage risks are evenly shared between the two main forbidden areas. Parameter optimization allowed to cut the overshoot of the maximum power of 4.8% . This last subsection has demonstrated that the joint optimization of DG reactive power control parameters allows to increase drastically the reliability of the grid. Both confidence levels that DGs and HV/MV interface powers remain within prescribed PQ diagrams are improved, with a limited actuation cost.

Conclusions
A new optimization algorithm has been proposed to improve the control of reactive power flows within distribution grids with many distributed generators. This algorithm is complimentary with voltage control which is ensured by a joint actuation of the OLTC and a control of the reactive power of DGs located into mixed feeders (feeders with both loads and power sources). The main problem addressed in this paper is to tune controllers such that the confidence levels that the powers at the HV/MV interface remain within specified diagrams. This is achieved by a two-stage optimization routine which works at different time-scales. the algorithm uses an accurate linear power flow and an assumption that power consumptions and productions are Gaussian variables. In a first step, the tap position of capacitor banks that minimizes these risks for a standard controller tuning is selected. The time window for this optimization is of one day because the expensive CBs lifespan depends on the number of tap changes, which should be drastically limited. The second stage is done on smaller time-scale (typically one hour), where the parameters of reactive power controllers of DGs in dedicated feeders are adjusted by solving a confidence level optimization problem. Results on a case study show that, after the first step, confidence levels that powers remain within prescribed PQ diagrams are not small enough, but that the two stage optimization tuning procedure allows to comply with specifications at a low actuation cost. Normal distribution with mean µ and variance σ 2 x → φ(x) Standard Gaussian probabilistic distribution function x → Φ(x) Standard Gaussian cumulative distribution function w i Objective function weighting factors