From 72b503bb8f5352dcc2065e0ca04787708c332135 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 6 Dec 2022 09:21:43 +0100 Subject: [PATCH] fixed calculation of sun vectore model --- mission/controller/acs/AcsParameters.h | 7 ++++--- mission/controller/acs/SensorProcessing.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 828e4495..f7aa2b37 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -857,12 +857,13 @@ class AcsParameters /*: public HasParametersIF*/ { struct SunModelParameters { enum UseSunModel { NO = 0, YES = 3 }; uint8_t useSunModel; - float domega = 36000.771; - float omega_0 = 282.94 * M_PI / 180.; // RAAN plus argument of perigee + float domega = 36000.77005361; // 36000.771; + float omega_0 = + 280.4606184 * M_PI / 180.; // 282.94 * M_PI / 180.; // RAAN plus argument of perigee float m_0 = 357.5256; // coefficients for mean anomaly float dm = 35999.049; // coefficients for mean anomaly float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis - float e1 = 0.74508 * M_PI / 180.; + float e1 = 0.013 * M_PI / 180.; // 0.74508 * M_PI / 180.; float p1 = 6892. / 3600. * M_PI / 180.; // some parameter float p2 = 72. / 3600. * M_PI / 180.; // some parameter diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 4635e673..c02398ce 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -397,10 +397,10 @@ void SensorProcessing::processSus( // Julean Centuries double sunIjkModel[3] = {0.0, 0.0, 0.0}; - double JC2000 = JD2000 / 36525; + double JC2000 = JD2000 / 36525.; double meanLongitude = - (sunModelParameters->omega_0 + (sunModelParameters->domega) * JC2000) * PI / 180; + sunModelParameters->omega_0 + (sunModelParameters->domega * JC2000) * PI / 180.; double meanAnomaly = (sunModelParameters->m_0 + sunModelParameters->dm * JC2000) * PI / 180.; double eclipticLongitude = meanLongitude + sunModelParameters->p1 * sin(meanAnomaly) +