Semi-active TMD control using Simulink

Dear all,

I was wondering if it was possible to define the control mode of a semi-active TMD in Simulink with FAST 8 the same way it is possible for the Pitch control for example?
For Pitch control it is possible to define the control mode as “user-defined from Simulink/Labview”. I was hoping there was an addition to the Simulink model of the 5 MW wind turbine, with which it is also possible to create a user-defined controller for the TMDs.

So far, I only saw the 5 predefined control modes for semi-active TMDs, which are implemented in ServoDyn_TMD but I’d like to define the control in the Simulink model.

I would be grateful for your help.

Best regards,
Laurin

Dear Laurin,

Unfortunately, the ability to actuate the TMD through Simulink is not yet a standard feature of FAST v8 or OpenFAST. But I’m sure this feature would be possible to add through customization of the source code.

I had a dialogue with Xing.Wei on the forum regarding this topic–see: http://forums.nrel.gov/t/question-about-running-fast-8-in-simulink/1783/1. You may want to reach out to Xing.Wei to see if he was successful and can share his updated source code.

Best regards,

Dear Jason,

thank you for your answer.

I started implementing the External Control of TMD properties using Simulink.
Eventually, I aim to control both the stifness and the damping of both the TMD in FA direction and in SS direction.

Therefore I increased the number of FixedInputs in the FAST_Library.h and in the FAST_Library.f90

I started to implement the external control as an additional control mode (TMD_CMODE) so there are four overall:
ControlMode_NONE = 0
CMODE_Semi = 1
CMODE_Active = 2
CMODE_EXTERN = 3 (new)

I also introduced some new variables to the registry files:

Accordingly to the C_Ctrl variable under the TMD_MiscVarType I added K_ctrl with the same dimension.
In the TMD_InputType I defined four variables ExtK_X, ExtC_X, ExtK_Y, ExtC_Y similar to the SrvD_InputTypes for external control.
At last I also added corresponding four variables to the FAST_Types for FAST_ExternInputType.

In the following I insert the parts of code I edited. The recompilation of the FAST_Library.vfproj in the Simulink folder has not been a problem
but when I try to validate the code I either get an error or results that differ from what I hoped to achieve:

For validation I use the CertTest #18 as I later want to work with the OnShore Wind turbine. I calculated the CertTest using a traditional passive
TMD first with the following properties:
Only a FA (X) TMD with
TMD_X_M = 36000 kg
TMD_X_C = 22366 N/(m/s)
TMD_X_K = 123301 N/m

I compare the TTDsp FA between the Calculation with the traditional implemented TMD with the TTDsp FA of my Simulink calcultion.

However when I enter the same TMD properties in my Simulink model (TMD mass is further defined in the TMD Input file),
I get the following error message:
“Error using Run_OpenLoop_edited (line 23)
Error reported by S-function ‘FAST_SFunc_edited’ in ‘OpenLoop_edited/FAST Nonlinear Wind
Turbine/S-Function’:
FAST_Solution:FAST_AdvanceStates:AD_UpdateStates:BEMT_UpdateStates(node 6, blade
1):BEMT_UnCoupledSolve:DeterminePhiBounds:There is no valid value of phi for these operating
conditions! Vx = -0.83787, Vy = 22.047, rlocal = 15.844, theta = 0.24381”

Which is a part of the Source code I didn’t change.

When I decrease the TMD mass (e.g. 10000 kg) the Simulation finishes after calculating the whole 60 s. But the results still differ from those using a traditional passive TMD with the same mass.

I hope you may see a mistake I made in my code or help me any other way on why my code doesn’t work as I intend it to.

Thank you very much.

Best regrads,
Laurin



Dear Laurin,

I’m not sure exactly what, but “something” is triggering an error regarding “no valid value of phi”. There were issues in AeroDyn v15.03 within FAST v8.16 that led to this error in some cases. However, these issues have been fixed in AeroDyn v15.04 and newer, including in the release of OpenFAST v1.0. I suggest you upgrade to OpenFAST v1.0: nwtc.nrel.gov/OpenFAST.

Best regards,

Dear Jason,
thanks for the advice, I decided to follow your suggestion and implement my code changes into OpenFAST but on Github I came across an issue regarding the link between OpenFAST and MATLAB/Simulink (github.com/OpenFAST/openfast/issues/59). Is it by now possible to build the dynamic link library for the S-Function using Visual Studio? Or is this issue only resolved when building the DLL using CMake?

Would it alternatively be possible to use the newer versions of AeroDyn in FAST v8 in order to avoid the error from before to be triggered?

Best regards,
Laurin

Dear Laurin,

As far as I know, the Simulink-OpenFAST interface issue has not been addressed yet for any operating system or compiler. This is still an open issue.

Best regards,

Dear Jason,

can you confirm, that this fix is implemented in the openfast_Win32.exe that is available here (nwtc.nrel.gov/system/files/OpenFAST_v1.0.0.zip)?

I get this error over and over again and wonder what the reason could be.

Best regards,
Simon

Dear Simon,

Correct, with the AeroDyn updated in OpenFAST v1.0.0, OpenFAST/AeroDyn will no longer abort if there is “no valid value of phi”. A warning message is displayed when this happens (although the situation should happen much less frequently), but the software is now robust enough to choose a suitable phi and continue without aborting.

Best regards,

ok thank you for clarifying.
So I get a lot of warnings but the simulation does not abort as you said.

Can you give an advice to reduce the amount of warnings related to invalid phi?

Could a simulation with a warning like this be not correct or can I ignore this warning?

Thank you and best regards,
Simon

Dear Simon,

I would not expect that you’d get a lot of these warnings if the wind turbine is operating correctly under normal operation. Are you running an OpenFAST model that NREL has provided (e.g. from the r-test) or is this a model you’ve developed yourself? Do you get the warnings when simulating normal operation or are you simulating odd gusts and direction changes? Are the rotor speeds, blade-pitch angles, and deflections reasonable for the wind conditions you are simulating?

Best regards,

Dear Jason,

the turbine model is self developed.
I´m running normal turbulent conditions (IEC ed.3 DLC 1.2). Pitch angle, Rotor speed and other operational parameters match relatively good with BLADED 4.3.
I guess, that then the blade model / airfoils is the reason for the error.
Could you give a hint for what I´m looking?

Thank you and best regards,

Simon

Dear Simon,

Is the blade aerodynamic twist distribution specified correctly? Are the airfoil lift and drag polars specified correctly? What does a typical time series of phi look like for aerodynamic analysis nodes that are triggering the error?

Best regards,