eive-obsw/mission/controller/acs/SusConverter.h
Marius Eggert 46ec376e4d
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
amended SusConverter for use as OBSW
2022-09-23 14:27:05 +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();
void checkSunSensorData(uint8_t Sensornumber);
void AngleCalculation(uint8_t Sensornumber);
void setCalibrationCoefficients(uint8_t Sensornumber);
void Calibration(uint8_t Sensornumber);
void CalculateSunVector(uint8_t Sensornumber);
bool getValidityNumber(uint8_t Sensornumber);
float* getSunVectorBodyFrame();
float* TransferSunVector();
private:
uint16_t susChannelValues[12][4]; //[Bit]
float AlphaBetaRaw[12][2]; //[°]
float AlphaBetaCalibrated[12][2]; //[°]
float SunVectorBodyFrame[12][3]; //[-]
bool ValidityNumber[12] = 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[12][9][10];
float CoeffBeta[12][9][10];
AcsParameters acsParameters;
};
#endif /* MISSION_CONTROLLER_ACS_SUSCONVERTER_H_ */