Bladed External Controller API
Bladed provides the facility for users to create and run their own controllers for the simulated turbine. These controllers can ask for simulation and model details, and control the simulated turbine by setting various operational parameters. For example, the external controller can ask what the current angle of blade one is, and based on this value, set the demanded pitch actuator rate to try to achieve a different pitch position.
The external controller has access to Bladed through a published API
(Application Programming Interface). The Bladed API
provides a suite of functions such as GetNumberOfBlades
and
SetDemandedGeneratorTorque
so that an external routine,
such as a user-specified controller, can interact with the simulation.
Documentation is available of the complete API in the accompanying
ExternalControllerAPI.chm
.
The mechanism by which the external controllers are integrated into the simulation is by compiling them as either a Dynamic Link Library (DLL) in 32 bit for Windows Operating System (OS) or a Shared Object file (SO) in 64 bit for Linux OS platforms. These routines are compiled independently of Bladed itself, and are called by the simulation at discrete intervals to allow the controller to modify the turbine’s controls. In order to function correctly, DLLs must conform to a tight specification and be compiled correctly.
The function “CONTROLLER_INIT” is called on the first time-step at time zero, if it is found within the DLL. If “CONTROLLER_INIT” is not found, the function “CONTROLLER” is called instead, and “CONTROLLER” is called on all subsequent time-steps.
A legacy external controller that uses the Swap Array, could be re-written using the external controller API and vice-versa. It will be important to know what API functions match which elements of the swap array. The definition of the elements of the Swap Array are documented along with the equivalent API functions.
Last updated 28-08-2024