Grid Code-Dependent Frequency Control Optimization in Multi-Terminal DC Networks

: The increasing deployment of wind power is reducing inertia in power systems. High-voltage direct current (HVDC) technology can help to improve the stability of AC areas in which a frequency response is required. Moreover, multi-terminal DC (MTDC) networks can be optimized to distribute active power to several AC areas by droop control setting schemes that adjust converter control parameters. To this end, in this paper, particle swarm optimization (PSO) is used to improve the primary frequency response in AC areas considering several grid limitations and constraints. The frequency control uses an optimization process that minimizes the frequency nadir and the settling time in the primary frequency response. Secondly, another layer is proposed for the redistribution of active power among several AC areas, if required, without reserving wind power capacity. This method takes advantage of the MTDC topology and considers the grid code limitations at the same time. Two scenarios are deﬁned to provide grid code-compliant frequency control.


Introduction
Power transmission infrastructure is experiencing continuous evolution around the globe due to the large-scale deployment of renewable energy sources and the need for new technologies that guarantee reliable and smart operation. The integration of renewables has been promoted by governmental agencies and environmental policies to combat global warming while efficiently upgrading power grids [1]. Consequently, inertia levels may decrease in the future due to the large integration of wind power, with an impact on the power system dynamics [2], including the frequency response of conventional alternating current (AC) systems [3]. regulation potential of wind turbines and HVDC transmission. Another communication-free control scheme that can allocate frequency support power between onshore VSC stations using local frequency signal during frequency events is shown in [29].
Several optimization applications have been used in MTDC networks. For instance, particle swarm optimization (PSO) has been employed in [30] for the DC voltage controller loops in an MTDC network. A distributed MPC is applied in [31] as an enhancer of automatic generation control (AGC) in MTDC networks. An optimization problem has been formulated in [32] to improve the nadir and RoCoF considering offshore grids and several contingencies. A supervisory power re-scheduler scheme using MPC is presented in [33], which helps the DC network to satisfy limits even under terminal outages. Another application of the PSO and MTDC networks is presented in [34], where the inner and outer controllers are optimized to enhance the voltage performance.
Primary frequency control enhancement requires innovative solutions that address the limitations in the system and provide adequate responses that maintain the stability of the system and guarantee that the controllers are between their narrow margins [35]. Therefore, the motivation of this paper is the development of an optimization approach for the maximization of the power injection and minimization of the nadir and RoCoF. A frequency control optimization algorithm is proposed in this paper to improve the frequency control support in AC grids through fast-frequency HVDC support. Before designing this control concept, grid code requirements need to be analyzed and-if needed-extended or adjusted. In this regard, this work presents an assessment of the forecoming European HVDC development, showing the limitations and possible results of optimizing frequency control through the PSO method. The objective of this paper is to propose a practical solution for frequency control optimization to ensure the grid code compliance of HVDC-connected systems. The main focus of this research is to find a procedure that can be used in reality to improve the behavior of an AC system connected to a HVDC converter. The PSO optimization methodology has been chosen as one example of an optimization method.
The rest of this article is organized as follows. Section 2 gives an overview of the current situation regarding the frequency grid code requirements in Europe, emphasizing the under-frequency limits and the synthetic inertia requirements. Section 3 explains the theoretical frameworks of frequency control and the MTDC system dynamics. The proposed methods are introduced in Section 4. The simulation results and discussions are presented in Section 5. Finally, Section 6 concludes the paper.

Regulation Levels
Different regulation levels can be identified in the case of HVDC connections. For example, Figure 1 shows the relation of three different grid connection requirement levels for some European countries; namely, European, national and TSO-specific requirement levels. The European Commission regulation 2016/1447 [36] has set the legal framework for the HVDC connections of OWFs in the European Union (EU). In [37], harmonized rules are provided to set a clear legal framework for grid connections. These rules should ensure EU-wide electricity trade possibilities, system security, the integration of renewable electricity sources, increased competition and a more efficient use of the grid and energy sources for the benefit of society in the EU [36].
The EU legislation needs to be adjusted in each country for specific regional requirements. For example, this has been realized in Germany by creating the Technical Connection Rules for HVDC Systems and HVDC-Connected Power Plants [38], which has the purpose of forming the basis for the safe application of new technologies in existing systems; e.g, integrating offshore wind energy with the lowest possible losses. The objective of the German grid code is that HVDC systems can provide ancillary services [38]. The contents of other national grid codes-e.g., from the UK, Denmark and Sweden-are comparable with the German grid code.
Finally, national-level grid codes are often transferred to grid connection rules that are applicable for certain grid operators [39]. In Germany, for example, the grid operator TenneT created the grid connection rules for OWFs that are connected to their existing grid [40]. These grid operator-specific requirements usually match the regional requirements.

Requirements for Power Plants Connected to HVDC Systems
The defined 10 s average frequency in the offshore AC grid needs to be within specific limits around a nominal frequency of 50 Hz. For HVDC connections, the following requirements need to be fulfilled: • 50 Hz ± 2% (49 Hz to 51 Hz) for 95% of the week; • 50 Hz ± 15% (42.5 to 57.5 Hz) 100% of the time.
The grid codes also define the frequency-dependent power supply. OWFs have to feed active power without limitations into the grid within a frequency range of 49.0 Hz to 50.2 Hz. It is permitted to limit the active power in-feed when the frequency goes below 49 Hz. The maximum active power reduction is 2% of the maximum generator power per Hz (see Figure 2). The maximum allowed active power reduction when under this frequency is defined by the the reference power of the OWF and not by the momentarily available power. 46 Figure 2. Requirements for the frequency-dependent power supply of generators connected via HVDC systems (based on [40]).
An additional requirement for power plants connected to a HVDC system is to provide a synthetic flywheel mass to limit the frequency gradient in the case of under and/or over-frequency. Details need to be defined with the responsible TSO [38]. As shown in Figure 2, an extended frequency range is required for HVDC connections. Usually, the offshore VSC operates in U/f control mode, which means that the voltage and the frequency are controlled at the offshore AC side.
The European Network of Transmission System Operators for Electricity (ENTSO-E) states in [41] that the pre and post-fault conditions for the RoCoF need to be specified regarding the minimum short-circuit capacity at the connection point pre and post-fault, as well as the active and reactive power operating point of the power generating module and the voltage at the connection point pre-fault. In order to harmonize European requirements, power-generating modules need to remain connected to the grid at a frequency of or below the following moving averages: ±2 Hz for 500 ms, ±1.5 Hz for 1000 ms and ±1.25 Hz for 2000 ms.

Synthetic Inertia
The aim of requiring synthetic inertia, according to the EU Network code [36], is to replace the effect of the inertia of traditional synchronous power-generating modules by a power park module or HVDC system. Synthetic inertia is stated in Article 14 of [36] as a requirement that can be specified by the relevant TSO. In a later published guidance document from the ENTSO-E, the need for synthetic inertia is discussed in more detail [42]. It is specified in [36] and in Table 1 that, in the case of a frequency step, the initial activation of the active power frequency response should not exceed 2 s (t 1,inertia ). This activation time can be shorter for power-generating modules without inertia (t 1,no inertia ), which would apply, for example, to renewable energy generators unless justified otherwise. The maximum admissible delay time of full activation is defined as t 2 (see Table 1), unless longer activation times are allowed by the relevant TSO for reasons of system stability. The full active power frequency response should be available for up to 15 to 30 min. The exact duration is also specified by the relevant TSO. Figure 3 illustrates the active power frequency response capability curve. On the x-axis is the time in seconds and on the y-axis is ∆P divided by P max , where ∆P is the change in active power output from the power-generating module, such as a wind turbine generator (WTG), and P max stands for the maximum active power capacity of the generating module. The times t 1 and t 2 are the initial delay time and the time for full activation, respectively. Figure 3. Constant DC voltage control. Table 1 defines the ranges of the parameters of the active power frequency response. The values are chosen to ensure stabilization (primary frequency control) and restoration to the nominal frequency (secondary frequency response). These preconditions can then help to maintain the power exchange flows between control areas to the scheduled values.
The requirement of providing synthetic inertia and therefore supporting the AC grid is also specified in the draft of the German grid connection code [38]. This additional requirement for HVDC systems consists of the ability to provide synthetic inertia in case of frequency deviations. This control should be activated at over or under-frequency by a fast adjustment of the active power supplied to/from the AC grid to limit the frequency gradient. The basic parameters of this control system will be discussed between the grid operator and the owner of the connected generation system.

Requirements from Grid Codes
This subsection gives a short overview of the grid code requirements, especially for a frequency-dependent power supply and synthetic inertia control. The content is defined in a more general way in the European HVDC network code [36]. These general requirements are specified in a next step in each country to take national specific conditions into account. Apart from technical grid code requirements, such as the RoCoF or details about how long an HVDC converter needs to be able to stay connected, more regulations and boundary conditions are defined for HVDC networks. For example, the component limits, such as the maximum Insulated-Gate Bipolar Transistor (IGBT) current-carrying capacity or the cable capacities, need to be considered. Furthermore, the simulation model needs to be built so that very small simulation time steps, in the range of milliseconds, can be used. This is necessary because frequency changes appear within very short time frames.

HVDC Modeling
Let a power system be described as a graph G = {V, E } where V is the set of vertices modeling the n b buses of the system and E is the set of edges, which represents all n l branches of the system [43]. We consider this power system to be an MTDC transmission network consisting of n converters, where each converter is connected to an AC system, denoted as i ∈ {1, . . . , n} [44]. The converters are interconnected by the MTDC network.

AC System Dynamics
The AC dynamics of subsystem i are represented by an aggregated model given by the swing equation, where M i ∈ R > 0 is the inertia constant, ω i is the AC frequency of the system, P m i and P e i are the mechanical and electrical power, respectively, and P c i is the power injected from the converter into the grid. Note that the active power of the converter P c i is considered positive when power is injected positively into the AC system.
The governor model is given bẏ where T a ∈ R> 0 is the governor time constant, T c ∈ R> 0 is the governor phase constant and K R ∈ R> 0 is the droop constant. The secondary control loop is neglected here, as this document is focused on primary control only.

Converter and MTDC System Dynamics
For the nodes connected to converter i, averaged models are used, which are characterized by their equivalent DC-side and AC-side equations as follows: where V i is the DC voltage of the converter at node i, C i is the converter equivalent capacitance and I inj i is the current that is injected from the converter into the node. The HVDC transmission lines, connecting two nodes i and j, are modeled with their resistances R ij .
The injected current will be calculated as follows, based on the notation of [45], with The voltage v c,j i represents the combination of upper and lower-arm voltages of the converter AC side, while i j i is the grid current. The index j ∈ {1, 2, 3} stands for the three phases of the converter AC grid connection. The current I loss i models converter losses with an equivalent resistance R loss i . The AC-side converter dynamics can then be modeled with the combined inductance L i and resistance R i of the transformer and the phase reactor, respectively.

Converter Control
A synchronous d-q reference frame approach is conventionally employed to facilitate VSC control [46]. Here, the d-axis aligns with the grid voltages, meaning d = 1 and q = 0. With the grid current dynamics in the d-q frame, where R dq i and L dq i are the combined resistance and inductance of the transformer and the phase reactor, respectively, and v d i and v q i are the grid voltages. Linear decoupling and neglecting the resistances give the following terms for the converter voltages: where u c,d i and u c,q i are the control signals which represent the control of the grid currents i d i and i q i in the d-q frame. Proportional-integral (PI) controllers are utilized, with the following control laws: The current controllers make up the inner control loops. Additionally, active and reactive power controllers are added as the outer control loops, again as PI controllers. With the calculation of active and reactive power, the control laws can be formulated as As can be seen, the outer control loops produce the set points for the inner current control loops.

Droop Control
In some MTDC grid converters, additional DC voltage droop control is deployed. This proportional control provides a linear relationship between the DC voltage deviation and the active power set points. This droop control characteristic is also implemented in converters 1, 3 and 4 of the MTDC network ( Figure 4): The active power nominal reference set point P c,nom i will be altered by the droop control output, with K V i as the droop constant, to create the active power reference set point P c i . As regards the AC frequency droop control, the following control scheme will be proposed. The nominal d-axis current set point i d,nom i will be altered by ∆i d i to obtain the reference.
Among the conventional constant droop gains, denoted as k ω i i , the frequency derivative will also be considered with so that the set point alteration results in Figure 5 shows the overall control principle and system dynamics of the converter and its AC and DC grid connection. In addition, the equations defined above are used in the outer as well as in the inner control loops [47].

Phase-Locked Loop
The phase-locked loop (PLL) is needed both for the overall converter control and for synchronization during frequency deviations. The algorithm follows a common PI-based control principle, where the set point of the grid voltage q-component is zero.
whereθ i is the deviation of the reference frame angle at node i, K P,PLL i and K I,PLL i are the proportional and integral gain, v q,re f i us the q-component grid voltage set point, which is zero, and v q i the calculated q-component of the grid voltage. The d-q reference frame angle θ i = ω i t is then expressed by It is assumed that the PLL dynamics are negligible compared to the dynamics of the frequency deviations.

Optimal Performance Indicators
The optimization problem is formulated using the RoCoF, the nadir and the settling time t s of the AC system frequency to realize the best possible and most robust solution. Figure 6 shows the four parameters that are utilized to optimize the frequency responses. Each parameter has a specific area in which it needs to be optimized. The RoCoF is the slope when a load event appears, and its gradient should be as low as possible according to grid code requirements (see Section 2) to ensure that the frequency controller has enough time to react. This parameter is therefore optimized in the red area. The nadir is the minimum frequency reached after a load event. This should be as close to the nominal frequency as possible. This parameter is optimized in the blue area. The settling time t s and the settling time need to be reduced in the yellow and green optimization areas, respectively.  Figure 7 illustrates the theoretical effect of the implemented frequency optimization. The blue trajectory, which represents a high-inertia system, can be developed by optimizing the frequency control regarding the four parameters explained in Figure 6. In contrast, the red graph shows the frequency response without optimization. The frequency responses in Figure 7 are only valid for the primary control, which has the goal of stabilizing the frequency. The secondary control is then responsible for bringing the frequency back to the nominal frequency, illustrated in Figure 7 as a black dashed line. A novel, flexible, optimal strategy has been proposed, with the overall flow chart shown in Figure 4.

Controller Optimization Using Particle Swarm Optimization
Particle swarm optimization (PSO) is a methodology used for the optimization of non-linear systems. The goal is to find the best solution considering the previous solutions for each iteration [48]. The PSO-based optimization problem is formulated below. Equation (24) illustrates the fitness function, which needs to be minimized. This equation consists of three characteristic parameters: the nadir, RoCoF and the settling time t s .
The weights v 1 , v 2 , and v 3 are assigned and related as follows: where v 1 is from 0 to 0.7 and v 2 is from 0 to 0.3.

Python-PSCAD Interface
In terms of the optimization procedure, a distinct interface has been utilized. As shown in Figure 4, measurements of specific parameters are given to a Python environment using the PSCAD Automation Library, in which the optimization algorithm is implemented. The resulting output-i.e., the adapted control parameters-are then fed back into the PSCAD to generate the successive input. Then, Python works as an optimization controller that adjusts the frequency controller parameters, controlling the power flow of the considered grid in the most efficient way. The frequency control parameters calculated in the optimization algorithm need to be within certain limits to ensure the practical implementation. For the optimization, different parameters need to be measured in the converters and transferred to the optimization algorithm. For the frequency optimization, it is especially important to obtain the minimum frequency within a certain time frame, as well as the frequency slope and the frequency settling time until a stable frequency value is reached after an event that resulted in a frequency change. The change of frequency over a time step is also important for the optimization algorithm. Similarly, the power flow on the AC as well as on the DC side needs to be measured. From these input values, the optimization algorithm can analyze how the frequency event can be supported by the HVDC converter. Therefore, the result of the algorithm is that droop control values and frequency controller parameters are fed back to the HVDC converter controller. More precisely, the power should be distributed within the MTDC system to support the AC grid in which the frequency event appeared.
The main challenge of utilizing this interface is to change parameters in the PSCAD model during the simulation. To ensure an appropriate adjustment of the parameters, the simulation needs to be started again after each optimization iteration, which makes the entire optimization process quite time-consuming. It is therefore beneficial to identify the optimal parameter sets for different operation conditions before the commissioning of the system.

Results and Discussion
A five-terminal HVDC system was modeled in PSCAD as shown in Figure 4. In general, power can flow in both directions, from the AC grid to the DC grid and vice versa. The basic definition is that converters 1, 3 and 4 work as inverters in a DC droop control mode, and converters 2 and 5 as rectifiers utilizing a constant active power control. Via converter 2, an OWF is connected to the MTDC system. Note that the OWF is modeled as an ideal AC voltage source. The five-terminal HVDC grid consists of the AC part, the DC part and the transmission line part. The AC current voltage from the source flows into the converters and is then converted into DC current voltage by the control system of these converters. After that, it flows through the DC transmission lines into the inverters, where the DC current and voltage are converted back into AC current and voltage. The load event is modeled on the AC side of converter 5, where the AC grid is defined by the swing-governor equation to combine the AC frequency response with the DC power injection. Transmission lines are modeled in PSCAD as being between 80 km and 250 km in length. The DC voltage level was chosen to be 420 kV for this benchmark topology. To examine and optimize the frequency behavior in such a MTDC system, the PSCAD Automation Library was used. This allowed the coupling of PSCAD and Python via an interface in which data could be collected from the model and optimized parameters could be given back to the model. In addition, it allowed the use of the Scipy optimization library in Python.
As shown in Figure 6, different characteristics of the frequency response needed to be considered for the optimization: • The RoCoF should not be very steep according to the grid code requirements. If the RoCoF is too steep, the converters would disconnect from the AC grid and could therefore no longer support it, thus provoking power imbalances; • The nadir should not drop below a specific value to ensure that the converter stays connected to the grid and follows the grid code limits; • The settling time t s needs to be minimized to reach a stable operating state as quickly as possible, as an earlier recovery means less impact.
To achieve grid code-compliant system behavior in accordance with the three requirements above, different control parameters were adjusted as part of the optimization algorithm; for example, changing the droop control values resulted in a different RoCoF, nadir and settling time.
The optimization procedure was executed for two different scenarios, which were then compared to the base case without additional frequency control. The first scenario focused on optimization using an additional frequency control loop connected in converter 5, as shown in Figure 4. For this first scenario, only k ω i i was used. In the second scenario, the RoCoF parameter was also implemented in addition to scenario 1.

Base Case Scenario
This scenario is defined as the operation of the five-terminal HVDC grid without additional frequency control. This scenario is represented by the first iteration, defined as w = 0, in scenarios A and B.

Scenario A
Scenario A is defined as the case in which only the gain parameter k ω i i is included in the frequency optimization. In order to minimize the fitness function, which is defined by the RoCoF, nadir and settling time, different values for k ω i i were calculated with Python and given to the PSCAD model. The next step was to simulate the frequency event; again, Python was utilized to analyze the results. If the fitness function improved, shown by a lower value, the parameters in PSCAD were accordingly changed in Python. Figure 8 shows the process of optimizing the frequency response in the case of a load event in the AC grids connected to the converters. More specifically, the iteration number is denoted as w.
As shown in Figure 8, the nadir and the settling time were mainly optimized. The RoCoF was also a key parameter, but optimizing the gain value of the frequency controller did not have a large effect on the frequency response. In addition, it can be seen that the grid code requirements regarding the allowed frequency band and the settling time were met. Figure 8 shows that the frequency derivative changed in a very steep way in the case of a load event in the AC grid connected to converter 5. This effect can be used for the optimization of the frequency controller and make it react faster. This will be evaluated in scenario B.   Figure 9 shows the change of the active power supplied from AC grids 1 and 2. The activation time was defined by the grid codes (see Table 1) at around 2 s, which was the allowed activation time delay for systems with inertia. Therefore, it was possible to change a system without inertia to respond similarly to a system with inertia.
It can be seen that the power could support the frequency stabilization in AC grid 5. Therefore, the MTDC topology was part of the frequency controller optimization. In this scenario, neither large batteries nor a reserve from the OWFs were needed. With these figures, it becomes clear that the MTDC grid needs to support the AC grid more as more frequency response is requested by the frequency controller.   Table 2 provides the settling time in seconds and the nadir in Hz for each iteration w. The settling time together with the nadir is an important parameter that allows the derivation of the behavior of the HVDC system. Consequently, it can be used to improve the developed optimization algorithm. Table 2 shows that the optimization algorithm searches for the global optimum by varying the important control parameters in different directions. This is also depicted in the settling time. The nadir improves with each iteration from 49.9624 Hz to 49.9697 Hz. This is a marginal improvement but shows the principle function of the proposed algorithm. To consider existing grid codes and the stability of the overall system, certain limits had to be considered in the optimization process, which led to rather small changes.

Scenario B
Like scenario A, scenario B also took the frequency derivative into account. The frequency derivative, as shown in Figures 8 and 10, shows a fast reaction in the case of a frequency change. This characteristic makes it very suitable for controller optimization.   Figure 11 shows how the derivative can improve the frequency response after a load event. The derivative can be multiplied with a constant parameter to increase its influence. Figure 11 illustrates that the RoCoF, the nadir and the settling time are influenced by the derivative. The larger the constant multiplied with the RoCoF, the greater the influence of this. Comparing Figures 11 and 8, it can be seen that the derivative influences the nadir as well as the RoCoF and the settling time, whereas the impact of the frequency control without the derivative only improves the nadir. Figure 11 also shows that the nonlinear behavior of the frequency grows with the product of the constant and the derivative. Increasing this constant by a factor of 10 from w = 1 to w = 2 results in a lower effect than that of the difference between w = 2 to w = 3 as shown in Figure 11b.  The RoCoF remains equal for scenario A, as well as scenario B, between the grid code limits as defined in Section 2. It is important to ensure this by adding these boundary conditions to the constraints of the optimization problem. Figure 10 shows the frequency derivative behind the frequency graphs in Figure 11. It can be seen that multiplying the frequency derivative results in a steeper curve when the constant is higher. The iteration w = 4 illustrated in grey illustrates that the derivative can also lead to unstable and negative behavior if the constant multiplied with the derivative was chosen to be too high. Therefore, constraints need to be defined for the optimization of the frequency control, and these constraints should also be included in grid codes. Figure 12a,b shows the active power at converter 1 and 2, respectively, for the different values of optimization. These figures show that, in general, the power change is similar for power levels around 500 MW and 1750 MW. The negative effect of an overly high constant multiplied with the derivative is also visible in Figure 12. Iteration w = 4 shows this and illustrates how the power supplied from the AC grids would change over a longer time and more drastically at the time of the load event. Comparing scenario B with scenario A, it becomes visible that the frequency control also has an effect on the power supplied to converter 5, at which the frequency event occurred. The power adjustments in the other converters occurred much faster compared to the case without the RoCoF being used.

Conclusions
In this paper, a novel approach for the optimization of frequency response has been presented. Simulations using PSCAD and Python interfaces have been used to illustrate the proposed method. The simulation model represents a low-inertia system with HVDC converter stations with additional frequency control. The special focus of this paper relied on the use of a specific topology for optimized frequency response. Consequently, no large storage capacities or OWF reserves were needed. This can improve the economic capability significantly. Another focus of this research was the grid code requirements; however, it can also be seen that grid code requirements are not yet sufficiently specific and that only some rules are defined on the national levels by the various TSOs. This paper can be seen as a first step-by-step guide to propose a method to transform low-inertia systems into a network that behaves similarly to one with inertia. The necessary steps to be taken to transform low-inertia networks using an optimization technique were presented. In addition, the most relevant parameters for the network transformation as well as for the adjustment of the network code were identified. One parameter that was investigated in detail was the frequency derivative for controller optimization, since it can have negative effects on the frequency support. Additionally, the importance of converters in case of low-inertia grids was demonstrated. Finally, it was possible to generalize the process, based on frequency control optimization, for the transformation of a low-inertia system into a network that behaves similarly to one with inertia. In future research, focus will be placed on defining different parameters with more precise values so that they can be included in future network codes. Furthermore, additional optimization techniques will be applied for the analysis.