From 4ed112d0199e90684edf011a2bb130f4405650fe Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 5 Apr 2023 16:21:10 +0200 Subject: [PATCH 1/3] safe mode controller no longer commands RWs --- mission/controller/AcsController.cpp | 17 ++++++++++++++--- mission/controller/AcsController.h | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 39eca18e..ff00d093 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -221,9 +221,8 @@ void AcsController::performSafe() { updateCtrlValData(errAng); updateActuatorCmdData(cmdDipolMtqs); - // commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], - // acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, - // acsParameters.rwHandlingParameters.rampTime); + // commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + // acsParameters.magnetorquerParameter.torqueDuration); } void AcsController::performDetumble() { @@ -472,6 +471,18 @@ void AcsController::performPointingCtrl() { // acsParameters.rwHandlingParameters.rampTime); } +ReturnValue_t AcsController::commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, + uint16_t dipoleTorqueDuration) { + { + PoolReadGuard pg(&dipoleSet); + MutexGuard mg(torquer::lazyLock(), torquer::LOCK_TYPE, torquer::LOCK_TIMEOUT, + torquer::LOCK_CTX); + torquer::NEW_ACTUATION_FLAG = true; + dipoleSet.setDipoles(xDipole, yDipole, zDipole, dipoleTorqueDuration); + } + return returnvalue::OK; +} + ReturnValue_t AcsController::commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, uint16_t dipoleTorqueDuration, int32_t rw1Speed, int32_t rw2Speed, int32_t rw3Speed, int32_t rw4Speed, diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 76cfe7b5..44e87e7e 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -105,6 +105,8 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes void modeChanged(Mode_t mode, Submode_t submode); void announceMode(bool recursive); + ReturnValue_t commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, + uint16_t dipoleTorqueDuration); ReturnValue_t commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, uint16_t dipoleTorqueDuration, int32_t rw1Speed, int32_t rw2Speed, int32_t rw3Speed, int32_t rw4Speed, uint16_t rampTime); From 78cc0fc52dd4b191033e13744544440909777b4e Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 5 Apr 2023 16:21:38 +0200 Subject: [PATCH 2/3] set commanded speed to 0 during off transition --- mission/acs/RwHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mission/acs/RwHandler.cpp b/mission/acs/RwHandler.cpp index 5ba5d7a3..87979ae8 100644 --- a/mission/acs/RwHandler.cpp +++ b/mission/acs/RwHandler.cpp @@ -55,6 +55,10 @@ void RwHandler::doShutDown() { PoolReadGuard pg(&tmDataset); tmDataset.setValidity(false, true); } + { + PoolReadGuard pg(&rwSpeedActuationSet); + rwSpeedActuationSet.setRwSpeed(0, 10); + } // The power switch is handled by the assembly, so we can go off here directly. setMode(MODE_OFF); } From 38b7593900d1be4f955fc35eec27eac97b1ec769 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 5 Apr 2023 16:23:29 +0200 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e678fff..3dbd81d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ will consitute of a breaking change warranting a new major release: - Adapted HK data rates to new table for LEOP SAFE mode. - GPS controller HK is now generated periodically as well. +- RWs are no longer commanded by the ACS Controller during safe mode. Instead the RW speed command + is set to 0 as part or the `doShutDown` of the RW handler. # [v1.43.1] 2023-04-04