Exawind / openturbine

A flexible multibody structural dynamics code for wind turbines
https://exawind.github.io/openturbine/
MIT License
15 stars 5 forks source link

Define turbine controller interface #155

Open deslaughter opened 2 months ago

deslaughter commented 2 months ago

The next milestone for OpenTurbine requires that blade pitch be set by a turbine controller. The controller will implement the standard Bladed interface which is also used by OpenFAST. Using this interface will allow existing controllers, such as ROSCO to be used with OpenTurbine.

The interface implemented by OpenFAST is defined at https://openfast.readthedocs.io/en/dev/source/user/servodyn/ExtendedBladedInterface.html

deslaughter commented 2 months ago

Here's a version of the NREL-5MW controller that I had converted from Fortran to C last year. It's compiled as a shared library which is loaded at runtime and the function DISCON is called at each time step to get the blade pitch and yaw commands. It's rudimentary, from a controls perspective, but it defines the minimal interface that we'll need to implement.

DISCON_C.zip

michaelasprague commented 1 month ago

PR 167 waiting for review; built unit tests based on OpenFAST for how we use the DISCON controller.

May need support in cmake here.

@ddement -- suggests bringing it to C++; modern well designed C++ vs having second language.

@deslaughter -- it does make sense to have one language in the code base; the interface will still be a shared interface; this is entirely for regression tests.

If someone wants to knock this out and bring over to C++, great, but not critical at this time.

michaelasprague commented 1 month ago

@faisal-bhuiyan is working on this -- need to compile controller as a shared library.

faisal-bhuiyan commented 3 weeks ago

Controller was added as a shared library by using the library dylib -- we can use this to call functions at runtime from a shared library. Not much left to do here.

michaelasprague commented 2 weeks ago

Converted C controller to C++; everything is there. Need final approval from @deslaughter