Dear @Jason.Jonkman,
Thank you very much! Based on your advice, this is what I did, based on the ROSCO controller code (for simplicity, I only focused on the Y direction):
In ROSCO_Types.f90, I added
REAL(ReKi) :: StC_Force_Y ! Structural control force in Y direction [N]
in the LocalVariables
In ReadSetParameters.f90, I added LocalVar%StC_Force_Y like this:
SUBROUTINE ReadAvrSWAP(avrSWAP, LocalVar, CntrPar, ErrVar)
USE ROSCO_Types, ONLY : LocalVariables
REAL(ReKi), INTENT(INOUT) :: avrSWAP(*) ! The swap array, used to pass data to, and receive data from, the DLL controller.
TYPE(LocalVariables), INTENT(INOUT) :: LocalVar
TYPE(ControlParameters), INTENT(IN) :: CntrPar
TYPE(ErrorVariables), INTENT(INOUT) :: ErrVar
! Allocate Variables:
INTEGER(IntKi) :: K ! Index used for looping through blades.
! Load variables from calling program (See Appendix A of Bladed User's Guide):
! <Other variables>
if (CntrPar%Ext_Interface > 0) THEN ! Use extended bladed interface
! <Other variables>
LocalVar%StC_Force_Y = avrSWAP(2817)
ENDIF
In Controllers.f90, I added this in the StructuralControl subroutine:
IF (CntrPar%StC_Mode == 1) THEN
! User defined control, step example
**LocalVar%StC_Input(1) = LocalVar%StC_Force_Y**
Now, the libdiscon.dll is created and the simulation that worked before still works fine. However, I am not sure how to test if the controller works for Dynamically-imposed data. What am I supposed to change in the OpenFAST code to feed sensor data to the simulation?
Best regards,
Tudor Istrate