NREL / ROSCO

A Reference Open Source Controller for Wind Turbines
https://rosco.readthedocs.io/en/latest/
Apache License 2.0
105 stars 91 forks source link

Running ROSCO on Simulink #268

Open EhsanASL92 opened 10 months ago

EhsanASL92 commented 10 months ago

Hi, I am trying to run ROSCO on Simulink. First, I added the ROSCO_toolbox to set the path in Matlab. Then, I changed the directory name for the SFunction and FAST directory. fast.FAST_SFuncDir = 'D:\OpenFASTbyEhsan\openfast-3.1.0\glue-codes\simulink\src'; %%%% NEED FOR SIMULINK fast.FAST_InputFile = '5MW_Land_BD_DLL_WTurb.fst'; % FAST input file (ext=.fst) fast.FAST_directory = 'D:\OpenFASTbyEhsan\openfast-3.1.0\reg_tests\r-test\glue-codes\openfast\5MW_Land_BD_DLL_WTurb'; % Path to fst directory files I tested it with both FAST v8 and OpenFAST v3.1.0 But I see this error : Error in ReadWrite_FAST (line 14) FP = FAST2Matlab(fullfile(fast.FAST_directory,fast.FAST_InputFile),2); %FP are Fast Parameters, specify 2 lines of header (FAST 8) Can you help me with running ROSCO on Matlab/Simulink?

I run OpenFAST examples and they all run properly!

dzalkind commented 10 months ago

Hi,

We can't properly test these simulink examples, so we can't support them quite as well. Can you place a breakpoint deeper into ReadWrite_FAST to understand the issue it has?

Dan

EhsanASL92 commented 10 months ago

Thanks for your reply @dzalkind, In fact, I just tried to run the ROSCO controller. Based on what I see on the running guide, it cannot be hard to run. I just defined some directories and then tried to use runFAST.m. This is the first step for running ROSCO, but do not know why I see such an error! I have attached the required files here.

ReadWrite_FAST.zip runFAST.zip

dzalkind commented 10 months ago

Please post the error that ReadWrite_FAST has. Also, I encourage you to find a solution here because we cannot support Simulink issues at this time.

EhsanASL92 commented 10 months ago

Here is the error

**Unrecognized function or variable 'FAST2Matlab'.

Error in ReadWrite_FAST (line 14) FP = FAST2Matlab(fullfile(fast.FAST_directory,fast.FAST_InputFile),2); %FP are Fast Parameters, specify 2 lines of header (FAST 8)

Error in runFAST (line 29) [Param,Cx] = ReadWrite_FAST(fast);**

I check both github and also the NREL forum, but cannot get a good response for that yet!

dzalkind commented 10 months ago

Have you tried searching for that function and adding it to your matlab path?

dzalkind commented 10 months ago

Please see the documentation here: https://github.com/NREL/ROSCO/tree/main/Matlab_Toolbox

You need the OpenFAST matlab-toolbox.

EhsanASL92 commented 10 months ago

Yes, I have already run the OpenFAST v3.1.0 and it is running correctly. I also added all the necessary paths to my environment.

Liamkk commented 10 months ago

I have encountered the same problem as you. Make sure the Matlab-toolbox folder path is added to the Matlab path.