ROSCO-MATLAB Implementation

This forum if for discussing controls. Questions about how to implement controls in FAST are more appropriate to the CAE Tools forum.

Moderator: Bonnie.Jonkman

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Sat Apr 03, 2021 4:33 pm

Dear Nikhar/Boni,
I have modelled the IEA-15MW wind turbine in MATLAB using Kane's dynamics. I need to upgrade the controller algorithm from the Legacy controller to the ROSCO in MATLAB. I have referred to the ROSCO-MATLAB toolbox (https://github.com/NREL/ROSCO_toolbox/t ... ab_Toolbox), but could not find a complete implementation of the controller logic. Is it available on some other platform? Or it needs to be developed by referring to the ROSCO source code in Fortran?

Thank you

Nikhar.Abbas
Posts: 30
Joined: Wed Apr 29, 2020 7:11 pm
Organization: National Renewable Energy Lab
Location: Boulder, CO

Re: ROSCO-MATLAB Implementation

Postby Nikhar.Abbas » Mon Apr 05, 2021 10:29 am

Hi Shubham,

Inside of the "Simulink" folder in the MATLAB toolbox that you linked, you will find a ROSCO.mdl file that has relatively complete Simulink implementation of ROSCO included in it. The MATLAB file, runFAST.m, provides an example of how to use the various utility functions to make running ROSCO in MATLAB/Simulink easier.

If you have found this already, are there any specific features that you see as missing from the Simulink model? Those can certainly be filled in by referencing the Fortran code, if there are any.

If you are interested running your turbine model without Simulink, this might be more difficult. There is not currently a MATLAB-only implementation of ROSCO. I think the path of least resistance would be to explore linking Matlab to the compiled ROSCO dynamic library in a way that is similar to the python implementation here: https://github.com/NREL/ROSCO_toolbox/b ... terface.py. I am certainly not an expert on the best way to do this, however, but maybe somebody else on the forum has some ideas.


Cheers,
Nikhar

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

Re: ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Mon Apr 05, 2021 11:45 am

Hello Nikhar,

Thanks for your prompt reply.
Firstly, I have found the Simulink implementation of ROSCO (ROSCO.mdl), and I didn't find any feature missing in this implementation. However, I want to run the turbine model without Simulink. I have referred to the python code you recommended, and I would try to replicate the same using MATLAB. I want to know which content are you referring to when you said compiled ROSCO dynamic library.
I will also look forward if somebody else on the forum comes up with other ideas.

Thanks,
Shubham

Nikhar.Abbas
Posts: 30
Joined: Wed Apr 29, 2020 7:11 pm
Organization: National Renewable Energy Lab
Location: Boulder, CO

Re: ROSCO-MATLAB Implementation

Postby Nikhar.Abbas » Mon Apr 05, 2021 1:14 pm

Hi Shubham,

When you compile ROSCO for standard use (instructions linked below), a compiled library (.dll for windows, .so for linux, .dylib for mac) is generated. This is communicated with via the wind turbine simulator (e.g. OpenFAST) to call the controller.

Example 05 in the ROSCO toolbox provides a simple working example of how this might look outside the OpenFAST framework. It sounds like you want to replicate the functions called in this example, but in MATLAB, and with your turbine model.

Here is the link to the compiling instructions for ROSCO: https://rosco-toolbox.readthedocs.io/en ... ling-rosco

Just a friendly reminder that the ROSCO tools are all open-source, so if/when you get this functionality working in MATLAB, we would love if you contributed to the git repository!

Best,
Nikhar

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

Re: ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Mon Apr 05, 2021 2:07 pm

Hello Nikhar,

Thanks for the inputs.
I will surely contribute to the repository once I get this working.

Cheers,
Shubham

KumaraRaja.Eedara
Posts: 52
Joined: Mon Sep 12, 2016 8:34 pm
Organization: IIT Bombay
Location: Mumbai

Re: ROSCO-MATLAB Implementation

Postby KumaraRaja.Eedara » Tue Apr 13, 2021 2:05 pm

Dear Nikhar,

Are there any technical papers that I can refer to understand the technical aspects of the controller design used in the ROSCO.mdl. I have gone through the Jupyter note book, but, I am looking fore more details like the "Wind speed estimation algorithm" etc.

Another general question regarding controller design:
While designing controller, how is the region of operation (2 or 3) of the turbine is determined? Is it based on the wind speed?
Also, is it mandatory to have some estimate of the wind speed for controller design? Or can the controller design be done just with the rotor speed and blade pitch angle information? Thanks.


Regards,
Kumara

Bartosz.Stachowicz
Posts: 26
Joined: Wed Jul 29, 2020 4:37 am
Organization: Politechnika Gdanska
Location: Gdansk

Re: ROSCO-MATLAB Implementation

Postby Bartosz.Stachowicz » Wed Apr 14, 2021 3:58 am

Dear OpenFAST team,

I'm working on 6MEW floating turbine model. I have generated the CP(TSR,pitch) surface for the rigid motor and I'm preparing another for the elastic configuration. Here's a view of the surface (here with changed axes but just to show you):
11ms.png
11ms.png (120.88 KiB) Viewed 441 times


Could you please comment on three things?
- Is it a correct assumption that the CP(TSR,pitch) calculated for one given wind speed will be similar for other wind speeds? I mean it seems to be the case. :P
- I have noticed that modifying the blade profiles pre-twist along the blade span allows me to move the maximum power point in the pitch direction as expected. I had generated the pre-twist distribution using the QBlade educational tool. In yellow, I marked the zero pitch line. Can I specify the slightly negative value for fine pitch, in ROSCO, or should I modify the pre-twist and calculate the Cp surface again?
- From my initial results for the Cp surface for the elastic case I can see the results are not very far off from the rigid motor case. Can I just use the results for the rigid motor as input CP data?

regards,

BS

Jason.Jonkman
Posts: 5761
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: ROSCO-MATLAB Implementation

Postby Jason.Jonkman » Wed Apr 14, 2021 6:44 am

Dear Bartosz,

I would expect the Cp surface to be independent of wind speed when the rotor is rigid. For a flexible rotor, different wind speeds can result in different Cp surfaces, depending on how flexible the blades are. If the results are not too different, then using the Cp surface for the rigid surface is fine.

In ROSCO, you can set fine pitch, i.e., the minimum pitch angle (PC_MinPit in ROSCO) to be different from zero.

Best regards,

Dear Kumara -- I'll let Nikhar answer your questions.
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Nikhar.Abbas
Posts: 30
Joined: Wed Apr 29, 2020 7:11 pm
Organization: National Renewable Energy Lab
Location: Boulder, CO

Re: ROSCO-MATLAB Implementation

Postby Nikhar.Abbas » Wed Apr 14, 2021 3:14 pm

Hi Kumara,

A more in-depth paper on the algorithms and tuning methods in the ROSCO toolchain is now available via Wind Energy Science Discussions here:
https://wes.copernicus.org/preprints/wes-2021-19/

Hope that helps,
Nikhar

KumaraRaja.Eedara
Posts: 52
Joined: Mon Sep 12, 2016 8:34 pm
Organization: IIT Bombay
Location: Mumbai

Re: ROSCO-MATLAB Implementation

Postby KumaraRaja.Eedara » Wed Apr 14, 2021 11:58 pm

Thank you, Nikhar. I will go through the referred article and revert incase of any queries.

Regards,
Kumara

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

Re: ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Mon Apr 19, 2021 7:25 am

Hello Nikhar,
Where can I find the header file (.h) for the ROSCO controller?

KumaraRaja.Eedara
Posts: 52
Joined: Mon Sep 12, 2016 8:34 pm
Organization: IIT Bombay
Location: Mumbai

Re: ROSCO-MATLAB Implementation

Postby KumaraRaja.Eedara » Mon Apr 19, 2021 8:16 am

Dear Shubham,

Check if you can find what you are looking for here: https://github.com/NREL/ROSCO/tree/cffa ... f3df92/src

Regards,
Kumara

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

Re: ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Mon Apr 19, 2021 9:28 am

Hello Kumara,
These are the source codes. I'm looking for a header file.
Thanks for your reply.

Regards,
Shubham

Nikhar.Abbas
Posts: 30
Joined: Wed Apr 29, 2020 7:11 pm
Organization: National Renewable Energy Lab
Location: Boulder, CO

Re: ROSCO-MATLAB Implementation

Postby Nikhar.Abbas » Mon Apr 19, 2021 4:51 pm

Hi Shubham,

Since ROSCO is written in Fortran, it does not have a header file in the sense that software written in C might have. DISCON.f90 is the primary file for ROSCO - the entirety of the functions and subroutines are called from the DISCON function. The variable types are allocated in ReadSetParameters.f90.

Hopefully this helps,
Nikhar

Shubham.Baisthakur
Posts: 11
Joined: Thu Jan 07, 2021 11:40 pm
Organization: Trinity College Dublin
Location: Ireland

Re: ROSCO-MATLAB Implementation

Postby Shubham.Baisthakur » Tue Apr 20, 2021 2:49 pm

Hello Nikhar,
Thanks for your reply. I will see how I can use this information to get the desired output.

Thanks,
Shubham


Return to “Controls”

Who is online

Users browsing this forum: No registered users and 1 guest