Skip to content

Commit

Permalink
Sort out actuator ICs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Nov 8, 2019
1 parent 112ae00 commit 2d05649
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/ReadSetParameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,17 @@ SUBROUTINE ReadAvrSWAP(avrSWAP, LocalVar)
LocalVar%FA_Acc = avrSWAP(53)
LocalVar%Azimuth = avrSWAP(60)
LocalVar%NumBl = NINT(avrSWAP(61))
! LocalVar%BlPitch(1) = avrSWAP(4)
! LocalVar%BlPitch(2) = avrSWAP(33)
! LocalVar%BlPitch(3) = avrSWAP(34)

! --- NJA: usually feedback back the previous pitch command helps for numerical stability, sometimes it does not...
LocalVar%BlPitch(1) = LocalVar%PitCom(1)
LocalVar%BlPitch(2) = LocalVar%PitCom(2)
LocalVar%BlPitch(3) = LocalVar%PitCom(3)
IF (LocalVar%iStatus == 0) THEN
LocalVar%BlPitch(1) = avrSWAP(4)
LocalVar%BlPitch(2) = avrSWAP(33)
LocalVar%BlPitch(3) = avrSWAP(34)
ELSE
LocalVar%BlPitch(1) = LocalVar%PitCom(1)
LocalVar%BlPitch(2) = LocalVar%PitCom(2)
LocalVar%BlPitch(3) = LocalVar%PitCom(3)
ENDIF

END SUBROUTINE ReadAvrSWAP
! -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -508,8 +512,12 @@ SUBROUTINE SetParameters(avrSWAP, aviFAIL, ErrMsg, size_avcMSG, CntrPar, LocalVa
! Setpoint Smoother initialization to zero
LocalVar%SS_DelOmegaF = 0

! Generator Torque at K omega^2
LocalVar%GenTq = min(CntrPar%VS_RtTq, CntrPar%VS_Rgn2K*LocalVar%GenSpeed*LocalVar%GenSpeed)
! Generator Torque at K omega^2 or rated
IF (LocalVar%GenSpeed > 0.98 * CntrPar%PC_RefSpd) THEN
LocalVar%GenTq = CntrPar%VS_RtTq
ELSE
LocalVar%GenTq = min(CntrPar%VS_RtTq, CntrPar%VS_Rgn2K*LocalVar%GenSpeed*LocalVar%GenSpeed)
ENDIF
LocalVar%VS_LastGenTrq = LocalVar%GenTq

! Check validity of input parameters:
Expand Down

0 comments on commit 2d05649

Please sign in to comment.