2022-09-23 09:56:32 +02:00
|
|
|
/*
|
|
|
|
* SusConverter.h
|
|
|
|
*
|
|
|
|
* Created on: Sep 22, 2022
|
|
|
|
* Author: marius
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MISSION_CONTROLLER_ACS_SUSCONVERTER_H_
|
|
|
|
#define MISSION_CONTROLLER_ACS_SUSCONVERTER_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <AcsParameters.h>
|
|
|
|
|
|
|
|
class SunSensor {
|
|
|
|
public:
|
|
|
|
SunSensor() {}
|
|
|
|
|
2022-09-23 14:27:05 +02:00
|
|
|
void setSunSensorData();
|
2022-09-23 09:56:32 +02:00
|
|
|
void checkSunSensorData(uint8_t Sensornumber);
|
2022-09-23 14:27:05 +02:00
|
|
|
void AngleCalculation(uint8_t Sensornumber);
|
2022-09-23 09:56:32 +02:00
|
|
|
void setCalibrationCoefficients(uint8_t Sensornumber);
|
2022-09-23 14:27:05 +02:00
|
|
|
void Calibration(uint8_t Sensornumber);
|
|
|
|
void CalculateSunVector(uint8_t Sensornumber);
|
2022-09-23 09:56:32 +02:00
|
|
|
|
2022-09-23 14:27:05 +02:00
|
|
|
bool getValidityNumber(uint8_t Sensornumber);
|
2022-09-23 09:56:32 +02:00
|
|
|
float* getSunVectorBodyFrame();
|
2022-09-23 14:27:05 +02:00
|
|
|
float* TransferSunVector();
|
2022-09-23 09:56:32 +02:00
|
|
|
|
|
|
|
private:
|
2022-09-23 14:27:05 +02:00
|
|
|
uint16_t susChannelValues[12][4]; //[Bit]
|
|
|
|
float AlphaBetaRaw[12][2]; //[°]
|
|
|
|
float AlphaBetaCalibrated[12][2]; //[°]
|
|
|
|
float SunVectorBodyFrame[12][3]; //[-]
|
2022-09-23 09:56:32 +02:00
|
|
|
|
2022-09-23 14:27:05 +02:00
|
|
|
bool ValidityNumber[12] = true;
|
2022-09-23 09:56:32 +02:00
|
|
|
|
|
|
|
uint16_t ChannelValueCheckHigh =
|
|
|
|
4096; //=2^12[Bit]high borderline for the channel values of one sun sensor for validity Check
|
|
|
|
uint8_t ChannelValueCheckLow =
|
|
|
|
0; //[Bit]low borderline for the channel values of one sun sensor for validity Check
|
|
|
|
uint16_t ChannelValueSumHigh =
|
|
|
|
100; // 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
|
|
|
|
uint8_t ChannelValueSumLow =
|
|
|
|
0; //[Bit]low borderline for check if the sun sensor is illuminated
|
|
|
|
// by the sun or by the reflection of sunlight from the moon/earth
|
|
|
|
uint8_t CompleteCellWidth = 140,
|
|
|
|
HalfCellWidth = 70; //[°] Width of the calibration cells --> necessary for checking in
|
|
|
|
// which cell a data point should be
|
|
|
|
|
2022-09-23 14:27:05 +02:00
|
|
|
float CoeffAlpha[12][9][10];
|
|
|
|
float CoeffBeta[12][9][10];
|
2022-09-23 09:56:32 +02:00
|
|
|
|
|
|
|
AcsParameters acsParameters;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* MISSION_CONTROLLER_ACS_SUSCONVERTER_H_ */
|