From 7ab8fb8cb9f29b2e971a99adae5fe67ba5051ce8 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 15 Aug 2023 09:37:54 +0200 Subject: [PATCH 1/2] added parameter to disable usage of mgm4 --- mission/controller/acs/AcsParameters.cpp | 3 +++ mission/controller/acs/AcsParameters.h | 1 + mission/controller/acs/SensorProcessing.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 2c97fa99..7b867a46 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -113,6 +113,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0x13: parameterWrapper->set(mgmHandlingParameters.mgmDerivativeFilterWeight); break; + case 0x14: + parameterWrapper->set(mgmHandlingParameters.useMgm4); + break; default: return INVALID_IDENTIFIER_ID; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index ae33ac43..0fb1daa9 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -80,6 +80,7 @@ class AcsParameters : public HasParametersIF { float mgm4variance[3] = {pow(1.7e-6, 2), pow(1.7e-6, 2), pow(1.7e-6, 2)}; float mgmVectorFilterWeight = 0.85; float mgmDerivativeFilterWeight = 0.85; + uint8_t useMgm4 = false; } mgmHandlingParameters; struct SusHandlingParameters { diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index a683aada..686a2fcf 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -101,7 +101,7 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const sensorFusionDenominator[i] += 1 / mgmParameters->mgm13variance[i]; } } - if (mgm4valid) { + if (mgm4valid and mgmParameters->useMgm4) { float mgm4ValueUT[3]; VectorOperations::mulScalar(mgm4Value, 1e-3, mgm4ValueUT, 3); // nT to uT MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueUT, From 196781ed4aeff86bfadb1d1193b87d827fd1af1f Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 15 Aug 2023 09:39:59 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d1b480..033ec315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ will consitute of a breaking change warranting a new major release: return the actual GPS data will be ignored once SPG4 is running. However, by setting the according parameter, the ACS Controller can be directed to ignore the SGP4 solution. - Skyview dataset for more GPS TM has been added +- Parameter to disable usage of MGM4, which is part of the MTQ and therefore cannot be + disabled without disabling the MTQ itself. ## Fixed