From 7e25f5012e81930d94a69ada71f324bc449b316c Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 26 Jan 2023 17:09:34 +0100 Subject: [PATCH 1/9] transformation before calibration --- mission/controller/acs/SensorProcessing.cpp | 67 +++++++++++---------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index ac2e5752..a8fd1576 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -47,71 +47,72 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const float mgm0ValueNoBias[3] = {0, 0, 0}, mgm1ValueNoBias[3] = {0, 0, 0}, mgm2ValueNoBias[3] = {0, 0, 0}, mgm3ValueNoBias[3] = {0, 0, 0}, mgm4ValueNoBias[3] = {0, 0, 0}; - float mgm0ValueCalib[3] = {0, 0, 0}, mgm1ValueCalib[3] = {0, 0, 0}, mgm2ValueCalib[3] = {0, 0, 0}, - mgm3ValueCalib[3] = {0, 0, 0}, mgm4ValueCalib[3] = {0, 0, 0}; float mgm0ValueBody[3] = {0, 0, 0}, mgm1ValueBody[3] = {0, 0, 0}, mgm2ValueBody[3] = {0, 0, 0}, mgm3ValueBody[3] = {0, 0, 0}, mgm4ValueBody[3] = {0, 0, 0}; + float mgm0ValueCalib[3] = {0, 0, 0}, mgm1ValueCalib[3] = {0, 0, 0}, mgm2ValueCalib[3] = {0, 0, 0}, + mgm3ValueCalib[3] = {0, 0, 0}, mgm4ValueCalib[3] = {0, 0, 0}; float sensorFusionNumerator[3] = {0, 0, 0}, sensorFusionDenominator[3] = {0, 0, 0}; if (mgm0valid) { - VectorOperations::subtract(mgm0Value, mgmParameters->mgm0hardIronOffset, mgm0ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm0orientationMatrix[0], mgm0Value, + mgm0ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm0ValueBody, mgmParameters->mgm0hardIronOffset, + mgm0ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm0softIronInverse[0], mgm0ValueNoBias, mgm0ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm0orientationMatrix[0], mgm0ValueCalib, - mgm0ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm0ValueBody[i] / mgmParameters->mgm02variance[i]; + sensorFusionNumerator[i] += mgm0ValueCalib[i] / mgmParameters->mgm02variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm02variance[i]; } } if (mgm1valid) { - VectorOperations::subtract(mgm1Value, mgmParameters->mgm1hardIronOffset, mgm1ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm1orientationMatrix[0], mgm1Value, + mgm1ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm1ValueBody, mgmParameters->mgm1hardIronOffset, + mgm1ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm1softIronInverse[0], mgm1ValueNoBias, mgm1ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm1orientationMatrix[0], mgm1ValueCalib, - mgm1ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm1ValueBody[i] / mgmParameters->mgm13variance[i]; + sensorFusionNumerator[i] += mgm1ValueCalib[i] / mgmParameters->mgm13variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm13variance[i]; } } if (mgm2valid) { - VectorOperations::subtract(mgm2Value, mgmParameters->mgm2hardIronOffset, mgm2ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm2orientationMatrix[0], mgm2Value, + mgm2ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm2ValueBody, mgmParameters->mgm2hardIronOffset, + mgm2ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm2softIronInverse[0], mgm2ValueNoBias, mgm2ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm2orientationMatrix[0], mgm2ValueCalib, - mgm2ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm2ValueBody[i] / mgmParameters->mgm02variance[i]; + sensorFusionNumerator[i] += mgm2ValueCalib[i] / mgmParameters->mgm02variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm02variance[i]; } } if (mgm3valid) { - VectorOperations::subtract(mgm3Value, mgmParameters->mgm3hardIronOffset, mgm3ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm3orientationMatrix[0], mgm3Value, + mgm3ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm3ValueBody, mgmParameters->mgm3hardIronOffset, + mgm3ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm3softIronInverse[0], mgm3ValueNoBias, mgm3ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm3orientationMatrix[0], mgm3ValueCalib, - mgm3ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm3ValueBody[i] / mgmParameters->mgm13variance[i]; + sensorFusionNumerator[i] += mgm3ValueCalib[i] / mgmParameters->mgm13variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm13variance[i]; } } if (mgm4valid) { - float mgm4ValueNT[3]; - VectorOperations::mulScalar(mgm4Value, 1e-3, mgm4ValueNT, 3); // uT to nT - VectorOperations::subtract(mgm4ValueNT, mgmParameters->mgm4hardIronOffset, + float mgm4ValueUT[3]; + VectorOperations::mulScalar(mgm4Value, 1e-3, mgm4ValueUT, 3); // nT to uT + MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueUT, + mgm4ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm4ValueBody, mgmParameters->mgm4hardIronOffset, mgm4ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm4softIronInverse[0], mgm4ValueNoBias, mgm4ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueCalib, - mgm4ValueBody, 3, 3, 1); + for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm4ValueBody[i] / mgmParameters->mgm4variance[i]; + sensorFusionNumerator[i] += mgm4ValueCalib[i] / mgmParameters->mgm4variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm4variance[i]; } } @@ -148,15 +149,15 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const { PoolReadGuard pg(mgmDataProcessed); if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataProcessed->mgm0vec.value, mgm0ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm0vec.value, mgm0ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm0vec.setValid(mgm0valid); - std::memcpy(mgmDataProcessed->mgm1vec.value, mgm1ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm1vec.value, mgm1ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm1vec.setValid(mgm1valid); - std::memcpy(mgmDataProcessed->mgm2vec.value, mgm2ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm2vec.value, mgm2ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm2vec.setValid(mgm2valid); - std::memcpy(mgmDataProcessed->mgm3vec.value, mgm3ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm3vec.value, mgm3ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm3vec.setValid(mgm3valid); - std::memcpy(mgmDataProcessed->mgm4vec.value, mgm4ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm4vec.value, mgm4ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm4vec.setValid(mgm4valid); std::memcpy(mgmDataProcessed->mgmVecTot.value, mgmVecTot, 3 * sizeof(double)); mgmDataProcessed->mgmVecTot.setValid(true); -- 2.43.0 From 03ec64672bfbaf6da0b7d517088f1518038a19a4 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 26 Jan 2023 17:15:04 +0100 Subject: [PATCH 2/9] also fixed validity flag --- mission/controller/acs/SensorProcessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index a8fd1576..5b4ddc84 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -129,6 +129,7 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const for (uint8_t i = 0; i < 3; i++) { mgmVecTotDerivative[i] = (mgmVecTot[i] - savedMgmVecTot[i]) / timeDiff; savedMgmVecTot[i] = mgmVecTot[i]; + mgmVecTotDerivativeValid = true; } } timeOfSavedMagFieldEst = timeOfMgmMeasurement; -- 2.43.0 From 24d2405fc8f6841db776f2f1e7315ce60a497f24 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 27 Jan 2023 11:18:55 +0100 Subject: [PATCH 3/9] added calibration matrices for testing --- mission/controller/acs/AcsParameters.h | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index a62b373d..2fd5ab27 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,23 +37,27 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {0.0, 0.0, 0.0};//{19.89364, -29.94111, -31.07508}; - float mgm1hardIronOffset[3] = {0.0, 0.0, 0.0};//{10.95500, -8.053403, -33.36383}; - float mgm2hardIronOffset[3] = {0.0, 0.0, 0.0};//{15.72181, -26.87090, -62.19010}; - float mgm3hardIronOffset[3] = {0.0, 0.0, 0.0}; - float mgm4hardIronOffset[3] = {0.0, 0.0, 0.0}; + float mgm0hardIronOffset[3] = {-3.009521e1, 1.600983e1, -3.025359e1}; + float mgm1hardIronOffset[3] = {-3.255443e1, 1.118625e1, -8.400313e0}; + float mgm2hardIronOffset[3] = {-6.194874e1, 1.561503e1, -2.911635e1}; + float mgm3hardIronOffset[3] = {-3.986654e1, 1.413371e1, -9.778686e0}; + float mgm4hardIronOffset[3] = {-3.046779e1, 1.690829e1, -6.597055e0}; - float mgm0softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{1420.727e-3, 9.352825e-3, -127.1979e-3}, - {9.352825e-3, 1031.965e-3, -80.02734e-3}, - {-127.1979e-3, -80.02734e-3, 934.8899e-3}};*/ - float mgm1softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{126.7325e-2, -4.146410e-2, -18.37963e-2}, - {-4.146410e-2, 109.3310e-2, -5.246314e-2}, - {-18.37963e-2, -5.246314e-2, 105.7300e-2}};*/ - float mgm2softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{143.0438e-2, 7.095763e-2, 15.67482e-2}, - {7.095763e-2, 99.65167e-2, -6.958760e-2}, - {15.67482e-2, -6.958760e-2, 94.50124e-2}};*/ - float mgm3softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; - float mgm4softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + float mgm0softIronInverse[3][3] = {{9.385532e-1, -1.261877e-1, -8.086912e-2}, + {-1.261877e-1, 1.415967e0, -6.953750e-3}, + {-8.086912e-2, -6.953750e-3, 1.014963e0}}; + float mgm1softIronInverse[3][3] = {{1.054248e0, -1.867005e-1, -4.884622e-2}, + {-1.867005e-1, 1.272026e0, -4.212676e-2}, + {-4.884622e-2, -4.212676e-2, 1.091061e0}}; + float mgm2softIronInverse[3][3] = {{9.474586e-1, 1.506282e-1, -7.002351e-2}, + {1.506282e-1, 1.427704e0, 7.247630e-2}, + {-7.002351e-2, 7.247630e-2, 9.822354e-1}}; + float mgm3softIronInverse[3][3] = {{1.082337e0, 1.971590e-1, -6.910370e-2}, + {1.971590e-1, 1.265329e0, 1.301571e-2}, + {-6.910370e-2, 1.301571e-2, 1.072459e0}}; + float mgm4softIronInverse[3][3] = {{1.094184e0, -1.765240e-2, -3.580871e-2}, + {-1.765240e-2, 1.250533e0, 8.302781e-3}, + {-3.580871e-2, 8.302781e-3, 1.325068e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; -- 2.43.0 From 45eadb8302ce00f9bd092d719492c08f8bcfdc62 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 31 Jan 2023 10:08:28 +0100 Subject: [PATCH 4/9] added new calibration matrices --- mission/controller/acs/AcsParameters.h | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 2fd5ab27..1fe5f29c 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,27 +37,27 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {-3.009521e1, 1.600983e1, -3.025359e1}; - float mgm1hardIronOffset[3] = {-3.255443e1, 1.118625e1, -8.400313e0}; - float mgm2hardIronOffset[3] = {-6.194874e1, 1.561503e1, -2.911635e1}; - float mgm3hardIronOffset[3] = {-3.986654e1, 1.413371e1, -9.778686e0}; - float mgm4hardIronOffset[3] = {-3.046779e1, 1.690829e1, -6.597055e0}; + float mgm0hardIronOffset[3] = {3.303907e0,4.009162e0,-1.677380e1}; + float mgm1hardIronOffset[3] = {-2.494258e0,3.526886e0,3.593006e0}; + float mgm2hardIronOffset[3] = {-1.630907e1,5.543566e0,-1.619287e1}; + float mgm3hardIronOffset[3] = {-8.612960e-1,2.752825e0,-1.101764e0}; + float mgm4hardIronOffset[3] = {1.696131e0,4.624440e0,2.449785e-1}; - float mgm0softIronInverse[3][3] = {{9.385532e-1, -1.261877e-1, -8.086912e-2}, - {-1.261877e-1, 1.415967e0, -6.953750e-3}, - {-8.086912e-2, -6.953750e-3, 1.014963e0}}; - float mgm1softIronInverse[3][3] = {{1.054248e0, -1.867005e-1, -4.884622e-2}, - {-1.867005e-1, 1.272026e0, -4.212676e-2}, - {-4.884622e-2, -4.212676e-2, 1.091061e0}}; - float mgm2softIronInverse[3][3] = {{9.474586e-1, 1.506282e-1, -7.002351e-2}, - {1.506282e-1, 1.427704e0, 7.247630e-2}, - {-7.002351e-2, 7.247630e-2, 9.822354e-1}}; - float mgm3softIronInverse[3][3] = {{1.082337e0, 1.971590e-1, -6.910370e-2}, - {1.971590e-1, 1.265329e0, 1.301571e-2}, - {-6.910370e-2, 1.301571e-2, 1.072459e0}}; - float mgm4softIronInverse[3][3] = {{1.094184e0, -1.765240e-2, -3.580871e-2}, - {-1.765240e-2, 1.250533e0, 8.302781e-3}, - {-3.580871e-2, 8.302781e-3, 1.325068e0}}; + float mgm0softIronInverse[3][3] = {{9.687712e-1,1.144510e-2,-9.601610e-2}, + {1.144510e-2,1.391574e0,-1.169994e-1}, + {-9.601610e-2,-1.169994e-1,1.025668e0}}; + float mgm1softIronInverse[3][3] = {{1.086339e0,-4.341287e-2,-5.870281e-2}, + {-4.341287e-2,1.274588e0,-1.893176e-1}, + {-5.870281e-2,-1.893176e-1,1.077651e0}}; + float mgm2softIronInverse[3][3] = {{9.554406e-1,7.009618e-2,-7.924296e-2}, + {7.009618e-2,1.428436e0,1.504623e-1}, + {-7.924296e-2,1.504623e-1,9.978038e-1}}; + float mgm3softIronInverse[3][3] = {{1.091974e0,1.492663e-2-5.993296e-2}, + {1.492663e-2,1.263068e0,2.013953e-1}, + {-5.993296e-2,2.013953e-1,1.055083e0}}; + float mgm4softIronInverse[3][3] = {{1.100341e0,-7.430518e-4,-3.810031e-2}, + {-7.430518e-4,1.259561e0,-1.951225e-2}, + {-3.810031e-2,-1.951225e-2,1.342584e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; -- 2.43.0 From 18af6228a0d617f47b0a56a457d9e57a825733ab Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 09:30:20 +0100 Subject: [PATCH 5/9] added final calibration matrices --- mission/controller/acs/AcsParameters.h | 41 +++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 1fe5f29c..ab8114bb 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,27 +37,28 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {3.303907e0,4.009162e0,-1.677380e1}; - float mgm1hardIronOffset[3] = {-2.494258e0,3.526886e0,3.593006e0}; - float mgm2hardIronOffset[3] = {-1.630907e1,5.543566e0,-1.619287e1}; - float mgm3hardIronOffset[3] = {-8.612960e-1,2.752825e0,-1.101764e0}; - float mgm4hardIronOffset[3] = {1.696131e0,4.624440e0,2.449785e-1}; + float mgm0hardIronOffset[3] = {6.116487, 6.796264, -19.188060}; + float mgm1hardIronOffset[3] = {-1.077152, 2.080583, 1.974483}; + float mgm2hardIronOffset[3] = {-19.285857, 5.401821, -16.096297}; + float mgm3hardIronOffset[3] = {-0.634033, 2.787695, 0.092036}; + float mgm4hardIronOffset[3] = {1.722133, 4.511870, 0.379980}; + + float mgm0softIronInverse[3][3] = {{1.163335, 0.137584, 0.203908}, + {0.137584, 0.625606, 0.045537}, + {0.203908, 0.045537, 1.095923}}; + float mgm1softIronInverse[3][3] = {{0.972071, 0.131166, 0.042151}, + {0.131166, 0.803260, 0.034779}, + {0.042151, 0.034779, 0.923417}}; + float mgm2softIronInverse[3][3] = {{1.234863, -0.157745, 0.070813}, + {-0.157745, 0.746707, -0.062080}, + {0.070813, -0.062080, 1.122514}}; + float mgm3softIronInverse[3][3] = {{0.956890, -0.134841, 0.054017}, + {-0.134841, 0.811361, -0.015383}, + {0.054017, -0.015383, 0.939153}}; + float mgm4softIronInverse[3][3] = {{0.913163, 0.011058, 0.023273}, + {0.011058, 0.792295, 0.002921}, + {0.023273, 0.002921, 0.739496}}; - float mgm0softIronInverse[3][3] = {{9.687712e-1,1.144510e-2,-9.601610e-2}, - {1.144510e-2,1.391574e0,-1.169994e-1}, - {-9.601610e-2,-1.169994e-1,1.025668e0}}; - float mgm1softIronInverse[3][3] = {{1.086339e0,-4.341287e-2,-5.870281e-2}, - {-4.341287e-2,1.274588e0,-1.893176e-1}, - {-5.870281e-2,-1.893176e-1,1.077651e0}}; - float mgm2softIronInverse[3][3] = {{9.554406e-1,7.009618e-2,-7.924296e-2}, - {7.009618e-2,1.428436e0,1.504623e-1}, - {-7.924296e-2,1.504623e-1,9.978038e-1}}; - float mgm3softIronInverse[3][3] = {{1.091974e0,1.492663e-2-5.993296e-2}, - {1.492663e-2,1.263068e0,2.013953e-1}, - {-5.993296e-2,2.013953e-1,1.055083e0}}; - float mgm4softIronInverse[3][3] = {{1.100341e0,-7.430518e-4,-3.810031e-2}, - {-7.430518e-4,1.259561e0,-1.951225e-2}, - {-3.810031e-2,-1.951225e-2,1.342584e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; -- 2.43.0 From a9fcb6a183d6de7263ed48ef944cb8049e7fa85b Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 09:46:19 +0100 Subject: [PATCH 6/9] update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b15c4f12..c835c81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,10 +17,17 @@ change warranting a new major release: # [unreleased] +## Changed + +- Readded calibration matrices for MGM calibration + ## Fixed - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). +- Bugfixes in 'SensofProcessing' where previously MGM values would be calibrated before being + transformed in body RF. However, the calibration values are in the body RF. Also fixed the + validity flag of 'mgmVecTotDerivative'. # [v1.23.0] 2023-02-01 -- 2.43.0 From 4f2853e1b81e742258465676b8196bf8e92f7b89 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 18:07:19 +0100 Subject: [PATCH 7/9] adapted new acs submodes for checkModeCommand --- 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 8a58eb90..2e53d17c 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -426,7 +426,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 6) || (submode < 2)) { + if ((submode > acs::PTG_TARGET_INERTIAL) || (submode < acs::SAFE)) { return INVALID_SUBMODE; } else { return returnvalue::OK; -- 2.43.0 From 6a24e1b9357ec0a53da11ffcbbdaace7bf493c52 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 20:11:16 +0100 Subject: [PATCH 8/9] updated MGM calibration values --- mission/controller/acs/AcsParameters.h | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index a7b2d631..c4653590 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -41,23 +41,23 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm1hardIronOffset[3] = {-1.077152, 2.080583, 1.974483}; float mgm2hardIronOffset[3] = {-19.285857, 5.401821, -16.096297}; float mgm3hardIronOffset[3] = {-0.634033, 2.787695, 0.092036}; - float mgm4hardIronOffset[3] = {1.722133, 4.511870, 0.379980}; + float mgm4hardIronOffset[3] = {2.702743, 5.236043, 0.726229}; - float mgm0softIronInverse[3][3] = {{1.163335, 0.137584, 0.203908}, - {0.137584, 0.625606, 0.045537}, - {0.203908, 0.045537, 1.095923}}; - float mgm1softIronInverse[3][3] = {{0.972071, 0.131166, 0.042151}, - {0.131166, 0.803260, 0.034779}, - {0.042151, 0.034779, 0.923417}}; - float mgm2softIronInverse[3][3] = {{1.234863, -0.157745, 0.070813}, - {-0.157745, 0.746707, -0.062080}, - {0.070813, -0.062080, 1.122514}}; - float mgm3softIronInverse[3][3] = {{0.956890, -0.134841, 0.054017}, - {-0.134841, 0.811361, -0.015383}, - {0.054017, -0.015383, 0.939153}}; - float mgm4softIronInverse[3][3] = {{0.913163, 0.011058, 0.023273}, - {0.011058, 0.792295, 0.002921}, - {0.023273, 0.002921, 0.739496}}; + float mgm0softIronInverse[3][3] = {{0.910192, -0.188413, -0.161522}, + {-0.188413, 1.642303, -0.033184}, + {-0.161522, -0.033184, 0.943904}}; + float mgm1softIronInverse[3][3] = {{1.053508, -0.170225, -0.041678}, + {-0.170225, 1.274465, -0.040231}, + {-0.041678, -0.040231, 1.086352}}; + float mgm2softIronInverse[3][3] = {{0.931086, 0.172675, -0.043084}, + {0.172675, 1.541296, 0.065489}, + {-0.043084, 0.065489, 1.001238}}; + float mgm3softIronInverse[3][3] = {{1.073353, 0.177266, -0.058832}, + {0.177266, 1.262156, 0.010478}, + {-0.058832, 0.010478, 1.068345}}; + float mgm4softIronInverse[3][3] = {{1.114887, -0.007534, -0.037072}, + {-0.007534, 1.253879, 0.006812}, + {-0.037072, 0.006812, 1.313158}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; -- 2.43.0 From 489c813bcc637bd519b0b14eb40cb625b4988224 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 8 Feb 2023 11:05:35 +0100 Subject: [PATCH 9/9] better fit for acs::OFF with SUBMODE_NONE --- mission/acsDefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 8869d6ff..63824131 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -7,7 +7,7 @@ namespace acs { enum CtrlSubmode { - OFF = HasModesIF::MODE_OFF, + OFF = HasModesIF::SUBMODE_NONE, SAFE = 10, DETUMBLE = 11, IDLE = 12, -- 2.43.0