Beginner to Simulink and FAST V7

This forum if for discussing controls. Questions about how to implement controls in FAST are more appropriate to the CAE Tools forum.

Moderator: Bonnie.Jonkman

Yanhua.Liu
Posts: 34
Joined: Mon Feb 29, 2016 5:22 am
Organization: University of Hull
Location: HULL,UK

Beginner to Simulink and FAST V7

Postby Yanhua.Liu » Mon Feb 29, 2016 11:41 am

Hi all,

I am a beginner for FAST. Now I want to use FAST V7 on Simulink. I do the procedures just as follows:
1) Download the NREL 5MW model from http://wind.nrel.gov/public/jjonkman/NR ... Bsline5MW/, Download NRELOffshrBsline5MW_Onshore.zip.

2) Unzip NRELOffshrBsline5MW_Onshore.zip and move everything into the FAST folder\Simulink. After that, in folder \Simulink\Samples, move those two Simulink example files to \Simulink.

3) Create a folder under \Simulink called WindData. Subsequently, Go to the FAST location\\CertTest\Wind\UAE_VI, copy the wind file, Shr11_30.wnd, to the WindData folder that I created. After that, under \Simulink, open NRELOffshrBsline5MW_AeroDyn.ipt, change line 10 to "WindData\Shr11_30.wnd".

4) In folder \Simulink, NRELOffshrBsline5MW_Onshore.fst, I change (i) ADAMSPrep to 1, (ii) PCMode to 2, (iii) VSContrl to 3 and (iv) GenModel to 1.

5) Finally, Run Simsetup.m under \Simulink, then type "NRELOffshrBsline5MW_Onshore.fst".Now, open "OpenLoop.mdl" and run.

Because my windows and Matlab are 64-bits. So I downloaded FAST_SFunc.mexw64 from the link http://wind.nrel.gov/public/jjonkman/FA ... 2.00d-bjj/ and put it to the file \Simulink where FAST_SFunc.mexw32 was. And I put FAST_SFunc.mexw32 to other place. I also set the Matlab path to the file \Simulink.

When I run the 5th step above, I still have the problem below. It said that "Error while obtaining sizes from MEX S-function 'FAST_SFunc' in 'OpenLoop/FAST Nonlinear Wind Turbine/S-Function'." Then closing the program. Who can help me to fix this problem? Is FAST_SFunc.mexw64 above okay for the matlab of 64-bits? Thank you so much!
Attachments
Untitled.jpg
Untitled.jpg (25.85 KiB) Viewed 7989 times

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

Re: Beginner to Simulink and FAST V7

Postby Bonnie.Jonkman » Mon Feb 29, 2016 3:01 pm

Hi, Yanhua.

Is there any message in the Matlab Command Window? Simulink will put some generic messages in the pop-up window that appears when there is an error, but usually the most helpful information comes from the Matlab Command Window. FAST may be unable to read an input file or it may be trying to read a file that is in the wrong format.

P.S. In FAST v7.02, you shouldn't have to be moving files all around. If you set relative path names inside your FAST input files and Matlab script, set your Matlab path so it can find the *.mex* (DLL) file and model files, and you should be good to go.
Bonnie Jonkman

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

Yanhua.Liu
Posts: 34
Joined: Mon Feb 29, 2016 5:22 am
Organization: University of Hull
Location: HULL,UK

Re: Beginner to Simulink and FAST V7

Postby Yanhua.Liu » Tue Mar 22, 2016 11:32 am

Dear Bonnie,

Sorry for answering you late. I fixed the above problem by using a 32-bit Matlab in my 64-bit windows system. When I do simulations with this FAST model, I have a confusion just as follows. When I change the wind input from 3m/s to 15m/s gradually, the OutData of GenPwr and GenTq (electrical generator power and torque respectively) should keep changing. However, the output always keeps 1, which I think is wrong. I can't figure out what the possible problems are. Can you help me? Thank you so much!

All the best.

Yanhua
Attachments
fig 3.jpg
The output
fig 3.jpg (47.98 KiB) Viewed 7741 times
fig 2.jpg
The model
fig 2.jpg (61.66 KiB) Viewed 7741 times
fig 1.jpg
The wind input
fig 1.jpg (95.99 KiB) Viewed 7741 times

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

Re: Beginner to Simulink and FAST V7

Postby Jason.Jonkman » Tue Mar 22, 2016 9:12 pm

Dear Yanhua,

It looks like you are simply running the OpenLoop.mdl without active control of the generator and power. The "Torque Controller" block that is included in OpenLoop.mdl is just an example that supplies a constant torque of 1000 Nm and a constant power of 1000 W (as you are seeing in your output). If you wish to run FAST with control commands coming from Simulink, you must implement your own control logic within Simulink.

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

Yanhua.Liu
Posts: 34
Joined: Mon Feb 29, 2016 5:22 am
Organization: University of Hull
Location: HULL,UK

Re: Beginner to Simulink and FAST V7

Postby Yanhua.Liu » Thu Apr 07, 2016 8:56 am

Dear Bonnie,

I am trying to design simple generator torque controller and pitch controller now. I encountered some confusions which need your help. I am using NRELOffshrBsline5MW_Onshore.fst, which I think is the NREL 5-MW baseline wind turbine. Am I right about this? Firstly, could you tell me the relationship between rotor speed and low-speed shaft speed for this type wind turbine? Does low-speed shaft speed multiplied by GBRatio (Gearbox ratio) equal to the high-speed shaft speed?

Secondly, what is the value of GBRatio of this type wind turbine? The definition of this value in Simsetup.m is 22.5 while the value of GBRatio in NRELOffshrBsline5MW_Onshore.fst is 97. Which one is correct? I see the description in " http://www.nrel.gov/docs/fy09osti/38060.pdf" is like this "We specified the NREL 5-MW baseline wind turbine to have the same rated rotor speed (12.1 rpm), rated generator speed (1173.7 rpm), and gearbox ratio (97:1) as the REpower 5M machine. The gearbox was assumed be a typical multiple-stage gearbox but with no frictional losses—a requirement of the preprocessor functionality in FAST for creating ADAMS models [11]." Therefore I think the value of GBRatio is 22.5. Thus why is the value in Simsetup.m 22.5 ? Is it wrong? It confuses a lot. I hope you can help me. Thank you so so much.

All the best.

Yanhua
Attachments
Simsetup.jpg
Simsetup.jpg (184.86 KiB) Viewed 7505 times

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

Re: Beginner to Simulink and FAST V7

Postby Jason.Jonkman » Thu Apr 07, 2016 1:27 pm

Dear Yanhua,

For the NREL 5-MW turbine, the gearbox ratio (GBRatio, i.e. the ratio between the high- and low-speed shaft speeds) is 97, whereas for the AWT-27CR2 turbine GBRatio is 22.5.

Test01_SIG.mdl is a test of the Simulink interface that mimics the simple induction generator (SIG) model built into FAST for test #1 in the FAST certification suite, which is a model of the AWT-27CR2 turbine. The SimSetup.m file of FAST7 sets the parameters needed for Test01_SIG.mdl to function properly, and so, the parameters are specific to the AWT-27CR2 turbine. These are provided only as an example.

I hope that helps.

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

Yanhua.Liu
Posts: 34
Joined: Mon Feb 29, 2016 5:22 am
Organization: University of Hull
Location: HULL,UK

Re: Beginner to Simulink and FAST V7

Postby Yanhua.Liu » Tue Apr 12, 2016 4:36 am

Dear Jason,

Thanks for your help.I am using NRELOffshrBsline5MW_Onshore.fst, which I think is the NREL 5-MW baseline wind turbine. I am trying to design the generator torque controller for this wind turbine as P31 of the document http://www.nrel.gov/docs/fy09osti/38060.pdf .I encountered some problem as follows:

(1) It said the rated generator speed is 1173.7 rpm which I found that the generator speed could be 4503 rpm when the wind speed is 18 m/s. And the rated rotor speed is 12.1 rpm and the low-speed shaft speed (which I saw it same with the rotor speed) could be 46 rpm when the wind speed is 18 m/s. It conflicts. What's the problem?

(2) I can't figure out the calculation equation of the generator torque when it's in region 1 1/2 and region 2 1/2. Can you help me with this?

Thank you so much. It puzzles me a lot.

All the best.

Yanhua
Attachments
generator toque controller.jpg
generator toque controller.jpg (135.81 KiB) Viewed 7486 times

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

Re: Beginner to Simulink and FAST V7

Postby Jason.Jonkman » Tue Apr 12, 2016 6:38 am

Dear Yanhua,

I'm sorry, but I don't understand your first question.

Regarding your second question, the torque-speed curve is linear in regions 1.5 and 2.5. The exact equations used to form the complete torque-speed curve are given in the source code for the DLL controller, as available in Annex C of the report you reference: http://www.nrel.gov/docs/fy09osti/38060.pdf.

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

Yanhua.Liu
Posts: 34
Joined: Mon Feb 29, 2016 5:22 am
Organization: University of Hull
Location: HULL,UK

Re: Beginner to Simulink and FAST V7

Postby Yanhua.Liu » Tue Apr 12, 2016 1:38 pm

Dear Jason,

Thanks for your help. Sorry for not explaining the first problem so clearly. I mean when I am doing the simulation on the Matlab with NREL 5MW Baseline Wind turbine model, I encountered the problem as following:

As the document http://www.nrel.gov/docs/fy09osti/38060.pdf said, the rated wind speed of this wind turbine is 11.4 m/s. So I set the wind speed input as 18 m/s which it should be in the rated operation regime. I found that the simulated generator speed is 4503 rpm which is different from the rated generator speed (1173.7 rpm). I don't understand why it is much larger than the number given by the above document. I think the simulated generator speed output should be 1173.7 rpm regardless of the generator torque controller.

I hope you can understand it this time. Thanks so much for your patience. Thanks a lot.

All the best.

Yanhua

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

Re: Beginner to Simulink and FAST V7

Postby Jason.Jonkman » Tue Apr 12, 2016 2:01 pm

Dear Yanhua,

My guess is that you model doesn't include blade-pitch control? The generator speed is regulated by the blade-pitch controller above rated wind speed. The generator speed would get very high above rated wind speed if you model does not include blade-pitch control.

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

David.Kolodziej
Posts: 20
Joined: Thu Apr 21, 2016 7:02 am
Organization: RWTH Aachen
Location: Germany

Re: Beginner to Simulink and FAST V7

Postby David.Kolodziej » Sun Jun 05, 2016 2:29 am

Dear all,

corresponding to a recommendation of Mr.La Cava and Mr. Park I decided to use FAST-SC´s interface with Simulink for the simulation of semiactive TMD´s. Unfortunately there is a problem with the Read_Fast_Input_TMD file. I put every necessary file in the correct folder as described in the FAST-V7 manual! When I call Simsetup.m (I changed simsetup.m to Read-Fast_Input_TMD) in the MATLAB Command Window and enter the name of the Input file NRELOffshrBsline5MW_TMD_v710.fst Matlab doesnt import all the input parameters. Some of them are imported correctly but for others the software reads in a whole line (including all the text) instead of just the parameter value. I didnt change anything within the files... Have you had such a problem before? I really hope you can help me out!

Thanks in advance!

David

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

Re: Beginner to Simulink and FAST V7

Postby Bonnie.Jonkman » Mon Jun 06, 2016 10:18 am

Hi, David.

Since NREL didn't create the Read_Fast_Input_TMD file, I'm not sure any of us can help with the error you are getting. Perhaps Bill La Cava or Semyung Park can help. I'd probably take a look at Read_Fast_Input_TMD and see which line is causing it to stop reading your input file correctly.
Bonnie Jonkman

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

Audrey.Viala
Posts: 14
Joined: Mon Jun 13, 2016 7:20 am
Organization: Cranfield university
Location: France

Re: Beginner to Simulink and FAST V7

Postby Audrey.Viala » Tue Jun 28, 2016 3:02 am

Dear all,

I am an MSc student and I am a beginner to Simulink and FAST V7.
I post a reply beacause I have the same problem as the beginning of this conversation.
I have an issue when I run a simulation with FAST V7. Everything works when I use FAST v8 but since I need the linearization model from FAST v7, I changed the version.

I have windows and Matlab 64-bits so I have downloaded FAST_SFunc.mexw64 from the link http://wind.nrel.gov/public/jjonkman/FA ... 2.00d-bjj/ and put it to the file \Simulink where FAST_SFunc.mexw32 was. But for each run, Matlab is closed without any message in the Matlab Command Window.
I have tried to do like Yanhua: to use a 32-bit Matlab in my 64-bit windows system and use the FAST_SFunc.mexw32 but the problem persists.
It is an important problem for me because I cannot run any simulation or linearization calculs.
Have you an idea to solve this problem?

Thank you in advance.

Best regards,
Audrey

David.Kolodziej
Posts: 20
Joined: Thu Apr 21, 2016 7:02 am
Organization: RWTH Aachen
Location: Germany

Re: Beginner to Simulink and FAST V7

Postby David.Kolodziej » Tue Jun 28, 2016 6:30 am

Hello Bonnie,

I found the mistake in the Read_FAST_Input_TMD and now I can import all the parameters I need! Thank you very much for your help! Nevertheless the simulink model provided by Dr. Lackner still doesnt run because of an error. In the process of eliminating the errors in the model I noticed the following: In the FAST-SC Overview.pdf it is mentioned that the "NREL5MW_Baseline_06b_TMD.mdl" is based on a model, which Dr. Namik from the University of Auckland has developed earlier! I already tried to contact him, but so far he has not replied to my message! I am wondering if you maybe know how I can get access to this simulink model from Dr. Namik? It would help me a lot to understand the changes Prof. Lackner undertook developing his TMD model!

If you dont have access to Dr. Namiks model you can maybe help me with the occuring error. I think the error the error is not directly associated with the TMD module: As soon as I run the model (after reading in the parameters) I get the following status line:

Warning: Invalid arguments passed to 'dpoly' drawing command in block 'NREL5MW_Baseline_06b_TMD/speedfilter'. Polynomial arguments cannot be empty

Error evaluating 'InitFcn' callback of block_diagram 'NREL5MW_Baseline_06b_TMD'. Caused by: Undefined function or variable 'Model_Inputs'.


Unfortunately the board attachment quota has been reached, so that I cannot upload any screenshots! But if you have a look into the modell you`ll see that it tries to extract the HSS speed from the green wind turbine block with "u(strmatch('GenSpeed',OutList))" - I added "GenSpeed" to the Outlist before running the model. Next in line is a transfer fcn with numerator w_cut, denominator [1 w_cut] and initial conditions 1173.7*1/w_cut. At the location of this transfer fcn I get the question marks and thats where the warning message points to! Do you have an idea what I may need to change in the primary Input file?

Thanks a lot,

David

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

Re: Beginner to Simulink and FAST V7

Postby Bonnie.Jonkman » Tue Jun 28, 2016 9:41 am

Hi, Audrey.

Depending on the version of Matlab you are using, you may need to recompile the FAST_SFunc mex function. I think the mex file was created with Matlab R2012a so it may not be compatible with your version of Matlab.
Bonnie Jonkman

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


Return to “Controls”

Who is online

Users browsing this forum: No registered users and 1 guest