From ccf1fcaa7910126165564a1df57dd5e3fc4c811a Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 15 Mar 2023 10:06:24 +0100 Subject: [PATCH] stuff --- mission/controller/AcsController.cpp | 12 +++++++----- mission/controller/AcsController.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8e7b1b9a..220ba178 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -173,14 +173,16 @@ void AcsController::performSafe() { sunTargetDir, satRateSafe, &errAng, magMomMtq); } if (result == returnvalue::FAILED) { - if (not doomFlag) { + if (not safeCtrlFailureFlag) { triggerEvent(acs::SAFE_MODE_CONTROLLER_FAILURE); - doomFlag = true; + safeCtrlFailureFlag = true; } - doomCounter++; - if (doomCounter > 5) { - doomFlag = false; + safeCtrlFailureCounter++; + if (safeCtrlFailureCounter > 50) { + safeCtrlFailureFlag = false; } + } else { + safeCtrlFailureFlag = false; } actuatorCmd.cmdDipolMtq(magMomMtq, cmdDipolMtqs, diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 2b0cda17..3c309bd4 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -62,8 +62,8 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes uint8_t multipleRwUnavailableCounter = 0; bool mekfInvalidFlag = false; uint16_t mekfInvalidCounter = 0; - bool doomFlag = false; - uint8_t doomCounter = 0; + bool safeCtrlFailureFlag = false; + uint8_t safeCtrlFailureCounter = 0; int32_t cmdSpeedRws[4] = {0, 0, 0, 0}; int16_t cmdDipolMtqs[3] = {0, 0, 0};