Prevent STR Blinding #859

Merged
meggert merged 35 commits from prevent-str-blinding into main 2024-02-27 13:48:20 +01:00
Showing only changes of commit 13f3739386 - Show all commits

View File

@ -8,6 +8,9 @@
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
class AcsParameters : public HasParametersIF { class AcsParameters : public HasParametersIF {
private:
static constexpr double DEG2RAD = M_PI / 180.;
public: public:
AcsParameters(); AcsParameters();
virtual ~AcsParameters(); virtual ~AcsParameters();
@ -854,7 +857,7 @@ class AcsParameters : public HasParametersIF {
struct PointingLawParameters { struct PointingLawParameters {
double zeta = 0.3; double zeta = 0.3;
double om = 0.3; double om = 0.3;
double omMax = 1 * M_PI / 180; double omMax = 1 * DEG2RAD;
double qiMin = 0.1; double qiMin = 0.1;
double gainNullspace = 0.01; double gainNullspace = 0.01;
@ -877,15 +880,15 @@ class AcsParameters : public HasParametersIF {
uint8_t timeElapsedMax = 10; // rot rate calculations uint8_t timeElapsedMax = 10; // rot rate calculations
// Default is Stuttgart GS // Default is Stuttgart GS
double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude double latitudeTgt = 48.7495 * DEG2RAD; // [rad] Latitude
double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude double longitudeTgt = 9.10384 * DEG2RAD; // [rad] Longitude
double altitudeTgt = 500; // [m] double altitudeTgt = 500; // [m]
// For one-axis control: // For one-axis control:
uint8_t avoidBlindStr = true; uint8_t avoidBlindStr = true;
double blindAvoidStart = 1.5; double blindAvoidStart = 1.5;
double blindAvoidStop = 2.5; double blindAvoidStop = 2.5;
double blindRotRate = 1 * M_PI / 180; double blindRotRate = 1. * DEG2RAD;
} targetModeControllerParameters; } targetModeControllerParameters;
struct GsTargetModeControllerParameters : PointingLawParameters { struct GsTargetModeControllerParameters : PointingLawParameters {
@ -893,9 +896,9 @@ class AcsParameters : public HasParametersIF {
uint8_t timeElapsedMax = 10; // rot rate calculations uint8_t timeElapsedMax = 10; // rot rate calculations
// Default is Stuttgart GS // Default is Stuttgart GS
double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude double latitudeTgt = 48.7495 * DEG2RAD; // [rad] Latitude
double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude double longitudeTgt = 9.10384 * DEG2RAD; // [rad] Longitude
double altitudeTgt = 500; // [m] double altitudeTgt = 500; // [m]
} gsTargetModeControllerParameters; } gsTargetModeControllerParameters;
struct NadirModeControllerParameters : PointingLawParameters { struct NadirModeControllerParameters : PointingLawParameters {
@ -912,7 +915,7 @@ class AcsParameters : public HasParametersIF {
} inertialModeControllerParameters; } inertialModeControllerParameters;
struct StrParameters { struct StrParameters {
double exclusionAngle = 20 * M_PI / 180; double exclusionAngle = 20. * DEG2RAD;
double boresightAxis[3] = {0.7593, 0.0000, -0.6508}; // geometry frame double boresightAxis[3] = {0.7593, 0.0000, -0.6508}; // geometry frame
} strParameters; } strParameters;
@ -926,25 +929,25 @@ class AcsParameters : public HasParametersIF {
struct SunModelParameters { struct SunModelParameters {
float domega = 36000.771; float domega = 36000.771;
float omega_0 = 280.46 * M_PI / 180.; // RAAN plus argument of float omega_0 = 280.46 * DEG2RAD; // RAAN plus argument of
// perigee // perigee
float m_0 = 357.5277; // coefficients for mean anomaly float m_0 = 357.5277; // coefficients for mean anomaly
float dm = 35999.049; // 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 e = 23.4392911 * DEG2RAD; // angle of earth's rotation axis
float e1 = 0.74508 * M_PI / 180.; float e1 = 0.74508 * DEG2RAD;
float p1 = 6892. / 3600. * M_PI / 180.; // some parameter float p1 = 6892. / 3600. * DEG2RAD; // some parameter
float p2 = 72. / 3600. * M_PI / 180.; // some parameter float p2 = 72. / 3600. * DEG2RAD; // some parameter
} sunModelParameters; } sunModelParameters;
struct KalmanFilterParameters { struct KalmanFilterParameters {
double sensorNoiseSTR = 0.1 * M_PI / 180; double sensorNoiseStr = 0.1 * DEG2RAD;
double sensorNoiseSS = 8 * M_PI / 180; double sensorNoiseSus = 8. * DEG2RAD;
double sensorNoiseMAG = 4 * M_PI / 180; double sensorNoiseMgm = 4. * DEG2RAD;
double sensorNoiseGYR = 0.1 * M_PI / 180; double sensorNoiseGyr = 0.1 * DEG2RAD;
double sensorNoiseArwGYR = 3 * 0.0043 * M_PI / sqrt(10) / 180; // Angular Random Walk double sensorNoiseGyrArw = 3. * 0.0043 / sqrt(10) * DEG2RAD; // Angular Random Walk
double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability double sensorNoiseGyrBs = 3. / 3600. * DEG2RAD; // Bias Stability
} kalmanFilterParameters; } kalmanFilterParameters;
struct MagnetorquerParameter { struct MagnetorquerParameter {
@ -960,8 +963,8 @@ class AcsParameters : public HasParametersIF {
struct DetumbleParameter { struct DetumbleParameter {
uint8_t detumblecounter = 75; // 30 s uint8_t detumblecounter = 75; // 30 s
double omegaDetumbleStart = 2 * M_PI / 180; double omegaDetumbleStart = 2 * DEG2RAD;
double omegaDetumbleEnd = 1 * M_PI / 180; double omegaDetumbleEnd = 1 * DEG2RAD;
double gainBdot = pow(10.0, -3.3); double gainBdot = pow(10.0, -3.3);
double gainFull = pow(10.0, -2.3); double gainFull = pow(10.0, -2.3);
uint8_t useFullDetumbleLaw = false; uint8_t useFullDetumbleLaw = false;