From 0ae8b4e85ee664dd60c93f44dc594244ca5de0b5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 1 Jan 2024 17:19:07 +0100 Subject: [PATCH 01/47] stupid PCDU --- mission/power/PcduHandler.cpp | 17 ++++++++++------- mission/power/PcduHandler.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mission/power/PcduHandler.cpp b/mission/power/PcduHandler.cpp index 0561288c..1596d522 100644 --- a/mission/power/PcduHandler.cpp +++ b/mission/power/PcduHandler.cpp @@ -65,8 +65,8 @@ ReturnValue_t PcduHandler::performOperation(uint8_t counter) { ReturnValue_t PcduHandler::initialize() { ReturnValue_t result; - IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); - if (IPCStore == nullptr) { + ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); + if (ipcStore == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -162,10 +162,13 @@ void PcduHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet sizeof(CCSDSTime::CDS_short), dataset); const uint8_t* packet_ptr = nullptr; size_t size = 0; - result = IPCStore->getData(storeId, &packet_ptr, &size); + result = ipcStore->getData(storeId, &packet_ptr, &size); if (result != returnvalue::OK) { - sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPCStore." - << std::endl; + sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPC store, result 0x" + << std::hex << std::setw(4) << std::setfill('0') << result << std::dec + << std::setfill(' ') << std::endl; + result = ipcStore->deleteData(storeId); + return; } result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE); if (result != returnvalue::OK) { @@ -173,7 +176,7 @@ void PcduHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet "in hk table dataset" << std::endl; } - result = IPCStore->deleteData(storeId); + result = ipcStore->deleteData(storeId); if (result != returnvalue::OK) { sif::error << "PCDUHandler::updateHkTableDataset: Failed to delete data in IPCStore" << std::endl; @@ -396,7 +399,7 @@ ReturnValue_t PcduHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO setParamMessage.serialize(&commandPtr, &serializedLength, maxSize, SerializeIF::Endianness::BIG); store_address_t storeAddress; - result = IPCStore->addData(&storeAddress, command, sizeof(command)); + result = ipcStore->addData(&storeAddress, command, sizeof(command)); CommandMessage message; ActionMessage::setCommand(&message, GOMSPACE::PARAM_SET, storeAddress); diff --git a/mission/power/PcduHandler.h b/mission/power/PcduHandler.h index 86d3747f..73df73ef 100644 --- a/mission/power/PcduHandler.h +++ b/mission/power/PcduHandler.h @@ -94,7 +94,7 @@ class PcduHandler : public PowerSwitchIF, * Pointer to the IPCStore. * This caches the pointer received from the objectManager in the constructor. */ - StorageManagerIF* IPCStore = nullptr; + StorageManagerIF* ipcStore = nullptr; /** * Message queue to communicate with other objetcs. Used for example to receive From d8ae45b3520d0eeb4853c8909272b24fe2fa28c6 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 19 Jan 2024 15:16:46 +0100 Subject: [PATCH 02/47] trigger transition into detumble no matter which mode we are in --- mission/controller/AcsController.cpp | 45 +++++++++++----------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8e7ae8d4..41ff69dd 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -178,6 +178,24 @@ void AcsController::performAttitudeControl() { result = navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, &attitudeEstimationData, &acsParameters); + if (not submode == acs::SafeSubmode::DETUMBLE) { + if (acsParameters.safeModeControllerParameters.useMekf) { + if (mgmDataProcessed.mgmVecTotDerivative.isValid() and + VectorOperations::norm(mgmDataProcessed.mgmVecTotDerivative.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } + } else if (detumbleCounter > 0) { + detumbleCounter -= 1; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + detumbleCounter = 0; + // Triggers detumble mode transition in subsystem + triggerEvent(acs::SAFE_RATE_VIOLATION); + startTransition(mode, acs::SafeSubmode::DETUMBLE); + } + } + if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and result != MultiplicativeKalmanFilter::MEKF_INITIALIZED) { if (not mekfInvalidFlag) { @@ -284,33 +302,6 @@ void AcsController::performSafe() { actuatorCmd.cmdDipoleMtq(*acsParameters.magnetorquerParameter.inverseAlignment, acsParameters.magnetorquerParameter.dipoleMax, magMomMtq, cmdDipoleMtqs); - // detumble check and switch - if (acsParameters.safeModeControllerParameters.useMekf) { - if (attitudeEstimationData.satRotRateMekf.isValid() and - VectorOperations::norm(attitudeEstimationData.satRotRateMekf.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } - } else if (acsParameters.safeModeControllerParameters.useGyr) { - if (gyrDataProcessed.gyrVecTot.isValid() and - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } - } else if (fusedRotRateData.rotRateTotal.isValid() and - VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else if (detumbleCounter > 0) { - detumbleCounter -= 1; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - detumbleCounter = 0; - // Triggers detumble mode transition in subsystem - triggerEvent(acs::SAFE_RATE_VIOLATION); - startTransition(mode, acs::SafeSubmode::DETUMBLE); - } - updateCtrlValData(errAng, safeCtrlStrat); updateActuatorCmdData(cmdDipoleMtqs); commandActuators(cmdDipoleMtqs[0], cmdDipoleMtqs[1], cmdDipoleMtqs[2], From ef730022a0c191442f8bce27f71c0e8041fc03e4 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 19 Jan 2024 15:18:15 +0100 Subject: [PATCH 03/47] isnt finished --- mission/controller/AcsController.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 41ff69dd..4980cbcd 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -181,7 +181,8 @@ void AcsController::performAttitudeControl() { if (not submode == acs::SafeSubmode::DETUMBLE) { if (acsParameters.safeModeControllerParameters.useMekf) { if (mgmDataProcessed.mgmVecTotDerivative.isValid() and - VectorOperations::norm(mgmDataProcessed.mgmVecTotDerivative.value, 3) > + VectorOperations::norm(mgmDataProcessed.mgmVecTotDerivative.value, + 3) > // units do not agree acsParameters.detumbleParameter.omegaDetumbleStart) { detumbleCounter++; } @@ -192,7 +193,7 @@ void AcsController::performAttitudeControl() { detumbleCounter = 0; // Triggers detumble mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); - startTransition(mode, acs::SafeSubmode::DETUMBLE); + startTransition(mode, acs::SafeSubmode::DETUMBLE); // this does not work } } From 6c90777e4b9bd39858b61c4da57a8215079aae70 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 25 Jan 2024 11:32:37 +0100 Subject: [PATCH 04/47] imagine being a newspace company and not even knowing what a mathematically positive sense of rotation is --- mission/controller/acs/AcsParameters.cpp | 8 ++++---- mission/controller/acs/AcsParameters.h | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index a6ce6c5d..4731b6ee 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -333,16 +333,16 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->setMatrix(rwMatrices.pseudoInverse); break; case 0x2: - parameterWrapper->setMatrix(rwMatrices.without1); + parameterWrapper->setMatrix(rwMatrices.pseudoInverseWithoutRW1); break; case 0x3: - parameterWrapper->setMatrix(rwMatrices.without2); + parameterWrapper->setMatrix(rwMatrices.pseudoInverseWithoutRW2); break; case 0x4: - parameterWrapper->setMatrix(rwMatrices.without3); + parameterWrapper->setMatrix(rwMatrices.pseudoInverseWithoutRW3); break; case 0x5: - parameterWrapper->setMatrix(rwMatrices.without4); + parameterWrapper->setMatrix(rwMatrices.pseudoInverseWithoutRW4); break; case 0x6: parameterWrapper->setVector(rwMatrices.nullspaceVector); diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index f11a673b..122a932b 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -812,19 +812,19 @@ class AcsParameters : public HasParametersIF { } rwHandlingParameters; struct RwMatrices { - double alignmentMatrix[3][4] = {{0.9205, 0.0000, -0.9205, 0.0000}, - {0.0000, -0.9205, 0.0000, 0.9205}, - {0.3907, 0.3907, 0.3907, 0.3907}}; + double alignmentMatrix[3][4] = {{-0.9205, 0.0000, 0.9205, 0.0000}, + {0.0000, 0.9205, 0.0000, -0.9205}, + {-0.3907, -0.3907, -0.3907, -0.3907}}; double pseudoInverse[4][3] = { - {0.5432, 0, 0.6398}, {0, -0.5432, 0.6398}, {-0.5432, 0, 0.6398}, {0, 0.5432, 0.6398}}; - double without1[4][3] = { - {0, 0, 0}, {0.5432, -0.5432, 1.2797}, {-1.0864, 0, 0}, {0.5432, 0.5432, 1.2797}}; - double without2[4][3] = { - {0.5432, -0.5432, 1.2797}, {0, 0, 0}, {-0.5432, -0.5432, 1.2797}, {0, 1.0864, 0}}; - double without3[4][3] = { - {1.0864, 0, 0}, {-0.5432, -0.5432, 1.2797}, {0, 0, 0}, {-0.5432, 0.5432, 1.2797}}; - double without4[4][3] = { - {0.5432, 0.5432, 1.2797}, {0, -1.0864, 0}, {-0.5432, 0.5432, 1.2797}, {0, 0, 0}}; + {-0.5432, 0, -0.6399}, {0, 0.5432, -0.6399}, {0.5432, 0, -0.6399}, {0, -0.5432, -0.6399}}; + double pseudoInverseWithoutRW1[4][3] = { + {0, 0, 0}, {-0.5432, 0.5432, -1.2798}, {1.0864, 0, 0}, {-0.5432, -0.5432, -1.2798}}; + double pseudoInverseWithoutRW2[4][3] = { + {-0.5432, 0.5432, -1.2798}, {0, 0, 0}, {0.5432, 0.5432, -1.2798}, {0, -1.0864, 0}}; + double pseudoInverseWithoutRW3[4][3] = { + {1.0864, 0, 0}, {-0.5432, -0.5432, 1.2798}, {0, 0, 0}, {-0.5432, 0.5432, 1.2798}}; + double pseudoInverseWithoutRW4[4][3] = { + {-0.5432, -0.5432, -1.2798}, {0, 1.0864, 0}, {0.5432, -0.5432, -1.2798}, {0, 0, 0}}; double nullspaceVector[4] = {-1, 1, -1, 1}; } rwMatrices; From edf2f889c1b0f5ab736e270379616fc18392d87a Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 25 Jan 2024 13:15:10 +0100 Subject: [PATCH 05/47] forgot this one --- mission/controller/acs/AcsParameters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 122a932b..0ab1105d 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -822,7 +822,7 @@ class AcsParameters : public HasParametersIF { double pseudoInverseWithoutRW2[4][3] = { {-0.5432, 0.5432, -1.2798}, {0, 0, 0}, {0.5432, 0.5432, -1.2798}, {0, -1.0864, 0}}; double pseudoInverseWithoutRW3[4][3] = { - {1.0864, 0, 0}, {-0.5432, -0.5432, 1.2798}, {0, 0, 0}, {-0.5432, 0.5432, 1.2798}}; + {-1.0864, 0, 0}, {0.5432, 0.5432, -1.2798}, {0, 0, 0}, {0.5432, -0.5432, -1.2798}}; double pseudoInverseWithoutRW4[4][3] = { {-0.5432, -0.5432, -1.2798}, {0, 1.0864, 0}, {0.5432, -0.5432, -1.2798}, {0, 0, 0}}; double nullspaceVector[4] = {-1, 1, -1, 1}; From 3892276a5c7fd7f4ab62f9921ab058208f7e1ef5 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 25 Jan 2024 13:19:59 +0100 Subject: [PATCH 06/47] reset guidance on mode change --- mission/controller/AcsController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8e7ae8d4..36d05fb2 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -885,6 +885,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, } void AcsController::modeChanged(Mode_t mode, Submode_t submode) { + guidance.resetValues(); return ExtendedControllerBase::modeChanged(mode, submode); } From ff5e1cd76b9c3794d0b5ef6ce8dd75c6225d275c Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 25 Jan 2024 13:25:11 +0100 Subject: [PATCH 07/47] reset guidance if lost --- mission/controller/AcsController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 36d05fb2..3f44f327 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -412,6 +412,7 @@ void AcsController::performPointingCtrl() { triggerEvent(acs::PTG_CTRL_NO_ATTITUDE_INFORMATION); ptgCtrlLostCounter = 0; } + guidance.resetValues(); updateCtrlValData(ptgCtrlStrat); updateActuatorCmdData(ZERO_VEC4, cmdSpeedRws, ZERO_VEC3_INT16); commandActuators(0, 0, 0, acsParameters.magnetorquerParameter.torqueDuration, cmdSpeedRws[0], From 42b94ab581f2b32b7339512347f5b563f8b14455 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 10:50:11 +0100 Subject: [PATCH 08/47] we can only use the nullspace if all rws are available --- mission/controller/acs/control/PtgCtrl.cpp | 8 ++++++-- mission/controller/acs/control/PtgCtrl.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index fd5b9f29..8c3a7e7b 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -39,7 +39,7 @@ void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters double qError[3] = {errorQuat[0], errorQuat[1], errorQuat[2]}; double cInt = 2 * om * zeta; - double kInt = 2 * pow(om, 2); + double kInt = 2 * om * om; double qErrorLaw[3] = {0, 0, 0}; @@ -111,9 +111,13 @@ void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); } -void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters, +void PtgCtrl::ptgNullspace(const bool allRwAvabilable, + AcsParameters::PointingLawParameters *pointingLawParameters, const int32_t speedRw0, const int32_t speedRw1, const int32_t speedRw2, const int32_t speedRw3, double *rwTrqNs) { + if (not allRwAvabilable) { + return; + } // concentrate RW speeds as vector and convert to double double speedRws[4] = {static_cast(speedRw0), static_cast(speedRw1), static_cast(speedRw2), static_cast(speedRw3)}; diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index a07849ec..66402b0d 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -33,7 +33,8 @@ class PtgCtrl { void ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, const double *qError, const double *deltaRate, const double *rwPseudoInv, double *torqueRws); - void ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters, + void ptgNullspace(const bool allRwAvabilable, + AcsParameters::PointingLawParameters *pointingLawParameters, const int32_t speedRw0, const int32_t speedRw1, const int32_t speedRw2, const int32_t speedRw3, double *rwTrqNs); From 10841a01b77a87259410fc9d125a9f90cbe05aae Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 10:59:15 +0100 Subject: [PATCH 09/47] class id is defined here now --- mission/controller/controllerdefinitions/AcsCtrlDefinitions.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 83a74552..78725755 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -8,6 +8,8 @@ namespace acsctrl { +static const uint8_t IF_ACS_CTRL_ID = CLASS_ID::ACS_CTRL; + enum SetIds : uint32_t { MGM_SENSOR_DATA, MGM_PROCESSED_DATA, From 7daeb9a148e08af0f4346f46e0dbeaa10ef0e654 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 10:59:57 +0100 Subject: [PATCH 10/47] better rw failure handling and use new classid location --- mission/controller/AcsController.cpp | 20 ++++++++++++-------- mission/controller/AcsController.h | 10 ++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 3f44f327..2310a99b 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -447,9 +447,10 @@ void AcsController::performPointingCtrl() { } uint8_t enableAntiStiction = true; + bool allRwAvailable = true; double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; ReturnValue_t result = guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - if (result == returnvalue::FAILED) { + if (result == Guidance::MULTIPLE_RW_UNAVAILABLE) { if (multipleRwUnavailableCounter >= acsParameters.rwHandlingParameters.multipleRwInvalidTimeout) { triggerEvent(acs::MULTIPLE_RW_INVALID); @@ -457,8 +458,10 @@ void AcsController::performPointingCtrl() { } multipleRwUnavailableCounter++; return; - } else { - multipleRwUnavailableCounter = 0; + } + multipleRwUnavailableCounter = 0; + if (result == Guidance::SINGLE_RW_UNAVAILABLE) { + allRwAvailable = false; } // Variables required for guidance @@ -476,10 +479,11 @@ void AcsController::performPointingCtrl() { errorSatRotRate, errorAngle); ptgCtrl.ptgLaw(&acsParameters.idleModeControllerParameters, errorQuat, errorSatRotRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.idleModeControllerParameters, + ptgCtrl.ptgNullspace(allRwAvailable, &acsParameters.idleModeControllerParameters, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); actuatorCmd.scalingTorqueRws(torqueRws, acsParameters.rwHandlingParameters.maxTrq); ptgCtrl.ptgDesaturation( @@ -500,7 +504,7 @@ void AcsController::performPointingCtrl() { errorSatRotRate, errorAngle); ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, errorQuat, errorSatRotRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, + ptgCtrl.ptgNullspace(allRwAvailable, &acsParameters.targetModeControllerParameters, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, rwTrqNs); @@ -521,7 +525,7 @@ void AcsController::performPointingCtrl() { errorSatRotRate, errorAngle); ptgCtrl.ptgLaw(&acsParameters.gsTargetModeControllerParameters, errorQuat, errorSatRotRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.gsTargetModeControllerParameters, + ptgCtrl.ptgNullspace(allRwAvailable, &acsParameters.gsTargetModeControllerParameters, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, rwTrqNs); @@ -545,7 +549,7 @@ void AcsController::performPointingCtrl() { errorSatRotRate, errorAngle); ptgCtrl.ptgLaw(&acsParameters.nadirModeControllerParameters, errorQuat, errorSatRotRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.nadirModeControllerParameters, + ptgCtrl.ptgNullspace(allRwAvailable, &acsParameters.nadirModeControllerParameters, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, rwTrqNs); @@ -568,7 +572,7 @@ void AcsController::performPointingCtrl() { errorSatRotRate, errorAngle); ptgCtrl.ptgLaw(&acsParameters.inertialModeControllerParameters, errorQuat, errorSatRotRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.inertialModeControllerParameters, + ptgCtrl.ptgNullspace(allRwAvailable, &acsParameters.inertialModeControllerParameters, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, rwTrqNs); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index aa2b9411..bb4e3c37 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -108,13 +108,15 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes static const DeviceCommandId_t UPDATE_TLE = 0x3; static const DeviceCommandId_t READ_TLE = 0x4; - static const uint8_t INTERFACE_ID = CLASS_ID::ACS_CTRL; //! [EXPORT] : [COMMENT] File deletion failed and at least one file is still existent. - static constexpr ReturnValue_t FILE_DELETION_FAILED = MAKE_RETURN_CODE(0); + static constexpr ReturnValue_t FILE_DELETION_FAILED = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 0); //! [EXPORT] : [COMMENT] Writing the TLE to the file has failed. - static constexpr ReturnValue_t WRITE_FILE_FAILED = MAKE_RETURN_CODE(1); + static constexpr ReturnValue_t WRITE_FILE_FAILED = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 1); //! [EXPORT] : [COMMENT] Reading the TLE to the file has failed. - static constexpr ReturnValue_t READ_FILE_FAILED = MAKE_RETURN_CODE(2); + static constexpr ReturnValue_t READ_FILE_FAILED = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 2); ReturnValue_t initialize() override; ReturnValue_t handleCommandMessage(CommandMessage* message) override; From c1e7ac7e9a6a44dcc0cde99a4dfee28eae49d1bc Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 11:12:28 +0100 Subject: [PATCH 11/47] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index e64e8b27..5879eb7f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e64e8b274d436502d5c5b87865b9006e52e4b1aa +Subproject commit 5879eb7f7b83205c64980580c16d3aa78d6ea073 From 291c9ea99ba8763924c2be7eb8c374dea744812d Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 11:16:59 +0100 Subject: [PATCH 12/47] calculate the rotation rate in normal way --- mission/controller/acs/Guidance.cpp | 77 +++++++++-------------------- mission/controller/acs/Guidance.h | 25 ++++++++-- 2 files changed, 44 insertions(+), 58 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 10d1393c..9ac7b5e9 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -1,15 +1,5 @@ #include "Guidance.h" -#include -#include -#include -#include -#include - -#include -#include -#include - Guidance::Guidance(AcsParameters *acsParameters_) { acsParameters = acsParameters_; } Guidance::~Guidance() {} @@ -455,44 +445,16 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do } void Guidance::targetRotationRate(const int8_t timeElapsedMax, const double timeDelta, - double quatInertialTarget[4], double *refSatRate) { - //------------------------------------------------------------------------------------- - // Calculation of target rotation rate - //------------------------------------------------------------------------------------- - if (VectorOperations::norm(savedQuaternion, 4) == 0) { - std::memcpy(savedQuaternion, quatInertialTarget, sizeof(savedQuaternion)); + double quatIX[4], double *refSatRate) { + if (VectorOperations::norm(quatIXprev, 4) == 0) { + std::memcpy(quatIXprev, quatIX, sizeof(quatIXprev)); } - if (timeDelta < timeElapsedMax and timeDelta != 0.0) { - double q[4] = {0, 0, 0, 0}, qS[4] = {0, 0, 0, 0}; - QuaternionOperations::inverse(quatInertialTarget, q); - QuaternionOperations::inverse(savedQuaternion, qS); - double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(q, qS, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1. / timeDelta, qDiff, 4); - - double tgtQuatVec[3] = {q[0], q[1], q[2]}; - double qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; - double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(tgtQuatVec, qDiffVec, sum1); - VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, q[3], sum3, 3); - VectorOperations::add(sum1, sum2, sum, 3); - VectorOperations::subtract(sum, sum3, sum, 3); - double omegaRefNew[3] = {0, 0, 0}; - VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); - - VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSaved, refSatRate, 3); - omegaRefSaved[0] = omegaRefNew[0]; - omegaRefSaved[1] = omegaRefNew[1]; - omegaRefSaved[2] = omegaRefNew[2]; + if (not timeDelta != 0.0) { + QuaternionOperations::rotationFromQuaternions(quatIX, quatIXprev, timeDelta, refSatRate); } else { - refSatRate[0] = 0; - refSatRate[1] = 0; - refSatRate[2] = 0; + std::memcpy(refSatRate, ZERO_VEC3, sizeof(refSatRate)); } - - std::memcpy(savedQuaternion, quatInertialTarget, sizeof(savedQuaternion)); + std::memcpy(quatIXprev, quatIX, sizeof(quatIXprev)); } ReturnValue_t Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues, @@ -506,22 +468,27 @@ ReturnValue_t Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues, std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverse, 12 * sizeof(double)); return returnvalue::OK; } else if (not rw1valid and rw2valid and rw3valid and rw4valid) { - std::memcpy(rwPseudoInv, acsParameters->rwMatrices.without1, 12 * sizeof(double)); - return returnvalue::OK; + std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW1, + 12 * sizeof(double)); + return SINGLE_RW_UNAVAILABLE; } else if (rw1valid and not rw2valid and rw3valid and rw4valid) { - std::memcpy(rwPseudoInv, acsParameters->rwMatrices.without2, 12 * sizeof(double)); - return returnvalue::OK; + std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW2, + 12 * sizeof(double)); + return SINGLE_RW_UNAVAILABLE; } else if (rw1valid and rw2valid and not rw3valid and rw4valid) { - std::memcpy(rwPseudoInv, acsParameters->rwMatrices.without3, 12 * sizeof(double)); - return returnvalue::OK; + std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW3, + 12 * sizeof(double)); + return SINGLE_RW_UNAVAILABLE; } else if (rw1valid and rw2valid and rw3valid and not rw4valid) { - std::memcpy(rwPseudoInv, acsParameters->rwMatrices.without4, 12 * sizeof(double)); - return returnvalue::OK; - } else { - return returnvalue::FAILED; + std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW4, + 12 * sizeof(double)); + return SINGLE_RW_UNAVAILABLE; } + return MULTIPLE_RW_UNAVAILABLE; } +void Guidance::resetValues() { std::memcpy(quatIXprev, ZERO_VEC4, sizeof(quatIXprev)); } + void Guidance::getTargetParamsSafe(double sunTargetSafe[3]) { std::error_code e; if (not std::filesystem::exists(SD_0_SKEWED_PTG_FILE, e) or diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 1cf5b8a9..98f77766 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -1,9 +1,18 @@ #ifndef GUIDANCE_H_ #define GUIDANCE_H_ +#include +#include +#include +#include +#include +#include #include -#include "../controllerdefinitions/AcsCtrlDefinitions.h" +#include +#include +#include + #include "AcsParameters.h" #include "SensorValues.h" @@ -14,6 +23,7 @@ class Guidance { void getTargetParamsSafe(double sunTargetSafe[3]); ReturnValue_t solarArrayDeploymentComplete(); + void resetValues(); // Function to get the target quaternion and reference rotation rate from gps position and // position of the ground station @@ -56,12 +66,21 @@ class Guidance { // reation wheel maybe can be done in "commanding.h" ReturnValue_t getDistributionMatrixRw(ACS::SensorValues *sensorValues, double *rwPseudoInv); + //! [EXPORT] : [COMMENT] A single RW has failed. + static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 3); + //! [EXPORT] : [COMMENT] Multiple RWs have failed. + static constexpr ReturnValue_t MULTIPLE_RW_UNAVAILABLE = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 4); + private: const AcsParameters *acsParameters; + static constexpr double ZERO_VEC3[3] = {0, 0, 0}; + static constexpr double ZERO_VEC4[3] = {0, 0, 0, 0}; + bool strBlindAvoidFlag = false; - double savedQuaternion[4] = {0, 0, 0, 0}; - double omegaRefSaved[3] = {0, 0, 0}; + double quatIXprev[4] = {0, 0, 0, 0}; static constexpr char SD_0_SKEWED_PTG_FILE[] = "/mnt/sd0/conf/acsDeploymentConfirm"; static constexpr char SD_1_SKEWED_PTG_FILE[] = "/mnt/sd1/conf/acsDeploymentConfirm"; From 944dfb6f81218cfd97b85645cec3628b6d9b46d0 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 13:16:27 +0100 Subject: [PATCH 13/47] convert target rot rate into body rf --- mission/controller/acs/Guidance.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 9ac7b5e9..d7e8fe26 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -421,7 +421,11 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do errorAngle = QuaternionOperations::getAngle(errorQuat, true); // Calculate error satellite rotational rate - // First combine the target and reference satellite rotational rates + // Convert target rotational rate into body RF + double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0}; + QuaternionOperations::inverse(errorQuat, errorQuatInv); + QuaternionOperations::multiplyVector(errorQuat, targetSatRotRate, targetSatRotRateB); + // Combine the target and reference satellite rotational rates double combinedRefSatRotRate[3] = {0, 0, 0}; VectorOperations::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3); // Then subtract the combined required satellite rotational rates from the actual rate From 588612875d67a78eb780aac76f56ec322dae3420 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 13:36:51 +0100 Subject: [PATCH 14/47] this is not not funny --- mission/controller/acs/Guidance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index d7e8fe26..185158d5 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -453,10 +453,10 @@ void Guidance::targetRotationRate(const int8_t timeElapsedMax, const double time if (VectorOperations::norm(quatIXprev, 4) == 0) { std::memcpy(quatIXprev, quatIX, sizeof(quatIXprev)); } - if (not timeDelta != 0.0) { + if (timeDelta != 0.0) { QuaternionOperations::rotationFromQuaternions(quatIX, quatIXprev, timeDelta, refSatRate); } else { - std::memcpy(refSatRate, ZERO_VEC3, sizeof(refSatRate)); + std::memcpy(refSatRate, ZERO_VEC3, 3 * sizeof(double)); } std::memcpy(quatIXprev, quatIX, sizeof(quatIXprev)); } From 2f296c3c8c444c227a89d1bf860aaec2afacac80 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 13:37:30 +0100 Subject: [PATCH 15/47] whoopsies --- mission/controller/acs/Guidance.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 98f77766..f6319c7b 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include #include @@ -13,9 +15,6 @@ #include #include -#include "AcsParameters.h" -#include "SensorValues.h" - class Guidance { public: Guidance(AcsParameters *acsParameters_); @@ -77,7 +76,7 @@ class Guidance { const AcsParameters *acsParameters; static constexpr double ZERO_VEC3[3] = {0, 0, 0}; - static constexpr double ZERO_VEC4[3] = {0, 0, 0, 0}; + static constexpr double ZERO_VEC4[4] = {0, 0, 0, 0}; bool strBlindAvoidFlag = false; double quatIXprev[4] = {0, 0, 0, 0}; From ec3523e5adc5b455bf2875f75d5f88ee302134df Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 15:36:01 +0100 Subject: [PATCH 16/47] cleanup --- mission/controller/acs/util/MathOperations.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mission/controller/acs/util/MathOperations.h b/mission/controller/acs/util/MathOperations.h index dd4c3f57..023e9379 100644 --- a/mission/controller/acs/util/MathOperations.h +++ b/mission/controller/acs/util/MathOperations.h @@ -4,15 +4,12 @@ #include #include #include -#include -#include -#include +#include #include +#include #include -#include "fsfw/serviceinterface.h" - template class MathOperations { public: @@ -46,7 +43,7 @@ class MathOperations { static void selectionSort(const T1 *matrix, T1 *result, uint8_t rowSize, uint8_t colSize) { int min_idx; T1 temp; - memcpy(result, matrix, rowSize * colSize * sizeof(*result)); + std::memcpy(result, matrix, rowSize * colSize * sizeof(*result)); // One by one move boundary of unsorted subarray for (int k = 0; k < rowSize; k++) { for (int i = 0; i < colSize - 1; i++) { From 26f69d611e260e068c1c71c52028701e7cbf0938 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 Jan 2024 15:45:24 +0100 Subject: [PATCH 17/47] never try sending invalid command --- mission/controller/acs/control/PtgCtrl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index fd5b9f29..e1069aba 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -220,6 +220,8 @@ void PtgCtrl::rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpee } } } + } else { + rwCmdSpeeds[i] = 0.0; } } } From 5f388d53a6b0742ae758d2841e36335196bb2ad3 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 10:33:49 +0100 Subject: [PATCH 18/47] reset RW cmds to 0 if they are not used anymore --- mission/controller/AcsController.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8e7ae8d4..43e2ccb6 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -885,6 +885,24 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, } void AcsController::modeChanged(Mode_t mode, Submode_t submode) { + if (mode == acs::AcsMode::SAFE) { + { + PoolReadGuard pg(&rw1SpeedSet); + rw1SpeedSet.setRwSpeed(0, 10); + } + { + PoolReadGuard pg(&rw2SpeedSet); + rw2SpeedSet.setRwSpeed(0, 10); + } + { + PoolReadGuard pg(&rw3SpeedSet); + rw3SpeedSet.setRwSpeed(0, 10); + } + { + PoolReadGuard pg(&rw4SpeedSet); + rw4SpeedSet.setRwSpeed(0, 10); + } + } return ExtendedControllerBase::modeChanged(mode, submode); } From 6cf746463b4f75c6be636af027b06fe82bb84cf2 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 10:35:33 +0100 Subject: [PATCH 19/47] is of type int --- mission/controller/acs/control/PtgCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index e1069aba..a7ed422a 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -221,7 +221,7 @@ void PtgCtrl::rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpee } } } else { - rwCmdSpeeds[i] = 0.0; + rwCmdSpeeds[i] = 0; } } } From 315365921ec2825ef82cd0aa1cf8406357257b2f Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 10:37:39 +0100 Subject: [PATCH 20/47] changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8202cea7..8e866eb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- RW speed commands get reset to 0 RPM, if the `AcsController` is has changed its mode + to Safe +- Antistiction for RWs will set commanded speed to 0 RPM, if a wheel is detected as not + working + # [v7.5.5] 2024-01-22 ## Fixed From 772e8f11492dd837a8c8a4a5430179f1873b5840 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 10:45:00 +0100 Subject: [PATCH 21/47] enableAntistiction must not be optional as it prevents the ACS ctrl from sending invalid speed cmds --- mission/controller/AcsController.cpp | 10 +--- mission/controller/acs/AcsParameters.cpp | 61 +++++++++--------------- mission/controller/acs/AcsParameters.h | 1 - 3 files changed, 24 insertions(+), 48 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 43e2ccb6..410ee81d 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -445,7 +445,6 @@ void AcsController::performPointingCtrl() { break; } - uint8_t enableAntiStiction = true; double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; ReturnValue_t result = guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); if (result == returnvalue::FAILED) { @@ -486,7 +485,6 @@ void AcsController::performPointingCtrl() { mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, mgtDpDes); - enableAntiStiction = acsParameters.idleModeControllerParameters.enableAntiStiction; break; case acs::PTG_TARGET: @@ -510,7 +508,6 @@ void AcsController::performPointingCtrl() { mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, mgtDpDes); - enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; break; case acs::PTG_TARGET_GS: @@ -531,7 +528,6 @@ void AcsController::performPointingCtrl() { mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, mgtDpDes); - enableAntiStiction = acsParameters.gsTargetModeControllerParameters.enableAntiStiction; break; case acs::PTG_NADIR: @@ -555,7 +551,6 @@ void AcsController::performPointingCtrl() { mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, mgtDpDes); - enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; break; case acs::PTG_INERTIAL: @@ -578,7 +573,6 @@ void AcsController::performPointingCtrl() { mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, mgtDpDes); - enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; break; default: sif::error << "AcsController: Invalid mode for performPointingCtrl" << std::endl; @@ -590,9 +584,7 @@ void AcsController::performPointingCtrl() { sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, acsParameters.onBoardParams.sampleTime, acsParameters.rwHandlingParameters.inertiaWheel, acsParameters.rwHandlingParameters.maxRwSpeed, torqueRws, cmdSpeedRws); - if (enableAntiStiction) { - ptgCtrl.rwAntistiction(&sensorValues, cmdSpeedRws); - } + ptgCtrl.rwAntistiction(&sensorValues, cmdSpeedRws); actuatorCmd.cmdDipoleMtq(*acsParameters.magnetorquerParameter.inverseAlignment, acsParameters.magnetorquerParameter.dipoleMax, mgtDpDes, cmdDipoleMtqs); diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index a6ce6c5d..4eb11246 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -432,9 +432,6 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(idleModeControllerParameters.desatOn); break; case 0x9: - parameterWrapper->set(idleModeControllerParameters.enableAntiStiction); - break; - case 0xA: parameterWrapper->set(idleModeControllerParameters.useMekf); break; default: @@ -471,42 +468,39 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(targetModeControllerParameters.desatOn); break; case 0x9: - parameterWrapper->set(targetModeControllerParameters.enableAntiStiction); - break; - case 0xA: parameterWrapper->set(targetModeControllerParameters.useMekf); break; - case 0xB: + case 0xA: parameterWrapper->setVector(targetModeControllerParameters.refDirection); break; - case 0xC: + case 0xB: parameterWrapper->setVector(targetModeControllerParameters.refRotRate); break; - case 0xD: + case 0xC: parameterWrapper->setVector(targetModeControllerParameters.quatRef); break; - case 0xE: + case 0xD: parameterWrapper->set(targetModeControllerParameters.timeElapsedMax); break; - case 0xF: + case 0xE: parameterWrapper->set(targetModeControllerParameters.latitudeTgt); break; - case 0x10: + case 0xF: parameterWrapper->set(targetModeControllerParameters.longitudeTgt); break; - case 0x11: + case 0x10: parameterWrapper->set(targetModeControllerParameters.altitudeTgt); break; - case 0x12: + case 0x11: parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); break; - case 0x13: + case 0x12: parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); break; - case 0x14: + case 0x13: parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); break; - case 0x15: + case 0x14: parameterWrapper->set(targetModeControllerParameters.blindRotRate); break; default: @@ -543,24 +537,21 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(gsTargetModeControllerParameters.desatOn); break; case 0x9: - parameterWrapper->set(gsTargetModeControllerParameters.enableAntiStiction); - break; - case 0xA: parameterWrapper->set(gsTargetModeControllerParameters.useMekf); break; - case 0xB: + case 0xA: parameterWrapper->setVector(gsTargetModeControllerParameters.refDirection); break; - case 0xC: + case 0xB: parameterWrapper->set(gsTargetModeControllerParameters.timeElapsedMax); break; - case 0xD: + case 0xC: parameterWrapper->set(gsTargetModeControllerParameters.latitudeTgt); break; - case 0xE: + case 0xD: parameterWrapper->set(gsTargetModeControllerParameters.longitudeTgt); break; - case 0xF: + case 0xE: parameterWrapper->set(gsTargetModeControllerParameters.altitudeTgt); break; default: @@ -597,21 +588,18 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(nadirModeControllerParameters.desatOn); break; case 0x9: - parameterWrapper->set(nadirModeControllerParameters.enableAntiStiction); - break; - case 0xA: parameterWrapper->set(nadirModeControllerParameters.useMekf); break; - case 0xB: + case 0xA: parameterWrapper->setVector(nadirModeControllerParameters.refDirection); break; - case 0xC: + case 0xB: parameterWrapper->setVector(nadirModeControllerParameters.quatRef); break; - case 0xD: + case 0xC: parameterWrapper->setVector(nadirModeControllerParameters.refRotRate); break; - case 0xE: + case 0xD: parameterWrapper->set(nadirModeControllerParameters.timeElapsedMax); break; default: @@ -648,18 +636,15 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(inertialModeControllerParameters.desatOn); break; case 0x9: - parameterWrapper->set(inertialModeControllerParameters.enableAntiStiction); - break; - case 0xA: parameterWrapper->set(inertialModeControllerParameters.useMekf); break; - case 0xB: + case 0xA: parameterWrapper->setVector(inertialModeControllerParameters.tgtQuat); break; - case 0xC: + case 0xB: parameterWrapper->setVector(inertialModeControllerParameters.refRotRate); break; - case 0xD: + case 0xC: parameterWrapper->setVector(inertialModeControllerParameters.quatRef); break; default: diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index f11a673b..d58a2d44 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -863,7 +863,6 @@ class AcsParameters : public HasParametersIF { double desatMomentumRef[3] = {0, 0, 0}; double deSatGainFactor = 1000; uint8_t desatOn = true; - uint8_t enableAntiStiction = true; uint8_t useMekf = false; } pointingLawParameters; From c4297975ff77b87d0b5546fe7caf8fa7f54eda7c Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 10:47:42 +0100 Subject: [PATCH 22/47] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e866eb0..dbbcd40b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ will consitute of a breaking change warranting a new major release: to Safe - Antistiction for RWs will set commanded speed to 0 RPM, if a wheel is detected as not working +- Removed parameter to disable antistiction, as deactivating it would result in the + `AcsController` being allowed sending invalid speed commands to the RW Handler, which + would then trigger FDIR and turning off the functioning device # [v7.5.5] 2024-01-22 From 398ddd1a3fca50998206aca89ac2e1cdaeaebe50 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 11:30:37 +0100 Subject: [PATCH 23/47] typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbcd40b..57dc0902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed -- RW speed commands get reset to 0 RPM, if the `AcsController` is has changed its mode +- RW speed commands get reset to 0 RPM, if the `AcsController` has changed its mode to Safe - Antistiction for RWs will set commanded speed to 0 RPM, if a wheel is detected as not working From 0d7f5d5dcafdddc0269f8de189513da6b4cee8f3 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 11:32:23 +0100 Subject: [PATCH 24/47] prevent use of if_id of DHB for rw rtvals --- mission/acs/RwHandler.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/acs/RwHandler.h b/mission/acs/RwHandler.h index a8903b81..87689fe6 100644 --- a/mission/acs/RwHandler.h +++ b/mission/acs/RwHandler.h @@ -59,6 +59,7 @@ class RwHandler : public DeviceHandlerBase { LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; private: + static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER; //! [EXPORT] : [COMMENT] Action Message with invalid speed was received. Valid speeds must be in //! the range of [-65000; 1000] or [1000; 65000] static const ReturnValue_t INVALID_SPEED = MAKE_RETURN_CODE(0xA0); From 060217fbb4825cdf19a346ab131bbf89f35ff853 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 11:33:33 +0100 Subject: [PATCH 25/47] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57dc0902..33d9eeae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ will consitute of a breaking change warranting a new major release: - Removed parameter to disable antistiction, as deactivating it would result in the `AcsController` being allowed sending invalid speed commands to the RW Handler, which would then trigger FDIR and turning off the functioning device +- `RwHandler` returnvalues would use the `INTERFACE_ID` of the `DeviceHandlerBase` # [v7.5.5] 2024-01-22 From ec2b026103e14dd334c6d269f7cdf4f3afaa3a7b Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 12:50:58 +0100 Subject: [PATCH 26/47] fix? --- mission/controller/controllerdefinitions/AcsCtrlDefinitions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 78725755..7de3e36e 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -1,6 +1,7 @@ #ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ #define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ +#include #include #include From ba6eac505e97d3bd9e8bc1ebe415e9495b467cdf Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 27 Jan 2024 13:58:17 +0100 Subject: [PATCH 27/47] we prob need a state machine here --- mission/acs/defs.h | 6 +++-- mission/controller/AcsController.cpp | 36 ++++++++++++++++++++-------- mission/controller/AcsController.h | 3 +++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/mission/acs/defs.h b/mission/acs/defs.h index 3a62b51f..67fcf024 100644 --- a/mission/acs/defs.h +++ b/mission/acs/defs.h @@ -66,8 +66,10 @@ enum Source : uint8_t { static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; //! [EXPORT] : [COMMENT] The limits for the rotation in safe mode were violated. static constexpr Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM); -//! [EXPORT] : [COMMENT] The system has recovered from a safe rate rotation violation. -static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); +//! [EXPORT] : [COMMENT] The limits for the rotation in pointing mode were violated. +static constexpr Event PTG_RATE_VIOLATION = MAKE_EVENT(10, severity::MEDIUM); +//! [EXPORT] : [COMMENT] The system has recovered from a rate rotation violation. +static constexpr Event RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); //! [EXPORT] : [COMMENT] Multiple RWs are invalid, uncommandable and therefore higher ACS modes //! cannot be maintained. static constexpr Event MULTIPLE_RW_INVALID = MAKE_EVENT(2, severity::HIGH); diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 4980cbcd..9ed6b1c5 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -179,22 +179,38 @@ void AcsController::performAttitudeControl() { &susDataProcessed, &attitudeEstimationData, &acsParameters); if (not submode == acs::SafeSubmode::DETUMBLE) { - if (acsParameters.safeModeControllerParameters.useMekf) { - if (mgmDataProcessed.mgmVecTotDerivative.isValid() and - VectorOperations::norm(mgmDataProcessed.mgmVecTotDerivative.value, - 3) > // units do not agree + } + + switch (detumbleState) { + case DetumbleState::NO_DETUMBLE: + if (fusedRotRateData.rotRateTotal.isValid() and + VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) > acsParameters.detumbleParameter.omegaDetumbleStart) { detumbleCounter++; + } else if (detumbleCounter > 0) { + detumbleCounter -= 1; } - } else if (detumbleCounter > 0) { - detumbleCounter -= 1; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + if (mode == acs::AcsMode::SAFE) { + detumbleState = DetumbleState::DETUMBLE_FROM_SAFE; + break; + } + detumbleState = DetumbleState::DETUMBLE_FROM_PTG; + } + break; + case DetumbleState::DETUMBLE_FROM_PTG: + triggerEvent(acs::PTG_RATE_VIOLATION); + break; + case DetumbleState::DETUMBLE_FROM_SAFE: detumbleCounter = 0; // Triggers detumble mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); - startTransition(mode, acs::SafeSubmode::DETUMBLE); // this does not work - } + startTransition(mode, acs::SafeSubmode::DETUMBLE); + break; + case DetumbleState::IN_DETUMBLE: + break; + default: + sif::error << "AcsController: Invalid DetumbleState: " << detumbleState << std::endl; } if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index aa2b9411..2d832f4f 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -101,6 +101,9 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes enum class InternalState { STARTUP, INITIAL_DELAY, READY }; InternalState internalState = InternalState::STARTUP; + enum class DetumbleState { NO_DETUMBLE, DETUMBLE_FROM_SAFE, DETUMBLE_FROM_PTG, IN_DETUMBLE }; + DetumbleState detumbleState = DetumbleState::NO_DETUMBLE; + /** Device command IDs */ static const DeviceCommandId_t SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0x0; static const DeviceCommandId_t RESET_MEKF = 0x1; From c67f65369c6bdd75475d88faf6659bbaf79a93fb Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 09:32:01 +0100 Subject: [PATCH 28/47] acs ctrl state machine done --- mission/controller/AcsController.cpp | 117 +++++++++++++-------------- mission/controller/AcsController.h | 20 +++-- 2 files changed, 69 insertions(+), 68 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 9ed6b1c5..f6aac85b 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -178,41 +178,6 @@ void AcsController::performAttitudeControl() { result = navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, &attitudeEstimationData, &acsParameters); - if (not submode == acs::SafeSubmode::DETUMBLE) { - } - - switch (detumbleState) { - case DetumbleState::NO_DETUMBLE: - if (fusedRotRateData.rotRateTotal.isValid() and - VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else if (detumbleCounter > 0) { - detumbleCounter -= 1; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - if (mode == acs::AcsMode::SAFE) { - detumbleState = DetumbleState::DETUMBLE_FROM_SAFE; - break; - } - detumbleState = DetumbleState::DETUMBLE_FROM_PTG; - } - break; - case DetumbleState::DETUMBLE_FROM_PTG: - triggerEvent(acs::PTG_RATE_VIOLATION); - break; - case DetumbleState::DETUMBLE_FROM_SAFE: - detumbleCounter = 0; - // Triggers detumble mode transition in subsystem - triggerEvent(acs::SAFE_RATE_VIOLATION); - startTransition(mode, acs::SafeSubmode::DETUMBLE); - break; - case DetumbleState::IN_DETUMBLE: - break; - default: - sif::error << "AcsController: Invalid DetumbleState: " << detumbleState << std::endl; - } - if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and result != MultiplicativeKalmanFilter::MEKF_INITIALIZED) { if (not mekfInvalidFlag) { @@ -354,33 +319,6 @@ void AcsController::performDetumble() { actuatorCmd.cmdDipoleMtq(*acsParameters.magnetorquerParameter.inverseAlignment, acsParameters.magnetorquerParameter.dipoleMax, magMomMtq, cmdDipoleMtqs); - if (acsParameters.safeModeControllerParameters.useMekf) { - if (attitudeEstimationData.satRotRateMekf.isValid() and - VectorOperations::norm(attitudeEstimationData.satRotRateMekf.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } - } else if (acsParameters.safeModeControllerParameters.useGyr) { - if (gyrDataProcessed.gyrVecTot.isValid() and - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } - } else if (fusedRotRateData.rotRateTotal.isValid() and - VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else if (detumbleCounter > 0) { - detumbleCounter -= 1; - } - - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - detumbleCounter = 0; - // Triggers safe mode transition in subsystem - triggerEvent(acs::SAFE_RATE_RECOVERY); - startTransition(mode, acs::SafeSubmode::DEFAULT); - } - updateCtrlValData(safeCtrlStrat); updateActuatorCmdData(cmdDipoleMtqs); commandActuators(cmdDipoleMtqs[0], cmdDipoleMtqs[1], cmdDipoleMtqs[2], @@ -612,6 +550,61 @@ void AcsController::performPointingCtrl() { acsParameters.rwHandlingParameters.rampTime); } +void AcsController::handleDetumbling() { + switch (detumbleState) { + case DetumbleState::NO_DETUMBLE: + if (fusedRotRateData.rotRateTotal.isValid() and + VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else if (detumbleCounter > 0) { + detumbleCounter -= 1; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + if (mode == acs::AcsMode::SAFE) { + detumbleState = DetumbleState::DETUMBLE_FROM_SAFE; + break; + } + detumbleState = DetumbleState::DETUMBLE_FROM_PTG; + } + break; + case DetumbleState::DETUMBLE_FROM_PTG: + triggerEvent(acs::PTG_RATE_VIOLATION); + detumbleState = DetumbleState::PTG_TO_SAFE_TRANSITION; + break; + case DetumbleState::PTG_TO_SAFE_TRANSITION: + if (mode == acs::AcsMode::SAFE) { + detumbleState = DetumbleState::DETUMBLE_FROM_SAFE; + } + break; + case DetumbleState::DETUMBLE_FROM_SAFE: + detumbleCounter = 0; + // Triggers detumble mode transition in subsystem + triggerEvent(acs::SAFE_RATE_VIOLATION); + startTransition(mode, acs::SafeSubmode::DETUMBLE); + break; + case DetumbleState::IN_DETUMBLE: + if (fusedRotRateData.rotRateTotal.isValid() and + VectorOperations::norm(fusedRotRateData.rotRateTotal.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else if (detumbleCounter > 0) { + detumbleCounter -= 1; + } + + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + detumbleCounter = 0; + // Triggers safe mode transition in subsystem + triggerEvent(acs::RATE_RECOVERY); + startTransition(mode, acs::SafeSubmode::DEFAULT); + detumbleState = DetumbleState::NO_DETUMBLE; + } + break; + default: + sif::error << "AcsController: Invalid DetumbleState: " << detumbleState << std::endl; + } +} + void AcsController::safeCtrlFailure(uint8_t mgmFailure, uint8_t sensorFailure) { if (not safeCtrlFailureFlag) { triggerEvent(acs::SAFE_MODE_CONTROLLER_FAILURE, mgmFailure, sensorFailure); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 2d832f4f..2383c381 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -46,11 +46,6 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes uint16_t startAtIndex) override; protected: - void performAttitudeControl(); - void performSafe(); - void performDetumble(); - void performPointingCtrl(); - private: static constexpr int16_t ZERO_VEC3_INT16[3] = {0, 0, 0}; static constexpr double ZERO_VEC3[3] = {0, 0, 0}; @@ -101,7 +96,13 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes enum class InternalState { STARTUP, INITIAL_DELAY, READY }; InternalState internalState = InternalState::STARTUP; - enum class DetumbleState { NO_DETUMBLE, DETUMBLE_FROM_SAFE, DETUMBLE_FROM_PTG, IN_DETUMBLE }; + enum class DetumbleState { + NO_DETUMBLE, + DETUMBLE_FROM_PTG, + PTG_TO_SAFE_TRANSITION, + DETUMBLE_FROM_SAFE, + IN_DETUMBLE + }; DetumbleState detumbleState = DetumbleState::NO_DETUMBLE; /** Device command IDs */ @@ -137,6 +138,13 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes void modeChanged(Mode_t mode, Submode_t submode); void announceMode(bool recursive); + void performAttitudeControl(); + void performSafe(); + void performDetumble(); + void performPointingCtrl(); + + void handleDetumbling(); + void safeCtrlFailure(uint8_t mgmFailure, uint8_t sensorFailure); ReturnValue_t commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, From 3441365c65e13050794473a3ae182b5188f4c194 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 10:10:36 +0100 Subject: [PATCH 29/47] some fixes --- mission/controller/AcsController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f6aac85b..504a8587 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -195,6 +195,8 @@ void AcsController::performAttitudeControl() { mekfInvalidFlag = false; } + handleDetumbling(); + switch (mode) { case acs::SAFE: switch (submode) { @@ -582,6 +584,7 @@ void AcsController::handleDetumbling() { // Triggers detumble mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); startTransition(mode, acs::SafeSubmode::DETUMBLE); + detumbleState = DetumbleState::IN_DETUMBLE; break; case DetumbleState::IN_DETUMBLE: if (fusedRotRateData.rotRateTotal.isValid() and @@ -601,7 +604,7 @@ void AcsController::handleDetumbling() { } break; default: - sif::error << "AcsController: Invalid DetumbleState: " << detumbleState << std::endl; + sif::error << "AcsController: Invalid DetumbleState" << std::endl; } } From bec57f98c0e5cdea9e40d84332c4cc8747dc9725 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 10:10:59 +0100 Subject: [PATCH 30/47] handle fallback to safe in case of rate violation --- mission/system/EiveSystem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index cd450502..bb0f5e69 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -174,6 +174,7 @@ ReturnValue_t EiveSystem::initialize() { manager->subscribeToEvent(eventQueue->getId(), event::getEventId(pdec::INVALID_TC_FRAME)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(power::POWER_LEVEL_LOW)); manager->subscribeToEvent(eventQueue->getId(), event::getEventId(power::POWER_LEVEL_CRITICAL)); + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::PTG_RATE_VIOLATION)); return Subsystem::initialize(); } @@ -224,6 +225,16 @@ void EiveSystem::handleEventMessages() { } break; } + case acs::PTG_RATE_VIOLATION: { + CommandMessage msg; + HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HasHealthIF::FAULTY); + ReturnValue_t result = MessageQueueSenderIF::sendMessage( + strQueueId, &msg, MessageQueueIF::NO_QUEUE, false); + if (result != returnvalue::OK) { + sif::error << "EIVE System: Sending FAULTY command to STR Assembly failed" + << std::endl; + } + } } break; default: From 68b0e3b20adfbb790c0681fa61be93960cb6a7d6 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 10:25:23 +0100 Subject: [PATCH 31/47] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 825810a6..4c4736b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ will consitute of a breaking change warranting a new major release: ## Changed - Increased allowed mode transition time for PLOC SUPV. +- Detumbling can now be triggered from all modes of the `AcsController`. In case the + current mode is a higher pointing mode, the STR will be set to faulty, to trigger a + transition to safe first. Then, in a second step, a transition to detumble is triggered. # [v7.5.5] 2024-01-22 From 5ec173f8c9c13db5e3b5d78dd1e1b2d31ee2b8ae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 29 Jan 2024 10:38:29 +0100 Subject: [PATCH 32/47] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 825810a6..152283c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ will consitute of a breaking change warranting a new major release: - Increased allowed mode transition time for PLOC SUPV. +## Fixed + +- If the PCDU handler fails reading data from the IPC store, it will + not try to do a deserialization anymore. + # [v7.5.5] 2024-01-22 ## Fixed From f7c997980c01c51e46f4185983e3e4fdb0f2d620 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 11:08:47 +0100 Subject: [PATCH 33/47] this makes more sense --- mission/controller/AcsController.cpp | 10 +++++----- mission/controller/AcsController.h | 10 ---------- mission/controller/acs/Guidance.cpp | 10 +++++----- mission/controller/acs/Guidance.h | 7 ------- .../controllerdefinitions/AcsCtrlDefinitions.h | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 2310a99b..22eb7a41 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -450,7 +450,7 @@ void AcsController::performPointingCtrl() { bool allRwAvailable = true; double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; ReturnValue_t result = guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - if (result == Guidance::MULTIPLE_RW_UNAVAILABLE) { + if (result == acsctrl::MULTIPLE_RW_UNAVAILABLE) { if (multipleRwUnavailableCounter >= acsParameters.rwHandlingParameters.multipleRwInvalidTimeout) { triggerEvent(acs::MULTIPLE_RW_INVALID); @@ -460,7 +460,7 @@ void AcsController::performPointingCtrl() { return; } multipleRwUnavailableCounter = 0; - if (result == Guidance::SINGLE_RW_UNAVAILABLE) { + if (result == acsctrl::SINGLE_RW_UNAVAILABLE) { allRwAvailable = false; } @@ -1087,7 +1087,7 @@ ReturnValue_t AcsController::writeTleToFs(const uint8_t *tle) { tleFile << "\n"; tleFile.write(reinterpret_cast(tle + 69), 69); } else { - return WRITE_FILE_FAILED; + return acsctrl::WRITE_FILE_FAILED; } tleFile.close(); return returnvalue::OK; @@ -1111,12 +1111,12 @@ ReturnValue_t AcsController::readTleFromFs(uint8_t *line1, uint8_t *line2) { std::memcpy(line2, tleLine2.c_str(), 69); } else { triggerEvent(acs::TLE_FILE_READ_FAILED); - return READ_FILE_FAILED; + return acsctrl::READ_FILE_FAILED; } tleFile.close(); } else { triggerEvent(acs::TLE_FILE_READ_FAILED); - return READ_FILE_FAILED; + return acsctrl::READ_FILE_FAILED; } return returnvalue::OK; } diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index bb4e3c37..928926fb 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -108,16 +108,6 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes static const DeviceCommandId_t UPDATE_TLE = 0x3; static const DeviceCommandId_t READ_TLE = 0x4; - //! [EXPORT] : [COMMENT] File deletion failed and at least one file is still existent. - static constexpr ReturnValue_t FILE_DELETION_FAILED = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 0); - //! [EXPORT] : [COMMENT] Writing the TLE to the file has failed. - static constexpr ReturnValue_t WRITE_FILE_FAILED = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 1); - //! [EXPORT] : [COMMENT] Reading the TLE to the file has failed. - static constexpr ReturnValue_t READ_FILE_FAILED = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 2); - ReturnValue_t initialize() override; ReturnValue_t handleCommandMessage(CommandMessage* message) override; void performControlOperation() override; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 185158d5..3b5d325c 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -474,21 +474,21 @@ ReturnValue_t Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues, } else if (not rw1valid and rw2valid and rw3valid and rw4valid) { std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW1, 12 * sizeof(double)); - return SINGLE_RW_UNAVAILABLE; + return acsctrl::SINGLE_RW_UNAVAILABLE; } else if (rw1valid and not rw2valid and rw3valid and rw4valid) { std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW2, 12 * sizeof(double)); - return SINGLE_RW_UNAVAILABLE; + return acsctrl::SINGLE_RW_UNAVAILABLE; } else if (rw1valid and rw2valid and not rw3valid and rw4valid) { std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW3, 12 * sizeof(double)); - return SINGLE_RW_UNAVAILABLE; + return acsctrl::SINGLE_RW_UNAVAILABLE; } else if (rw1valid and rw2valid and rw3valid and not rw4valid) { std::memcpy(rwPseudoInv, acsParameters->rwMatrices.pseudoInverseWithoutRW4, 12 * sizeof(double)); - return SINGLE_RW_UNAVAILABLE; + return acsctrl::SINGLE_RW_UNAVAILABLE; } - return MULTIPLE_RW_UNAVAILABLE; + return acsctrl::MULTIPLE_RW_UNAVAILABLE; } void Guidance::resetValues() { std::memcpy(quatIXprev, ZERO_VEC4, sizeof(quatIXprev)); } diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index f6319c7b..bdf6d7fb 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -65,13 +65,6 @@ class Guidance { // reation wheel maybe can be done in "commanding.h" ReturnValue_t getDistributionMatrixRw(ACS::SensorValues *sensorValues, double *rwPseudoInv); - //! [EXPORT] : [COMMENT] A single RW has failed. - static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 3); - //! [EXPORT] : [COMMENT] Multiple RWs have failed. - static constexpr ReturnValue_t MULTIPLE_RW_UNAVAILABLE = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 4); - private: const AcsParameters *acsParameters; diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 7de3e36e..a9e527f4 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -10,6 +10,20 @@ namespace acsctrl { static const uint8_t IF_ACS_CTRL_ID = CLASS_ID::ACS_CTRL; +//! [EXPORT] : [COMMENT] File deletion failed and at least one file is still existent. +static constexpr ReturnValue_t FILE_DELETION_FAILED = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 0); +//! [EXPORT] : [COMMENT] Writing the TLE to the file has failed. +static constexpr ReturnValue_t WRITE_FILE_FAILED = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 1); +//! [EXPORT] : [COMMENT] Reading the TLE to the file has failed. +static constexpr ReturnValue_t READ_FILE_FAILED = returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 2); +//! [EXPORT] : [COMMENT] A single RW has failed. +static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 3); +//! [EXPORT] : [COMMENT] Multiple RWs have failed. +static constexpr ReturnValue_t MULTIPLE_RW_UNAVAILABLE = + returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 4); enum SetIds : uint32_t { MGM_SENSOR_DATA, From 64d105cf876ee93c839bba7c692bfa8373d58b17 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 11:11:47 +0100 Subject: [PATCH 34/47] fix --- mission/controller/acs/Guidance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 3b5d325c..12957ab2 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -424,7 +424,7 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // Convert target rotational rate into body RF double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0}; QuaternionOperations::inverse(errorQuat, errorQuatInv); - QuaternionOperations::multiplyVector(errorQuat, targetSatRotRate, targetSatRotRateB); + QuaternionOperations::multiplyVector(errorQuatInv, targetSatRotRate, targetSatRotRateB); // Combine the target and reference satellite rotational rates double combinedRefSatRotRate[3] = {0, 0, 0}; VectorOperations::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3); From 96b74574b0acf6eecaa6b05ff97b18bb26941adf Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 11:12:40 +0100 Subject: [PATCH 35/47] forgot that one --- mission/controller/AcsController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 22eb7a41..41a16919 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -49,7 +49,7 @@ ReturnValue_t AcsController::executeAction(ActionId_t actionId, MessageQueueId_t case SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL: { ReturnValue_t result = guidance.solarArrayDeploymentComplete(); if (result == returnvalue::FAILED) { - return FILE_DELETION_FAILED; + return acsctrl::FILE_DELETION_FAILED; } return HasActionsIF::EXECUTION_FINISHED; } From 8390a0269033ba98ff0dba2e89c722d04db48b46 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 14:15:16 +0100 Subject: [PATCH 36/47] changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8293fdf6..321e5a58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +- Bumped `eive-tmtc` to +- Bumped `eive-fsfw` + ## Added - Added new parameter for MPSoC which allows to skip SUPV commanding. @@ -29,6 +32,13 @@ will consitute of a breaking change warranting a new major release: - If the PCDU handler fails reading data from the IPC store, it will not try to do a deserialization anymore. - All action commands sent by the PLOC SUPV to itself will have no sender now. +- The `AcsController` will reset its stored guidance values on mode change and lost + orientation. +- The nullspace controller will only be used if all RWs are available. +- Calculation of required rotation rate in pointing modes has been fixed to actual + calculation of rotation rate from two quaternions. +- Fixed alignment matrix and pseudo inverses of RWs, to match the wrong definition of + positive rotation. # [v7.5.5] 2024-01-22 From e3ad08d987d35dc901a0a05c7acdbe0455af8c1f Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 14:21:43 +0100 Subject: [PATCH 37/47] bumped fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 5879eb7f..b5e7179a 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5879eb7f7b83205c64980580c16d3aa78d6ea073 +Subproject commit b5e7179af1da085b9be598b4897f2664012781af From e301b19aba5de836d8026f19434d39cc9dd8d78d Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 17:08:12 +0100 Subject: [PATCH 38/47] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e178ee01..ec91b607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.6.0] 2024-01-29 + - Bumped `eive-tmtc` to - Bumped `eive-fsfw` From 8b91c91a7a0707bc796d075293c47449780cae0f Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 17:08:51 +0100 Subject: [PATCH 39/47] bump version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b8eb93e..8957c6bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) -set(OBSW_VERSION_MINOR 5) -set(OBSW_VERSION_REVISION 5) +set(OBSW_VERSION_MINOR 6) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From da5890f99a19e7af43002644750b66aaf662e431 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 29 Jan 2024 17:13:46 +0100 Subject: [PATCH 40/47] gens --- .../fsfwconfig/events/translateEvents.cpp | 11 +++++++---- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 3 ++- generators/bsp_hosted_returnvalues.csv | 17 ++++++++--------- generators/bsp_q7s_events.csv | 3 ++- generators/bsp_q7s_returnvalues.csv | 17 ++++++++--------- generators/events/translateEvents.cpp | 11 +++++++---- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 11 +++++++---- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 10 files changed, 44 insertions(+), 35 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index d5b3de46..7ccb09b0 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 318 translations. + * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateEvents.h" @@ -94,7 +94,7 @@ const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; -const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; +const char *RATE_RECOVERY_STRING = "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"; @@ -103,6 +103,7 @@ const char *PTG_CTRL_NO_ATTITUDE_INFORMATION_STRING = "PTG_CTRL_NO_ATTITUDE_INFO const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *TLE_TOO_OLD_STRING = "TLE_TOO_OLD"; const char *TLE_FILE_READ_FAILED_STRING = "TLE_FILE_READ_FAILED"; +const char *PTG_RATE_VIOLATION_STRING = "PTG_RATE_VIOLATION"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -505,7 +506,7 @@ const char *translateEvents(Event event) { case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): - return SAFE_RATE_RECOVERY_STRING; + return RATE_RECOVERY_STRING; case (11202): return MULTIPLE_RW_INVALID_STRING; case (11203): @@ -522,6 +523,8 @@ const char *translateEvents(Event event) { return TLE_TOO_OLD_STRING; case (11209): return TLE_FILE_READ_FAILED_STRING; + case (11210): + return PTG_RATE_VIOLATION_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index ac61a526..f0e7bbcc 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 175 translations. - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 97eeaf37..e02f0638 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -88,7 +88,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h 10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h 11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h -11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h +11201;0x2bc1;RATE_RECOVERY;MEDIUM;The system has recovered from a rate rotation violation.;mission/acs/defs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h 11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h 11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h @@ -97,6 +97,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h 11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h 11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h +11210;0x2bca;PTG_RATE_VIOLATION;MEDIUM;The limits for the rotation in pointing mode were violated.;mission/acs/defs.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/power/defs.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/power/defs.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 8ef110db..7838f868 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -454,6 +454,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h 0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h 0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x53a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/acs/RwHandler.h +0x53a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/acs/RwHandler.h +0x53a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/acs/RwHandler.h +0x53a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/acs/RwHandler.h +0x53a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/acs/RwHandler.h +0x53a5;RWHA_ValueNotRead;No description;165;RW_HANDLER;mission/acs/RwHandler.h 0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h 0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h 0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h @@ -487,12 +493,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x54b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x54b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x54b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x59a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h -0x59a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h -0x59a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h -0x59a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h -0x59a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h -0x59a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h +0x59a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h +0x59a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h 0x5e00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5e01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h 0x5e02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h @@ -509,9 +511,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h -0x6a01;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;1;ACS_CTRL;mission/controller/AcsController.h -0x6a02;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;2;ACS_CTRL;mission/controller/AcsController.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 97eeaf37..e02f0638 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -88,7 +88,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h 10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h 11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h -11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h +11201;0x2bc1;RATE_RECOVERY;MEDIUM;The system has recovered from a rate rotation violation.;mission/acs/defs.h 11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h 11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h 11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h @@ -97,6 +97,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h 11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h 11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h +11210;0x2bca;PTG_RATE_VIOLATION;MEDIUM;The limits for the rotation in pointing mode were violated.;mission/acs/defs.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/power/defs.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/power/defs.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 76184dce..f14ea256 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -454,6 +454,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h 0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h 0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h +0x53a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/acs/RwHandler.h +0x53a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/acs/RwHandler.h +0x53a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/acs/RwHandler.h +0x53a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/acs/RwHandler.h +0x53a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/acs/RwHandler.h +0x53a5;RWHA_ValueNotRead;No description;165;RW_HANDLER;mission/acs/RwHandler.h 0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h 0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h 0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h @@ -499,12 +505,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x58a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x58a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x58a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h -0x59a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h -0x59a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h -0x59a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h -0x59a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h -0x59a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h -0x59a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h +0x59a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h +0x59a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h 0x5aa0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h 0x5ba0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h 0x5d01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h @@ -593,9 +595,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h -0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h -0x6a01;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;1;ACS_CTRL;mission/controller/AcsController.h -0x6a02;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;2;ACS_CTRL;mission/controller/AcsController.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index d5b3de46..7ccb09b0 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 318 translations. + * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateEvents.h" @@ -94,7 +94,7 @@ const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; -const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; +const char *RATE_RECOVERY_STRING = "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"; @@ -103,6 +103,7 @@ const char *PTG_CTRL_NO_ATTITUDE_INFORMATION_STRING = "PTG_CTRL_NO_ATTITUDE_INFO const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *TLE_TOO_OLD_STRING = "TLE_TOO_OLD"; const char *TLE_FILE_READ_FAILED_STRING = "TLE_FILE_READ_FAILED"; +const char *PTG_RATE_VIOLATION_STRING = "PTG_RATE_VIOLATION"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -505,7 +506,7 @@ const char *translateEvents(Event event) { case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): - return SAFE_RATE_RECOVERY_STRING; + return RATE_RECOVERY_STRING; case (11202): return MULTIPLE_RW_INVALID_STRING; case (11203): @@ -522,6 +523,8 @@ const char *translateEvents(Event event) { return TLE_TOO_OLD_STRING; case (11209): return TLE_FILE_READ_FAILED_STRING; + case (11210): + return PTG_RATE_VIOLATION_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 30696975..9ba7f448 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 179 translations. - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index d5b3de46..7ccb09b0 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 318 translations. + * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateEvents.h" @@ -94,7 +94,7 @@ const char *FILESTORE_ERROR_STRING = "FILESTORE_ERROR"; const char *FILENAME_TOO_LARGE_ERROR_STRING = "FILENAME_TOO_LARGE_ERROR"; const char *HANDLING_CFDP_REQUEST_FAILED_STRING = "HANDLING_CFDP_REQUEST_FAILED"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; -const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; +const char *RATE_RECOVERY_STRING = "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"; @@ -103,6 +103,7 @@ const char *PTG_CTRL_NO_ATTITUDE_INFORMATION_STRING = "PTG_CTRL_NO_ATTITUDE_INFO const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE"; const char *TLE_TOO_OLD_STRING = "TLE_TOO_OLD"; const char *TLE_FILE_READ_FAILED_STRING = "TLE_FILE_READ_FAILED"; +const char *PTG_RATE_VIOLATION_STRING = "PTG_RATE_VIOLATION"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -505,7 +506,7 @@ const char *translateEvents(Event event) { case (11200): return SAFE_RATE_VIOLATION_STRING; case (11201): - return SAFE_RATE_RECOVERY_STRING; + return RATE_RECOVERY_STRING; case (11202): return MULTIPLE_RW_INVALID_STRING; case (11203): @@ -522,6 +523,8 @@ const char *translateEvents(Event event) { return TLE_TOO_OLD_STRING; case (11209): return TLE_FILE_READ_FAILED_STRING; + case (11210): + return PTG_RATE_VIOLATION_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 30696975..9ba7f448 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 179 translations. - * Generated on: 2023-12-13 11:29:45 + * Generated on: 2024-01-29 17:12:14 */ #include "translateObjects.h" From 07e4a6bc5a0583302d52d60fd004c04af11a6b94 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:07:04 +0100 Subject: [PATCH 41/47] make rtvals readable for generators (not sure why the other way did not work) --- .../controllerdefinitions/AcsCtrlDefinitions.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index a9e527f4..0f21548e 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -9,21 +9,17 @@ namespace acsctrl { -static const uint8_t IF_ACS_CTRL_ID = CLASS_ID::ACS_CTRL; +static const uint8_t INTERFACE_ID = CLASS_ID::ACS_CTRL; //! [EXPORT] : [COMMENT] File deletion failed and at least one file is still existent. -static constexpr ReturnValue_t FILE_DELETION_FAILED = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 0); +static constexpr ReturnValue_t FILE_DELETION_FAILED = MAKE_RETURN_CODE(0xA0); //! [EXPORT] : [COMMENT] Writing the TLE to the file has failed. -static constexpr ReturnValue_t WRITE_FILE_FAILED = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 1); +static constexpr ReturnValue_t WRITE_FILE_FAILED = MAKE_RETURN_CODE(0xA1); //! [EXPORT] : [COMMENT] Reading the TLE to the file has failed. -static constexpr ReturnValue_t READ_FILE_FAILED = returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 2); +static constexpr ReturnValue_t MAKE_RETURN_CODE = MAKE_RETURN_CODE(0xA2); //! [EXPORT] : [COMMENT] A single RW has failed. -static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 3); +static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = MAKE_RETURN_CODE(0xA3); //! [EXPORT] : [COMMENT] Multiple RWs have failed. -static constexpr ReturnValue_t MULTIPLE_RW_UNAVAILABLE = - returnvalue::makeCode(acsctrl::IF_ACS_CTRL_ID, 4); +static constexpr ReturnValue_t MULTIPLE_RW_UNAVAILABLE = MAKE_RETURN_CODE(0xA4); enum SetIds : uint32_t { MGM_SENSOR_DATA, From ef4d3066e97f9e102454bf59ec6bc0d9aa418414 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:07:27 +0100 Subject: [PATCH 42/47] gens --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 5 +++++ generators/bsp_q7s_returnvalues.csv | 5 +++++ generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 8 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 7ccb09b0..e47fff0f 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 319 translations. * @details - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index f0e7bbcc..766ee3fa 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 175 translations. - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 7838f868..c7c20d0b 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -511,6 +511,11 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h +0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa2;ACSCTRL_MakeReturnCode;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index f14ea256..666dd130 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -595,6 +595,11 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h +0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa2;ACSCTRL_MakeReturnCode;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 7ccb09b0..e47fff0f 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 9ba7f448..08ad0eaa 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 179 translations. - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 7ccb09b0..e47fff0f 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 9ba7f448..08ad0eaa 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 179 translations. - * Generated on: 2024-01-29 17:12:14 + * Generated on: 2024-01-30 09:05:49 */ #include "translateObjects.h" From e3f7cda69a9ef6b1491b6505055dd6a2adb53ae1 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:09:35 +0100 Subject: [PATCH 43/47] whoops --- mission/controller/controllerdefinitions/AcsCtrlDefinitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 0f21548e..c830ffac 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -15,7 +15,7 @@ static constexpr ReturnValue_t FILE_DELETION_FAILED = MAKE_RETURN_CODE(0xA0); //! [EXPORT] : [COMMENT] Writing the TLE to the file has failed. static constexpr ReturnValue_t WRITE_FILE_FAILED = MAKE_RETURN_CODE(0xA1); //! [EXPORT] : [COMMENT] Reading the TLE to the file has failed. -static constexpr ReturnValue_t MAKE_RETURN_CODE = MAKE_RETURN_CODE(0xA2); +static constexpr ReturnValue_t READ_FILE_FAILED = MAKE_RETURN_CODE(0xA2); //! [EXPORT] : [COMMENT] A single RW has failed. static constexpr ReturnValue_t SINGLE_RW_UNAVAILABLE = MAKE_RETURN_CODE(0xA3); //! [EXPORT] : [COMMENT] Multiple RWs have failed. From 7dc69d3473150688ea69e83b62fce1ea6617a593 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:10:30 +0100 Subject: [PATCH 44/47] gens --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 2 +- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 2 +- generators/bsp_q7s_returnvalues.csv | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index e47fff0f..c1174d8a 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 319 translations. * @details - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 766ee3fa..9de30a3c 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 175 translations. - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index c7c20d0b..52acf3dd 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -513,7 +513,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h -0x6aa2;ACSCTRL_MakeReturnCode;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa2;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 666dd130..72d47797 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -597,7 +597,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h -0x6aa2;ACSCTRL_MakeReturnCode;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +0x6aa2;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index e47fff0f..c1174d8a 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 08ad0eaa..7ab40047 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 179 translations. - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index e47fff0f..c1174d8a 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 319 translations. * @details - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 08ad0eaa..7ab40047 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 179 translations. - * Generated on: 2024-01-30 09:05:49 + * Generated on: 2024-01-30 09:10:05 */ #include "translateObjects.h" From 3cfde3071c4de6b8747f005caef81efd6d0ce42c Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:27:44 +0100 Subject: [PATCH 45/47] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index bcdd12ca..d33013ed 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit bcdd12caf05b6a874b0d3ac2b9436c4061545312 +Subproject commit d33013ed58131a69d09145af4f3c7a71766cebd3 From 0d80e2a8ecb095c91a0639da9cc8d2b1c14abbd5 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:27:53 +0100 Subject: [PATCH 46/47] changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec91b607..21792d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,9 +16,9 @@ will consitute of a breaking change warranting a new major release: # [unreleased] -# [v7.6.0] 2024-01-29 +# [v7.6.0] 2024-01-30 -- Bumped `eive-tmtc` to +- Bumped `eive-tmtc` to v5.13.0 - Bumped `eive-fsfw` ## Added From 467ab39ad9c522145b93d9b28dbac61663b8dba5 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 30 Jan 2024 09:28:46 +0100 Subject: [PATCH 47/47] frmt --- linux/payload/FreshSupvHandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/payload/FreshSupvHandler.cpp b/linux/payload/FreshSupvHandler.cpp index 88a68635..a51934d6 100644 --- a/linux/payload/FreshSupvHandler.cpp +++ b/linux/payload/FreshSupvHandler.cpp @@ -1115,7 +1115,8 @@ void FreshSupvHandler::handleEvent(EventMessage* eventMessage) { if (not isCommandAlreadyActive(supv::SHUTDOWN_MPSOC)) { CommandMessage actionMsg; ActionMessage::setCommand(&actionMsg, supv::SHUTDOWN_MPSOC, store_address_t::invalid()); - result = messageQueue->sendMessageFrom(getCommandQueue(), &actionMsg, MessageQueueIF::NO_QUEUE); + result = messageQueue->sendMessageFrom(getCommandQueue(), &actionMsg, + MessageQueueIF::NO_QUEUE); if (result != returnvalue::OK) { triggerEvent(supv::SUPV_MPSOC_SHUTDOWN_BUILD_FAILED); sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "