From 46c125d9fe7e87f24a2dccfb20fdb183687e44c7 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 20 Mar 2024 16:18:03 +0100 Subject: [PATCH] rot rate limit change --- mission/controller/acs/AcsParameters.cpp | 3 +++ mission/controller/acs/AcsParameters.h | 1 + mission/controller/acs/Guidance.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 3a7aa726..a9f806ec 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -554,6 +554,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0xE: parameterWrapper->set(gsTargetModeControllerParameters.altitudeTgt); break; + case 0xF: + parameterWrapper->set(gsTargetModeControllerParameters.rotRateLimit); + break; default: return INVALID_IDENTIFIER_ID; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 965878e7..c80627ea 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -898,6 +898,7 @@ class AcsParameters : public HasParametersIF { double latitudeTgt = 48.7495 * DEG2RAD; // [rad] Latitude double longitudeTgt = 9.10384 * DEG2RAD; // [rad] Longitude double altitudeTgt = 500; // [m] + double rotRateLimit = .5 * DEG2RAD; } gsTargetModeControllerParameters; struct NadirModeControllerParameters : PointingLawParameters { diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index a6559db3..2c1b3c63 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -251,7 +251,7 @@ void Guidance::limitReferenceRotation(const double xAxisIX[3], double quatIX[4]) QuaternionOperations::inverse(quatIXprev, quatXprevI); QuaternionOperations::multiply(quatIX, quatXprevI, quatXprevX); QuaternionOperations::normalize(quatXprevX); - double phiMax = acsParameters->gsTargetModeControllerParameters.omMax * + double phiMax = acsParameters->gsTargetModeControllerParameters.rotRateLimit * acsParameters->onBoardParams.sampleTime; if (2 * std::acos(quatXprevX[3]) < phiMax) { return;