Baseline NREL 5MW controller on simulink

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Tue Feb 21, 2017 9:47 am

Hi all,
as a sequence to better understand FAST for control design, I'm implementing the baseline PI controller described in "Definition of a 5-MW Reference Wind Turbine for Offshore System Development".
To do that I simulated the results using the DISCON.dll with a 12m/s constant wind and saved for comparison.
With the objective of finding errors and such I kept the pitch control from the discon.dll (PCmode = 5) and made my own torque controller on simulink (VSmode = 4) following the guidelines proposed.

I've encountered 2 issues:
1) the GenPwr and GenTq have zeroed initial values when connected to simulink (I read a post saying that I couldn't really do much about it)
2) my torque controller is getting close but not the exact same values as the discon.dll and I can't figure out why

Manly I look for answers to the second question.

The comparison between the discon.dll and my torque controller results, in purple the discon.dll, in blue my torque controller, in yellow the demanded torque values:
FASTtorque.png
FASTtorque.png (53.25 KiB) Viewed 6270 times


My simulink scheme for the torque controller:
Fastsimulinktorque.png
Fastsimulinktorque.png (46.56 KiB) Viewed 6270 times


Thank you very much in advance and everyone in this forum because I learned a lot from just reading everyone's doubts and questions.

Extras:
1) the filter has a initial value for the generator speed to be the same as the on from discon.dll
2) if i had to guess i would say that the filter is somehow different but I used exactly the same from the .pdf and changed the step time to 0.0625 to be the sabe as the one used in Test18.fst matching the discon.dll file

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Tue Feb 21, 2017 5:27 pm

Dear Leonardo,

From what I can tell, the torque computed by your Simulink model matches that from the DLL when the torque versus time slope (i.e. torque rate) is small, but differs when the slope is steeper. It appears that you have not implemented in your Simulink model the torque and torque rate saturations that are included in the DISCON.dll. My guess is that including these saturations will improve the comparison.

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Wed Feb 22, 2017 11:28 am

Thanks you very much for your response Jason!
So yeah, you are right, it was missing a rate saturation on the torque, now it's closer to the values obtained from the discon.dll.
Yet there is, still, some discrepancies:

So the torque looks way closer now but around the time 12s it takes completly different approaches, in blue and yellow my torque control and in red the discon.dll torque:
FASTtorque.png
FASTtorque.png (15.81 KiB) Viewed 6260 times


To better undestand I kept track of the generator speed, it is the same until 12s and from here the two approaches diverge, in blue my torque control, in red the discon.dll one and the constant is the generator speed for region 3:
FASTspeed.png
FASTspeed.png (24.44 KiB) Viewed 6260 times


Again I must add that the initial values for GenPwr and GenTq are 0 but that doenst seem to produce any effect because less than 0.05s later the values converge to the same as discon.dll

Thank you very much!

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Wed Feb 22, 2017 12:02 pm

Dear Leanardo,

It's not immediately obvious to me where the difference may lie, but you are close enough now that it is probably not too difficult for you to debug.

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Fri Feb 24, 2017 11:37 am

Thank you Jason!

Now is near perfect match (since i'm comparing my simulink to command prompt call to FAST).
For anyone interested you really have to take into consideration the pitch for region 3 as in discon.dll:

IF ( ( GenSpeedF >= VS_RtGnSp ) .OR. ( PitCom(1) >= VS_Rgn3MP ) ) THEN ! We are in region 3 - power is constant
GenTrq = VS_RtPwr/GenSpeedF

After adding the .OR. part to the simulink it got perfect.

My new problem now lies with the Pitch control, my fast simulation returns with blade error, probably numerical.
I'll just add my simulink approach for the pitch controller for maybe someone can see why I've been unable to simulate more than 3 seconds withour error:
fastsimulinkpitch.png
fastsimulinkpitch.png (43.6 KiB) Viewed 6242 times


i'm using the same simulation parameters in Test18.fst but only changing the controls to come from simulink.

After finishing this, if it is of anyone interest, I'll be suplying my simulink for baseline controll. :D

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Fri Feb 24, 2017 12:32 pm

Dear Leanardo,

I'm glad you solved the issue with the torque controller.

What "blade error" are you receiving?

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Fri Feb 24, 2017 1:43 pm

Hi Jason,
well just to add I discovered that my torque controller matches perfectly for a wind speed of 20m/s but differs for 12m/s. So I'm accepting this difference because in steady state the values somehow converge.

With respect to the pitch error i'm getting:

FAST_Solution:FAST_AdvanceStates:AD_UpdateStates:BEMT_UpdateStates(node
5, blade 3):BEMT_UnCoupledSolve:DeterminePhiBounds:There
is no valid value of phi for these operating conditions!
Vx = 1.6695, Vy = -17.999, rlocal = 11.863, theta = 0.2338

I've read in another post a person with the same error but couldn't track a way to solve it.

Any ideas on where i can start? I tried making the same controller in discon.dll but in simulink again.

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Fri Feb 24, 2017 1:57 pm

Dear Leanardo,

Vx is small and Vy is negative in your error, which sounds unphysical for a load case simulation with pitch control. Is the model perhaps going numerically unstable for some reason before this error is triggered?

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Fri Feb 24, 2017 7:27 pm

Thanks for the reply Jason!

Yes, I'll post two graphics, in both the blue line refer to my FAST simulation that stops around 3.5s and in red the simulation from discon.dll:

numericalerror.png
numericalerror.png (18.84 KiB) Viewed 6226 times

numericalerrorrotspd.png
numericalerrorrotspd.png (34.97 KiB) Viewed 6226 times


Thank you very much for you answers, for me getting to really understand and being able to "play" with FAST is of utmost importance for my research :D

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Fri Feb 24, 2017 8:46 pm

Dear Leonardo,

It looks like your FAST model is going numerically unstable soon after the pitch controller activates. Again, I suggest that you debug by comparing the response of your Simulink implementation of the pitch controller against the DISCON implementation.

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

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Fri Mar 03, 2017 10:57 am

Thanks for you reply Jason!
To finish up, I got the pitch and torque controller to work on simulink the same way it did on the discon.dll.
The difference being the fact that GenTq initial condition on simulink is always 0 causing de difference that you can see in the next picture.

The error I got happened because I thought the pitch input to FAST was in Degree when in fact it's in Radians.

The next graph shows the simulink torque controller in yellow and the discon in red:
torquefinal.png
torquefinal.png (27.78 KiB) Viewed 6095 times

The next graph shows the simulink GenSpd in blue and the discon in red:
wgfinal zoom total.png
wgfinal zoom total.png (38.2 KiB) Viewed 6095 times

The next graph shows a zoom in to the previous one to see that in a permanent regime the simulink and discon controllers are very close alike
wgfinal zoom fim.png
wgfinal zoom fim.png (50.09 KiB) Viewed 6095 times

Leonardo.Lopez
Posts: 11
Joined: Mon Dec 19, 2016 12:33 pm
Organization: DAS/UFSC
Location: Brazil

Re: Baseline NREL 5MW controller on simulink

Postby Leonardo.Lopez » Fri Mar 03, 2017 10:59 am

To anyone interested the simulink model:
torque.png
torque.png (43.36 KiB) Viewed 6094 times

zoom alto.png
zoom alto.png (27.44 KiB) Viewed 6094 times

pitch.png
pitch.png (33.69 KiB) Viewed 6094 times

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

Re: Baseline NREL 5MW controller on simulink

Postby Jason.Jonkman » Fri Mar 03, 2017 11:17 am

Thanks for sharing, Leonardo!

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

Tassio.Borges
Posts: 1
Joined: Mon Apr 24, 2017 5:41 am
Organization: INSA Rouen
Location: France

Re: Baseline NREL 5MW controller on simulink

Postby Tassio.Borges » Fri May 05, 2017 6:50 am

Dear Leonardo Lopez,

First of all, I have to thank you, your posts really helped me, as I'm starting in the same subject as you.

I based my simulink model on yours, but I have 3 questions, that, apparently you solved:
1. How you implemented the filter? I used the same equation on the DLL for the alpha. but when I insert the value on the "Discrete State-Space" it returns me negative values.
2. Inside your pitch controller you place an "Integrator Limited" block and then an "If" block, I understand the If block is there to limit the integrator result to a MAX value, but I don't quite see where is your lower limit, as it's also a function of GK. My question is, how do you managed to add a lower limit inside the integrator block?
3. Did you run the simulation only changing the control parameters from the Test18.fst? So the Tmax used was only 60 secs? My code doesn't behave nothing like yours, I can't get any close to the ones I got using DISCON.dll.

Thanks in advance for your help.

PS: I'm glad to see another Brazilian here! :P


Return to “Controls”

Who is online

Users browsing this forum: No registered users and 1 guest