Implementation and Validation of an Advanced Wind Energy Controller in Aero-Servo-Elastic Simulations Using the Lifting Line Free Vortex Wake Model

Accurate and reproducible aeroelastic load calculations are indispensable for designing modern multi-MW wind turbines. They are also essential for assessing the load reduction capabilities of advanced wind turbine control strategies. In this paper, we contribute to this topic by introducing the TUB Controller, an advanced open-source wind turbine controller capable of performing full load calculations. It is compatible with the aeroelastic software QBlade, which features a lifting line free vortex wake aerodynamic model. The paper describes in detail the controller and includes a validation study against an established open-source controller from the literature. Both controllers show comparable performance with our chosen metrics. Furthermore, we analyze the advanced load reduction capabilities of the individual pitch control strategy included in the TUB Controller. Turbulent wind simulations with the DTU 10 MW Reference Wind Turbine featuring the individual pitch control strategy show a decrease in the out-of-plane and torsional blade root bending moment fatigue loads of 14% and 9.4% respectively compared to a baseline controller.


Introduction
Over the past years, wind turbines have increased significantly in size in an effort to reduce the cost of wind energy and make it a competitive source of energy. So far, this has been a successful approach. An example of this success can be seen in the increased installation numbers of new wind turbines in Germany [1]. Yet increasing the turbine size also has its drawbacks. A larger rotor will be subjected to higher aerodynamic and gravitational loads. For example, the aerodynamic bending moments and the moments due to the self-weight of the blade scale as the third and fourth power of the rotor diameter respectively ( [2], (pp. 97-123)). As a consequence, the structure of the turbine components such as rotor blades has to be stiffer, which requires more or stronger material. This leads to an increase in the cost of energy. A way of counteracting the load increase seen in larger wind turbines is through the use of advanced wind turbine controllers. This allows for less material use in the design of the different components and hence results in a decrease of the cost of energy.
The most common actuator used for load alleviation is the blade pitch actuator. This comes from it being already used in the power regulation strategy of modern turbines. Many advanced load alleviation strategies using pitch actuators have been proposed. One of the best-known ones is the Individual Pitch Control (IPC) strategy [3], which commonly relies on the out-of-plane Blade Root Bending Moments (BRBM) of the individual blades as input signals. It has been used in combination with different input sensors-such as inflow sensors [4,5]-and also in combination with different actuators-such as active trailing edge flaps [6][7][8][9]. Other studies have studied advanced model-based [10] or adaptive [11] controllers for load alleviation. A controller that uses neural networks as part of its architecture has also been recently proposed in [12].
Oftentimes, the results of these studies are difficult to compare and reproduce. This is partly because many research groups use self-developed baseline controller strategies as a basis for load reduction comparative studies. The source code of these controllers is rarely available. Alternatively, studies that use the NREL 5 MW Reference Wind Turbine (RWT) [13] also use the baseline controller available in the model definition. This is an older controller-based on [14,15]-that offers limited functionality and is inconvenient to use with other turbine models. This is because the controller parameters are hard-coded in the source file and the controller has to be recompiled every time the parameters change.
As part of the UpWind Project, a more advanced baseline controller was developed which allows for better power tracking and smoother transitions between the operating regions. These features lead to better energy capture and to reduced loading compared to the NREL 5 MW controller. Many of the aforementioned features are also implemented in the Basic DTU Wind Energy Controller [16].
In recent years, the wind energy community has started to address the problem of reproducible controller results by introducing several modern, open-source reference wind turbine controllers. Mulders and van Wingerden publish the Delft Research Controller (DRC) [17], which is expanded by Abbas et al. into NREL's Reference Open-Source Controller (ROSCO) [18]. Meng et al. also extend the Basic DTU Wind Controller to form the DTU Wind Energy Controller (DTUWEC), which includes advanced industrial features [19].
All of the cited reference controllers use classical controller architectures such as PID controllers. As discussed in ( [20], (pp. 506-518)), there are several reasons for this choice. An important one is that with classical controller architectures, controller stability can be guaranteed. This is of utmost importance since modern large wind turbines are expected to operate reliably under all circumstances with minimum supervision. Another reason is that individual features can be added to the controller without the need to re-calibrate the whole controller. Also, the integration of a supervisory controller is much more straightforward when classical controller architectures are used. Other control techniques such as neural networks are powerful techniques that could potentially be used to solve specific control objectives. They are therefore well suited to be part of advanced controller features. They are however less appropriate as candidates for reference baseline controllers. Because of their black-box model nature, it is difficult to guarantee their stability, add specific features or integrate them with supervisory controllers.
Having a reference controller is one aspect of accurate and comparable load reduction estimation. In order to have a complete picture of the design loads of different wind turbine components, we need to simulate the wind turbine in realistic aeroelastic scenarios that often include controller faults or other unforeseen events. Current industry standards prescribe a large number of aeroelastic simulations of the complete turbine [21]. These are grouped together into Design Load Case (DLC) groups, each considering a particular scenario in the wind turbine's design life. Most of the aforementioned studies only include a selection of DLC groups, such as the power production DLC group. While being a good approximation for certain component's loads, using a selection of DLCs will not give a complete picture of the load reduction capabilities of the different turbine controllers. This is in part because many of the available wind turbine controllers do not feature a supervisory controller. The latter oversees the pitch and torque controller and reacts to unforeseen events, shutting down if threshold values of certain signals are passed in order to ensure the structural integrity of the turbine components. Only a full load calculation according to industry standards will give an accurate estimate of the load reduction capabilities of advanced controller strategies.
Another important aspect for accurate load estimation is the use of appropriate models in the aeroelastic simulations. Current aeroelastic codes mostly rely on the Blade Element Momentum (BEM) aerodynamic model to calculate aerodynamic loads ( [20], (pp. 57-66)). BEM models are attractive because they are computationally inexpensive. Yet in order to capture the more challenging unsteady aerodynamic phenomena present in DLCs, BEM models require a series of engineering corrections. These corrections have been developed and tested so that they work for a wide range of operating conditions. If the wind turbine operates in a condition outside this range, then the BEM corrections could introduce inaccuracies and overestimate the aerodynamic loading on the turbine. Examples of this include turbine operation in extreme yawed conditions or inflow conditions that are inhomogeneous across the rotor. This could arise if the turbine is operating in the partial wake of another turbine, in sheared and/or turbulent inflow due to the Earth's boundary layer or if there is a large difference in the individual pitch angles of the blades (e.g., with pitch actuator faults) [22][23][24][25].
Vortex methods such as the Lifting Line Free Vortex Wake (LLFVW) aerodynamic model have a higher order representation of the unsteady aerodynamic phenomena and are capable of modeling these with far fewer assumptions than BEM models [26]. This is because in the LLFVW method the wake is explicitly modeled. In [27] the authors show that there are significant differences in fatigue and extreme loading if the aeroelastic simulations are performed with a BEM aerodynamic model compared to a LLFVW model, with the BEM model predicting increased fatigue loads. If we wish to accurately asses the load reduction potential of advanced control strategies based on individual pitch action, we require an accurate representation of the local aerodynamic effects that occur on each blade. Since the advanced controller action will be individual on each blade, the resulting induction field will be non-homogeneous. This in turn requires a higher-order aerodynamic model such as the LLFVW model to accurately estimate the effect of the resulting aerodynamic loads.
In this study, we address the aforementioned issues by introducing the TUB Controller (TUBCon). It is an open-source reference wind turbine controller with advanced load reduction strategies that features a complete supervisory controller. It can therefore be used to perform a full load calculation so that an accurate load picture of the turbine loads is obtained. Furthermore, this controller is fully compatible with the aeroelastic software QBlade [28]-which features the LLFVW aerodynamic model. In combination, QBlade and TUBCon can be used to accurately calculate wind turbine loads and also evaluate the performance of advanced load reduction strategies. We give an example of this by analyzing the load reduction capabilities of the well-known IPC strategy in power production with turbulent wind conditions. This paper is structured as follows: In Section 3 we present and fully describe TUBCon, including its advanced load reduction strategy and supervisory controller. In Section 4, we validate TUBCon in steady and turbulent wind conditions by comparing its performance to an established wind turbine controller from the literature. In Section 5 we analyze TUBCon's advanced load reduction capabilities in turbulent wind conditions by simulating a reference wind turbine using the baseline and IPC variants of TUBCon. Conclusions are drawn in Section 6.

Methods
We chose the DTU 10 MW RWT as the turbine model for this study as it is representative of the new generation of wind turbines and has been used in several research studies. The complete description of the turbine can be found in [29].
As explained in [25], large rotors such as the one from the DTU 10MW RWT have similar scales to the scales from turbulent wind found in Earth's boundary layer. As a consequence, the wind field that the turbine rotor sees will be much less homogeneous than the wind field seen by a smaller turbine rotor. BEM codes typically average the induction factor across a blade annulus, thus leading to inaccurate load predictions. In addition, large blade deflections that occur in modern large blades may introduce radial flow, thus violating the assumptions of many BEM models. Both of the aforementioned issues are addressed with higher order aerodynamic models such as the LLFVW model found in TU Berlin's aeroelastic simulation tool QBlade. We did the testing and simulation of the TUB Controller presented in this study using QBlade.

QBlade
To model the unsteady aerodynamics, QBlade uses the Lifting Line Free Vortex Wake (LLFVW) method [28]. Here, the blade aerodynamic forces are evaluated on a blade element basis using standard airfoil polar data. The wake is modeled with vortex line elements. These are shed at the blade's trailing edge during every time step and then undergo free convection behind the rotor. Vortex methods can model the wake with far less assumptions and engineering corrections compared to BEM methods. Especially when the wind turbine is subject to unsteady inflow or varying blade loads, the LLFVW method increases the accuracy compared to BEM methods [27]. To model the dynamic stall of the blade elements, QBlade uses the ATEFlap unsteady aerodynamic model [30], modified so that it excludes contribution of the wake in the attached flow region [31].
Regarding the structural model, QBlade uses the open-source multi-physics library CHRONO [32]. It features a multi-body representation of the turbine which includes Euler-Bernoulli beam elements in a co-rotational formulation. With it, QBlade is able to accurately simulate blade deflections including the blade torsion, which has a significant influence on the blade loads. A detailed comparison between QBlade and OpenFAST can be found in [27].

Description of the TUB Controller
This section describes the TUB Controller (TUBCon). A graphical representation of the controller architecture is shown in Figure 1.

Software
Interface Object

, …
Parameter File  The controller code is written in C++ in an object-oriented manner. It features a two-stage interaction with the aeroelastic simulation software. The first stage is an interface object that handles the data exchange with the aeroelastic code (Figure 1(a)). The current supported interfaces are the conventional Bladed-Style communication via a swap-array and a modified swap-array communication specially designed for interacting with QBlade.
This makes TUBCon compatible with common aeroelastic simulation codes including OpenFAST, Bladed and QBlade. The modular nature of the interface object makes it easy to extend the compatibility of TUBCon with other aeroelastic codes.
The interface object then communicates with the turbine controller in a second stage Figure 1(b). The individual controller components are designed in Simulink and compiled to a C++ object using the Simulink Coder package. The resulting object has an initialization function, a step function and a termination function. These are called by the main routine at the appropriate simulation times. Such an architecture allows us to rapidly develop and test new controller features that can be incorporated to the compiled controller library. The controller is parameterized externally using an appropriate parameter file (Figure 1(c)). This XML file is read and the controller parameters set as part of the initialization routine.
The controller object is adapted from the Basic DTU Wind Energy Controller [16] and shares many of its capabilities. It features a state-of-the-art pitch and torque controller that enable the turbine to operate reliably under unsteady turbulent wind conditions. Although the description of the torque and collective pitch controller is given in [16], it is also included here for the sake of completeness. Figure 2 shows a schematic overview of the controller.  Figure 2. Overview of the controller object. It is comprised of three major modules: the pitch controller, the torque controller and the supervisory control. The latter is able to override the former two with the use of switches. The setpoint signals are passed to the respective actuator model to calculate the actuation signal.
Both the pitch and torque controllers share the rotor speed Ω and the mean pitch angle θ mean as input sensors (Figure 2(a)). The output of the torque controller is the generator set-point torque Q gen−set and the reference power P re f . The pitch controller uses the aforementioned Ω and θ mean as well as P re f and the measured wind speed at hub height V hub to determine the set-point angles of all three blades (θ 1−set , θ 2−set and θ 3−set ) (Figure 2(c)). If the IPC strategy is enabled, then the pitch controller also needs the out-of-plane BRBM of all blades ( M BR Y ). The controller includes actuator models for the pitch and yaw actuators as well as the brakes and generator to model the dynamics of the different actuators ( Figure 2(d)). The set-point signal of each controller is passed to the respective actuator model to calculate the actual signals passed back to the aeroelastic code ( Figure 2(e)). In the following sections, the individual parts of the controller will be further explained. Figure 2 also shows the supervisory control. It is included to allow the controller to perform full load calculations. It will be explained in Section 3.3 and is included in Figure 2(f),(g) to show the location where the supervisory control overrides the signals of the individual controllers.
The pitch and torque controllers explained in the following sections operate using the low speed shaft side of the drive train. That is, they assume that the generator speed and torque are identical to the low speed shaft speed and torque. For geared turbines, the gear box ratio G is applied to convert the high speed shaft quantities into low speed shaft quantities and back.

Torque Controller
The torque controller is divided into two main parts: the partial and the full load regimes. There is also the switching logic to change between both regimes. The input for the controller is the rotor speed Ω and the mean pitch angle θ mean . The latter is used for the switching logic between the two load regimes. The output of the controller is the generator torque Q gen and the reference power P re f for the pitch controller. The reference power is simply the product of the instantaneous generator torque and the rotor speed: The variable speed controller is a PID controller with two different rotor speed setpoints. The controller is saturated with a maximum and a minimum limit so that Ω is adjusted to follow an optimum tip speed ratio in the partial load regime.
As a first step, the rotor speed Ω is low-pass filtered with a second order low-pass filter to exclude unwanted high frequency dynamics. The function of the low-pass filter is given by Appendix A Equation (A2). The speed error e TC is calculated using the difference of the low-passed rotor speed Ω LP and the current speed set-point Ω set : e TC = Ω LP − Ω set . The speed set-point is defined as where Ω rated and Ω min represent the rated and minimum rotor speed. The generator torque is computed using the equation Here, k P−TC , k I−TC and k D−TC represent the proportional, the integral and the differential gain of the PID controller. Because the values of the generator torque are saturated, each time step, the integral term of Q PID is recalculated as This helps to avoid windup of Q I and enables the controller to react quickly if the required torque signal changes from a previously saturated value.

Partial Load Regime
In order for the torque controller to enforce an optimum tip speed ratio in the partial load regime, the generator torque is saturated with upper and lower limits: Q P max and Q P min . Between Ω min and Ω rated , the limits are identical and follow the optimal torque speed curve of the turbine: In the last equation, ρ represents the air density, R the rotor radius and C p−opt the power coefficient at optimum tip speed ratio λ opt . At two given rotor speed ranges, [Ω min−a , Ω min−b ] and [Ω max−a , Ω max−b ], the torque limits open up to allow the PID controller to keep the rotor speed at the required set-point. The switching logic for Q P min is given by: In the above equation, Q F re f represents the generator torque in full load regime and σ(·) represents a smooth switching function between the two limits Ω min−a and Ω min−b . The switch function is given by Equations (A5) and (A6). Complementary to Equation (6), Q P max follows the switching logic: The above equation uses the symbol σ max to denote the switch function σ(Ω max−a , Q P min for const. torque Q P max for const. torque Q P min for const. power Q P max for const. power Below the minimum rotor speed, Q P min is kept at 0 kNm to allow the rotor to gain enough rotational speed at low wind speeds. Once the rotor speed reaches Ω min−a (95% of Ω min in the figure), Q P min is increased and equaled to K opt · Ω 2 . This enforces the optimal torque-speed curve of the wind turbine below the rated speed. Once Ω gets close to Ω max−a (95% of Ω rated ), Q P max opens up to allow the PID controller to regulate the rotor speed. The parameters Ω min−a , Ω min−b , Ω max−a and Ω max−b are externally defined by the user. Figure 3 includes the behavior of the torque limits for the two torque control strategies in the full load regime: constant power and constant torque. These are explained in the next section.

Full Load Regime
The full load regime of the controller uses the same PID controller for the controller torque, but now the torque limits Q P min and Q P max take the same value Q F re f . The control strategy of the torque controller in the full load regime can be either constant power or constant torque. Q F re f takes different values depending on the strategy. These are: While Q F re f is constant for the constant torque strategy, it is inversely proportional to the (unfiltered) rotor speed signal for the constant power strategy. This explains the 1/Ω behavior of Q P min and Q P max for the constant power strategy in Figure 3.

Switching between Regimes
The controller switches between partial and full load regimes depending on the first order low-pass filtered switch variable σ θ−LP . σ θ is defined using Equation (A5) as σ(θ f 1 , θ f 2 , θ mean ). The limits θ f 1 and θ f 2 are user-defined parameters. For this study, the limits were defined as θ f 1 = θ f 2 = θ min + 0.5 • . In this configuration, the switching function σ θ behaves like a step function. The variable θ min is the minimum pitch angle of the pitch controller, defined in Section 3.2. The equation of the first order low-passed filter is given by (A1).
Including the switching between regimes and the torque strategy in the above rated regime, the full torque limits take the form

Drivetrain Damper
The torque controller also includes a drivetrain damper to damp unwanted oscillation of the turbine shaft due to e.g., excitation of its torsional eigenfrequency. The drivetrain damper is implemented as a proportional term k dmp to the band-passed rotor speed signal Ω BPF : The equation of the band-pass filter is given in Equation (A3). Q dmp is added to Q PID to obtain the total output torque of the controller:

Disable for Low Rotor Speeds
An additional feature of the controller is a switch-off mechanism for low rotor speeds. The rotor speed signal Ω is filtered using a low pass filter (see Equation (A2)) and compared to a fraction of the minimum rotor speed: k off · Ω Min . If the filtered rotor speed signal is below this value, then the torque controller shuts down by setting Q max = Q min = 0 Nm. Note that if the turbine rotor speeds up again and the (filtered) rotor signal exceeds the aforementioned limit, then the torque controller is activated again and functions as described above.

Pitch Controller
The pitch controller in TUBCon features two strategies. The first is the Collective Pitch Control (CPC) strategy for power regulation. The second is the advanced Individual Pitch Control (IPC) strategy for additional load reduction. The CPC strategy is always active while the IPC strategy can be enabled by the user through the external parameter file.

Collective Pitch Control
The CPC controller combines two PID controllers that react to the rotor speed error and the power error. The inputs for the pitch controller are the rotor speed Ω, the mean pitch angle θ mean , the reference power from the torque controller P re f and the measured wind speed at hub height V hub (see Figure 2(a)).
The rotor speed signal is filtered using a second order low-pass filter as described by Equation (A2). Both the pitch and the torque controller share the same filter frequency and damping ratio to calculate Ω LP . The speed error e Ω is calculated as the difference between the low pass filtered rotor speed Ω LP and the rated rotor speed Ω rated . The error e Ω is then passed through a notch filter to filter out the drivetrain eigenfrequency. The equation of a notch filter is given in Equation (A4).
In parallel, the power error e P is calculated as the difference between P re f and P rated and passed through a notch filter (Equation (A4)) to obtain e P−NF . The proportional, integral and differential terms of the pitch controller are calculated as follows: Here, k P−X , k I−X and k D−X are the proportional, integral and derivative constants of each PID controller. The subscript Ω denotes that the PID constants are applied to e Ω−NF . Likewise, the subscript P denotes the affiliation of the constants to e P−NF . Note that k D−P is always set to zero.
Additionally, the pitch signal is gain-scheduled with two factors. The first one accounts for the non-linear effect that larger blade pitch angles have on the aerodynamic torque. The second factor increases sensitivity of the pitch controller to large speed excursions in order to limit them. The total gain schedule is calculated via In this equation, θ LP is the low-pass filtered mean pitch signal θ mean . K 1 , K 2 and Ω 2 are parameters given by the user. To calculate θ LP , a first order filter as described in Equation (A1) is used.
The pitch angle signal is limited by the parameters θ max and θ min . In addition, θ min can be modified by V Hub using a look-up table given by the user. In this case, the measured wind speed at hub height is also low-passed using a first order low pass filter (Equation (A1)).
In order for the pitch controller to react quickly if the required pitch signal changes suddenly from a saturated value, an anti-windup scheme like the one described in Equation (3) is used for θ I .
The total collective pitch angle signal of the pitch controller is therefore given by Additionally, the pitch rate is also limited by two user defined parameters:θ max andθ min .
The power dependency of θ PC will make the pitch controller raise the pitch angle set point when P re f from the torque controller is close to P rated . This in turn helps trigger the switching procedure from partial to full load regime of the torque controller as explained in Section 3.1.3.

Individual Pitch Control
One of the most common advanced pitch control strategies in wind energy research is the Individual Pitch Control (IPC) strategy [3,33]. Several studies have used this strategy as a comparison to other advanced pitch controller strategies [4,11,34]. It has also been used as a comparison or a complementary strategy for trailing edge flap controllers [7,9,10]. Figure 4 shows the graphical representation of the IPC strategy implemented in TUBCon.

PI-Controller
Low pass filter

Low pass filter
Notch filter
Gain Schedule The IPC uses as input signals the out-of-plane BRBM of the three blades (M BR Y1 , M BR Y2 , M BR Y3 ) as well as the mean pitch angle θ mean and the rotor azimuth angle ϕ (Figure 4(a)). The outof-plane BRBMs are transformed to the direct and quadrature axes using the once-perrevolution or 1P-Coleman transformation (Figure 4(b)). The 1P-Coleman transformation for a three bladed rotor takes the form where d and q are the quantities expressed in the direct and quadrature axes respectively. The physical interpretation of these quantities is the rotor tilt and yaw moment in the non-rotating coordinate system. These rotor moments are then passed through a second order low-pass filter (Equation (A2)) and a notch filter (Equation (A4)) Figure 4(c) to filter out unwanted high frequency content as well as the 1P component of the load signals in the non-rotating frame of reference. This step is needed as a 1P oscillation in the non-rotating frame of reference can lead to an increased 3P excitation of the turbine [35]. Following a concept presented in [9], a gain schedule is implemented using θ mean to adapt the individual pitching action to the wind speed (Figure 4(d)). The gain schedule has the same mathematical expression as η θ in Equation (16) but uses different parameter values. A PI controller is implemented with a zero set-point to reduce the rotor tilt and yaw moments (Figure 4(e)).
The control demand is transformed back to the demands of the individual pitch angles using the inverse 1P-Coleman transformation (Figure 4(f)). The inverse transformation is given by where the quantities D and Q represent the control signals in the non-rotating coordinate system and θ 1 , θ 2 and θ 3 the individual pitch angles for each blade (Figure 4(h)). The inverse Coleman transformation uses a modified azimuth angle ϕ . Figure 4(g) shows that ϕ = ϕ + ϕ lead , where ϕ lead is the lead angle. This constant angle helps decoupling the rotor yaw and tilt moments in the non-rotating frame of reference so that they can be treated as independent systems. As explained in [4], certain factors such as blade stiffness, collective pitch angle and pitch actuator response time introduce a dependency between the two rotor moments. Using the lead angle is a straightforward way to counter this problem. It is possible to generalize this strategy to other frequencies by using nP Coleman transformations. In this case the rotor angle ϕ and the respective shift for each blade in Equations (18) and (19) are replaced by n-times their value. Using for example an IPC-like strategy with a 2P Coleman transform helps to reduce the 3P asymmetrical loads in the yaw bearing of the turbine [10].
The IPC pitch angles are limited to a maximum and minimum value (θ max−IPC and θ min−IPC ) given by the user. Since the PI controller determines the quantities D and Q in the non-rotating coordinate system, the limits are transformed into this coordinate system: As with the CPC strategy, an anti-windup procedure equivalent to Equation (3) is used to limit the increase of the integral part of the controller.
The pitch angle signal of the IPC strategy is added to the collective pitch signal to obtain the final pitch angle signal. The use of this strategy increases the pitch activity significantly. In order to limit this increase in pitch activity, the control strategy is phased out in the partial load regime. Bergami and Gaunaa show in [36] that the majority of fatigue loading that can be alleviated with this strategy occurs in the above-rated region. Phasing out the IPC strategy helps limit the pitch activity and optimizes energy capture by keeping the pitch angle constant in the below-rated region. The phasing out is done by multiplying the IPC PI-constants with a switch function (Equation (A5)) based on θ mean . The switch limits used in this study are x 0 = 0.5 • and x 1 = 3 • .

Supervisory Control
The supervisory control of TUBCon has two main functions. The first one is to detect whenever some security limit (e.g., generator over-speed) has been tripped and enforce an appropriate maneuver (e.g., normal stop). The second function is to trigger specific events. These can be controller fault events (as required by current industry standards) or stop maneuvers (if a specific alarm has been triggered).
The control signals from the supervisory control will always override the signals from the pitch and torque controllers. This is shown in Figure 2 with the switch for each controller. In this figure, θ SC represents the pitch signal from the supervisory control that overrides the signal from the pitch controller. In the same manner, Q gen−SC overrides the generator torque from the torque controller. In addition, the supervisory controller can activate the brake and the yaw actuator of the turbine.
The internal logic of the supervisory control is based on [37] and shown here in Figure 5. It features three control blocks. The first one checks if any turbine sensor is outside its allowable range and triggers an alarm should this happen ( Figure 5(a)). The turbine sensors are bundled into the vector S SC in Figure 5 for the sake of clarity (see Section 3.3.1 for a full description of the considered sensors). Depending on the situation, the alarm can have several levels. An example of this could be the tripping of the first over-speed limit and the tripping of the second over-speed limit, both alarms depending on the sensor Ω.
The second block manages the alarms that the first block triggered and sets an appropriate reaction maneuver ( Figure 5(b)). Keeping the example above, if the alarm block detected a first over-speed trigger, the managing block would request a normal stop of the turbine. If a second over-speed trigger is detected, then the manager block would request an emergency stop procedure. The latter clearly has a higher priority than the former. Both stop procedures have a higher priority than the normal control action of the controller. The third block is the event generator block ( Figure 5(c)). This block creates the necessary controller signals to simulate any given event. These signals could be a controller fault required by a specific design load case or the normal stop maneuver requested from the manager block. The input signals for this block are the current pitch angle of each blade θ i , the rotor speed Ω and torque Q gen and the current time t. The last sensor is needed if an event is to occur at a specific simulation time. The output of the event block are the overridden controller signals. Note that depending on the specific event, not all control signals are necessarily overridden. Table 1 lists all the considered alarms of the supervisory control. The first column shows the measured sensor, the second column the limit and the third column the requested maneuver. In the third column, NS stands for normal stop and ES for emergency stop. These are the only two currently implemented maneuvers of the controller and are explained below.

Considered Alarms and Reaction Maneuvers
The alarm block considers five sensors: rotor speed Ω, electrical power P, yaw misalignment γ, pitch angles θ and grid status. Both Ω and P have two limits (n4, p4 and nA, pA respectively) that, when surpassed, trigger instantly the appropriate stop maneuver. The same simple trip-logic is implemented for the grid status signal. At the instant that the grid status is measured as offline, a normal stop maneuver is triggered.
For the other sensors, the alarm is triggered if the sensor surpasses the limit for a given time period. The alarm block foresees two limits for γ with two different duration times. The first limit γ max−1 considers long-time yaw misalignments. The measured yaw misalignment γ has to be larger than this limit for a time interval greater than τ γ−1 , which should be fairly large. In contrast, γ max−2 considers short-term extreme yaw misalignments. The yaw misalignment signal used to trigger the alarms is filtered with a first order low pass filter (Equation (A1)) to even out variations coming from inflow turbulence.

Sensor
Limit Maneuver Offline NS For the pitch angle group, there are two conditions that can trigger alarms. The first one is the difference between the individual pitch angles (∆θ ij or ∆θ i−CP ). This difference is calculated differently depending on the active pitch control strategy. For the CPC strategy (Section 3.2.1), the alarm block checks the difference between all three angles. If the difference between any two pitch angles is greater than the fixed limit ∆θ max−CPC for a given time τ ∆θ−CPC , then the alarm is triggered and a normal stop maneuver is requested. For the IPC strategy (Section 3.2.2), the pitch angle differences are measured against the collective pitch angle signal. The limit ∆θ max−IPC is not constant but varies depending on the short-term mean difference between the IPC angle and the collective pitch angle (plus a used-defined offset angle). The short-term mean difference of the individual pitch angles is obtained by applying a first-order low pass filter to the instantaneous mean difference. The time constant for this filter is a user-defined parameter. By using this triggering strategy, the supervisory control can detect pitch angle faults even when the difference between two pitch angles lies below the maximum allowed pitch difference for the IPC strategy.
The second condition included in the pitch angle alarm group is the difference between the measured and the demanded pitch angle for each blade ∆θ set . If the difference between the two signals in any blade is greater than ∆θ set−max for a given time τ ∆θ−set , then the alarm is triggered and a stop maneuver is requested.
The two stop maneuvers used in this controller are defined by a sequence of actions that are taken (almost) independently of the controller signals. The only exception is the normal stop maneuver that additionally uses the pitch angle differences, as explained below. The parameters for both maneuvers are listed and explained in Table 2. Note that there are two sets of parameters: one for the normal stop and one for the emergency stop procedure.
The implemented stop maneuvers foresee that the collective pitch angle will increase at a rateθ S up to a maximum value θ max−S . This pitching towards feather can be delayed for a given time using the parameter τ θ . Parallel to the pitch controller, the torque controller decreases linearly to Q min−S at a rate given by the parameterQ S . This procedure can also be delayed for a given time using the parameter τ Q . In case of a grid loss, a chopper can keep the generator torque constant for a given time τ Chopper in order to avoid very high rotor speeds. There is also the option to enable the turbine brake during the stop maneuvers. This is controlled with an enable flag and a minimum rotor speed (Ω Brake−S ) at which the brake is activated.
In addition to these fixed parameters, the normal stop procedure checks the pitch angle differences between all blades. If the absolute value of a given difference is above 0.5 • , then the pitch rateθ S is replaced by the minimum value betweenθ max and 1.5 ·θ S . This is done for all blades except the one with the highest pitch angle. This way the pitch angle differences are minimized during the stop maneuver avoiding unnecessary oscillations due to aerodynamic imbalances of the rotor. The emergency stop does not have this feature as it is designed to be hard coded in the turbine's safety mechanism. Delay time at which the pitch angle is kept constant before pitching. BrakeFlag S Flag to enable the brake in the maneuver Ω Brake−S Rotor speed at which the brake is enabled

Considered Events
The event block allows the controller to simulate the events required by the current industry standards for a full load calculation [21]. Table 3 presents and explains all the events that the controller is able to perform. All of the listed events are controlled by a set of parameters passed to the controller. Both the normal stop and the emergency stop events require two parameters: a flag to indicate if the event will be triggered and the time at which the maneuver is triggered.
The pitch runaway to feather/fine fault simulates an error in one or several pitch actuators. In this event, one or several blades suddenly pitch with a given pitch rate to the respective extreme value. The pitch rate is one of the parameters for this event. The sign of the pitch rate defines if the event is a pitch-to-feather (positive rate) or a pitch-to-fine (negative rate) fault event. There is one activation flag and one activation time parameter for each blade. This gives the flexibility to simulate the single pitch fault events and the collective pitch fault events with a limited set of parameters.
The pitch transducer fault simulates an error in the measurement of the generator speed. Instead of the actual speed, the transducer measures a constant value and passes it to the pitch and torque controller. The parameters for this event are a flag to enable the event, the time at which the event starts and the constant generator speed passed to the controller once the fault occurs.
The grid loss event simulates a sudden loss of the electrical grid. As a consequence, the generator cannot feed the generated power to the grid and the torque drops to 0 Nm. This event also raises the grid loss flag so that the alarm block recognizes the event and triggers the appropriate maneuver. The parameters that control this event are a flag that enables it and the time at which the grid loss event happens.
Finally, the yaw runaway event simulates a malfunction in the yaw system that causes the yaw motor to activate. The parameters for this event are an activation flag, a time to start yawing, a yaw rate and a time to stop yawing.

Actuator Models
Once the set-point values of the blade pitch angles and generator torque are calculated by the respective controllers, they are passed to the actuator models of the controller (see Figure 2). The actuator models are used to model the additional inertial effects of the physical actuators. These models can be very accurate depending on the individual needs of the calculation.
For the TUB Controller, a simple second-order linear model was chosen to model both the pitch actuators and the generator model. The second-order model has the same mathematical description as a second-order low-pass filter, namely Equation (A2). This model is also used for the yaw actuator in the yaw runaway event. The individual cut-off frequencies and damping ratios for the actuators and the generator model are supplied as parameters by the user. For the brake actuator, a simple first-order linear model as described by Equation (A1) is used. The time constant is supplied by the user. Figure 6 shows four examples of events and stop maneuvers using the DTU 10 MW RWT in turbulent wind simulations. In Figure 6a, a collective pitch-to-fine fault at a simulation time of 125 s leads to the triggering of the first and second over-speed alarms. The resulting maneuvers (normal and emergency stop) can be distinguished by the different pitch rates. Figure 6b shows a single pitch-to-fine event during power production using the IPC strategy. At 120 s of simulation time, θ 1 receives a faulty signal and starts pitching towards 0 • . This is caught by the supervisory controller and the normal stop procedure is triggered. The normal stop feature that minimizes aerodynamic imbalances can be clearly seen in this figure, as the difference in individual pitch angles is reduced to 0 • at 130 s of simulation time. Figure 6c shows a grid loss scenario and the resulting stop maneuver. Finally, Figure 6d shows a speed transducer fault at 120 s simulation time. As a consequence, the generator torque and pitch angle signals freeze and a normal stop is only triggered because of the first over-power alarm (comparable to the first over-speed threshold).

Controller Validation
The TUB Controller was tested and validated in a series of load cases to verify its functionality. This was done in steady and turbulent wind conditions, summarized in Table 4. The validation was done by comparing TUBCon to the established Basic DTU Wind Energy Controller [16]. The parameters for both controllers were taken from the LIFE50+ report [38].  This simulation features a series of wind speed steps from 4 m/s to 24 m/s with a 2 m/s step height. Between two steps, the wind speed is held constant for 30 s. It can be seen that both controllers behave in an almost identical manner. This is due to the fact that the collective pitch and torque controllers from TUBCon were directly adapted from the Basic DTU Controller. With the chosen parameters, TUBCon manages to stabilize the turbine without large overshoots in the pitch and rotor speed signals in spite of the sudden increases in wind speed. This is true for all simulated wind speeds.

Turbulent Wind Simulations
The turbulent wind simulations were done using the Normal Turbulent wind Model (NTM) from [21]. Because of this, the controller validation has to be done in a statistical manner. The setup is given in Table 4 under the column "Turbulent calculations". For each wind speed bin, we did six simulations with three different yaw angles of the turbine and two turbulence seeds. In total, there were 66 simulations, each 600 s in length for each controller. Because we are using QBlade's LLFVW method, the wake needs to first develop behind the rotor in order to have accurate results. We added 200 s of pre-simulation time to allow the wake to develop. This time was discarded in the analysis. Figure 8 shows an example of an aero-servo-elastic simulation of the DTU 10 MW RWT within QBlade. The incoming turbulent wind speed has an average hub-height value of 14 m/s and is shown on the left. The wake is modeled by vortex elements that are allowed to convect freely downstream of the turbine. To compare the controllers we chose a selection of turbine sensors that are summarized in Table 5. These sensors give a good estimate of the overall loading of the turbine blades, tower top and tower bottom.

Sensor Name Symbol
Blade pitch angle/rotor speed/generator power θ/Ω/P Blade root in-plane/out-of-plane/torsional bending moment Tower base side-side/fore-aft/torsional bending moment We used two metrics to analyze the performance of the controllers, depending on the nature of the sensor. For the load sensors our metric is the lifetime Damage Equivalent Loads (DELs). These are calculated using the rainflow counting algorithm combined with the Palmgren-Miner linear damage accumulation hypothesis, as described in [39]. The rainflow count was done using the software Crunch [40]. For the controller signals, we use the averaged standard deviation of each signal. The average is taken from the individual standard deviations of all simulations in each of the wind speed bins. To calculate the lifetime DELs we used a wind speed distribution that corresponds to a wind class IA turbine [21], which is the design wind class of the DTU 10MW RWT. Figure 9 shows the averaged normalized standard deviation of the controller signals as a function of the average wind speed for the calculations with the DTU and the TUB controllers. The normalization is done with respect to the calculations with the DTU controller. We can see in this figure that the averaged standard deviations of the rotor speed and pitch angle are very similar with both controllers. The main difference is seen for Ω in wind speed bins of 12 m/s and higher. Here, theσ(Ω) of the calculations with TUBCon are consistently higher than with the DTU controller. The reason for this can be seen in Figure 9c. Here we can see thatσ(P) is considerably smaller for the TUBCon calculations compared to the calculations with the DTU controller. The torque controller objective was constant power for both controllers. The fact thatσ(P) is smaller in the TUBCon simulations indicates a more aggressive constant power enforcement of this controller. This comes at the expense of larger torque and rotor speed fluctuations when compared to the calculations with the DTU controller. We note that even though the differences in the normalizedσ(P) are large, the absolute differences in the variation of the generator power were small. The large relative differences seen in wind speed bins of 14 m/s and higher arise because the generator power is mostly constant and the values ofσ(P) are small for both controllers.  Table 5.

Fatigue Loads
The effect on the fatigue loads can be seen in Figure 10. The only significant differences occur for M TB X and M TB Y , with TUBCon simulations showing a 3% and 2% increase respectively, compared to simulations with the DTU controller. The differences in M TB Y come from the larger oscillations of Ω in the TUBCon simulations, driven by the more aggressive constant power controller. The increased fatigue loads of M TB X are only indirectly affected by controller action and it is therefore more difficult to find the source of this difference. It is assumed that the different variations of Ω lead to differences in the induced tower oscillations. For the fore-aft direction, the tower vibrations are damped out quickly due to aerodynamic damping. This is not the case in the side-side direction as the damping is much lower and hence these vibrations cause different amounts of M TB X fatigue loads. Further investigation is needed to corroborate this assumption.  Table 5.
All in all the differences in controller behavior and turbine loading remain small and the performance of both controllers is very similar.

Fatigue Load Reduction through Advanced Control Action
As discussed in [27], many implementations of the BEM aerodynamic model average the axial induction factor across the turbine rotor. This leads to inaccuracies in the local induced velocities on the blades and hence to significant loading differences when compared to the more accurate LLFVW aerodynamic method.
These differences will necessarily affect the performance of advanced control strategies such as IPC. Firstly, the input signals of the IPC controller will be different in LLFVW simulations because of the more accurate estimation of M BR Y in each blade compared to BEM-based simulations. Secondly, the controller action will affect the turbine loads differently due to the more accurate representation of the non-homogeneous induction field in LLFVW simulations caused by the individual pitch positions.
In this section we explore the load reduction potential of the IPC control strategy (Section 3.2.2) using the LLFVW method from QBlade. This will give us a more accurate picture of the load reduction capabilities of this strategy. The IPC strategy focuses on reducing the once-per-revolution (1P) M BR Y loads. The parameters were taken from the report [9] and slightly adapted to account for the different coordinate system in which the input is measured. Since we are interested mainly in fatigue load reduction, we considered the same load cases from Table 4 (column "Turbulent calculations"). These load cases correspond to the DLC group 1.2 from [21]. For onshore wind turbines, the DLC group 1.2 is the main contributor of lifetime fatigue loads for most of the turbine components, since the turbine spends most of its operating time in these conditions [41]. Evaluating the fatigue loads from this group will therefore give a close estimate of the real fatigue loads. To keep consistency, we considered the same load sensors and metrics as the ones described in Section 4.2. Figure 11 shows a selection of representative time series from a baseline simulation and a simulation with active IPC strategy. Both simulations use the TUB Controller with the same controller parameters. The baseline simulation uses the CPC strategy and the IPC simulation uses the CPC and IPC strategies. In this figure we can see the effect of the IPC strategy on the controller signals and on the M BR Y loads. From Figures 11b,e it can be seen that the influence of the IPC strategy on Ω and P is small. This is mainly due to the frequency separation between the CPC and IPC strategies. Figure 11c shows the time series of θ 1 . We can clearly see the 1P oscillation of the IPC strategy on top of the CPC pitch signal. The load reducing effect of this strategy can be seen in Figure 11d at around 700 s of simulation time. The 1P variation of M BR Y are clearly reduced due to the additional pitch actuation. The below-rated power limitation of the IPC strategy can be seen in Figure 11c around 650 s of simulation time. When the mean pitch angle decreases to 0 • , the amplitude of the IPC signal is also reduced 0 • to maximize power capture.

Controller Signals
The effect of the IPC strategy on the controller signals can be seen in Figure 12. It shows the normalized averaged standard variations of Ω, θ and P respectively. Figure 12a shows that the normalizedσ(Ω) of the IPC strategy is practically 1 for all wind speed bins except the bins corresponding to 12 and 14 m/s average speed. There we see that Ω from the IPC simulations oscillates less than Ω from the CPC simulations. This can be understood if we look at Figure 11b. The additional 1P fluctuation of θ does influence the value of Ω by reducing slightly the sensitivity of the rotor to changes in the wind speed. This is particularly marked around rated wind, where the pitch angle is close to 0 • and there are high angles of attack in the outer span of the blades. The latter lead to large values of lift forces and changes in the lift force due to pitching have an increased effect on rotor thrust and torque. Figure 12b shows the normalizedσ(θ) vs. the wind speed bin. This is the controller signal that shows the largest differences. From 10 m/s onward, the value ofσ(θ) increases up to values larger than 1.2. It is this region where the IPC strategy starts to function. The increase in pitch activity from the IPC strategy is directly linked to the fact that the 1P fluctuation of M BR Y increases with increasing wind speed [36]. Finally, Figure 12c shows the normalized values ofσ(P). Here, there is almost no difference between the two strategies. The lower value in the IPC simulations seen in the wind speed bin of 14 m/s comes from the relatively small reference value ofσ(P) for the CPC calculations. Because P is fairly constant in above-rated wind simulations, differences in the drop of P for temporarily low wind speeds (as seen in Figure 11e) will have a large effect on the normalizedσ(P).  Table 5. Base = CPC strategy. Figure 13 shows the normalized lifetime DELs of the simulations with the CPC and the IPC strategies. We can see that the main effect of the IPC strategy is to reduce the lifetime DELs of M BR Y and M BR Z by 14% and 9.4% respectively. There are also smaller effects on other load sensors. The lifetime DELs of M BR X are 2.4% lower in the simulations with the IPC strategy compared to the CPC strategy. The load differences for these three sensors come directly from the IPC strategy. Since the strategy is minimizing the yaw and tilt moments of the rotor, it indirectly minimizes the load fluctuations of the individual blade root moments.   Table 5. Base = CPC strategy.

Fatigue Loads
The yaw bearing sensors are practically unaffected by the IPC strategy. This is due to the nature of our metric. The 1P based IPC strategy focuses on reducing the steady or slow varying yaw and tilt moments of the rotor. Our calculation of the DELs does not consider the means but only the ranges of the load cycles. A reduction of the load averages is therefore not captured by our metric. An IPC strategy that additionally targets the 2P load fluctuations would also reduce the yaw bearing DELs, ( [10,20], (pp. 501-503)). The tower base lifetime DELs show that the IPC strategy also has a small impact on the tower fatigue loads. The IPC strategy increases the M TB X DELs by 1.5% and decreases the M TB Y DELs by 0.9% compared to the CPC strategy.

Conclusions
This paper presented and detailed TUBCon, an advanced open-source wind turbine controller that includes pitch, torque and supervisory controllers. The controller can therefore be used to perform a complete load calculation according to industry standards. It is compatible with the common aeroelastic simulation codes including QBlade, which features the higher order LLFVW aerodynamic method in addition to a standard unsteady BEM aerodynamic model.
TUBCon was validated against an established turbine controller from the literature by comparing aeroelastic simulations of the DTU 10 MW RWT in steady and turbulent wind conditions. For steady wind conditions, the controllers show practically the same performance. For turbulent wind conditions, TUBCon shows a more aggressive constant power regulation. This reduces the mean standard deviation of the generator power for the above-rated wind bins by up to 70%, but increases the standard deviation of the rotor speed by up to 3.7%. This difference also affects the lifetime DELs of the tower base bending moments. The lifetime DELs of M TB X and M TB Y are increased in the TUBCon simulations by 3% and 2% respectively.
We also investigated the advanced load reduction capabilities of TUBCon by comparing the performances of the IPC strategy against a baseline CPC strategy. This was done using QBlade's LLFVW aerodynamic method, which is able to calculate the aerodynamic effects of a non-homogeneous induction field due to individual pitching more accurately compared to most BEM-based aerodynamic methods. The results show that the IPC strategy is able to reduce the lifetime DELs of M BR Y and M BR Z by 14% and 9.4% respectively when compared to the baseline simulations. This comes at the cost of increased pitch activity from the IPC controller. The normalizedσ(θ) of the IPC strategy increase to values up to 22.6% higher than the values of the CPC strategy for wind speed bins above rated wind speed.
Future work will include further development of TUBCon to add new features such as tower vibration damping and rotor speed exclusion. It is also planned to add a fully featured trailing edge flap controller and the necessary features so that TUBCon can be used as a controller in offshore floating wind turbine simulations. Furthermore, the controller will be extended to include power curtailment and wake steering capabilities so that it can be used in conjunction with a wind farm controller. In addition, the effect of QBlade's LLFVW aerodynamic model on advanced controller performance will be further analyzed by comparing the results from LLFVW-based simulations to more common BEM-based simulations and considering more DLC groups.  where ω is the center frequency, ξ the damping ratio and τ a time constant.
The notch filter of a general signal takes the form x NF (s) = s 2 + 2ξ 2 ω · s + ω 2 s 2 + 2ξ 1 ω · s + ω 2 · x(s), where ξ 1 and ξ 2 are the damping ratios and ω the filter frequency. The general form of the switching function used by the controller is given by the equation where the coefficients take following values: (A6) Table A1 lists the abbreviations used in this work.