safeCtrl using MEKF can now be disabled
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Marius Eggert 2023-04-11 11:19:04 +02:00
parent c66799b24f
commit b6ba2f291a
5 changed files with 8 additions and 3 deletions

View File

@ -173,6 +173,7 @@ void AcsController::performSafe() {
uint8_t safeCtrlStrat = safeCtrl.safeCtrlStrategy( uint8_t safeCtrlStrat = safeCtrl.safeCtrlStrategy(
mgmDataProcessed.mgmVecTot.isValid(), not mekfInvalidFlag, mgmDataProcessed.mgmVecTot.isValid(), not mekfInvalidFlag,
gyrDataProcessed.gyrVecTot.isValid(), susDataProcessed.susVecTot.isValid(), gyrDataProcessed.gyrVecTot.isValid(), susDataProcessed.susVecTot.isValid(),
acsParameters.safeModeControllerParameters.useMekf,
acsParameters.safeModeControllerParameters.dampingDuringEclipse); acsParameters.safeModeControllerParameters.dampingDuringEclipse);
switch (safeCtrlStrat) { switch (safeCtrlStrat) {
case (acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF): case (acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF):

View File

@ -354,6 +354,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(safeModeControllerParameters.angleStartSpin); parameterWrapper->set(safeModeControllerParameters.angleStartSpin);
break; break;
case 0xA: case 0xA:
parameterWrapper->set(safeModeControllerParameters.useMekf);
break;
case 0xB:
parameterWrapper->set(safeModeControllerParameters.dampingDuringEclipse); parameterWrapper->set(safeModeControllerParameters.dampingDuringEclipse);
break; break;
default: default:

View File

@ -825,6 +825,7 @@ class AcsParameters : public HasParametersIF {
float angleStartSpin = 20 * M_PI / 180; float angleStartSpin = 20 * M_PI / 180;
uint8_t useMekf = true;
uint8_t dampingDuringEclipse = true; uint8_t dampingDuringEclipse = true;
} safeModeControllerParameters; } safeModeControllerParameters;

View File

@ -11,10 +11,10 @@ SafeCtrl::~SafeCtrl() {}
uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid, uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
const bool satRotRateValid, const bool sunDirValid, const bool satRotRateValid, const bool sunDirValid,
const uint8_t dampingEnabled) { const uint8_t mekfEnabled, const uint8_t dampingEnabled) {
if (not magFieldValid) { if (not magFieldValid) {
return acs::SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL; return acs::SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
} else if (mekfValid) { } else if (mekfEnabled and mekfValid) {
return acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF; return acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF;
} else if (satRotRateValid and sunDirValid) { } else if (satRotRateValid and sunDirValid) {
return acs::SafeModeStrategy::SAFECTRL_WITHOUT_MEKF; return acs::SafeModeStrategy::SAFECTRL_WITHOUT_MEKF;

View File

@ -14,7 +14,7 @@ class SafeCtrl {
uint8_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid, uint8_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
const bool satRotRateValid, const bool sunDirValid, const bool satRotRateValid, const bool sunDirValid,
const uint8_t dampingEnabled); const uint8_t mekfEnabled, const uint8_t dampingEnabled);
void safeMekf(const double *magFieldB, const double *satRotRateB, const double *sunDirModelI, void safeMekf(const double *magFieldB, const double *satRotRateB, const double *sunDirModelI,
const double *quatBI, const double *sunDirRefB, const double satRotRateRef, const double *quatBI, const double *sunDirRefB, const double satRotRateRef,