eive-obsw/mission/controller/acs/SusConverter.h
Marius Eggert 5f17f365e3
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
fixed local includes
2022-09-27 11:06:11 +02:00

59 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 "AcsParameters.h"
#include <stdint.h>
class SunSensor {
public:
SunSensor() {}
void setSunSensorData();
void checkSunSensorData(uint8_t susNumber);
void calcAngle(uint8_t susNumber);
void setCalibrationCoefficients(uint8_t susNumber);
void Calibration(uint8_t susNumber);
void CalculateSunVector(uint8_t susNumber);
bool getValidFlag(uint8_t susNumber);
float* getSunVectorBodyFrame();
float* TransferSunVector();
private:
uint16_t susChannelValues[12][4]; //[Bit]
float alphaBetaRaw[12][2]; //[°]
float alphaBetaCalibrated[12][2]; //[°]
float sunVectorBodyFrame[12][3]; //[-]
bool validFlag[12] = returnvalue::OK;
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[12][9][10];
float coeffBeta[12][9][10];
AcsParameters acsParameters;
};
#endif /* MISSION_CONTROLLER_ACS_SUSCONVERTER_H_ */