Skip to content

Commit

Permalink
Comment Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 20, 2019
1 parent e68a2ee commit 066b118
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Source/Controllers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,28 @@ SUBROUTINE PitchControl(avrSWAP, CntrPar, LocalVar, objInst)
LocalVar%PC_MaxPitVar = CntrPar%PC_FinePit
END IF

! Compute the gain scheduling correction factor based on the previously
! commanded pitch angle for blade 1:
LocalVar%PC_KP = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KP, LocalVar%PC_PitComT)
LocalVar%PC_KI = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KI, LocalVar%PC_PitComT)
LocalVar%PC_KD = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KD, LocalVar%PC_PitComT)
LocalVar%PC_TF = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_TF, LocalVar%PC_PitComT)
! Compute (interpolate) the gains based on previously commanded blade pitch angles and lookup table:
LocalVar%PC_KP = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KP, LocalVar%PC_PitComT) ! Proportional gain
LocalVar%PC_KI = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KI, LocalVar%PC_PitComT) ! Integral gain
LocalVar%PC_KD = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_KD, LocalVar%PC_PitComT) ! Derivative gain
LocalVar%PC_TF = interp1d(CntrPar%PC_GS_angles, CntrPar%PC_GS_TF, LocalVar%PC_PitComT) ! TF gains (derivative filter) !NJA - need to clarify

! Integrate the error signal w.r.t. time; saturate the integral term using the pitch angle limits:
! Compute the pitch commands associated with the proportional and integral
! gains:

! Compute the collective pitch command associated with the proportional and integral gains:
IF (LocalVar%iStatus == 0) THEN
LocalVar%PC_PitComT = PIController(LocalVar%PC_SpdErr, LocalVar%PC_KP, LocalVar%PC_KI, CntrPar%PC_FinePit, LocalVar%PC_MaxPitVar, LocalVar%DT, LocalVar%PitCom(1), .TRUE., objInst%instPI)
ELSE
LocalVar%PC_PitComT = PIController(LocalVar%PC_SpdErr, LocalVar%PC_KP, LocalVar%PC_KI, CntrPar%PC_FinePit, LocalVar%PC_MaxPitVar, LocalVar%DT, CntrPar%PC_FinePit, .FALSE., objInst%instPI)
END IF

! Individual pitch control
! Find individual pitch control contribution
IF ((CntrPar%IPC_ControlMode >= 1) .OR. (CntrPar%Y_ControlMode == 2)) THEN
CALL IPC(CntrPar, LocalVar, objInst)
ELSE
LocalVar%IPC_PitComF = 0.0 ! THIS IS AN ARRAY!!
END IF

! Fore-aft tower vibration damping control
! Include tower fore-aft tower vibration damping control
IF ((CntrPar%FA_KI > 0.0) .OR. (CntrPar%Y_ControlMode == 2)) THEN
CALL ForeAftDamping(CntrPar, LocalVar, objInst)
ELSE
Expand Down

0 comments on commit 066b118

Please sign in to comment.