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 (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
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: 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
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
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: 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
Hello Nikhar,
Thanks for the inputs.
I will surely contribute to the repository once I get this working.
Cheers,
Shubham
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
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):
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.
- 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
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.
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:
wes.copernicus.org/preprints/wes-2021-19/
Hope that helps,
Nikhar
Thank you, Nikhar. I will go through the referred article and revert incase of any queries.
Regards,
Kumara
Hello Nikhar,
Where can I find the header file (.h) for the ROSCO controller?
Dear Shubham,
Check if you can find what you are looking for here: github.com/NREL/ROSCO/tree/cffa … f3df92/src
Regards,
Kumara
Hello Kumara,
These are the source codes. I’m looking for a header file.
Thanks for your reply.
Regards,
Shubham
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
Hello Nikhar,
Thanks for your reply. I will see how I can use this information to get the desired output.
Thanks,
Shubham
Dear Nikhar Abbas,
In the paper you shared in this thread replying to KumaraRaja.Eedara you are mentioning the minimum rotor speed constraint. How is it estimated/derived for the 15MW NREL turbine?
BS
Hi Bartosz,
The minimum rotor speed is simply from the definition of the IEA 15MW wind turbine here:
nrel.gov/docs/fy20osti/75698.pdf
Nikhar
Hello Nikhar,
What is the main purpose of the DISCON.dll and DISCON.f90 file? Are these files only used to communicate with the openFAST? Also, what is the significance of the avrSWAP variable, which is repeatedly used in the ROSCO source code?
While implementing ROSCO in MATLAB, is it possible to bypass these files? Since I have an indigenously developed wind turbine model, I won’t have to interface the controller with openFAST.
Thanks,
Shubham
Hi Shubham,
DISCON.dll is the compiled binary file that OpenFAST (or any other simulator) calls to run ROSCO. DISCON.f90 is the “top-level” script in ROSCO that contains the primary DISCON routine. This routine calls all of the internal submodules, functions, etc., that make ROSCO run as it does. Finally, the avrSWAP is an array that is passed between ROSCO and the calling wind turbine simulator (e.g. OpenFAST) containing all of the controller’s inputs/outputs. The structure of the avrSWAP is “bladed-style” - meaning that each entry in the array is consistent with DNV-GL Bladed’s array structure (e.g., avrSWAP(2) contains the time variable, always).
For your purposes, I don’t think any of these are particularly necessary. You might want to to draw from the structure of DISCON.f90 to understand the order of calls that happens in ROSCO, though.
Cheers,
Nikhar
Hello Nikhar,
Thanks for the reply. Although, there’s one more issue.
A part of the ComputeVariablesSetPoint subroutine reads
! ----- Torque controller reference errors -----
! Define VS reference generator speed [rad/s]
IF ((CntrPar%VS_ControlMode == 2) .OR. (CntrPar%VS_ControlMode == 3)) THEN
VS_RefSpd = (CntrPar%VS_TSRopt * LocalVar%We_Vw_F / CntrPar%WE_BladeRadius) * CntrPar%WE_GearboxRatio
VS_RefSpd = saturate(VS_RefSpd,CntrPar%VS_MinOMSpd, CntrPar%VS_RefSpd)
ELSE
VS_RefSpd = CntrPar%VS_RefSpd
ENDIF
However, as per the DISCON.IN file, VS_ControlMode can never have a value equal to 3.
1 ! VS_ControlMode - Generator torque control mode in above rated conditions {0: constant torque, 1: constant power, 2: TSR tracking PI control}
Is this a bug or serves some other purpose?
Thanks,
Shubham