Create a custom controller

If you want to write a controller that behaves like the NREL 5-MW controller (i.e. variable generator speed under rated conditions and collective pitch above rated conditions), you can follow the steps 3 and 4 of the Create a custom rated power turbine document.

If you want to create a controller with some specific features (such as a Shut down procedure, or pitch fault for example), you can use the Ashes Python controller found in the Python examples file. This Python script gives you the possibility to control
  • the generator torque
  • the demanded pitch angle
  • the yawing torque
  • the pitching torque

Note that this controller has been designed to match the NREL controller for the demanded pitch and the generator torque. The yawing and pitching torques are controlled via PIDs, and fine tuning of the gains might be necessary to improve the response time of both controllers

In order to run this controller, select the Python controller option for the relevant part (GeneratorDemanded pitchYaw actuator or Pitch actuators) and run the file . The Python controller will automatically return the values requested by Ashes for the relevant part.

1 Example: pitch to feather after 60 seconds

In this section we show how to modify the provided Python controller so that the blade pitch goes from 0 to 90 degrees after 60 seconds at maximum pitch rate (i.e. 8 deg/s). The controllers used by this script are defined in the  file.

The figure below shows a screen shot of the  script. The line highlighted in the figure calls for the PID controller to update the value of the pitch.

In order to have the pitch going from 0 to 90 degrees, we can modify the code as follows:

The figure below illustrates the modifications brought to this controller, for the default onshore template and a turbulent wind of 7 m/s. At 60 seconds, the pitch starts increasing and reaches 90 degress at 71.25 seconds (i.e. 90/8=11.25 seconds after pitching has started). As expected, the rotor also stops rotating as a consequence of pitching the blades to feather.

Note: with the current modification, the pitch angle would always go to 0 at 60 seconds (even if the wind was above rated conditions and the blades were pitched before the pitching procedure is started). To account for non-zero pitch angles, a parameter storing the previous pitch value should be added (in a similar was as Previous_torque works for the VariableSpeedGeneratorController class).