Skip to content

Commit

Permalink
Add floating proportional control
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Dec 4, 2019
1 parent ca63d61 commit cc1c38f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
6 changes: 5 additions & 1 deletion parameter_files/NREL5MW/DISCON.IN
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
2 ! WE_Mode - Wind speed estimator mode {0: One-second low pass filtered hub height wind speed, 1: Immersion and Invariance Estimator, 2: Extended Kalman Filter}
0 ! PS_Mode - Peak shaving mode {0: no peak shaving, 1: implement peak shaving}
0 ! SD_Mode - Shutdown mode {0: no shutdown procedure, 1: pitch to max pitch at shutdown}
1 ! FL_Mode - Floating specific feedback mode {0: no nacelle velocity feedback, 1: nacelle velocity feedback}

!------- FILTERS ----------------------------------------------------------
1.57 ! F_LPFCornerFreq - Corner frequency (-3dB point) in the low-pass filters, [rad/s]
Expand Down Expand Up @@ -106,4 +107,7 @@

!------- SHUTDOWN -------------------------------------------
0.261800000000 ! SD_MaxPit - Maximum blade pitch angle to initiate shutdown, [rad]
0.418880000000 ! SD_CornerFreq - Cutoff Frequency for first order low-pass filter for blade pitch angle, [rad/s]
0.418880000000 ! SD_CornerFreq - Cutoff Frequency for first order low-pass filter for blade pitch angle, [rad/s]

!------- FLOATING --------------------------------------------
-0.2 ! FL_Kp - Nacelle velocity proportional feedback gain [s]
1 change: 0 additions & 1 deletion src/ControllerBlocks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,4 @@ REAL FUNCTION Shutdown(LocalVar, CntrPar, objInst)

END FUNCTION Shutdown
!-------------------------------------------------------------------------------------------------------------------------------

END MODULE ControllerBlocks
23 changes: 23 additions & 0 deletions src/Controllers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ SUBROUTINE PitchControl(avrSWAP, CntrPar, LocalVar, objInst)
LocalVar%PC_PitComT = Shutdown(LocalVar, CntrPar, objInst)
ENDIF

! FloatingFeedback
IF (CntrPar%Fl_Mode == 1) THEN
CALL FloatingFeedback(LocalVar, CntrPar, objInst)
ENDIF

! Combine and saturate all pitch commands:
DO K = 1,LocalVar%NumBl ! Loop through all blades, add IPC contribution and limit pitch rate
LocalVar%PitCom(K) = saturate(LocalVar%PC_PitComT, LocalVar%PC_MinPit, CntrPar%PC_MaxPit) ! Saturate the overall command using the pitch angle limits
Expand Down Expand Up @@ -333,4 +338,22 @@ SUBROUTINE ForeAftDamping(CntrPar, LocalVar, objInst)
END DO

END SUBROUTINE ForeAftDamping
!-------------------------------------------------------------------------------------------------------------------------------
SUBROUTINE FloatingFeedback(LocalVar, CntrPar, objInst)
! FloatingFeedback defines a minimum blade pitch angle based on a lookup table provided by DISON.IN
! FL_Mode = 0, No feedback
! FL_Mode = 1, Proportional feedback of nacelle velocity
USE ROSCO_Types, ONLY : LocalVariables, ControlParameters, ObjectInstances
IMPLICIT NONE
! Inputs
TYPE(ControlParameters), INTENT(IN) :: CntrPar
TYPE(LocalVariables), INTENT(INOUT) :: LocalVar
TYPE(ObjectInstances), INTENT(INOUT) :: objInst
! Allocate Variables
REAL(4) :: NacIMU_FA_vel ! Tower fore-aft velocity

NacIMU_FA_vel = PIController(-LocalVar%NacIMU_FA_Acc, 0.0, 1.0, -100.0 , 100.0 ,LocalVar%DT, 0.0, .FALSE., objInst%instPI)
LocalVar%PC_PitComT = LocalVar%PC_PitComT + NacIMU_FA_vel * CntrPar%FL_Kp

END SUBROUTINE FloatingFeedback
END MODULE Controllers
10 changes: 7 additions & 3 deletions src/ROSCO_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ MODULE ROSCO_Types
REAL(4) :: SD_MaxPit ! Maximum blade pitch angle to initiate shutdown, [rad]
REAL(4) :: SD_CornerFreq ! Cutoff Frequency for first order low-pass filter for blade pitch angle, [rad/s]

INTEGER(4) :: FL_Mode ! Floating specific feedback mode {0: no nacelle velocity feedback, 1: nacelle velocity feedback}
REAL(4) :: FL_Kp ! Nacelle velocity proportional feedback gain [s]

REAL(4) :: PC_RtTq99 ! 99% of the rated torque value, using for switching between pitch and torque control, [Nm].
REAL(4) :: VS_MaxOMTq ! Maximum torque at the end of the below-rated region 2, [Nm]
REAL(4) :: VS_MinOMTq ! Minimum torque at the beginning of the below-rated region 2, [Nm]
Expand All @@ -136,10 +139,11 @@ MODULE ROSCO_Types
REAL(4) :: rootMOOP(3)
REAL(4) :: BlPitch(3)
REAL(4) :: Azimuth
INTEGER(4) :: NumBl

INTEGER(4) :: NumBl
REAL(4) :: FA_Acc ! Tower fore-aft acceleration [m/s^2]
REAL(4) :: NacIMU_FA_Acc ! Tower fore-aft acceleration [m/s^2]

! ---------- -Internal controller variables ----------
REAL(4) :: FA_Acc ! Tower fore-aft acceleration [m/s^2]
REAL(4) :: FA_AccHPF ! High-pass filtered fore-aft acceleration [m/s^2]
REAL(4) :: FA_AccHPFI ! Tower velocity, high-pass filtered and integrated fore-aft acceleration [m/s]
REAL(4) :: FA_PitCom(3) ! Tower fore-aft vibration damping pitch contribution [rad]
Expand Down
7 changes: 7 additions & 0 deletions src/ReadSetParameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ SUBROUTINE ReadControlParameterFileSub(CntrPar)
READ(UnControllerParameters, *) CntrPar%WE_Mode
READ(UnControllerParameters, *) CntrPar%PS_Mode
READ(UnControllerParameters, *) CntrPar%SD_Mode
READ(UnControllerParameters, *) CntrPar%FL_Mode
READ(UnControllerParameters, *)

!----------------- FILTER CONSTANTS ---------------------
Expand Down Expand Up @@ -193,6 +194,11 @@ SUBROUTINE ReadControlParameterFileSub(CntrPar)
READ(UnControllerParameters, *)
READ(UnControllerParameters, *) CntrPar%SD_MaxPit
READ(UnControllerParameters, *) CntrPar%SD_CornerFreq
READ(UnControllerParameters, *)

!------------ FLOATING ------------
READ(UnControllerParameters, *)
READ(UnControllerParameters, *) CntrPar%Fl_Kp
! END OF INPUT FILE

!------------------- CALCULATED CONSTANTS -----------------------
Expand Down Expand Up @@ -296,6 +302,7 @@ SUBROUTINE ReadAvrSWAP(avrSWAP, LocalVar)
LocalVar%rootMOOP(2) = avrSWAP(31)
LocalVar%rootMOOP(3) = avrSWAP(32)
LocalVar%FA_Acc = avrSWAP(53)
LocalVar%NacIMU_FA_Acc = avrSWAP(83)
LocalVar%Azimuth = avrSWAP(60)
LocalVar%NumBl = NINT(avrSWAP(61))

Expand Down

0 comments on commit cc1c38f

Please sign in to comment.