Bladed dll

Hello Forum,

I am almost a new usser of FAST codes. :blush:
I have been doing little simulations with FAST and right now I want to use a BLADED dll that I have.

I am reading the FAST documentation and I have found that FAST ignores the record 46, demanded pitch rate. My dll use this kind of actuator

what should I do in order to use my dll??

Mike

Hi Mike,

I wont tease you for being a new user of FAST. Better late than never I say! :laughing:

Without modification, the existing interface between FAST and Bladed-style DLL controllers cannot accept pitch rate demands. This is because the user-defined pitch control routines in FAST expect a pitch angle demand to be returned, not a pitch rate demand.

In order to get around this limitation, you will have to integrate the pitch rate demand to obtain the pitch angle demand. The logic for the integration could be as simple as:

PitchAngle = PitchAngle + PitchRate*( CurrentTime - LastTime )
LastTime = CurrentTime

There are two places you could perform this integration: (1) put the integration in a modified version of the DLL or (2) put the integration in a modified version of the interface between FAST and the Bladed-style DLL.

I suspect you would want to pursue option (2) because than both FAST and Bladed could use the same DLL. If you’ve read the FAST User’s Guide, you will already know that the interface between FAST and the Bladed-style DLL is contained in source file BladedDLLInterface.f90. You will have to make three changes to this source file as follows:

(2a) In MODULE BladedDLLParameters(), set PARAMETER Ptch_Cntrl to 0. This tells FAST to accept collective pitch demands from the DLL.

(2b) In SUBROUTINE BladedDLLInterface(), set avrSWAP(10) to 1.0. This tells both FAST and the DLL to accept the return value of collective pitch rate demand.

(2c) In SUBROUTINE BladedDLLInterface(), replace the line of code that says “BlPitchCom_SAVE = avrSWAP(45)”, with something like this: “BlPitchCom_SAVE = BlPitchCom_SAVE + avrSWAP(46)*( AllOuts(Time) - LastTime )”. Here, avrSWAP(46) is the collective pitch rate demand returned by the DLL and the rest of the variables in the integration are already defined in the SUBROUTINE.

Please let me know if this works.

Also, please remember when performing the integration that is often beneficial to saturate the integral term in order for to keep from exceeding the min and max pitch angles. Perhaps you have already done this in your DLL.

Best regards,

Hi Jason,

Thank you for your extensive answer.
It looks very usefull for a beginner in FAST

I will try what you explain and others during next days and I will let you know the results

Bye

Hi,

After some “vacations” of fast :unamused: , here I am again
I am having new problems.
When I try to do all the changes you told me, and I try to compile them including de BladedDLLInterface.f90 , I need to include in some way the bladed discon.dll

I am using “g95”
And the error I am suffering is
BladedDLLInterface.f90: undefined reference to `discon_’

Any idea to solve it?
:confused:

Thanks in advance

Is that a compiler error or a linker error?

Marshall

Hi Mike,

Unfortunately, I have no experience with the G95 compiler; although, after a quick browse through their website, it appears that it should support DLLs.

Which version of FAST are you using? I know before v6.01, you had to include the DISCON.lib file (the library file associated with the DLL) in the build. I fixed this in v6.01 so that the DLL is loaded at runtime using a CALL to LoadLibrary(). If you are using an earlier version, simply upgrading to v6.01 should fix your problem.

If that is not your problem, perhaps you should ask G95 support?

Please let me know what fixes the problem,

Hi,

for openFAST I changed following lines in BladedInterface.f90:

p%Ptch_Cntrl = 0 dll_data%avrSWAP(10) = 1 dll_data%BlPitchCom = dll_data%BlPitchCom+(dll_data%avrSWAP(46)*p%DLL_DT)

I try to use in the controller dll avrSWAP(46), but there is no reaction in the blade pitch angle.

Is there something missing?

Best regards
Kemal

Dear Kemal,

I’m not sure. You seem to be integrating the pitch rate command instead of using the pitch angle command, which looks fine to me. When debugging, do you see that dll_data%avrSWAP(46) and dll_data%BlPitchCom are being set correctly?

Best regards,

Thank Jason! Do you mean, I must redebug openFAST after changing BladedInterface.f90? I thought OpenFAST is reading the file. And my question before was, are my changes comform to this:

Best regards
Kemal

Dear Kemal,

Your changes appear to match my guidance, so, I’m not sure why you are not getting the response you expect. Is the DISCON controller DLL you are using setting the value of avrSWAP(46) as you expect? I would run your compiled version of FAST in debug mode to track the values of avrSWAP(46) and BlPitchCom and/or WRITE the values to the screen to debug.

Best regards,

So, now everything is fine. It is necessary to debug OpenFAST again after all the changes in the BladedInterface.f90. By the way, I want to say thanks Jason. You are always helping evryone one ofvus users.