Final Version of the ACS Controller #367

Merged
muellerr merged 78 commits from eggert/acs into develop 2023-02-08 13:50:11 +01:00
2 changed files with 11 additions and 14 deletions
Showing only changes of commit 12a367f65f - Show all commits

View File

@ -22,22 +22,19 @@ Detumble::Detumble(AcsParameters *acsParameters_) { loadAcsParameters(acsParamet
Detumble::~Detumble() {} Detumble::~Detumble() {}
void Detumble::loadAcsParameters(AcsParameters *acsParameters_) { void Detumble::loadAcsParameters(AcsParameters *acsParameters_) {
detumbleCtrlParameters = &(acsParameters_->detumbleCtrlParameters); detumbleParameter = &(acsParameters_->detumbleParameter);
magnetorquesParameter = &(acsParameters_->magnetorquesParameter); magnetorquesParameter = &(acsParameters_->magnetorquesParameter);
} }
ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool *magRateValid, ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool magRateValid,
const double *magField, const bool *magFieldValid, const double *magField, const bool magFieldValid, double *magMom) {
double *magMom) { if (!magRateValid || !magFieldValid) {
return DETUMBLE_NO_SENSORDATA;
if (!magRateValid || !magFieldValid) { }
return DETUMBLE_NO_SENSORDATA; double gain = detumbleParameter->gainD;
} double factor = -gain / pow(VectorOperations<double>::norm(magField, 3), 2);
double gain = detumbleParameter->gainD; VectorOperations<double>::mulScalar(magRate, factor, magMom, 3);
double factor = -gain / pow(VectorOperations<double>::norm(magField,3),2); return returnvalue::OK;
VectorOperations<double>::mulScalar(magRate, factor, magMom, 3);
return returnvalue::OK;
} }
ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool magRateValid, ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool magRateValid,

View File

@ -25,7 +25,7 @@ class Detumble {
static const uint8_t INTERFACE_ID = CLASS_ID::DETUMBLE; static const uint8_t INTERFACE_ID = CLASS_ID::DETUMBLE;
static const ReturnValue_t DETUMBLE_NO_SENSORDATA = MAKE_RETURN_CODE(0x01); static const ReturnValue_t DETUMBLE_NO_SENSORDATA = MAKE_RETURN_CODE(0x01);
/* @brief: Load AcsParameters für this class /* @brief: Load AcsParameters for this class
* @param: acsParameters_ Pointer to object which defines the ACS configuration parameters * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters
*/ */
void loadAcsParameters(AcsParameters *acsParameters_); void loadAcsParameters(AcsParameters *acsParameters_);