Beginner Guide for MATLAB Simulink and FAST

Dear Jonkman

Thank you for your attention. I have tried to run FAST V8, and then chose one of the tests randomly.
I think I have a problem as running FAST V8.
Of course I changed nothing over the file named CertTest/Test11.SFunc.out//
It should be mentioned that I use 32bit- MATLAB 2010; do you think the version of the MATLAB
, in turn, is a problem ??

Furthermore, I wonder I should make any changes in m-file “create_FAST_SFunc.m”.
on the other hand, I made change in Run_OpenLoop.m m-file like below:

addpath(‘C:\Users\Amirh\Desktop\FAST 2015\bin’);

CertTest_Dir = ‘C:\Users\Amirh\Desktop\FAST 2015\CertTest’;

Anyway, I couldn’t Identify what is the problem!!

Sincerely

FAST_SFunc is running, so the problem is not a 32-bit vs 64-bit one and it isn’t a Matlab version problem, either. The error message says it is trying to open a file called C:\Users\Amirh\Desktop\FAST 2015\CertTest\Test11.SFunc.out but it can’t open it for writing. This is a permission problem: Do you have permission to write in that folder (can you write other files there)? Is there already a file with that name that is open in another program? Sometimes if you’ve opened the file in Matlab, Matlab doesn’t close it properly. Running “fclose all” in a Matlab command prompt window usually fixes that problem.

Dear Dr.Jonkman

Thank you very much for your comment.

As you know in the very local folder “CertTest” there are two exe files -CertTest and Update.
Having used Update file, double clicking, all the notepad files were cleared except two input files: Test11.CRU and Test11.FST.
Now, when trying to run Simulink file, some notepad files with similar name are created that I am showing herewith:

Test11.SFunc.AD
Test11.SFunc.ED
Test11.SFunc.SUM
Test11.SFunc.OUT

and after few moment I face this error:

Unknown option specified with the generic function of S-function
‘FAST_SFunc’ in ‘OpenLoop/FAST Nonlinear Wind Turbine/S-Function’.
This may be caused by using an S-function generated in a more recent
version of Simulink than the one you are currently using.

Best Regard
FAST_er.png

It looks like you have fixed the permission problem. The S-Function we distribute with FAST v8.12 was created with MATLAB R2014b. If you are getting the error

that means you either have to recompile the S-Function with your version of MATLAB or use MATLAB 2014 (2015 may work, too). To recompile, please read the instructions for compiling FAST_SFunc in the FAST ReadMe, page 40.

Hello everybody
In the level of simulating a DFIG 5MW wind turbine in cunjunction of FAST i found dificulties in the DFIG generator parameters that can match well
If someone have the the exacte parameters excate of themodel or rather the simulink model please share it i will be very greatfull with your help

Sinceerly

Dear Jason,

As the NREL website crashed, could you send me a copy or link regarding FAST v7.02.00d-bjj compiled with the Bladed-style DLL controller? Thank you for your help.

Regards,
Jian

Dear Jian,

As I announced here: Other News, the drive.google.com/drive/folders/ … sp=sharing.

Best regards,

Dear Jason,

I feel sorry for missing your announcement. Thank you for your help.

Best regards,
Jian

Dear Jason
I want to run OpenFast with Simulink,but it has an error:
Error in S-function ‘Test01_SIG/FAST Nonlinear Wind Turbine/S-Function’: S-Function ‘FAST_SFunc’ does not exist
In v8, i know it has two reasons:Your FAST_SFunc.mexw* file is not on the MATLAB search path, or You’re running 64-bit MATLAB and using FAST_SFunc.mexw32 (or vice versa: 32-bit MATLAB with FAST_SFunc.mexw64).
But how i solve it in OpenFast?

Best Regarsd!
Rui

Dear Rui,

I would think the same issue/solution for FAST v8 applies to OpenFAST. The difference in OpenFAST is that NREL has not provided the precompiled mex function. Have you compiled the mex function yourself?

Best regards,

Dear Jason
Sorry i dont ever compile it. :neutral_face: :neutral_face: :neutral_face:
How can i do? I have copied the mex file from v8 to OpenFast, but it doesnt work. :blush: :blush: :blush:
I want to find some instructions but i cant open the link above , so what should i do to solve the problem or could you send me a precompiled mex function file(1551286186@qq.com)? Forgive my offensive behavior if it makes you uncomfortable!

Best Regards!

Rui

Dear Rui,

The mex function from FAST v8 cannot be used with OpenFAST. In OpenFAST, you must currently compile the mex function and the OpenFAST dynamic library yourself, as these have not been provided as precompiled binaries by NREL. There is documentation and quite a bit of discussion about this topic on the OpenFAST github page: github.com/OpenFAST/openfast.

Best regards,

Dear Jason
I am trying to use OpenFast with Simulink, but have the following error:
S-Function ‘FAST_SFunc’ does not exist

maybe i am missing some dll’s?

Regards,
Stephen

Dear Stephen,

The OpenFAST S-Function is not provided as a precompiled mex function on the OpenFAST github site. Did you compile the OpenFAST S-Function?

Best regards,

Hi Jason,

I am recently trying to interface FASTV8 with Simulink and have followed instruction provided in the manual. As instructed, I change the VSContrl, PCModel, YCMode and HSSBrMode to 4 in the ServoDyn module. When I run the provided “Run_OpenLoop.m” code provided in the FAST directory, the model runs without error but the results do not seem to be logical, as example the rotor speed for NREL 5MW increases to 50, which is not correct and it should oscillate around 12 rpm. Same problem with Test01 where the rotor speed increases by the time.

I tested this problem with Test01_SIG, this Simulink model worked without error and the rotor speed does not increase by the time. By comparing these two models, I thought maybe the issue is with the Torque controller. Because, Test01_SIG has a simple induction generator model, while for the OpenLoop model I am not sure how should I define the controllers in Simulink. Do you have any suggestions?

Dear Vahid,

If you set VSContrl, PCMode, YCMode, or HSSBrMode to 4 in ServoDyn, you’ll need to define the associated control logic within the Simulink model. The OpenLoop model does not have any control implemented within Simulink, so, you should not set VSContrl, PCMode, YCMode, or HSSBrMode to 4 when using this model.

Best regards,

Dear Jason,

Thank you for your response. Setting those parameters to 4 is instructed in the file available in: nrel.gov/wind/nwtc/assets/d … _FAST8.pdf

Also, if I set those values to a number except 4, the Simulink model will come up with an error of “ValidatePrimaryData:Generator torque and power are not commanded from Simulink model.

Dear Vahid,

Correct, you should set VSContrl, PCMode, YCMode, or HSSBrMode to 4 in ServoDyn if you want to use the associated control logic defined within the Simulink model. Otherwise, VSContrl, PCMode, YCMode, or HSSBrMode should not be set to 4.

Best regards,

Dear Jason,
I am using ‘create_FAST_SFunc.m’ in matlab, I find the OpenFAST-Simulink folder, but I can’t compile them to creat a DLL. what should I do, thanks in advance.

Best regards,
Liye

Dear @Liye.Zhao,

The OpenFAST S-Function for Simulink on Windows has been precompiled by NREL (available here: Releases · OpenFAST/openfast · GitHub); you should not need to recompile unless you are changing the source code.

If you need to recompile, what error are you receiving?

Best regards,