From ca9f1656786eb4e4ebfbcd3870b75633a0480b3e Mon Sep 17 00:00:00 2001 From: Nikhar Abbas Date: Thu, 14 Nov 2019 17:18:32 -0700 Subject: [PATCH] Call Flap Controller --- src/Controllers.f90 | 21 +++++++++++---------- src/DISCON.F90 | 3 ++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Controllers.f90 b/src/Controllers.f90 index 80a09a3f..858a8162 100644 --- a/src/Controllers.f90 +++ b/src/Controllers.f90 @@ -349,15 +349,16 @@ SUBROUTINE FlapControl(avrSWAP, CntrPar, LocalVar, objInst) TYPE(ObjectInstances), INTENT(INOUT) :: objInst ! Flap control - - LocalVar%Flp_Angle(1) = CntrPar%Flp_Angle * D2R - LocalVar%Flp_Angle(2) = CntrPar%Flp_Angle * D2R - LocalVar%Flp_Angle(3) = CntrPar%Flp_Angle * D2R - - ! Send to AVRSwap - avrSWAP(120) = LocalVar%Flp_Angle(1) - avrSWAP(121) = LocalVar%Flp_Angle(2) - avrSWAP(122) = LocalVar%Flp_Angle(3) - + IF (CntrPar%Flp_Mode) THEN + LocalVar%Flp_Angle(1) = CntrPar%Flp_Angle * D2R + LocalVar%Flp_Angle(2) = CntrPar%Flp_Angle * D2R + LocalVar%Flp_Angle(3) = CntrPar%Flp_Angle * D2R + ! Send to AVRSwap + avrSWAP(120) = LocalVar%Flp_Angle(1) + avrSWAP(121) = LocalVar%Flp_Angle(2) + avrSWAP(122) = LocalVar%Flp_Angle(3) + ELSE + RETURN + ENDIF END SUBROUTINE FlapControl END MODULE Controllers diff --git a/src/DISCON.F90 b/src/DISCON.F90 index f74fd126..27754b86 100644 --- a/src/DISCON.F90 +++ b/src/DISCON.F90 @@ -73,7 +73,8 @@ SUBROUTINE DISCON(avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG) BIND (C, NAME CALL VariableSpeedControl(avrSWAP, CntrPar, LocalVar, objInst) CALL PitchControl(avrSWAP, CntrPar, LocalVar, objInst) CALL YawRateControl(avrSWAP, CntrPar, LocalVar, objInst) - + CALL FlapControl(avrSWAP, CntrPar, LocalVar, objInst) + CALL Debug(LocalVar, CntrPar, avrSWAP, RootName, SIZE(avcOUTNAME)) END IF