From 9c735e36b8c3ccc2018c5785a2d4a1a541224004 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 23 Mar 2023 10:27:32 +0100 Subject: [PATCH 1/4] reset mekfInvalidCounter after STR FDIR event and also trigger event in case mekf has recovered --- mission/acsDefs.h | 6 ++++-- mission/controller/AcsController.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 7ba8dc13..dcfc17b0 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -30,10 +30,12 @@ static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); static constexpr Event MULTIPLE_RW_INVALID = MAKE_EVENT(2, severity::HIGH); //!< MEKF was not able to compute a solution. static constexpr Event MEKF_INVALID_INFO = MAKE_EVENT(3, severity::INFO); +//!< MEKF is able to compute a solution again. +static constexpr Event MEKF_RECOVERY = MAKE_EVENT(4, severity::INFO); //!< MEKF was not able to compute a solution during any pointing ACS mode for a prolonged time. -static constexpr Event MEKF_INVALID_MODE_VIOLATION = MAKE_EVENT(4, severity::HIGH); +static constexpr Event MEKF_INVALID_MODE_VIOLATION = MAKE_EVENT(5, severity::HIGH); //!< The ACS safe mode controller was not able to compute a solution and has failed. -static constexpr Event SAFE_MODE_CONTROLLER_FAILURE = MAKE_EVENT(5, severity::HIGH); +static constexpr Event SAFE_MODE_CONTROLLER_FAILURE = MAKE_EVENT(6, severity::HIGH); extern const char* getModeStr(AcsMode mode); diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index b275960b..4b865ee3 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -289,6 +289,7 @@ void AcsController::performPointingCtrl() { &susDataProcessed, &mekfData, &acsParameters); if (result != MultiplicativeKalmanFilter::MEKF_RUNNING && result != MultiplicativeKalmanFilter::MEKF_INITIALIZED) { + mekfInvalidCounter++; if (not mekfInvalidFlag) { triggerEvent(acs::MEKF_INVALID_INFO); mekfInvalidFlag = true; @@ -299,15 +300,18 @@ void AcsController::performPointingCtrl() { if (mekfInvalidCounter > acsParameters.onBoardParams.mekfViolationTimer) { // Trigger this so STR FDIR can set the device faulty. EventManagerIF::triggerEvent(objects::STAR_TRACKER, acs::MEKF_INVALID_MODE_VIOLATION, 0, 0); + mekfInvalidCounter = 0; } - mekfInvalidCounter++; // commandActuators(0, 0, 0, acsParameters.magnetorquesParameter.torqueDuration, // cmdSpeedRws[0], // cmdSpeedRws[1], cmdSpeedRws[2], cmdSpeedRws[3], // acsParameters.rwHandlingParameters.rampTime); return; } else { - mekfInvalidFlag = false; + if (mekfInvalidFlag) { + triggerEvent(acs::MEKF_RECOVERY); + mekfInvalidFlag = false; + } mekfInvalidCounter = 0; } uint8_t enableAntiStiction = true; -- 2.43.0 From 32bab161ef54b158dbc4988f793efdd2fcd4d819 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 23 Mar 2023 10:37:34 +0100 Subject: [PATCH 2/4] new event --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 9 ++++++--- generators/bsp_hosted_events.csv | 5 +++-- generators/bsp_q7s_events.csv | 5 +++-- generators/events/translateEvents.cpp | 9 ++++++--- linux/fsfwconfig/events/translateEvents.cpp | 9 ++++++--- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 1e8756e2..04285d29 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 280 translations. * @details - * Generated on: 2023-03-21 23:59:36 + * Generated on: 2023-03-23 10:28:33 */ #include "translateEvents.h" @@ -96,6 +96,7 @@ const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO"; +const char *MEKF_RECOVERY_STRING = "MEKF_RECOVERY"; const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION"; const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; @@ -465,8 +466,10 @@ const char *translateEvents(Event event) { case (11203): return MEKF_INVALID_INFO_STRING; case (11204): - return MEKF_INVALID_MODE_VIOLATION_STRING; + return MEKF_RECOVERY_STRING; case (11205): + return MEKF_INVALID_MODE_VIOLATION_STRING; + case (11206): return SAFE_MODE_CONTROLLER_FAILURE_STRING; case (11300): return SWITCH_CMD_SENT_STRING; diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 8fe777aa..6d7d32a9 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -90,8 +90,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;No description;mission/acsDefs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;No description;mission/acsDefs.h 11203;0x2bc3;MEKF_INVALID_INFO;INFO;No description;mission/acsDefs.h -11204;0x2bc4;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h -11205;0x2bc5;SAFE_MODE_CONTROLLER_FAILURE;HIGH;No description;mission/acsDefs.h +11204;0x2bc4;MEKF_RECOVERY;INFO;No description;mission/acsDefs.h +11205;0x2bc5;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h +11206;0x2bc6;SAFE_MODE_CONTROLLER_FAILURE;HIGH;No description;mission/acsDefs.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/devices/devicedefinitions/powerDefinitions.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 8fe777aa..6d7d32a9 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -90,8 +90,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;No description;mission/acsDefs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;No description;mission/acsDefs.h 11203;0x2bc3;MEKF_INVALID_INFO;INFO;No description;mission/acsDefs.h -11204;0x2bc4;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h -11205;0x2bc5;SAFE_MODE_CONTROLLER_FAILURE;HIGH;No description;mission/acsDefs.h +11204;0x2bc4;MEKF_RECOVERY;INFO;No description;mission/acsDefs.h +11205;0x2bc5;MEKF_INVALID_MODE_VIOLATION;HIGH;No description;mission/acsDefs.h +11206;0x2bc6;SAFE_MODE_CONTROLLER_FAILURE;HIGH;No description;mission/acsDefs.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/devices/devicedefinitions/powerDefinitions.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 1e8756e2..04285d29 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 280 translations. * @details - * Generated on: 2023-03-21 23:59:36 + * Generated on: 2023-03-23 10:28:33 */ #include "translateEvents.h" @@ -96,6 +96,7 @@ const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO"; +const char *MEKF_RECOVERY_STRING = "MEKF_RECOVERY"; const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION"; const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; @@ -465,8 +466,10 @@ const char *translateEvents(Event event) { case (11203): return MEKF_INVALID_INFO_STRING; case (11204): - return MEKF_INVALID_MODE_VIOLATION_STRING; + return MEKF_RECOVERY_STRING; case (11205): + return MEKF_INVALID_MODE_VIOLATION_STRING; + case (11206): return SAFE_MODE_CONTROLLER_FAILURE_STRING; case (11300): return SWITCH_CMD_SENT_STRING; diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 1e8756e2..04285d29 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 279 translations. + * @brief Auto-generated event translation file. Contains 280 translations. * @details - * Generated on: 2023-03-21 23:59:36 + * Generated on: 2023-03-23 10:28:33 */ #include "translateEvents.h" @@ -96,6 +96,7 @@ const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *MULTIPLE_RW_INVALID_STRING = "MULTIPLE_RW_INVALID"; const char *MEKF_INVALID_INFO_STRING = "MEKF_INVALID_INFO"; +const char *MEKF_RECOVERY_STRING = "MEKF_RECOVERY"; const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION"; const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; @@ -465,8 +466,10 @@ const char *translateEvents(Event event) { case (11203): return MEKF_INVALID_INFO_STRING; case (11204): - return MEKF_INVALID_MODE_VIOLATION_STRING; + return MEKF_RECOVERY_STRING; case (11205): + return MEKF_INVALID_MODE_VIOLATION_STRING; + case (11206): return SAFE_MODE_CONTROLLER_FAILURE_STRING; case (11300): return SWITCH_CMD_SENT_STRING; -- 2.43.0 From 7bca418db8efa502d7d2e69accf234be1e13997f Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 23 Mar 2023 10:51:06 +0100 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c387a4a7..3ab7abc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Added + +- The event `MEKF_RECOVERY` will be triggered in case the `MEKF` does manage to recover itself. + +## Fixed + +- The `mekfInvalidCounter` now resets on setting the STR to faulty. + # [v1.39.1] 2023-03-22 ## Fixed -- 2.43.0 From 613d7738a8a7a3379ee4f04543ae1b2732c8f3f8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 24 Mar 2023 15:02:13 +0100 Subject: [PATCH 4/4] update generates files --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 1bb3b08e..786e7aa7 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 279 translations. * @details - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 5ad62831..f48a9fd2 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 169 translations. - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateObjects.h" diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 1bb3b08e..786e7aa7 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 279 translations. * @details - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index c5adb5d2..e63c74d3 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 173 translations. - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 1bb3b08e..786e7aa7 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 279 translations. * @details - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index c5adb5d2..e63c74d3 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 173 translations. - * Generated on: 2023-03-24 14:59:06 + * Generated on: 2023-03-24 15:01:12 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 93ad3ada..5e0d33c9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 93ad3ada7d4f351ae15209a6ffd668a61474ea68 +Subproject commit 5e0d33c9a843c3cd2da10304050665ef25a08f2a -- 2.43.0