ACS Ctrl Bug Bash #439
@ -47,6 +47,7 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
|
|
||||||
- The `detumbleCounter` now does not get hard reset anymore, if the critical rate does not get
|
- The `detumbleCounter` now does not get hard reset anymore, if the critical rate does not get
|
||||||
violated anymore. Instead it is incrementally reset.
|
violated anymore. Instead it is incrementally reset.
|
||||||
|
- The RW antistiction now only takes the RW speeds in account.
|
||||||
|
|
||||||
# [v1.36.0] 2023-03-08
|
# [v1.36.0] 2023-03-08
|
||||||
|
|
||||||
|
@ -785,8 +785,8 @@ class AcsParameters : public HasParametersIF {
|
|||||||
double inertiaWheel = 0.000028198;
|
double inertiaWheel = 0.000028198;
|
||||||
double maxTrq = 0.0032; // 3.2 [mNm]
|
double maxTrq = 0.0032; // 3.2 [mNm]
|
||||||
int32_t maxRwSpeed = 65000; // 0.1 RPM
|
int32_t maxRwSpeed = 65000; // 0.1 RPM
|
||||||
int32_t stictionSpeed = 100; // RPM
|
int32_t stictionSpeed = 1000; // 0.1 RPM
|
||||||
int32_t stictionReleaseSpeed = 120; // RPM
|
int32_t stictionReleaseSpeed = 1000; // 0.1 RPM
|
||||||
double stictionTorque = 0.0006;
|
double stictionTorque = 0.0006;
|
||||||
|
|
||||||
uint16_t rampTime = 10;
|
uint16_t rampTime = 10;
|
||||||
|
@ -154,38 +154,33 @@ void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters *pointingLawPara
|
|||||||
VectorOperations<double>::mulScalar(rwTrqNs, -1, rwTrqNs, 4);
|
VectorOperations<double>::mulScalar(rwTrqNs, -1, rwTrqNs, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PtgCtrl::rwAntistiction(ACS::SensorValues *sensorValues, double *torqueCommand) {
|
void PtgCtrl::rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpeeds) {
|
||||||
bool rwAvailable[4] = {
|
bool rwAvailable[4] = {
|
||||||
(sensorValues->rw1Set.state.value && sensorValues->rw1Set.state.isValid()),
|
(sensorValues->rw1Set.state.value && sensorValues->rw1Set.state.isValid()),
|
||||||
(sensorValues->rw2Set.state.value && sensorValues->rw2Set.state.isValid()),
|
(sensorValues->rw2Set.state.value && sensorValues->rw2Set.state.isValid()),
|
||||||
(sensorValues->rw3Set.state.value && sensorValues->rw3Set.state.isValid()),
|
(sensorValues->rw3Set.state.value && sensorValues->rw3Set.state.isValid()),
|
||||||
(sensorValues->rw4Set.state.value && sensorValues->rw4Set.state.isValid())};
|
(sensorValues->rw4Set.state.value && sensorValues->rw4Set.state.isValid())};
|
||||||
int32_t omegaRw[4] = {sensorValues->rw1Set.currSpeed.value, sensorValues->rw2Set.currSpeed.value,
|
int32_t currRwSpeed[4] = {
|
||||||
|
sensorValues->rw1Set.currSpeed.value, sensorValues->rw2Set.currSpeed.value,
|
||||||
sensorValues->rw3Set.currSpeed.value, sensorValues->rw4Set.currSpeed.value};
|
sensorValues->rw3Set.currSpeed.value, sensorValues->rw4Set.currSpeed.value};
|
||||||
for (uint8_t i = 0; i < 4; i++) {
|
for (uint8_t i = 0; i < 4; i++) {
|
||||||
if (rwAvailable[i]) {
|
if (rwAvailable[i]) {
|
||||||
if (torqueMemory[i] != 0) {
|
if (rwCmdSpeeds[i] != 0) {
|
||||||
if ((omegaRw[i] * torqueMemory[i]) >
|
if (rwCmdSpeeds[i] > -acsParameters->rwHandlingParameters.stictionSpeed &&
|
||||||
acsParameters->rwHandlingParameters.stictionReleaseSpeed) {
|
rwCmdSpeeds[i] < acsParameters->rwHandlingParameters.stictionSpeed) {
|
||||||
torqueMemory[i] = 0;
|
if (currRwSpeed[i] == 0) {
|
||||||
} else {
|
if (rwCmdSpeeds[i] > 0) {
|
||||||
torqueCommand[i] = torqueMemory[i] * acsParameters->rwHandlingParameters.stictionTorque;
|
rwCmdSpeeds[i] = acsParameters->rwHandlingParameters.stictionSpeed;
|
||||||
|
} else if (rwCmdSpeeds[i] < 0) {
|
||||||
|
rwCmdSpeeds[i] = -acsParameters->rwHandlingParameters.stictionSpeed;
|
||||||
|
}
|
||||||
|
} else if (currRwSpeed[i] < -acsParameters->rwHandlingParameters.stictionSpeed) {
|
||||||
|
rwCmdSpeeds[i] = acsParameters->rwHandlingParameters.stictionSpeed;
|
||||||
|
} else if (currRwSpeed[i] > acsParameters->rwHandlingParameters.stictionSpeed) {
|
||||||
|
rwCmdSpeeds[i] = -acsParameters->rwHandlingParameters.stictionSpeed;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ((omegaRw[i] < acsParameters->rwHandlingParameters.stictionSpeed) &&
|
|
||||||
(omegaRw[i] > -acsParameters->rwHandlingParameters.stictionSpeed)) {
|
|
||||||
if (omegaRw[i] < omegaMemory[i]) {
|
|
||||||
torqueMemory[i] = -1;
|
|
||||||
} else {
|
|
||||||
torqueMemory[i] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
torqueCommand[i] = torqueMemory[i] * acsParameters->rwHandlingParameters.stictionTorque;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
torqueMemory[i] = 0;
|
|
||||||
}
|
}
|
||||||
omegaMemory[i] = omegaRw[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,3 @@
|
|||||||
/*
|
|
||||||
* PtgCtrl.h
|
|
||||||
*
|
|
||||||
* Created on: 17 Jul 2022
|
|
||||||
* Author: Robin Marquardt
|
|
||||||
*
|
|
||||||
* @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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PTGCTRL_H_
|
#ifndef PTGCTRL_H_
|
||||||
#define PTGCTRL_H_
|
#define PTGCTRL_H_
|
||||||
|
|
||||||
@ -23,6 +10,13 @@
|
|||||||
#include "eive/resultClassIds.h"
|
#include "eive/resultClassIds.h"
|
||||||
|
|
||||||
class PtgCtrl {
|
class PtgCtrl {
|
||||||
|
/*
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
public:
|
public:
|
||||||
/* @brief: Constructor
|
/* @brief: Constructor
|
||||||
* @param: acsParameters_ Pointer to object which defines the ACS configuration parameters
|
* @param: acsParameters_ Pointer to object which defines the ACS configuration parameters
|
||||||
@ -50,13 +44,10 @@ class PtgCtrl {
|
|||||||
/* @brief: Commands the stiction torque in case wheel speed is to low
|
/* @brief: Commands the stiction torque in case wheel speed is to low
|
||||||
* torqueCommand modified torque after antistiction
|
* torqueCommand modified torque after antistiction
|
||||||
*/
|
*/
|
||||||
void rwAntistiction(ACS::SensorValues *sensorValues, double *torqueCommand);
|
void rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpeed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const AcsParameters *acsParameters;
|
const AcsParameters *acsParameters;
|
||||||
|
|
||||||
double torqueMemory[4] = {0, 0, 0, 0};
|
|
||||||
double omegaMemory[4] = {0, 0, 0, 0};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ACS_CONTROL_PTGCTRL_H_ */
|
#endif /* ACS_CONTROL_PTGCTRL_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user