Beginner Guide for MATLAB Simulink and FAST

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Giuseppe.Abbate
Posts: 18
Joined: Thu Aug 29, 2013 9:03 am
Organization: Aalborg University
Location: Aalborg

Beginner Guide for MATLAB Simulink and FAST

Postby Giuseppe.Abbate » Mon Sep 09, 2013 1:51 am

Hi all,
I've decided to write this little post just to make other life easier. :lol: 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
http://www.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: http://www.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 http://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 :P
Giuseppe
MsC student in Aalborg University

Moises.Tellez
Posts: 5
Joined: Sun Aug 25, 2013 4:00 pm
Organization: University of Cordoba (UCO)
Location: Córdoba (Spain)

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Moises.Tellez » Mon Sep 09, 2013 3:43 pm

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 (viewtopic.php?f=4&t=898)

Regards.

Giuseppe.Abbate
Posts: 18
Joined: Thu Aug 29, 2013 9:03 am
Organization: Aalborg University
Location: Aalborg

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Giuseppe.Abbate » Thu Sep 12, 2013 6:18 am

Moises.Tellez wrote: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 (viewtopic.php?f=4&t=898)

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.

Moises.Tellez
Posts: 5
Joined: Sun Aug 25, 2013 4:00 pm
Organization: University of Cordoba (UCO)
Location: Córdoba (Spain)

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Moises.Tellez » Thu Sep 12, 2013 7:35 am

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.

Giuseppe.Abbate
Posts: 18
Joined: Thu Aug 29, 2013 9:03 am
Organization: Aalborg University
Location: Aalborg

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Giuseppe.Abbate » Thu Sep 12, 2013 7:44 am

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!

Marshall.Buhl
Posts: 437
Joined: Fri Oct 21, 2005 10:22 am
Organization: NREL/NWTC
Location: Boulder, CO
Location: Boulder, CO
Contact:

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Marshall.Buhl » Tue Nov 05, 2013 2:15 pm

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!
Mr. Marshall L. Buhl Jr.
NWTC-3811
National Renewable Energy Laboratory
Golden, CO 80401 USA
Marshall.Buhl@nrel.gov
Voice: +1 (303) 384-6914
Cell: +1 (303) 915-6623
Fax: +1 (303) 384-7079

Ismail.Alizadeh
Posts: 8
Joined: Wed Feb 05, 2014 9:28 am
Organization: Concordia University
Location: Canada

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Ismail.Alizadeh » Mon Feb 10, 2014 2:37 pm

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
Attachments
Capture.JPG
Capture.JPG (58.15 KiB) Viewed 19636 times

Giuseppe.Abbate
Posts: 18
Joined: Thu Aug 29, 2013 9:03 am
Organization: Aalborg University
Location: Aalborg

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Giuseppe.Abbate » Tue Feb 11, 2014 3:27 am

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

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Bonnie.Jonkman » Tue Feb 11, 2014 9:40 am

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: http://wind.nrel.gov/public/jjonkman/FA ... 2.00d-bjj/
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Ismail.Alizadeh
Posts: 8
Joined: Wed Feb 05, 2014 9:28 am
Organization: Concordia University
Location: Canada

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Ismail.Alizadeh » Mon Feb 24, 2014 12:34 pm

Hi,

I forgot to thank you Bonnie. So sorry :(

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.

Yiqing.Xia
Posts: 9
Joined: Mon Mar 11, 2013 9:52 pm
Organization: Shanghai Jiao Tong University
Location: China

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Yiqing.Xia » Tue Mar 04, 2014 8:32 pm

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.

Jason.Jonkman
Posts: 4613
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Jason.Jonkman » Wed Mar 05, 2014 7:19 am

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,
Attachments
PwrCrvJumpFastUp.wnd.txt
AeroDyn "hub-height" wind file featuring wind stepping from 3 to 25 m/s in steps of 1 m/s every 20 s.
(1.77 KiB) Downloaded 399 times
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Hamid.Hokmabady
Posts: 17
Joined: Wed Apr 17, 2013 2:10 am
Organization: University
Location: Iran

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Hamid.Hokmabady » Mon Jun 09, 2014 12:21 am

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
-----
Hamid Hokmabady
M.Sc Student of Civil Engineering
Tabriz University
Tabriz
Iran

Jason.Jonkman
Posts: 4613
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Jason.Jonkman » Thu Jun 12, 2014 11:20 pm

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,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Augusto.Bustamante
Posts: 1
Joined: Wed Jul 30, 2014 2:42 am
Organization: Kassel University
Location: Germany

Re: Beginner Guide for MATLAB Simulink and FAST

Postby Augusto.Bustamante » Tue Sep 02, 2014 1:35 pm

Hi :)
I have a question regarding the Cart Model which is analyzed in http://www.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


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest