Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running ROSCO on Simulink #268

Closed
EhsanASL92 opened this issue Oct 17, 2023 · 10 comments
Closed

Running ROSCO on Simulink #268

EhsanASL92 opened this issue Oct 17, 2023 · 10 comments

Comments

@EhsanASL92
Copy link

EhsanASL92 commented Oct 17, 2023

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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

@dzalkind
Copy link
Collaborator

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

You need the OpenFAST matlab-toolbox.

@EhsanASL92
Copy link
Author

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
Copy link

Liamkk commented Oct 25, 2023

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

@YongxiangLei
Copy link

Hi I am also encountered the same problem, while such error given. The Matlab-Toolbox folder was added, and the fast_dir is:
fast.FAST_SFuncDir = 'D:/openfast-main/glue-codes/simulink/src'; %%%% NEED FOR SIMULINK
fast.FAST_InputFile = '5MW_Land_Simulink.fst'; % FAST input file (ext=.fst)
fast.FAST_directory = 'D:/ROSCO/Examples/Test_Cases/5MW_Land_Simulink'; % Path to fst directory files

image

@dzalkind
Copy link
Collaborator

dzalkind commented Dec 6, 2024

Re-directing this issue to #263

@dzalkind dzalkind closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants