2023-06-19 16:33:04 +02:00
|
|
|
#include <fsfw/globalfunctions/math/VectorOperations.h>
|
2022-09-23 09:56:32 +02:00
|
|
|
|
2022-10-06 15:38:23 +02:00
|
|
|
#include "AcsParameters.h"
|
|
|
|
|
|
|
|
class SusConverter {
|
2022-09-23 09:56:32 +02:00
|
|
|
public:
|
2022-10-06 15:38:23 +02:00
|
|
|
SusConverter() {}
|
|
|
|
|
2023-06-19 16:33:04 +02:00
|
|
|
uint64_t checkSunSensorData(const uint16_t susChannel[6]);
|
|
|
|
bool checkValidity(bool* susValid, const uint64_t brightness[12], const float threshold);
|
|
|
|
void calculateSunVector(float* sunVectorSensorFrame, const uint16_t susChannel[6]);
|
2022-09-23 09:56:32 +02:00
|
|
|
|
|
|
|
private:
|
2022-10-06 15:38:23 +02:00
|
|
|
static const uint8_t GNDREF = 4;
|
2023-06-16 21:16:39 +02:00
|
|
|
// =2^12[Bit]high borderline for the channel values of one sun sensor for validity Check
|
|
|
|
static constexpr uint16_t SUS_CHANNEL_VALUE_HIGH = 4096;
|
|
|
|
// [Bit]low borderline for the channel values of one sun sensor for validity Check
|
|
|
|
static constexpr uint8_t SUS_CHANNEL_VALUE_LOW = 0;
|
|
|
|
// 4096[Bit]high borderline for check if the sun sensor is illuminated by the sun or by the
|
|
|
|
// reflection of sunlight from the moon/earth
|
2023-06-19 16:33:04 +02:00
|
|
|
static constexpr uint16_t SUS_ALBEDO_CHECK = 1000;
|
2023-06-16 21:16:39 +02:00
|
|
|
// [Bit]low borderline for check if the sun sensor is illuminated by the sun or by the reflection
|
|
|
|
// of sunlight from the moon/earth
|
|
|
|
static constexpr uint8_t SUS_CHANNEL_SUM_LOW = 0;
|
2023-06-19 16:33:04 +02:00
|
|
|
|
|
|
|
static constexpr float S = 0.03; // S=[mm] gap between diodes
|
|
|
|
static constexpr float D = 5; // D=[mm] edge length of the quadratic aperture
|
2023-06-21 17:46:59 +02:00
|
|
|
static constexpr float H = 2.5; // H=[mm] distance between diodes and aperture
|
2022-09-23 09:56:32 +02:00
|
|
|
|
|
|
|
AcsParameters acsParameters;
|
|
|
|
};
|