Baseline NREL 5MW controller on simulink

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:

My simulink scheme for the torque controller:

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

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,

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

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

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!

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,

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:

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. :smiley:

Dear Leanardo,

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

What “blade error” are you receiving?

Best regards,

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.

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,

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:


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 :smiley:

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,

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:


The next graph shows the simulink GenSpd in blue and the discon in red:

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

To anyone interested the simulink model:



Thanks for sharing, Leonardo!

Best regards,

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! :stuck_out_tongue:

Dear,
I have implemented Torque Control in Simulink. But I have found big fluctuations in generator power when the wind changes dramatically. And I set PCMode=5 and VSContrl=4 in FAST. Could you please help me?
The meaning of legend:
Simulink: Torque control I have implemented in fast
Discon: fast control



Dear Dezheng.Zhu,

I have not used this myself, but Leonardo.Lopez uploaded his Simulink implementation of the baseline controller for the NREL 5-MW turbine in the Mar 03, 2017 post in the following forum topic: Baseline NREL 5MW controller on simulink - #12 by Leonardo.Lopez.

Best regards,