Optimal Control of Wind Farms for Coordinated TSO-DSO Reactive Power Management

The growing importance of renewable generation connected to distribution grids requires an increased coordination between transmission system operators (TSOs) and distribution system operators (DSOs) for reactive power management. This work proposes a practical and effective interaction method based on sequential optimizations to evaluate the reactive flexibility potential of distribution networks and to dispatch them along with traditional synchronous generators, keeping to a minimum the information exchange. A modular optimal power flow (OPF) tool featuring multi-objective optimization is developed for this purpose. The proposed method is evaluated for a model of a real German 110 kV grid with 1.6 GW of installed wind power capacity and a reduced order model of the surrounding transmission system. Simulations show the benefit of involving wind farms in reactive power support reducing losses both at distribution and transmission level. Different types of setpoints are investigated, showing the feasibility for the DSO to fulfill also individual voltage and reactive power targets over multiple connection points. Finally, some suggestions are presented to achieve a fair coordination, combining both TSO and DSO requirements.


Motivation
Over the past decade, growth in renewable generation has led to substantial increase in decentralized generation located in distribution grids [1]. In classical power system operation, reactive power has been mainly balanced by large generation units in the transmission grid, in addition to compensating equipment and Flexible AC Transmission Systems (FACTS). The Transmission System Operator (TSO) has been in charge of coordinating different reactive sources (mainly synchronous generators and compensation units) to ensure the reactive power balance of the entire system. In the future, this bulk generation capacity will likely decrease and reactive power provision by distributed generation (DG) will gain a significant role [2]. Moreover, voltage control and reactive power management have been traditionally addressed in a rather uncoordinated way between distribution and transmission system [3]. Distribution systems acted mainly as passive networks and the possible use of On Load Tap Changer (OLTC) transformers together with load power factor correction were the main methods for the Distribution System Operator (DSO) to perform local voltage control. With the current capacity of distributed generation mainly installed under DSO control, challenges It can be concluded that most existing studies adopt a passive approach to DSO participation in reactive power management, assuming fixed setpoints or targets which are computed without considering actual DSO flexibility potential. Conversely, an active inclusion of distribution grids in the TSO voltage regulation mechanism implies that a flexibility statement is provided to the TSO in the proper time horizon in order to be used for the determination of setpoints through the TSO scheduling or real-time regulation process. Only in this way, the distribution grids can be considered real competitors of conventional power plants in the reactive power provision to the TSO.

Contribution of This Paper
The paper at hand investigates the optimal operation of DG located in 110 kV distribution grids to contribute to local and regional reactive power management and reactive power provision to the transmission grid. A coordination mechanism between TSO and DSO based on an Optimal Power Flow (OPF) tool featuring Model Predictive Control (MPC) and Multi-Objective (MO) optimization is presented. The mechanism involves the coordination between two real-time OPF running in the control centers of the TSO and DSO respectively. An interaction chain based on sequential optimizations and exchange of relevant data and setpoints is defined. The performance of the proposed mechanism is evaluated through simulations on a regional-scale grid model featuring a portion of the German transmission system and a real German 110 kV distribution grid model with 1.6 GW of total installed wind power capacity. Different control modes (cosφ, Q and Q(U)) for wind farms are also implemented in the OPF. Figure 1 shows the scheme of the proposed interaction between TSO and DSO for an optimal coordinated overall operation. The paper is organized as follows: in Section 2 the mathematical model of the developed OPF tool used for the transmission as well as for the distribution system is detailed, in Section 3 the proposed coordination scheme between TSO and DSO is explained. Section 4 contains the description of the simulation setup and time series data. Simulation results are shown in Section 5, while Section 6 provides the conclusion.

Mathematical Model of the OPF Tool
A flexible and comprehensive OPF tool was developed to be applied at both distribution and transmission level. For the present application, an Optimal Power Flow tool was chosen, belonging to the class of Mixed-Integer Non-Linear Problems (MINLP), due to the presence of discrete variables, such as OLTC tap positions. Furthermore, a model predictive control was introduced through a multi-step optimization, in order to smooth in time control signals and reduce OLTC operations. The The paper is organized as follows: in Section 2 the mathematical model of the developed OPF tool used for the transmission as well as for the distribution system is detailed, in Section 3 the proposed coordination scheme between TSO and DSO is explained. Section 4 contains the description of the simulation setup and time series data. Simulation results are shown in Section 5, while Section 6 provides the conclusion.

Mathematical Model of the OPF Tool
A flexible and comprehensive OPF tool was developed to be applied at both distribution and transmission level. For the present application, an Optimal Power Flow tool was chosen, belonging to the class of Mixed-Integer Non-Linear Problems (MINLP), due to the presence of discrete variables, such as OLTC tap positions. Furthermore, a model predictive control was introduced through a multi-step optimization, in order to smooth in time control signals and reduce OLTC operations. The main features of the proposed tool are detailed in [12,19], and are enhanced with several Energies 2018, 11, 173 4 of 25 functionalities in order to extend their use to transmission systems and study TSO-DSO interactions: Q(U) control of wind farms, modelling of PV nodes to account for transmission connected synchronous generators in large power plants, inclusion of individual voltage and reactive power setpoints in the MO function, multi-area optimization. For the modeling, General Algebraic Modeling Language (GAMS) [20] is used and the OPF problem is solved with KNITRO [21]. The following objective functions (OFs) are included using weighting factors µi in the MO OPF formulation: min u µ VP f profile + µ losses f losses + µ ∆tap f Tap + µ ∆Q f ∆Q + µ Vext f Vext + µ ∆Q cp f ∆Q cp (1) Smoothing of voltage profile: Minimization of grid losses: Minimization of number of tap position changes: Minimization of quadratic deviation from global reactive power exchange target: Minimization of sum of quadratic deviations from voltage targets at each CP: Minimization of sum of quadratic deviations from reactive power targets at each CP: For voltage profile smoothing, f profile penalizes the quadratic deviations from a voltage setpoint U set (t). Active power losses in the system are described by f losses . Variations in tap-changer positions are penalized quadratically with f Tap . f ∆Q describes the quadratic deviation from a global reactive power exchange setpoint Q set (t) with the transmission grid. The function f Vext represents the quadratic deviation of voltages on the EHV side of OLTC transformers, from the setpoints given by the TSO. f ∆Q cp is used to penalize quadratic deviations from individual reactive power exchange setpoints Q cp (t) at each CP. The factors µ i denote the objective weights. The grid under study consists of n nodes. The set A in Equation (2) is introduced to represent the area of the grid subject to optimization: for instance it can include distribution grid only, transmission grid only or both. Each node in the system is mapped to a grid area, thus the OPF is able to distinguish grid areas and optimize only those indicated by the set A. Distribution and transmission grid are connected via grid-coupling transformers. The nodes on the low voltage side of those transformers define the set M and those on the high voltage side the set Energies 2018, 11, 173 5 of 25 K, respectively. They are mapped to the CPs through the set cp. The subscripts i and j indicate grid nodes. Set g refers to generators, while set t refers to time instants.
The state variables are the voltage magnitude U i and angle θ i for PQ buses, the reactive power Q i and voltage angle θ i for PV buses and the active power P i and reactive power Q i for the Uθ bus. The control variables u are the positions of the transformer tap-changers r ij and reactive power set-points Q g of PQ generation units and voltage setpoints U i opt in case of Q(U) or PV generators.
The transformer tap-changer positions are discrete and modeled with binary variables r ij . G ij and B ij are the branch conductance and susceptance. These are dependent on the actual tap-changer configuration. The state and control variables are bounded by the following equality and inequality constraints. Equality constraints comprise the power balance ∆P i , ∆Q i at each node expressed by power flow equations. Inequalities resemble the operating limits, in particular limitations on generator reactive power injections, restrictions on node voltages U i , generators voltage setpoints U i opt , and transformer tap changer positions(r ij max ):

Synchronous Generators Model
PV nodes are introduced to account for the behavior of synchronous generators in the transmission grid, enabling a simulation of a wider grid region. The difficult aspect is to represents the change to PQ nodes in case the capability limits of synchronous machines are overcome and those generators have to switch to PQ-behavior. Complementarity constraints are thus introduced [22]: Here ∆U i represents the deviation from the voltage setpoint when the reactive limits are reached. If PV generators voltages are variables of the optimization, then Equations (15)- (17) can be substituted easily by Equation (18).

Wind Farm Control Modes
Two possible control modes for wind farms are considered and modeled in the OPF: Q (or cosφ) setpoints and Q(U) control. Both modes can be either static, with fixed setpoints, or dynamic, with setpoints updated at each time interval by the OPF, as shown in Figure 3. Power factor control represents the most widely applied reactive power control for wind farms. In this case they are simply modelled in the OPF as PQ nodes which reactive power output can vary in the range Qrange,g = [Qg min , Qg max ]. Reactive limits are updated at each time step, depending on the admissible power factor range considered. Q(U) control is instead based on a voltage target and a droop to get a variable reactive power output depending on the voltage deviation. It is also often used, especially targeting local voltage control purposes [24], but also for coordinated [9,25] or semicoordinated applications [26]. The development of this control in the OPF is performed adding one additional constraint equation. Q(U) characteristic is modelled using a fifth order polynomial function (20), since it allows to intrinsically represent reactive limits in the load flow, whilst ensuring fast convergence due to the derivability of such a function. In the OPF explicit reactive limits are added.

Wind Farm Control Modes
Two possible control modes for wind farms are considered and modeled in the OPF: Q (or cosφ) setpoints and Q(U) control. Both modes can be either static, with fixed setpoints, or dynamic, with setpoints updated at each time interval by the OPF, as shown in Figure 3.

Wind Farm Control Modes
Two possible control modes for wind farms are considered and modeled in the OPF: Q (or cosφ) setpoints and Q(U) control. Both modes can be either static, with fixed setpoints, or dynamic, with setpoints updated at each time interval by the OPF, as shown in Figure 3. Power factor control represents the most widely applied reactive power control for wind farms. In this case they are simply modelled in the OPF as PQ nodes which reactive power output can vary in the range Qrange,g = [Qg min , Qg max ]. Reactive limits are updated at each time step, depending on the admissible power factor range considered. Q(U) control is instead based on a voltage target and a droop to get a variable reactive power output depending on the voltage deviation. It is also often used, especially targeting local voltage control purposes [24], but also for coordinated [9,25] or semicoordinated applications [26]. The development of this control in the OPF is performed adding one additional constraint equation. Q(U) characteristic is modelled using a fifth order polynomial function (20), since it allows to intrinsically represent reactive limits in the load flow, whilst ensuring fast convergence due to the derivability of such a function. In the OPF explicit reactive limits are added.
Generally, both voltage setpoint and droop can be optimized. In the present application, the droop is kept constant. Coefficients a1,3,5 are found through polynomial fitting (least-mean-square approach) once the desired droop has been chosen. In Figure 4 we can see an example with 2% droop (a1 = −91, a3 = 1.42 × 10 5 , a5 = −1 × 10 8 ). Power factor control represents the most widely applied reactive power control for wind farms. In this case they are simply modelled in the OPF as PQ nodes which reactive power output can vary in the range Q range,g = [Q g min , Q g max ]. Reactive limits are updated at each time step, depending on the admissible power factor range considered. Q(U) control is instead based on a voltage target and a droop to get a variable reactive power output depending on the voltage deviation. It is also often used, especially targeting local voltage control purposes [24], but also for coordinated [9,25] or semi-coordinated applications [26]. The development of this control in the OPF is performed adding one additional constraint equation. Q(U) characteristic is modelled using a fifth order polynomial function (20), since it allows to intrinsically represent reactive limits in the load flow, whilst ensuring fast convergence due to the derivability of such a function. In the OPF explicit reactive limits are added. Generally, both voltage setpoint and droop can be optimized. In the present application, the droop is kept constant. Coefficients a 1,3,5 are found through polynomial fitting (least-mean-square approach) once the desired droop has been chosen. In Figure 4 we can see an example with 2% droop (a 1 = −91, a 3 = 1.42 × 10 5 , a 5 = −1 × 10 8 ).

Model Predictive Control (MPC)
Model Predictive Control extends the time horizon of the problem considering the future evolution of the system with respect mainly to wind power forecasts. The single-step optimization can be seen as a particular case of MPC with time horizon (T) equal to zero. The knowledge of the future evolution of the system allows defining an optimal trajectory for control actions and smoothing them over time. This is particularly important for OLTC tap operations, which should be minimized as much as possible. MPC is based on a forecast of the system; therefore, the forecast accuracy is paramount for the effectiveness of this type of control. MPC was introduced and applied in the DSO operation only in previous works [12]. The focus of this paper is the coordination between TSO and DSO and therefore MPC was only included in the mathematical model, through the set t, but not applied in simulations (T = 0), to keep the problem smaller in the first implementation. Future works will bring the coordination and the MPC approach together, including in the OPF probabilistic forecasts, as done in [18]. Thanks to the described features, the OPF tool developed is extremely flexible and suitable for several applications, involving continuous and integer variables, single or multi-objective functions, single step or MPC optimization.

TSO-DSO Coordinated Voltage Control
Building on the work illustrated in [12,19], where an OPF was used by the DSO to derive optimal setpoints for wind farms in a 110 kV distribution grid, a mechanism of coordination with the TSO voltage control system was developed and it is presented in this section.

Overview of Different Voltage Control Methods in the Transmission System
The first step towards the definition of a joint operation mechanism was the modelling of the TSO voltage control system. Different mechanisms are employed in different countries. In Switzerland, a centralized offline OPF defines voltage setpoints for regulating power plants. Since 2011, also active distribution grids have been involved in the voltage regulation mechanism, yielding an additional reactive power reserve of approximately ±300 Mvar, as of 2014 [16]. Reactive power provision to support the target voltage is remunerated, as long as the voltage is kept close to the setpoint, in a band of ±2 kV and ±3 kV for 220 and 380 kV voltage level, respectively. Alternatively, DSOs can opt for passive participation, and are obliged to fulfill reactive power exchange limits stricter than ENTSO-E DCC (Demand and Connection Code) prescriptions, as shown in Figure 5.
In Italy, an automatic hierarchical voltage regulation system is in place [27]. It is made of three hierarchical levels (see Figure 6): on top, the OPF-based tertiary voltage control, finds the optimal voltage values for pilot nodes in the entire transmission system. Then the secondary voltage control computes the voltage error and, based on a PI controller logic, defines a reactive level q, between 1 and −1, which is sent as control signal to regulating plants, where the primary voltage control, based on AVR, is performed. The system works automatically in real-time with different time constants for

Model Predictive Control (MPC)
Model Predictive Control extends the time horizon of the problem considering the future evolution of the system with respect mainly to wind power forecasts. The single-step optimization can be seen as a particular case of MPC with time horizon (T) equal to zero. The knowledge of the future evolution of the system allows defining an optimal trajectory for control actions and smoothing them over time. This is particularly important for OLTC tap operations, which should be minimized as much as possible. MPC is based on a forecast of the system; therefore, the forecast accuracy is paramount for the effectiveness of this type of control. MPC was introduced and applied in the DSO operation only in previous works [12]. The focus of this paper is the coordination between TSO and DSO and therefore MPC was only included in the mathematical model, through the set t, but not applied in simulations (T = 0), to keep the problem smaller in the first implementation. Future works will bring the coordination and the MPC approach together, including in the OPF probabilistic forecasts, as done in [18]. Thanks to the described features, the OPF tool developed is extremely flexible and suitable for several applications, involving continuous and integer variables, single or multi-objective functions, single step or MPC optimization.

TSO-DSO Coordinated Voltage Control
Building on the work illustrated in [12,19], where an OPF was used by the DSO to derive optimal setpoints for wind farms in a 110 kV distribution grid, a mechanism of coordination with the TSO voltage control system was developed and it is presented in this section.

Overview of Different Voltage Control Methods in the Transmission System
The first step towards the definition of a joint operation mechanism was the modelling of the TSO voltage control system. Different mechanisms are employed in different countries. In Switzerland, a centralized offline OPF defines voltage setpoints for regulating power plants. Since 2011, also active distribution grids have been involved in the voltage regulation mechanism, yielding an additional reactive power reserve of approximately ±300 Mvar, as of 2014 [16]. Reactive power provision to support the target voltage is remunerated, as long as the voltage is kept close to the setpoint, in a band of ±2 kV and ±3 kV for 220 and 380 kV voltage level, respectively. Alternatively, DSOs can opt for passive participation, and are obliged to fulfill reactive power exchange limits stricter than ENTSO-E DCC (Demand and Connection Code) prescriptions, as shown in Figure 5. In Italy, an automatic hierarchical voltage regulation system is in place [27]. It is made of three hierarchical levels (see Figure 6): on top, the OPF-based tertiary voltage control, finds the optimal voltage values for pilot nodes in the entire transmission system. Then the secondary voltage control computes the voltage error and, based on a PI controller logic, defines a reactive level q, between 1 and −1, which is sent as control signal to regulating plants, where the primary voltage control, based on AVR, is performed. The system works automatically in real-time with different time constants for each hierarchical level. In Italy, approximately 30 GW of DG are connected to distribution grids [28], with wind farms located mainly at HV level. So far they have not been involved in reactive power provision for the TSO but mainly operated at cosφ = 1 [28]. A new consultation document from the Italian TSO Terna investigates the possibility to involve distribution grids in transmission voltage regulation extending the q level signal also to the DSO [29]. with wind farms located mainly at HV level. So far they have not been involved in reactive power provision for the TSO but mainly operated at cosφ = 1 [28]. A new consultation document from the Italian TSO Terna investigates the possibility to involve distribution grids in transmission voltage regulation extending the q level signal also to the DSO [29].  In Germany, no hierarchical system is currently in place [28]. The four German TSOs (Amprion, EnBW, TenneT and 50 Hertz) are responsible for voltage regulation in their own areas. Setpoints for each generating unit are based on values scheduled via bilateral agreements, and updated in real time when necessary. They can be in the form of voltage, Q or cosφ values [30]. For the present study, it was assumed that the TSO has a centralized OPF tool similar to the one adopted by the Swiss TSO. Regulating plants are assumed to follow voltage setpoints.

Coordination Procedure between TSO and DSO
Coordinating the actions of TSO and DSO to perform a joint voltage regulation raises several issues. Once established that both operators make use of an OPF tool, the necessity to coordinate these optimizations becomes evident: actions taken by the TSO affect the optimality of measures adopted by the DSO, and to a lesser extent, vice-versa. If we consider a mechanism similar to the Swiss system, where a reactive power capability is associated to each distribution transformer and then it is used by the TSO to find the optimal voltage setpoint, it is clear that this flexibility statement with wind farms located mainly at HV level. So far they have not been involved in reactive power provision for the TSO but mainly operated at cosφ = 1 [28]. A new consultation document from the Italian TSO Terna investigates the possibility to involve distribution grids in transmission voltage regulation extending the q level signal also to the DSO [29].
-P max,export  In Germany, no hierarchical system is currently in place [28]. The four German TSOs (Amprion, EnBW, TenneT and 50 Hertz) are responsible for voltage regulation in their own areas. Setpoints for each generating unit are based on values scheduled via bilateral agreements, and updated in real time when necessary. They can be in the form of voltage, Q or cosφ values [30]. For the present study, it was assumed that the TSO has a centralized OPF tool similar to the one adopted by the Swiss TSO. Regulating plants are assumed to follow voltage setpoints.

Coordination Procedure between TSO and DSO
Coordinating the actions of TSO and DSO to perform a joint voltage regulation raises several issues. Once established that both operators make use of an OPF tool, the necessity to coordinate these optimizations becomes evident: actions taken by the TSO affect the optimality of measures adopted by the DSO, and to a lesser extent, vice-versa. If we consider a mechanism similar to the Swiss system, where a reactive power capability is associated to each distribution transformer and In Germany, no hierarchical system is currently in place [28]. The four German TSOs (Amprion, EnBW, TenneT and 50 Hertz) are responsible for voltage regulation in their own areas. Setpoints for each generating unit are based on values scheduled via bilateral agreements, and updated in real time when necessary. They can be in the form of voltage, Q or cosφ values [30]. For the present study, it was assumed that the TSO has a centralized OPF tool similar to the one adopted by the Swiss TSO. Regulating plants are assumed to follow voltage setpoints.

Coordination Procedure between TSO and DSO
Coordinating the actions of TSO and DSO to perform a joint voltage regulation raises several issues. Once established that both operators make use of an OPF tool, the necessity to coordinate these optimizations becomes evident: actions taken by the TSO affect the optimality of measures adopted by the DSO, and to a lesser extent, vice-versa. If we consider a mechanism similar to the Swiss system, where a reactive power capability is associated to each distribution transformer and then it is used by the TSO to find the optimal voltage setpoint, it is clear that this flexibility statement depends on the configuration of the transmission grid and the voltage at the interface points. At the same time, the results of the TSO OPF will take advantage of the flexibility offered by the DSO. Constraints and requirements of both systems should be taken into account. A simple solution is to use constant flexibility values computed on a yearly basis, as suggested in [10]. However, the variability and unpredictability of reactive power exchanges demands for real-time solutions.
Therefore, the conceived optimization problem belongs to the class of multi-area power system optimization. Different solutions can be found in literature to solve this type of problems. One class of solutions makes use of reduced network equivalents updated at each iteration step; a thorough analysis of reduced equivalents applied to voltage optimization can be found in [31]. The problem with this class of solutions is that they yield different accuracy of results depending on the type of equivalent selected. Another class of solutions makes use of power flow decomposition techniques, such as Lagrangian relaxation or Lagrangian augmentation. This implies to have a unique OPF problem which is decomposed and solved separately for different areas coupled by common constraints, e.g., active and reactive power flows over connection lines, and based on the exchange of Lagrangian multipliers [32]. However, the method is not adequately performant requiring a significant amount of iterations even for simple cases.
The scheme developed should target practical applications and be able to get smoothly integrated in current or future system operation procedures. The need of data exchange, which arises from the nature of the physical problem, should be kept to a minimum for security concerns. Notwithstanding this, as prescribed by the DCC, a communication system must be in place between TSO and DSO to communicate reactive flexibility and setpoints in real time. The proposed procedure is made of three sequential steps: reactive power flexibility assessment by DSO, TSO OPF and DSO OPF. The steps are detailed hereafter.

DSO Flexibility Assessment
Firstly, a reactive power flexibility assessment is performed every 15 min by the DSO using its own OPF tool. In presence of N CPs, the flexibility is computed maximizing and minimizing in sequence the overall reactive power exchange between the transmission and distribution grid, using the objective functions (22)- (23). The OPF is here working in simulation mode: Control variables in this subproblem are controllable wind farms and OLTC transformers. After this first step, results are communicated to the TSO in the form of an overall range for the whole grid and corresponding specific ranges for single CPs to be used as capability limits in the TSO optimization, according to Equation (24) The choice to consider the overall maximum and minimum depends on the fact that in case of multiple CPs, which is the standard in 110 kV grids, these are interrelated and it is not possible to define the flexibility of a single CP unless the others are determined. The identified flexibility ranges are theoretically narrower than the ranges computed by maximizing and minimizing reactive power exchange over a single CP per time.
Within this reactive power flexibility assessment, as well as in the following DSO optimization, an overall regional grid model is used, as shown in Figure 7a, where only variables under DSO control are optimization variables. This assumption is equivalent to the use of an accurate reduced model of the TSO network, which is updated at each time step based on measurements at the interface and data coming from the TSO itself. Such reduced models with real-time definition will be likely available to system operators in the near future, as envisioned in the new EU System Operation Guideline [33] where a framework for structural, scheduled and real-time data exchange is defined, as well as an area of "observability" for connected operators.

TSO OPF
The TSO uses the reactive flexibility communicated for the whole grid group and the values declared for each CP to run the TSO-OPF where distribution grid transformers are represented as virtual generators, as shown in Figure 7b. The total reactive power exchange at TSO-DSO interfaces is constrained by Equation (23): This is to ensure that the setpoints found can be fulfilled by the DSO. Optimal setpoints are found for both regulating synchronous power plants in the TSO grid, in the example, and for distribution grids CPs. The TSO-optimization problem is configured as a non-linear problem, since OLTCs are considered under DSO control and thus are not control variables of this problem. This is an assumption of the authors, since, in the current practice, they can be under the control of both operators depending on individual cases. As for the objective function, several objectives can be found in literature for Optimal Reactive Power Flow (ORPF) problems [34,35], among the most common we find: losses minimization (Equation (3)), cost of reactive power procurement minimization, minimization of quadratic deviations from a voltage profile (Equation (2)) and maximization of loadability margins. In the presented simulations, the OF of the TSO was built assuming a main interest in loss minimization and considering the cost of reactive power procurement from both synchronous generators and distribution grids equal to zero.

DSO OPF
As final step, the DSO computes its OPF including TSO setpoints. The setpoints can be either in the form of reactive power exchange or optimal voltage values at the interface. Issuing voltage setpoints for each CP implies using a mechanism similar to the Swiss system. Another option is to use as setpoint the reactive power exchange, either as the sum over the whole group or as individual setpoints for each CP. A further choice is whether to state the setpoints as hard constraints or include

TSO OPF
The TSO uses the reactive flexibility communicated for the whole grid group and the values declared for each CP to run the TSO-OPF where distribution grid transformers are represented as virtual generators, as shown in Figure 7b. The total reactive power exchange at TSO-DSO interfaces is constrained by Equation (23): This is to ensure that the setpoints found can be fulfilled by the DSO. Optimal setpoints are found for both regulating synchronous power plants in the TSO grid, in the example, and for distribution grids CPs. The TSO-optimization problem is configured as a non-linear problem, since OLTCs are considered under DSO control and thus are not control variables of this problem. This is an assumption of the authors, since, in the current practice, they can be under the control of both operators depending on individual cases. As for the objective function, several objectives can be found in literature for Optimal Reactive Power Flow (ORPF) problems [34,35], among the most common we find: losses minimization (Equation (3)), cost of reactive power procurement minimization, minimization of quadratic deviations from a voltage profile (Equation (2)) and maximization of loadability margins. In the presented simulations, the OF of the TSO was built assuming a main interest in loss minimization and considering the cost of reactive power procurement from both synchronous generators and distribution grids equal to zero.

DSO OPF
As final step, the DSO computes its OPF including TSO setpoints. The setpoints can be either in the form of reactive power exchange or optimal voltage values at the interface. Issuing voltage setpoints for each CP implies using a mechanism similar to the Swiss system. Another option is to use as setpoint the reactive power exchange, either as the sum over the whole group or as individual setpoints for each CP. A further choice is whether to state the setpoints as hard constraints or include them as part of the MO function, minimizing a quadratic deviation. For voltages and individual reactive power targets, hard constraints are not a feasible option due to the physical limitations imposed by the coupling electrical network. As for a cumulative reactive exchange target, although feasible to fulfill it when set as a hard constraint, simulations show it is highly preferable to avoid that, in order to allow larger flexibility to the DSO and reduce tap operations. In case of model predictive control, it is also preferable for convergence reasons.
In the present study, both voltage and reactive setpoints solutions (sum and individual targets) are included in the MO function (with the functions f Vext , f ∆Q and f ∆Q cp ) and tested through simulations. Also a combined type of setpoint can be considered adjusting the weights (µ Vext , µ ∆Q , and µ ∆Q cp in Equation (1)) associated to the three functions. The whole chain of actions is anticipated at the initial time step by a system initialization, as shown in Figure 8, needed to compute the optimal initial voltage setpoints and tap positions.  Then, the following three operations are repeated at each time step. Under the assumption that the system is close to an optimal status, thanks to the initialization, and that the whole chain is performed often enough (e.g., every 15 min), an open loop control can be employed with good results. Closed loop solutions, where more iterations of the chain are performed at each time step, could also be investigated.
Finally, it should be pointed out that the computed flexibility is limited only by technical constraints (voltage limits, reactive power capabilities of DG and OLTC operations per time step), without considerations about DSO interests. Therefore, tuning the MO function weights in step 4 can allow giving different priorities between TSO requests and DSO objectives. In a market framework, the DSO could choose to set a price for its reactive support, for instance considering the cost of losses or tap operations incurred. This price would be included in the TSO cost function together with the cost of reactive power from other sources. This requirement is present also in the ENTSO-E guidance document for reactive power management at T-D interface: "This aspect should be considered from the point of view of the global system benefits and not from individual owner/operator interest" [36].

Grid Model
The validation of the proposed optimal control of wind farms for coordinated TSO-DSO reactive Then, the following three operations are repeated at each time step. Under the assumption that the system is close to an optimal status, thanks to the initialization, and that the whole chain is performed often enough (e.g., every 15 min), an open loop control can be employed with good results. Closed loop solutions, where more iterations of the chain are performed at each time step, could also be investigated.
Finally, it should be pointed out that the computed flexibility is limited only by technical constraints (voltage limits, reactive power capabilities of DG and OLTC operations per time step), without considerations about DSO interests. Therefore, tuning the MO function weights in step 4 can allow giving different priorities between TSO requests and DSO objectives. In a market framework, the DSO could choose to set a price for its reactive support, for instance considering the cost of losses or tap operations incurred. This price would be included in the TSO cost function together with the cost of reactive power from other sources. This requirement is present also in the ENTSO-E guidance document for reactive power management at T-D interface: "This aspect should be considered from the point of view of the global system benefits and not from individual owner/operator interest" [36].

Grid Model
The validation of the proposed optimal control of wind farms for coordinated TSO-DSO reactive power management is performed through simulations on a portion of the German transmission system close to the North Sea. Here, a real 110 kV distribution grid with 1.6 GW of connected installed wind power capacity, is modelled together with the surrounding 220/380 kV transmission system (Figure 9). The regional grid model is used to study the interaction between TSO and DSO. The remaining part of the German power system is represented with a reduced network equivalent. Other distribution grids within the area are represented as equivalent loads. Future work will focus on studying the interaction of several distribution grids. The whole grid was modeled in DIgSILENT PowerFactory [37] and then exported to MatLab [38]. MatLab is in charge of combining the grid data with time series data and several settings, creating the input files with variables and parameters for GAMS where the optimization algorithm is implemented. After the optimization the results can be reimported to DIgSILENT for a subsequent power flow calculation emulating the real grid and used for the demonstration of the effectiveness of the algorithm. The transmission and distribution grids are connected via 8 OLTC transformers located in five CPs, one with primary voltage of 380 kV, the others 220 kV, as shown in Figure 9b. In the transmission grid 15 synchronous generators and 3 static generators (off-shore wind farms) are modeled. In case of parallel generators, only one was considered in voltage regulation mode. In the distribution grid, all the 55 wind farms (1029 MW) connected to the 110 kV level are assumed to be equipped with remote control systems, and can therefore receive setpoints from the OPF. Lower voltage aggregated generation (611 MW) operates at fixed cosφ (0.95 inductive). For controllable wind farms, in order to have an higher reactive power flexibility, reactive power limits were computed extending the German grid code [39] minimum requirements at the point of connection (cosφ = [0.95 ind.-0.95 cap.]) and including phase shifting capability allowed by STATCOM installation at wind farm level, as shown in Figure 10. In the transmission grid 15 synchronous generators and 3 static generators (off-shore wind farms) are modeled. In case of parallel generators, only one was considered in voltage regulation mode. In the distribution grid, all the 55 wind farms (1029 MW) connected to the 110 kV level are assumed to be equipped with remote control systems, and can therefore receive setpoints from the OPF. Lower voltage aggregated generation (611 MW) operates at fixed cosφ (0.95 inductive). For controllable wind farms, in order to have an higher reactive power flexibility, reactive power limits were computed extending the German grid code [39] minimum requirements at the point of connection (cosφ = [0.95 ind.-0.95 cap.]) and including phase shifting capability allowed by STATCOM installation at wind farm level, as shown in Figure 10. assumed to be equipped with remote control systems, and can therefore receive setpoints from the OPF. Lower voltage aggregated generation (611 MW) operates at fixed cosφ (0.95 inductive). For controllable wind farms, in order to have an higher reactive power flexibility, reactive power limits were computed extending the German grid code [39] minimum requirements at the point of connection (cosφ = [0.95 ind.-0.95 cap.]) and including phase shifting capability allowed by STATCOM installation at wind farm level, as shown in Figure 10.

Time Series Data
Time series data for the distribution grid nodal load and generation are derived from yearly measurement data provided by the DSO. In the transmission grid, data regarding individual power plants dispatch and aggregated residual load (load minus DG generation) are obtained from a Unit Commitment (UC) model of the German power system [41]. Aggregated consumption values are evenly divided over the total loads and UC results are slightly changed to minimize the mismatch and power flows from and to the slack. Daily and weekly timeframes are considered for simulations. Time series data are visualized in Figures 11 and 12.

Time Series Data
Time series data for the distribution grid nodal load and generation are derived from yearly measurement data provided by the DSO. In the transmission grid, data regarding individual power plants dispatch and aggregated residual load (load minus DG generation) are obtained from a Unit Commitment (UC) model of the German power system [41]. Aggregated consumption values are evenly divided over the total loads and UC results are slightly changed to minimize the mismatch and power flows from and to the slack. Daily and weekly timeframes are considered for simulations. Time series data are visualized in Figures 11 and 12.

Investigated Scenarios
Different significant scenarios were simulated and compared, as shown in Table 1: In the OLTC-cosphi = 1 scenario wind farms are not controlled and operate at fixed cosφ = 1, a practice still common for many system operators. In this scenario OLTC transformers represent the only regulating tool for the DSO. The OLTC operation is here also driven by an optimization, not

Investigated Scenarios
Different significant scenarios were simulated and compared, as shown in Table 1: In the OLTC-cosphi = 1 scenario wind farms are not controlled and operate at fixed cosφ = 1, a practice still common for many system operators. In this scenario OLTC transformers represent the only regulating tool for the DSO. The OLTC operation is here also driven by an optimization, not only by a local control of the tap changer. Therefore an OPF is run to simulate also this and the following scenario.
In the OLTC-Static Q(U) scenario, the application of Q(U) control to wind farms is introduced without optimization; therefore, a constant voltage target is applied to all controllable wind farms. In case of a static Q(U) solution, the selected voltage setpoint is crucial in determining the reactive behavior of the wind farms and the grid as a whole. In the end, a uniform value of 1.02 p.u. for all WPPs was used in simulations, corresponding to a realistic arbitrary value.
In the Coordinated Optimization TSO-DSO, the presently described optimization chain is applied. Different objective functions can be conceived. Q or V setpoints can be followed by the DSO at the interface.
Finally, the Overall System OPF scenario represents the benchmark case corresponding to overall system optimality: the whole grid is assumed to belong to a unique system operator (comparable to an independent system operator (ISO) in the US), which optimizes both areas controlling wind farms, OLTC and synchronous generators at the same time.

Feasibility and Performance of Different Setpoints
In this section, the performance of the three setpoints for TSO-DSO coordination is evaluated through a weekly simulation to test their feasibility. The weights reported in Table 2 were used for the simulation. The same cost for tap operations was applied equal to 0.001. This choice is the result of comparing the cost of active power losses (whose weight is set equal to 1) and tap operations, using data reported in Appendix A (Table A3). As for weights of external setpoints, a tuning procedure showed that a much higher value is required for voltage setpoints (since the quadratic voltage difference is very low) and a lower one for individual reactive power targets. Dynamic Q(U) control for wind farms is considered. Tap operations are restricted to a maximum of 1 each time interval (15 min).  In Figure 13 we can see the different reactive power exchanges. Reactive power targets (either sum or individual) lead to a similar exchange profile while in case of voltage setpoints this is rather lower. The profile also follows quite clearly the daily load profile. The flexibility range is quite constant thanks to the use of STATCOM, which decouples reactive power from wind resource availability. The average range is about 350 Mvar.
In Figure 14, the first 24 h are shown in detail. The red dashed line represents the cumulative reactive power sum requested by the TSO, and it is very close to the actual flow in case of Q sum optimization.
In the hours with highest wind feed-in and lowest load, the minimum weekly values of Q ext,min and Q ext,max are found since the time period is a period with high wind power generation (see Figure 11) and therefore the distribution grid experiences high line loadings to export excess wind power. In these conditions, the coordinated OPF leads the DSO to operate close to the maximum limit, requesting a considerable reactive support from wind farms, as shown in Figure 15.         The absolute average errors between optimal and actual voltages at each CP are reported in Table 3. Lowest errors are generally associated with individual targets, but this obviously depends on the chosen weight in the OF. The Swiss regulation for active distribution grids requires a maximum deviation of ±3 kV at 380-kV level and ±2 kV at 220-kV level. Compliance with these limits was achieved in all three scenarios and for each time step. The other relevant performance indicators are presented in Table 4. The best performance was in this case achieved with the use of voltage targets, entailing lower losses both for the DSO and TSO and no tap operations at all. The performance of Q sum and Q targets is similar, except for the number of tap operations which is significantly higher in the second case, since a more accurate control of reactive power flows is required. However, the presented results depend highly on the chosen weights, the grid structure and the input data and therefore it is not possible to draw general conclusions on the preferability among different setpoints. Different choices could be made in different contexts depending on specific needs of both operators and the regulatory framework. The feasibility of all the three setpoint types has been demonstrated. In the following, voltage targets will be used as example.

Performance of Coordinated Optimization with Different DSO Strategies
In the present section, the coordinated optimization, based on the chosen voltage targets, is tested and compared to the other scenarios: the OLTC OPF, featuring unitary power factor or static Q(U) control of wind farms, and the overall system OPF. Two different coordinated optimizations are run with different weights for external setpoints, tap operations and losses in the DSO OPF (see Table 5). This to simulate different degrees of cooperation of the DSO: a collaborative strategy and a greedy strategy, in which the DSO prioritizes its internal objectives.  The overall reactive power exchange in the different scenarios is presented in Figure 16. In Figure 17, the focus is on the first 24 h. Without including the wind farms in the OPF, a very negative reactive power exchange occurs during high wind infeed. This condition is only slightly mitigated by applying a static Q(U) control. Conversely, in times of low wind infeed and low loading, positive reactive power flows at interface take place. A close to neutral reactive power balance is instead the optimal result in case of a coordinated scheme employing voltage setpoints from the TSO. In case of a stronger coordination (blue line) the DSO tends to provide an higher reactive support in times of high wind infeed, while, if the internal objectives weights are higher (orange line), it tends to provide less reactive power achieving a result very close to the overall system optimization (yellow line). This is evident looking at the reactive power output of wind farms shown in Figure 18. a stronger coordination (blue line) the DSO tends to provide an higher reactive support in times of high wind infeed, while, if the internal objectives weights are higher (orange line), it tends to provide less reactive power achieving a result very close to the overall system optimization (yellow line). This is evident looking at the reactive power output of wind farms shown in Figure 18.  The reactive power output is achieved modulating a Q(U) control law at wind farm level through the communication of a voltage setpoint determined by the OPF in the admissible range between 0.9 and 1.1 (see Figure 19). The use of a Q(U) control has the theoretical benefit of working also as local control in case of a communication link failure. The outlier curve with very high voltage targets represents the offshore wind farm Alpha Ventus, connected via a 60 km long AC cable to the shore. a stronger coordination (blue line) the DSO tends to provide an higher reactive support in times of high wind infeed, while, if the internal objectives weights are higher (orange line), it tends to provide less reactive power achieving a result very close to the overall system optimization (yellow line). This is evident looking at the reactive power output of wind farms shown in Figure 18.  The reactive power output is achieved modulating a Q(U) control law at wind farm level through the communication of a voltage setpoint determined by the OPF in the admissible range between 0.9 and 1.1 (see Figure 19). The use of a Q(U) control has the theoretical benefit of working also as local control in case of a communication link failure. The outlier curve with very high voltage targets represents the offshore wind farm Alpha Ventus, connected via a 60 km long AC cable to the shore. The reactive power output is achieved modulating a Q(U) control law at wind farm level through the communication of a voltage setpoint determined by the OPF in the admissible range between 0.9 and 1.1 (see Figure 19). The use of a Q(U) control has the theoretical benefit of working also as local control in case of a communication link failure. The outlier curve with very high voltage targets represents the offshore wind farm Alpha Ventus, connected via a 60 km long AC cable to the shore.  In Table 6, the weekly performance parameters are collected. Controlling wind farms through the coordinated optimization allows a reduction of losses not only in the transmission system but also in the distribution system, creating a win-win strategy for the two operators. The greedy strategy leads to slightly higher losses for the TSO in favor of lower losses for the DSO, as expected. Interestingly, the tap operations are higher in the greedy case even though a weight of 0.005 instead of 0.001 was used: this shows how delicate is the weights choice in the MO function, since even small variations can modify Pareto surfaces significantly. The loss reduction for the TSO is not so considerable, since it represents about the 0.7%. A little higher value is achieved at DSO grid level were losses decrease by 3%. However, it should be pointed out that a very optimized base case is used: it is also based on a OPF by the DSO and the same setpoints of synchronous generators found in the coordinated mode are used, to simulate a separated TSO OPF and achieve a fair comparison. Therefore, the only difference is the control of wind farms at 110 kV level. The impact of one single distribution grid is also evaluated on a rather big portion of the transmission system.  In Table 6, the weekly performance parameters are collected. Controlling wind farms through the coordinated optimization allows a reduction of losses not only in the transmission system but also in the distribution system, creating a win-win strategy for the two operators. The greedy strategy leads to slightly higher losses for the TSO in favor of lower losses for the DSO, as expected. Interestingly, the tap operations are higher in the greedy case even though a weight of 0.005 instead of 0.001 was used: this shows how delicate is the weights choice in the MO function, since even small variations can modify Pareto surfaces significantly. The loss reduction for the TSO is not so considerable, since it represents about the 0.7%. A little higher value is achieved at DSO grid level were losses decrease by 3%. However, it should be pointed out that a very optimized base case is used: it is also based on a OPF by the DSO and the same setpoints of synchronous generators found in the coordinated mode are used, to simulate a separated TSO OPF and achieve a fair comparison. Therefore, the only difference is the control of wind farms at 110 kV level. The impact of one single distribution grid is also evaluated on a rather big portion of the transmission system. In Table 6, the weekly performance parameters are collected. Controlling wind farms through the coordinated optimization allows a reduction of losses not only in the transmission system but also in the distribution system, creating a win-win strategy for the two operators. The greedy strategy leads to slightly higher losses for the TSO in favor of lower losses for the DSO, as expected. Interestingly, the tap operations are higher in the greedy case even though a weight of 0.005 instead of 0.001 was used: this shows how delicate is the weights choice in the MO function, since even small variations can modify Pareto surfaces significantly. The loss reduction for the TSO is not so considerable, since it represents about the 0.7%. A little higher value is achieved at DSO grid level were losses decrease by 3%. However, it should be pointed out that a very optimized base case is used: it is also based on a OPF by the DSO and the same setpoints of synchronous generators found in the coordinated mode are used, to simulate a separated TSO OPF and achieve a fair comparison. Therefore, the only difference is the control of wind farms at 110 kV level. The impact of one single distribution grid is also evaluated on a rather big portion of the transmission system. However, the proximity to results of the overall optimization, suggests the effectiveness of the method proposed. Moreover, loss reduction is not the only point of interest for the TSO in increasing the coordination with DSOs, and probably not even the main one. The knowledge of available flexibility at each CP and the possibility to issue voltage and reactive power targets at T-D interface could be used for several purposes and demonstrates how, with the correct tools, active distribution grids can be operated in a way similar to power plants. In Table 7 are reported absolute voltage errors at each EHV busbar, under the two different DSO strategies. As expected, deviation from the targets is higher under the greedy strategy even though still widely within the Swiss regulation limits. However, a recommendation is that the DSO strategy is transparently shown in the flexibility declaration, not to affect the optimality of TSO control actions. In the present simulations, the DSO offers the whole flexibility available, limited only by technical constraints (voltages, reactive limits, etc.). In this way, the mechanism is unbalanced towards the TSO interests. In terms of losses, for instance, the risk is that, in order to decrease slightly the losses in the transmission system, a significant increase of losses could be incurred in the distribution grid. This becomes more important when a large number of distribution grids is involved in the coordinated control scheme. Different possible market schemes can be used to regulate this ancillary service [42]. Two possible methods are: either a price is attributed to each supplied Mvarh or the free flexibility range is limited before technical constraints, considering losses and tap operations for instance. In the first case the challenge is how to distinguish the reactive power adjustment to be paid from the natural reactive power flow, also considering that the former is influenced by internal DSO objectives (how can we distinguish in the presented OPF results which Mvar or tap operation was triggered by the external setpoints and which by distribution losses minimization or other possible objective functions?). In the second case the flexibility computation could take into account that no tap operation should be incurred and losses should not increase over a defined threshold. This restricted margin freely available under normal operation could be transmitted along with the technical flexibility, available for emergency situations. Another main point of interest is shown in Figure 20, where the sum of the net reactive power output of wind farms and synchronous generators is displayed. Thanks to the active involvement of wind farms, not only the reactive power provision of traditional plants is decreased of about 8% on a weekly basis between the coordinated strategy and the OLTC OPF, but also the overall reactive power production (sum of reactive power from wind farms and synchronous generators) is lowered

Conclusions
The presented paper illustrates a procedure to achieve an optimal control of wind farms for a coordinated reactive power management between TSO and DSO considering constraints and interests of both operators. The proposed procedure is based on the coordination of Optimal Power Flow (OPF) tools operating in real-time. The exchange of information is limited to a minimum in order to preserve data security. The effectiveness of the proposed method was shown through simulations on a portion of the German power system with a 110 kV meshed distribution grid comprising five CPs. The feasibility for the DSO to fulfill several types of targets, including voltage and reactive power setpoints at each interface, was demonstrated. Loss reduction was experienced at both transmission and distribution level, compared to the basecase scenario, as well as a substantial reduction in the reactive power demand from synchronous generators. The possibility for the TSO to know the available reactive flexibility of distribution grids and dispatch them along with traditional power plants is expected to facilitate the integration of distributed generation and allow a more secure operation of the power system also in presence of high penetrations of wind and solar power. Future work will be devoted to study the impact of MPC and the interaction of several distribution grids participating to the coordination scheme. Also the modular OPF tool will be expanded to include other components (e.g., HVDC stations) and the method extended to active power optimization.

Acknowledgments:
The authors sincerely acknowledge the financial support provided by the German Federal Ministry for Economic affairs and Energy as part of the project "IMOWEN" within the research initiative "Zukunftsfähige Stromnetze".
Author Contributions: All the authors have contributed in the article.

Conflicts of Interest:
The authors declare no conflict of interest.

Conclusions
The presented paper illustrates a procedure to achieve an optimal control of wind farms for a coordinated reactive power management between TSO and DSO considering constraints and interests of both operators. The proposed procedure is based on the coordination of Optimal Power Flow (OPF) tools operating in real-time. The exchange of information is limited to a minimum in order to preserve data security. The effectiveness of the proposed method was shown through simulations on a portion of the German power system with a 110 kV meshed distribution grid comprising five CPs. The feasibility for the DSO to fulfill several types of targets, including voltage and reactive power setpoints at each interface, was demonstrated. Loss reduction was experienced at both transmission and distribution level, compared to the basecase scenario, as well as a substantial reduction in the reactive power demand from synchronous generators. The possibility for the TSO to know the available reactive flexibility of distribution grids and dispatch them along with traditional power plants is expected to facilitate the integration of distributed generation and allow a more secure operation of the power system also in presence of high penetrations of wind and solar power. Future work will be devoted to study the impact of MPC and the interaction of several distribution grids participating to the coordination scheme. Also the modular OPF tool will be expanded to include other components (e.g., HVDC stations) and the method extended to active power optimization.