Beginner Guide for MATLAB Simulink and FAST

Hi all,
I’ve decided to write this little post just to make other life easier. :laughing: I’ve just started a week ago using FAST simulator, and I had a couple of problem that are not related to the understanding of the material. In fact I had some problems in founding the correct materials/files for a beginner in wind turbine studies, as I am. I’ll list the things that I have done:

1- Of course, download and install FAST.
2- Read the FAST User Guide, really well written. The guide explains how to interface FAST with Simulink, thing that can be done in a few minutes.

3- If you have no idea (like me) of how to control in simulink a wind turbine I suggest you the report
nrel.gov/docs/fy08osti/42437.pdf
It explains almost every single baseline controller for the wind turbine, and is really well written. The problem, in this case, is that the report refers to the CART turbine, that is a two bladed wind turbine, and it’s almost impossible to find some of the input file that are needed to run the simulation (some are reported at the end of the document, but some are not). Reading in the forums I’ve found that a standard is the “5MW NREL wind turbine”. For this turbine is possible to find every file about the structure. You can find all the needed files in:
wind.nrel.gov/public/ (ftp folder where you can find a lot of good stuff)
click on “jjonkman/”
click on "NRELOffshrBsline5MW/ "
Here there is the file “NRELOffshrBsline5MW_Onshore.zip” that contains all the file for the onshore version of the turbine.

4- After that you should read the document: nrel.gov/docs/fy09osti/38060.pdf that explains all the parameters about the 5MW NREL wind turbine, and has in the end the input file (the same of jjonkman’s folder) and the parameters for the control. For simulating you should use the *.wnd file in the pages A-5, A-6 of the report 42437.
5- Following the direction of these two report you will be able to make your first torque controller and pitch controller.

Important: one important resource for these kind of documents is the link nrelpubs.nrel.gov/Webtop/ws/nich … SearchForm where you can search all the documents that you need (just saying so because I had some problem in searching these reports).

Remark: with this post I surely don’t want to complain about anything in this site, forum or documentation. It is just a post for the students like me that for the first time are studying a wind turbine control, and can have some problem in finding the correct material and the right files.
Anyway I would like to thank all the people in this forum that have created this great community where is possible to share and understand a lot about wind turbine.

Hope that someone can save time with this post :stuck_out_tongue:
Giuseppe
MsC student in Aalborg University

Hi Giuseppe. Thanks for your thread. It has served me very helpful. I am also a beginner in FAST. I have simulated the model of the Advanced Control Design for Wind Turbines technical report, in page 26, but I don´t know what delay you have to use in Transport Delay block. I wrote a thread where I explained this problem (http://forums.nrel.gov/t/problems-with-test01-sig-model/753/1)

Regards.

Hi Moises. For the delay I’ve used the value 0.004. I’ve found it on an example file on this forum, and it worked. Unfortunately I still don’t really understand the meaning of this delay, but I think it’s just for the simulation.
I’ve attached my simulink file for basic control, and also the script for finding the parameters. Unfortunately the comments are in italian, but I hope that can be helpful to you in some way.

Regards
Giuseppe

I have some problem in uploading the attachment.

Hi Giussepe!. Thanks for your answer. I´ve already tried this delay of 0.004, but the results are not the same as using FAST in DOS. What step of simulation did you use with this delay?
The files that are uploaded to the forum must be a compressed format, like RAR.
If you want, you can send me the file to my email (p62telum@gmail.com)

Thanks.

As DT I’ve used the default value 0.0125 in the primary input file. I’ll send you an email with the rar archive because I cannot still upload it.
Anyway, I’m not comparing the results of my control in simulink with the ones used in the DOS version.

Regards!

I just want to say that seeing this dialogue makes me very happy. I’ve been very busy the last couple of months and am only just now getting caught up on the forums. When we set up this forum, one of our greatest hopes was that users would be willing to help each other, as you two have done. We at NREL just cannot always respond in a timely fashion.

Thanks, folks!

Hi,

First, thanks for the nice thread.
I’ve followed every single step in FAST USER’s Guide but I cannot run even the simulink file. I’m getting the problem that S-Function ‘FAST_SFunction’ does not exits. A snapshot of the error message is attached.

When I’m asked to “Enter the name of the FAST input file to read”, I entered C:…\NRELOffshrBsline5MW_Onshore.fst as an input file. After that data has been loaded and when I run the simulink, I got the error message.

I think the problem is in the FAST_SFunc block in Simulink that call FAST_SFunc file.

any hint?

Thanks in advance

Hi,

I am not sure about it, but it seems that you have not added the correct folder in MATLAB as written in the FAST user’s guide. Have you followed that guide (see page 35 and expecially 36 of the guide) before following my steps?

Have a nice day,
Giuseppe

There are typically two things that could cause Simulink to say it can’t find FAST_SFunc:

  • 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)

It looks like you’ve got the 32-bit version of the mex function in your current folder, so my guess is you’re running a 64-bit version of MATLAB.

The FAST v7.02.00d-bjj archive on the web contains only the 32-bit compiled version. If you need a 64-bit version of the mex function, you can find it here: wind.nrel.gov/public/jjonkman/FA … 2.00d-bjj/

Hi,

I forgot to thank you Bonnie. So sorry :frowning:

The problem was that I’m using a 64-bit version of MATLAB, and the default S-Function file was in 32-bit.

Thanks again.

Hi ,friends
I read the paper http://www.nrel.gov/docs/fy08osti/42437.pdf. And in regin 2,the generator torque control,it said that :
Simulating this control, we use step winds to excite the FAST turbine model. These step
winds cause the turbine operating point to begin in Region 2, pass through Region 2½,
and end in Region 3. In the FAST model the only DOF switched on for this simulation is
generator speed. Figure 3.5 shows the resulting generator torque versus generator speed
for this simulation. In this plot, the red curve is the FAST simulated generator torque and
the blue curve is the targeted generator torque from these equations. The results are
identical, showing that we have implemented the desired controller in FAST.
I want to ask how to simulate the step wind. And there is an example of wind input file in the appendix A.
Where can I find the wind input file in a software? Because I always simulate the wind with TurbSim. Thank you very much.

Dear Yiqing,

For simple wind time histories, such as step changs in the wind speed, AeroDyn’s simple “hub-height” format wind data file can be used in place of wind files generated by TurbSim. Please find an example of such a file attached.

Best regards,
PwrCrvJumpFastUp.wnd.txt (1.77 KB)

Hello Guys;

I have a question about MATLAB Compiling; I’m sure that it is kind of a beginner one; but I want to know!
After compiling FAST using MATLAB we have a file by the name of *.mexw32 or *.mexw64; the question is; how should we use this file inside MATLAB or Simulink?

Regards

Dear Hamid,

The “Simulink Interface” chapter of the FAST User’s Guide explains how to run FAST compiled as a mex-function for use within MATLAB/Simulink. The process explained in the “Simulink Interface” chapter applies to both the *.mexw32 and *.mexw64.

Best regards,

Hi :slight_smile:
I have a question regarding the Cart Model which is analyzed in nrel.gov/wind/pdfs/42437.pdf.

In page 29, they are indicated the parameters A, B and Bd like a constants not like a matrix which normaly comes after the linearization. Somebody knows which procedure was used to get these paremeters like constants?

Thank you for your time,

Regards

Dear Augusto,

The example on page 29 of Alan’s controls report is a simple model with 1 state (rotor speed perturbation), 1 input (collective pitch angle perturbation), and 1 disturbance (wind speed perturbation). The FAST linearization process returns 2 states for every DOF enabled, so, with the generator-azimuth DOF enabled, the result is a 2-state model (rotor azimuth angle perturbation and rotor speed perturbation). But as Alan Wright explains in the last paragraph on section 4.1.2 , Alan removes the rotor azimuth angle perturbation as a state. This effectively eliminates the 1st column from A and the first equation, leaving only a single equation with scalar values of A, B, and Bd.

Best regards,

Hello,

I am starting to work with FAST and specifically the Simulink model of Baseline Controller - I read the related manuals and instructions but still have problem with running the simulink file.
First of all, which FAST/Simulink version is now compatible with MATLAB2014 or 2013?
I mean I have the files from NREL’s website:
wind.nrel.gov/public/ (ftp folder )
“jjonkman/”
"NRELOffshrBsline5MW/ "
“NRELOffshrBsline5MW_Onshore.zip”

1- Is there specific MATLAB version that should be used to work with this files?
2- Are the current FAST 8 and FAST 7 versions that are available at NREL’s download section compatible too run the 5MW turbine model?

I already downloaded the current FAST versions and I am using FAST 7 version files as samples for baseline controller/simulink files.
I am using MATLAB2014 and MATLAB 2013 -

In FAST Manual - page 35/36 there are instructions on how to run the Simulink sample - here it says ( first transfer files Simsetup.m and Openloop.mdl from simulinkSamples folder the directory containing the primary input file of a FAST model that you want to use).

3- Does this mean that I should copy these files (Simsetup.m and Openloop.mdl) to the same folder (CertTest)?
4- Should I also put the Read_FAST_Input. and FAST_SFunc.dll in the same folder (CertTest)?? if not where should these files be?
5- should all of these files be in the same root directory (or folder) as the software FAST is?

** my windows/MATLAB is 64-bits . SO I added the 64-bit version of the FAST_SFunc but I still get the Error and my MATLAB shuts down
** I tried to put the (0,[],[],9) in S_Func block settings but still the MATLAB shuts down.

Any comments?

Dear Elham,
These are my experiences using FAST and ADAMS interfacing with Simulink,
The FAST and ADAMS versions developed files in NREL is based on 32bit system, it means that you will need 32bit windows to install the 32bit version of Matlab to use them.
I have worked with Matlab 2010b it works well.
You should copy those files(Simsetup.m and Openloop.mdl) to your current working folder.

Best regards,
Mehdi,

Elham,

FAST v8 allows you to run the 5MW model without modifying source code, however, we have not yet released the FAST v8 S-Function for Simulink. (It should be ready for release in the very near future).

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.

If you set your Matlab path variable, you should not have to move any files. See, for instance, the Simulink_CertTest.m file in the CertTest directory of FAST v7. Your Matlab path needs to know the directory location of FAST_SFunc.mexw* and the directory location of the Simulink model you are trying to run.

Please note that FAST_SFunc.dll (on Windows) is FAST_SFunc.mexw32 for 32-bit versions of Matlab and FAST_SFunc.mexw64 for 64-bit version of Matlab. There are some slightly updated instructions for the Simulink interface in the Addendum to the FAST User’s Guide.

Dear Bonnie,

Thank you very much for your comments.

However, I am now a bit more confused!
1- So, how do I work with the files for 5MW WT at (wind.nrel.gov/public/jjonkman/NR … Bsline5MW/) ? what FAST version is compatible ?
2- Should I use the current version of FAST 7 or 8?
3- should I download the FAST from (wind.nrel.gov/public/jjonkman/FAST/)?
4-how can I have access to the source files for making the S-function?

Please let me know your comments.