Beginner to Simulink and FAST V7

Hi Bonnie!

Thank you so much for your help! I have succeded in compiling FAST_SFun mex file.
Now, I will try to use it in simulation to see if the problem with Matlab persists.

Best regards.
Audrey

Hi Bonnie,

I have looked further the simulation with Simulink and FAST v7 and I have a small question.
Why the parameter “initialized” decrease from 1 to 0 after a simulation?

I have realized that after setting this parameter to 1 and run again a simulation, there is no problem whereas if I let this parameter with the 0 value Matlab is closed.
In the file "Read_FAST_Input.m we can read:

Initialized = 1;                                    % Tells S-function if this script ran prior to simulation.  0 = no.

Is it the FAST_SFun which changes this parameter? And why? It seems causing some problems to run a second simulation without setting to 1 after the first one.

I don’t know if I am very clear but I think it can be the origin of my issue with FAST v7 and Simulink simulation.

Regards,
Audrey

The FAST v7 S-Function does change the initialized variable to 0 after initialization. It also checks that it is 1 before it will run. The idea is to make sure you have called Read_FAST_Input.m in Matlab each time you start a model, which makes sure the variables in the Matlab workspace are consistent with the internal variables of the S-Function. If you are running the same model again (using the same, unchanged, FAST input file), it should be okay to reset the initialized variable to 1 without running Read_FAST_Input. The way it was developed, though, it assumes you use Simsetup.m each time you start a model.

Hi Bonnie,

Thank you for your explanation.
With all your instructions I have compiled FAST_SFunc for both 32 and 64 bits.
However, when I try to use them, MATLAB is crashed.

I am trying to run a simulation with the NRELOffshrBsline5MW_OC3Hywind but it does not worked. I don’t really understand what you said in another post: "FAST v7 as distributed does not run the 5MW models. The primary reason is that the Bladed-style DLL controller requires a separate compilation. If you want to run the 5MW model in Simulink, you’ll have to recompile FAST_SFunc using the appropriate source files for the Bladed Interface. " from AeroDyn Feedback

  1. How can I use the appropriate DLL file during the compilation?

I have tried to use the one available in the OC3 file: FAST_v7.02.00d-bjj_AeroDyn_v13.00.02a-bjj_BladedDLLInterface_OC3Hywind by remplacing the FAST bladed DLL but the FAST_SFUNC mex after compilation is the same.
2) How can I use the three following files included in the OC3 folder?

  • FAST_v7.02.00d-bjj_AeroDyn_v13.00.02a-bjj_BladedDLLInterface_OC3Hywind
    -DISCON.dll
  • DISCON.f90

I feel desperate because I am not able to run a linearization of the OC3 model…
Thank you very much for your help.
Audrey

Dear Bonnie,

I have encountered the same problem as Audrey. I am using Matlab 2016b 64 bits. I have read the FAST v8 Interface to Simulink from README_FAST8 pdf and did as follows:

  • created the FAST_SFunc.mexw64 using create_FAST_SFunc.m
  • add %FAST_v8\bin to MATLAB path

then I tried running the two samples from %Simulink\Samples.

In both cases matlab crashes (with system error). The OpenLoop file gives the following error message:

Error using Run_OpenLoop (line 30)
Error while obtaining sizes from MEX S-function ‘FAST_SFunc’ in ‘OpenLoop/FAST Nonlinear Wind Turbine/S-Function’.
Caused by:
Error using Run_OpenLoop (line 30)
FatalException

Hello Everyone,

I am posting on this thread because I have a similar query and I am a beginner with Fast v7.
I am following a documentation from NREL “Simulation for Wind Turbines Generator - With Fast and Matlab-Simulink Module”
[url]http://www.nrel.gov/docs/fy14osti/59195.pdf[/url]

During the time I was following the above documentation in the section 4.1.2 I took all the steps necessary to do interface the induction generator in to the Test01_Sig model, and also make the constant as it is in the documentation.

But when I am trying to run my simulation I get these errors. I don`t know what mistake I am doing.
Below is the error when I am trying to run the simulation

Below is the Simulink file related to it and also the m file


Regards,
Sami



Dear Sami,

Your error is regarding a Tmech, which is part of the induction generator model, not provided by NREL. I suggest that you contact the source of this induction generator model for help.

Best regards,

Dear Jason,

thanks for your quick reply the problem is solved. By completely deleting the tmech and put a constant of 0 instead of it.

Thanks anyways

Dear All,

I am an MSc student and I am trying to simulate the NREL 5.0 MW Baseline Wind Turbine, including torque and pitch control using Simulink. I have troubles in this procedure, since it is not so clear to me. As I understand, all the information about the controllers is in the DISCON.dll file that is also included in the .zip file found in [url]National Wind Technology Center's Information Portal | Wind Research | NREL. Please correct me if I am wrong.

In order to use these controllers I run Simsetup.m and then OpenLoop.mdl. I added in the same folder the files: FAST_SFunc.mexw64, FAST_Library_x64.dll and MAP_x64.dll from FAST v8. I initially used FAST_SFunc.mexw64 from v7.02, but OpenLoop.mdl gave me errors. Finally, after running OpenLoop.mdl, I derive the following error:


My questions are the following:

  1. How can I solve this error?
  2. Is any other way to use the information of the DISCON.dll apart from using Simulink?
  3. Is it correct to use the files I mentioned before from FAST v8?
  4. Since I am simply running the OpenLoop.mdl, should I change anything in it?

Thank you very much for your time!

Best regards,

Georgios

Dear Georgios,

You shouldn’t need to change anything to run the OpenLoop.mdl. Are you running the OpenLoop.mdl distributed with FAST v8 or FAST v7? When you open the FAST_SFunc block in Simulink, do you see three S-Function parameters (FAST_InputFileName, TMax, 0), as shown in Figure 9 of the FAST v8 ReadMe file: wind.nrel.gov/nwtc/docs/README_FAST8.pdf (it should look just like Figure 9 if you are using the OpenLoop.mdl provided with FAST v8)?

Regardless, you don’t need to use the Simulink interface at all if you want to use a controller implemented as a DISCON.dll. The Simulink interface is meant to be used for implementing the controller within Simulink. If you want to use a controller implemented as a DISCON.dll, I would suggest running the FAST executable instead.

Best regards,

Dear Jason,

My apologies for my late response. Thank you very much for your help. I downloaded and used the already compiled executable file “FAST_v7.02.00d-bjj_AeroDyn_v13.00.02a-bjj_BladedDLLInterface.exe” from the directory [url]National Wind Technology Center's Information Portal | Wind Research | NREL. I also included the “DFORRT.DLL” file in the working directory. It seems that the controller works.

Thank you very much again!

Best regards

Georgios