eive-obsw/mission/controller/acs/SusConverter.h
Marius Eggert e70ee1bf9d
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
initial commit of SusConverter
2022-09-23 09:56:32 +02:00

60 lines
1.8 KiB
C++

/*
* 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() {}
void setSunSensorData(uint8_t Sensornumber);
void checkSunSensorData(uint8_t Sensornumber);
void AngleCalculation();
void setCalibrationCoefficients(uint8_t Sensornumber);
void Calibration();
void CalculateSunVector();
bool getValidityNumber() { return ValidityNumber; }
float* getSunVectorBodyFrame();
float* TransferSunVector(SunSensor SUS[12]);
private:
uint16_t ChannelValue[5]; //[Bit]
float AlphaBetaRaw[2]; //[°]
float AlphaBetaCalibrated[2]; //[°]
float SunVectorBodyFrame[3]; //[-]
bool ValidityNumber = true;
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
float CoeffAlpha[9][10];
float CoeffBeta[9][10];
AcsParameters acsParameters;
};
#endif /* MISSION_CONTROLLER_ACS_SUSCONVERTER_H_ */