Dear @Jason.Jonkman ,
I see. I don’t know Fortran very well, so my next question might be a silly one.
As a first step towards achieving this real-time capability, I am modifying the
UserSubs.f90 routine, as follows:
SUBROUTINE PitchCntrl ( BlPitch, ElecPwr, LSS_Spd, TwrAccel, NumBl, ZTime, DT, DirRoot, BlPitchCom )
! ! This is a dummy routine for holding the place of a user-specified
! ! blade pitch control model (either independent or rotor-collective).
! ! Modify this code to create your own model.
! ! Passed variables:
INTEGER(4), INTENT(IN ) :: NumBl ! Number of blades, (-).
REAL(ReKi), INTENT(IN ) :: BlPitch (NumBl) ! Current values of the blade pitch angles, rad.
REAL(DbKi), INTENT(IN ) :: DT ! Integration time step, sec.
REAL(ReKi), INTENT(IN ) :: ElecPwr ! Electrical power, watts.
REAL(ReKi), INTENT(IN ) :: LSS_Spd ! LSS speed (rad/s)
REAL(ReKi), INTENT(OUT) :: BlPitchCom(NumBl) ! Commanded blade pitch angles (demand pitch angles), rad.
REAL(ReKi), INTENT(IN ) :: TwrAccel ! Tower Acceleration, m/s^2.
REAL(DbKi), INTENT(IN ) :: ZTime ! Current simulation time, sec.
CHARACTER(1024), INTENT(IN ) :: DirRoot ! The name of the root file including the full path to the current working directory. This may be useful if you want this routine to write a permanent record of what it does to be stored with the simulation results: the results should be stored in a file whose name (including path) is generated by appending any suitable extension to DirRoot.
BlPitchCom(1) = 1.0
BlPitchCom(2) = 2.0
BlPitchCom(3) = 3.0
END SUBROUTINE PitchCntrl
So basically I should see a constant command applied to the blades, respectively of one, two and three degrees.
As a next step, I proceed with re-compiling a new build (I am compiling in Linux/Ubuntu).
runs fine, but when I launch:
sudo make install
I get the following error:
23 | USE ServoDyn_Types
41 | INTEGER(IntKi), PARAMETER :: OutStrLenM1 = ChanLen - 1
Error: Symbol ‘outstrlenm1’ at (1) conflicts with symbol from module ‘nwtc_base’, use-associated at (2)
1377 | InputFileData%NumOuts, 'OutList', "List of user-requested output channels", ErrStat2, ErrMsg2, UnEcho )
Error: Type mismatch in argument ‘errstat’ at (1); passed CHARACTER(7) to INTEGER(4)
make: *** [modules/servodyn/CMakeFiles/servodynlib.dir/build.make:140: modules/servodyn/CMakeFiles/servodynlib.dir/src/ServoDyn_IO.f90.o] Error 1
make: *** [CMakeFiles/Makefile2:944: modules/servodyn/CMakeFiles/servodynlib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
As the “code” should not contain any errors - hopefully, since I am just assigning some values - I must doing something wrong in the procedure.
Maybe you can easily spot what is wrong?
OpenFAST/modules/servodyn/CMakeLists.txt I have commeted out
PitchCntrl.f90 as the pitch command will be provided now from the
#src/PitchCntrl_ACH.f90 commenting since we are using UserSubs.f90 (custom defined)
Many thanks for you precious help,