eive-obsw/mission/controller/acs/control/PtgCtrl.h

54 lines
2.0 KiB
C
Raw Normal View History

2022-09-20 13:43:26 +02:00
#ifndef PTGCTRL_H_
#define PTGCTRL_H_
#include <stdio.h>
2022-10-12 15:06:24 +02:00
#include <string.h>
2022-09-20 13:43:26 +02:00
#include <time.h>
2022-10-12 15:06:24 +02:00
#include "../AcsParameters.h"
#include "../SensorValues.h"
#include "eive/resultClassIds.h"
2022-09-20 13:43:26 +02:00
2022-10-12 15:06:24 +02:00
class PtgCtrl {
2023-03-10 17:21:52 +01:00
/*
* @brief: This class handles the pointing control mechanism. Calculation of an commanded
* torque for the reaction wheels, and magnetic Field strength for magnetorques for desaturation
*
* @note: A description of the used algorithms can be found in
* https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_Studenten/Marquardt_Robin&openfile=896110
*/
2022-10-12 15:06:24 +02:00
public:
/* @brief: Constructor
* @param: acsParameters_ Pointer to object which defines the ACS configuration parameters
*/
PtgCtrl(AcsParameters *acsParameters_);
virtual ~PtgCtrl();
static const uint8_t INTERFACE_ID = CLASS_ID::ACS_PTG;
2022-10-12 15:06:24 +02:00
static const ReturnValue_t PTGCTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01);
/* @brief: Calculates the needed torque for the pointing control mechanism
*/
2023-01-23 16:34:52 +01:00
void ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, const double *qError,
const double *deltaRate, const double *rwPseudoInv, double *torqueRws);
2022-10-12 15:06:24 +02:00
2023-01-23 16:34:52 +01:00
void ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawParameters,
double *magFieldEst, bool magFieldEstValid, double *satRate,
int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3,
double *mgtDpDes);
2022-10-12 15:06:24 +02:00
2023-01-23 16:34:52 +01:00
void ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters,
const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2,
2022-10-12 15:06:24 +02:00
const int32_t *speedRw3, double *rwTrqNs);
/* @brief: Commands the stiction torque in case wheel speed is to low
* torqueCommand modified torque after antistiction
*/
2023-03-10 17:21:52 +01:00
void rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpeed);
2022-10-12 15:06:24 +02:00
private:
2023-02-28 10:47:37 +01:00
const AcsParameters *acsParameters;
2022-09-20 13:43:26 +02:00
};
#endif /* ACS_CONTROL_PTGCTRL_H_ */