From eb66d7585c68068848bf626ae987bada1cb7adb2 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Mar 2023 10:01:08 +0100 Subject: [PATCH 1/3] fixed ptgCtrl after acs submode to mode changes --- 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 8d1bd369..b4e7c5d3 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -304,7 +304,7 @@ void AcsController::performPointingCtrl() { // Variables required for setting actuators double torquePtgRws[4] = {0, 0, 0, 0}, rwTrqNs[4] = {0, 0, 0, 0}, torqueRws[4] = {0, 0, 0, 0}, mgtDpDes[3] = {0, 0, 0}; - switch (submode) { + switch (mode) { case acs::PTG_IDLE: guidance.targetQuatPtgSun(susDataProcessed.sunIjkModel.value, targetQuat, targetSatRotRate); guidance.comparePtg(mekfData.quatMekf.value, mekfData.satRotRateMekf.value, targetQuat, @@ -416,6 +416,9 @@ void AcsController::performPointingCtrl() { &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; break; + default: + sif::error << "AcsController: Invalid mode for performPointingCtrl"; + break; } actuatorCmd.cmdSpeedToRws( -- 2.43.0 From b1fa3fd01636210a38f54feef44dcf9feebe2d26 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Mar 2023 10:03:40 +0100 Subject: [PATCH 2/3] fixed max speed limitation done before calculation to right unit scale --- mission/controller/acs/ActuatorCmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index f32ce241..457cacce 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -42,14 +42,14 @@ void ActuatorCmd::cmdSpeedToRws(int32_t speedRw0, int32_t speedRw1, int32_t spee deltaSpeedInt[i] = std::round(deltaSpeed[i]); } VectorOperations::add(speedRws, deltaSpeedInt, rwCmdSpeed, 4); + VectorOperations::mulScalar(rwCmdSpeed, 10, rwCmdSpeed, 4); for (uint8_t i = 0; i < 4; i++) { if (rwCmdSpeed[i] > maxRwSpeed) { rwCmdSpeed[i] = maxRwSpeed; } else if (rwCmdSpeed[i] < -maxRwSpeed) { rwCmdSpeed[i] = -maxRwSpeed; } - } - VectorOperations::mulScalar(rwCmdSpeed, 10, rwCmdSpeed, 4); + } } void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator, -- 2.43.0 From f71fe274f4e81febf670e171cf658825b670d357 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Mar 2023 10:05:54 +0100 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d8cf6a..dd1f57a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Pointing control of the `AcsController` was still expecting submodes instead of modes. +- Limitation of RW speeds was done before converting them to the correct unit scale. + # [v1.37.0] 2023-03-11 eive-tmtc: v2.18.1 -- 2.43.0