**3. Description of the TUB Controller**

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

**Figure 1.** Graphical representation of the controller architecture. The communication with the aeroelastic software is done in two stages using an interface and a controller object. The controller parameters are passed through an external parameter file. - *SCon* stands for controller signals.

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 *Qgen*−*set* and the reference power *Pref* . The pitch controller uses the aforementioned Ω and *θmean* as well as *Pref* and the measured wind speed at hub height *Vhub* 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 *<sup>Y</sup>* ). 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.
