ACS Ctrl Bug Bash #439
@ -658,25 +658,25 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
|
|||||||
case (0x12): // MagnetorquesParameter
|
case (0x12): // MagnetorquesParameter
|
||||||
switch (parameterId) {
|
switch (parameterId) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
parameterWrapper->setMatrix(magnetorquesParameter.mtq0orientationMatrix);
|
parameterWrapper->setMatrix(magnetorquerParameter.mtq0orientationMatrix);
|
||||||
break;
|
break;
|
||||||
case 0x1:
|
case 0x1:
|
||||||
parameterWrapper->setMatrix(magnetorquesParameter.mtq1orientationMatrix);
|
parameterWrapper->setMatrix(magnetorquerParameter.mtq1orientationMatrix);
|
||||||
break;
|
break;
|
||||||
case 0x2:
|
case 0x2:
|
||||||
parameterWrapper->setMatrix(magnetorquesParameter.mtq2orientationMatrix);
|
parameterWrapper->setMatrix(magnetorquerParameter.mtq2orientationMatrix);
|
||||||
break;
|
break;
|
||||||
case 0x3:
|
case 0x3:
|
||||||
parameterWrapper->setMatrix(magnetorquesParameter.alignmentMatrixMtq);
|
parameterWrapper->setMatrix(magnetorquerParameter.alignmentMatrixMtq);
|
||||||
break;
|
break;
|
||||||
case 0x4:
|
case 0x4:
|
||||||
parameterWrapper->setMatrix(magnetorquesParameter.inverseAlignment);
|
parameterWrapper->setMatrix(magnetorquerParameter.inverseAlignment);
|
||||||
break;
|
break;
|
||||||
case 0x5:
|
case 0x5:
|
||||||
parameterWrapper->set(magnetorquesParameter.DipolMax);
|
parameterWrapper->set(magnetorquerParameter.dipolMax);
|
||||||
break;
|
break;
|
||||||
case 0x6:
|
case 0x6:
|
||||||
parameterWrapper->set(magnetorquesParameter.torqueDuration);
|
parameterWrapper->set(magnetorquerParameter.torqueDuration);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return INVALID_IDENTIFIER_ID;
|
return INVALID_IDENTIFIER_ID;
|
||||||
|
@ -912,16 +912,16 @@ class AcsParameters : public HasParametersIF {
|
|||||||
double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability
|
double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability
|
||||||
} kalmanFilterParameters;
|
} kalmanFilterParameters;
|
||||||
|
|
||||||
struct MagnetorquesParameter {
|
struct MagnetorquerParameter {
|
||||||
double mtq0orientationMatrix[3][3] = {{1, 0, 0}, {0, 0, 1}, {0, -1, 0}};
|
double mtq0orientationMatrix[3][3] = {{1, 0, 0}, {0, 0, 1}, {0, -1, 0}};
|
||||||
double mtq1orientationMatrix[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
|
double mtq1orientationMatrix[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
|
||||||
double mtq2orientationMatrix[3][3] = {{0, 0, 1}, {0, 1, 0}, {-1, 0, 0}};
|
double mtq2orientationMatrix[3][3] = {{0, 0, 1}, {0, 1, 0}, {-1, 0, 0}};
|
||||||
double alignmentMatrixMtq[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}};
|
double alignmentMatrixMtq[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}};
|
||||||
double inverseAlignment[3][3] = {{0, -1, 0}, {0, 0, 1}, {-1, 0, 0}};
|
double inverseAlignment[3][3] = {{0, -1, 0}, {0, 0, 1}, {-1, 0, 0}};
|
||||||
double DipolMax = 0.2; // [Am^2]
|
double dipolMax = 0.2; // [Am^2]
|
||||||
|
|
||||||
uint16_t torqueDuration = 300; // [ms]
|
uint16_t torqueDuration = 300; // [ms]
|
||||||
} magnetorquesParameter;
|
} magnetorquerParameter;
|
||||||
|
|
||||||
struct DetumbleParameter {
|
struct DetumbleParameter {
|
||||||
uint8_t detumblecounter = 75; // 30 s
|
uint8_t detumblecounter = 75; // 30 s
|
||||||
|
@ -23,7 +23,7 @@ Detumble::~Detumble() {}
|
|||||||
|
|
||||||
void Detumble::loadAcsParameters(AcsParameters *acsParameters_) {
|
void Detumble::loadAcsParameters(AcsParameters *acsParameters_) {
|
||||||
detumbleParameter = &(acsParameters_->detumbleParameter);
|
detumbleParameter = &(acsParameters_->detumbleParameter);
|
||||||
magnetorquesParameter = &(acsParameters_->magnetorquesParameter);
|
magnetorquesParameter = &(acsParameters_->magnetorquerParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool magRateValid,
|
ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool magRateValid,
|
||||||
@ -43,7 +43,7 @@ ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool magRateVal
|
|||||||
return DETUMBLE_NO_SENSORDATA;
|
return DETUMBLE_NO_SENSORDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
double dipolMax = magnetorquesParameter->DipolMax;
|
double dipolMax = magnetorquesParameter->dipolMax;
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
magMom[i] = -dipolMax * sign(magRate[i]);
|
magMom[i] = -dipolMax * sign(magRate[i]);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class Detumble {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
AcsParameters::DetumbleParameter *detumbleParameter;
|
AcsParameters::DetumbleParameter *detumbleParameter;
|
||||||
AcsParameters::MagnetorquesParameter *magnetorquesParameter;
|
AcsParameters::MagnetorquerParameter *magnetorquesParameter;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*ACS_CONTROL_DETUMBLE_H_*/
|
#endif /*ACS_CONTROL_DETUMBLE_H_*/
|
||||||
|
Loading…
Reference in New Issue
Block a user