Dear Jonkman,
I hope you are doing well.
I tried to test the 5MW baseline controller, but the pitch controller or torque controller is not responding. Can you please have a look and see what mistake did I make??
I guess the blocks are fine, but the values might wrong.
And these are my set up:
CornerFreq = 1.570796325;
PC_DT = 0.00125;
PC_KI = 0.008068634;
PC_KK = 0.109996;
PC_KP = 0.01882681;
PC_MaxPit = 1.570796;
PC_MinPit = 0.05;
PC_MaxRat = 0.1396263;
PC_RefSpd = 122.9096*(pi/30); %in rad
R2D = 57.295780;
RPS2RPM = 9.5492966;
VS_CtInSp = 70.16224;
VS_DT = 0.00125;
%VS_MaxRatFORHIGHWIND = 30000.0;//Tried to change but irrelevant
VS_MaxRat = 15000.0;
VS_MaxTq = 47402.91;
VS_Rgn2K = 2.332287;
VS_Rgn2Sp = 91.21091;
VS_Rgn3MP = 0.01745329;
VS_RtGnSp = 121.6805;
VS_RtPwr = 5296610.0;
VS_SlPc = 10.0;
GenEff = 94.4;
fc = 0.25;
alpha = exp(-2piDT*fc);
VS_SySp = VS_RtGnSp/( 1.0 + 0.01*VS_SlPc );
VS_Slope15 = ( VS_Rgn2KVS_Rgn2SpVS_Rgn2Sp )/( VS_Rgn2Sp - VS_CtInSp );
VS_Slope25 = ( VS_RtPwr/VS_RtGnSp )/( VS_RtGnSp - VS_SySp );
if VS_Rgn2K == 0.0
VS_TrGnSp = VS_SySp;
else
VS_TrGnSp = ( VS_Slope25 - sqrt( VS_Slope25*( VS_Slope25 - 4.0VS_Rgn2KVS_SySp ) ) )/( 2.0*VS_Rgn2K );
end
Can you please help with this issue?
Dear @Hyeon.Cha,
I haven’t reviewed the details of your Simulink model, but it looks like the OpenFAST S-Function is returning zeros for the pitch angle and generator torque commands from ServoDyn. Have you set up your ServoDyn model to receive the pitch and torque signals from Simulink (PCMode
= VSContrl
= 4, TPCOn
= 0 s, GenTiStr
= GenTiStp
= TRUE, TimeGenOn
= 0 s, TimGenOf
> TMax
)?
Best regards,
Dear Jonkman,
Thank you for your reply.
I checked the values you mentioned and it was same.
But I have solved the problem ! and would like to ask if these values for NREL 5MW OC3 spar are appropriate:
PC_KI = 0.008068634; % [1/s^2] - Integral gain for pitch controller
PC_KK = 0.109996; % [-] - Gain scheduling coefficient (used in some formulations)
PC_KP = 0.01882681; % [1/s] - Proportional gain for pitch controller
Best regards,
Hyeon
Dear @Hyeon.Cha,
I’m glad you solved your original problem.
I agree with your value of PC_KK. Your values of PC_KI and PC_KP are the values used for the land-based NREL 5-MW baseline wind turbine, but these values were lowered for the NREL 5-MW baseline wind turbine atop the OC3-Hywind spar. As documented in the OC3-Hywind specifications document (https://docs.nrel.gov/docs/fy10osti/47535.pdf), the values should be PC_KI = 0.008965149 and PC_KI = 0.006275604 s. Note that your units on PC_KI and PC_KP are not shown correctly either.
Best regards,
Dear Jonkman,
Thanks for the information. I really apperciate it and the response is much better now.
My goal is to test in extreme wind conditions ( above 25 m/s), but whenever I put 35 the simulink stops and says FAST_Solution:FAST_UpdateStates:FAST_AdvanceStates: NaN state detected.
** MD_UpdateStates: NaN state detected.**
Can you please tell me how to address this issue and test in extreme weather conditions?
Best regards,
Hyeon
Dear @Hyeon.Cha,
For this above cut-out condition, have you disabled the pitch and torque controller in ServoDyn, idled the rotor with the blades feathered in ElastoDyn, and the disabled the wake and unsteady airfoil aerodynamics in AeroDyn?
Best regards,
Dear Jonkman,
Thank you for the information.
Can I ask if the Discon_OC3Hywind.dll can do the individual pitch control?
In the Servodyn.dat file I can see the “Ptch_Cntrl - Record 28: Use individual pitch control {0: collective pitch; 1: individual pitch control} (switch) [used only with Bladed Interface]”
and I wonder if also Discon_OC3Hywind.dll provide individual pitch control.
I downloaded the precompiled version in OpenFAST Github Asset and using.
Also I would like to know if the DISCON_OC3Hywind.dll can do IPC, then can I simulate all different scenarios? as shown below?
If DISCON can control IPC, VC Mode 5, PC Mode 4 and if DISCON can only do CPC, VC Mode 5 and PC Mode 4
I’m bit confused if the system can calculate properly when the VC and PC mode are different. And looks like the PC Mode 5 and VC Mode 4 is inappropriate, since the Pitch Controller (DISCON) will not use torque from simulink and will calculate the torque by own logic.
Best regards,
Hyeon
Dear @Hyeon.Cha,
The baseline controllers provided for the NREL 5-MW baseline wind turbine (including DISCON.dll, DISCON_OC3Hywind.dll, and DISCON_ITIBarge.dll) do not include support for IPC. You’d have to modify the source code or upgrade from the baseline controllers to ROSCO (GitHub - NREL/ROSCO: A Reference Open Source Controller for Wind Turbines) if you wish to consider IPC for the NREL 5-MW baseline wind turbine models.
The baseline controllers for the NREL 5-MW baseline wind turbine, as well as ROSCO, have both pitch and torque controller supported by the same DISCON library. So, if you enable the controller through PCMode
= 5 or VSContrl
= 5, I would also enable the other to avoid issues whereby part of the control is not functional.
Best regards,
Dear Jonkman,
Thank you for your help.
I am currently working on a project where I am developing a reinforcement learning-based pitch controller (using Proximal Policy Optimization, PPO) for a floating wind turbine. For this purpose, I am using OpenFAST in combination with Simulink.
To train the PPO agent, I need to run many simulation episodes. After each episode, it is essential to reset the OpenFAST simulation so that each run starts from the initial condition (e.g., time = 0, same wind and sea states).
I understand that OpenFAST has a reset functionality, including options such as init
, trueRestart
, and restartDriverInitFAST
. I would like to confirm:
- Is there a supported or recommended way to reset OpenFAST through Simulink (e.g., via the S-Function) after each episode, such that it behaves as if the simulation started from scratch (like using
init
)?
- Or would you recommend reloading the Simulink model (e.g., using
sim()
in a MATLAB loop) to ensure OpenFAST fully restarts at each episode?
Any guidance or best practices for using OpenFAST with reinforcement learning frameworks would be greatly appreciated.
Best regards,
Hyeon
Dear @Hyeon.Cha,
I’m not familiar with the functions you mention, but in the FAST library called by the OpenFAST S-Function, there is a routine FAST_End()
in source file FAST.Library.f90, which is called by function mdlTerminate()
in source file FAST_SFunc.c that is part of the OpenFAST S-Function. As long as FAST_End()
is called and executs without error, the next simulation should start with its normal initialization.
Best regards,
Dear Jonkman,
Thank you. I found the way to restart it.
While I was analyzing the outdata, the wind speed moves so quickly and also the blade pitch.
Wind Speed Time
42.51762009 2.375
39.97005463 2.4375
38.82161331 2.5
38.90948105 2.5625
38.91971207 2.625
etc..
I have applied a Rate Limiter
block in Simulink before sending the pitch command to OpenFAST, with a limit of ±0.1396 (in rad), and the simulation timestep is 0.0625 seconds.
Given this setup, I assume that the actual pitch command change per step (as applied in OpenFAST) should not exceed:
0.1396×0.0625=0.008725 rad/step0.1396 \times 0.0625 = 0.008725 \text{ rad/step}0.1396×0.0625=0.008725 rad/step
My question is:
Does OpenFAST receive and apply the Simulink pitch input exactly as-is every time step, or is there any internal mechanism that might affect the pitch response (e.g., additional filtering, interpolation, or actuator dynamics)?
Or Should I multiply DT with Max and Min Rat?
I would like to confirm whether this per-step rate limit is strictly enforced in OpenFAST when using Simulink-based pitch control (PCMode = 4
).
And also for the wind that generated from turbsim. It changes so quickly and wonder if it is possible to change 1-3 wind/0.0625 s. Seems not realistic changes.
Best regards,
Hyeon
Dear @Hyeon.Cha,
The OpenFAST S-Function will use extrapolated values of the inputs (including blade pitch) passed from Simulink (as discussed in other forum topics e.g.: S-Function input output signal mismatch). Thus, the OpenFAST S-Function may not report exactly the same values of the blade pitch that are input from Simulink and the control signals should be smooth, without steps.
I’m not sure I understand your question about wind steps, but I’m a bit puzzled by your wind data anyway because I would not expect the rotor to be operational at such high wind speeds.
Best regards,
Dear Jonkman,
Hello,
I am developing a pitch controller for a floating offshore wind turbine that must operate under extreme weather conditions. The reference wind speed UrefU_{\text{ref}}Uref is around 36 m/s with a turbulence intensity (TI) of approximately 16%.
My primary control goal is to keep the rotor speed within 0 to 1.267 rad/s. However, during high-wind simulations, I observe that the rotor speed fluctuates rapidly, with significant angular acceleration.
I would like to ask the following:
- How exactly is
RotorSpeed
calculated in OpenFAST?
Is it derived from the azimuth angle’s time derivative, and does OpenFAST consider the rate of change (acceleration) of the rotor speed when computing RotSpeed
?
- If the rotor speed fluctuates rapidly (i.e., high
dω/dt
), does OpenFAST reflect this dynamic response accurately in its outputs?
- Is there any recommended or allowable range for the rotor acceleration (
dω/dt
) for the NREL 5MW baseline turbine or similar models?
Any documentation reference or clarification would be greatly appreciated.
Thank you!
Dear @Hyeon.Cha,
The rotor speed is calculated in ElastoDyn as the integral of the rotational acceleration. Yes, rotor speed fluctuations and their impact on structural loads should be accurately captured by OpenFAST. There are no specific rotational acceleration limits specified for the NREL 5-MW baseline wind turbine, but the higher the acceleration, the higher the structural loads would be, which would be a limiting factor.
FYI: The cut-out speed for the NREL 5-MW baseline wind turbine is 25 m/s, so, your case sounds extreme, with winds well beyond cut-out. Are you considering some soft cut-out control option?
Best regards,