This commit is contained in:
Marius Eggert 2023-03-15 10:06:24 +01:00
parent 4fdb2de510
commit ccf1fcaa79
2 changed files with 9 additions and 7 deletions

View File

@ -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,

View File

@ -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};