Skip to content

Commit

Permalink
Region 1.5 bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Jul 22, 2020
1 parent 84b7e3b commit 532b462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/ControllerBlocks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ SUBROUTINE StateMachine(CntrPar, LocalVar)
ELSE
IF (LocalVar%GenArTq >= CntrPar%VS_MaxOMTq*1.01) THEN ! Region 2 1/2 - active PI torque control
LocalVar%VS_State = 3
ELSEIF (LocalVar%GenSpeedF < CntrPar%VS_RefSpd) THEN ! Region 2 - optimal torque is proportional to the square of the generator speed

ELSEIF ((LocalVar%GenSpeedF < CntrPar%VS_RefSpd) .AND. &
(LocalVar%GenBrTq >= CntrPar%VS_MinOMTq)) THEN ! Region 2 - optimal torque is proportional to the square of the generator speed
LocalVar%VS_State = 2
ELSEIF (LocalVar%GenBrTq <= CntrPar%VS_MinOMTq*0.99) THEN ! Region 1 1/2
ELSEIF (LocalVar%GenBrTq < CntrPar%VS_MinOMTq) THEN ! Region 1 1/2

LocalVar%VS_State = 1
ELSE ! Error state, Debug
Expand Down
7 changes: 3 additions & 4 deletions src/ReadSetParameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ SUBROUTINE ReadControlParameterFileSub(CntrPar, accINFILE, accINFILE_size)!, acc
CntrPar%PC_RtTq99 = CntrPar%VS_RtTq*0.99
CntrPar%VS_MinOMTq = CntrPar%VS_Rgn2K*CntrPar%VS_MinOMSpd**2
CntrPar%VS_MaxOMTq = CntrPar%VS_Rgn2K*CntrPar%VS_RefSpd**2

CLOSE(UnControllerParameters)

!------------------- HOUSEKEEPING -----------------------
Expand All @@ -226,7 +225,7 @@ END SUBROUTINE ReadControlParameterFileSub
! Calculate setpoints for primary control actions
SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)
USE ROSCO_Types, ONLY : ControlParameters, LocalVariables, ObjectInstances

USE Constants
! Allocate variables
TYPE(ControlParameters), INTENT(INOUT) :: CntrPar
TYPE(LocalVariables), INTENT(INOUT) :: LocalVar
Expand Down Expand Up @@ -268,7 +267,7 @@ SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)

! Force zero torque in shutdown mode
IF (LocalVar%SD) THEN
VS_RefSpd = CntrPar%VS_MinOMSpd
VS_RefSpd = CntrPar%VS_MinOMSpd * CntrPar%WE_GearboxRatio
ENDIF

! Force minimum rotor speed
Expand All @@ -281,7 +280,7 @@ SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)

! Define transition region setpoint errors
LocalVar%VS_SpdErrAr = VS_RefSpd - LocalVar%GenSpeedF ! Current speed error - Region 2.5 PI-control (Above Rated)
LocalVar%VS_SpdErrBr = CntrPar%VS_MinOMSpd - LocalVar%GenSpeedF ! Current speed error - Region 1.5 PI-control (Below Rated)
LocalVar%VS_SpdErrBr = CntrPar%VS_MinOMSpd * CntrPar%WE_GearboxRatio - LocalVar%GenSpeedF ! Current speed error - Region 1.5 PI-control (Below Rated)

! Region 3 minimum pitch angle for state machine
LocalVar%VS_Rgn3Pitch = LocalVar%PC_MinPit + CntrPar%PC_Switch
Expand Down

0 comments on commit 532b462

Please sign in to comment.