Skip to content

Commit

Permalink
Shutdown: Add comments and minor code edit
Browse files Browse the repository at this point in the history
  • Loading branch information
abhineet-gupta committed Nov 24, 2024
1 parent b57df54 commit 96f1f54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rosco/controller/src/Controllers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,16 @@ SUBROUTINE PitchControl(avrSWAP, CntrPar, LocalVar, objInst, DebugVar, ErrVar)
! Shutdown
IF (LocalVar%SD_Trigger == 0) THEN
LocalVar%PitCom_SD = LocalVar%PitCom
! If shutdown is not triggered, PitCom_SD tracks PitCom.
ELSE
IF (CntrPar%SD_Method == 1) THEN !Only SD_Method==1 supported for now
DO K = 1,LocalVar%NumBl
LocalVar%PitCom_SD(K) = LocalVar%PitCom_SD(K) + CntrPar%SD_MaxPitchRate*LocalVar%DT
END DO
ENDIF
LocalVar%PitCom = LocalVar%PitCom_SD
! When shutdown is triggered (SD_Trigger \=0), pitch to feather.
! Note that in some instances (like a downwind rotor), we may want to pitch to a stall angle.
ENDIF


Expand Down
4 changes: 3 additions & 1 deletion rosco/controller/src/DISCON.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ SUBROUTINE DISCON(avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG) BIND (C, NAME
CALL UpdateZeroMQ(LocalVar, CntrPar, ErrVar)
ENDIF

CALL Shutdown(LocalVar, CntrPar, objInst,ErrVar)
IF (CntrPar%SD_Mode \= 0) THEN
CALL Shutdown(LocalVar, CntrPar, objInst,ErrVar)
ENDIF
CALL WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, ErrVar)
CALL ComputeVariablesSetpoints(CntrPar, LocalVar, objInst, DebugVar, ErrVar)
CALL StateMachine(CntrPar, LocalVar)
Expand Down

0 comments on commit 96f1f54

Please sign in to comment.