Merge remote-tracking branch 'origin/develop' into acs_update_scheduling
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
commit
3b8903b2e2
@ -24,12 +24,20 @@ change warranting a new major release:
|
||||
|
||||
- `AcsController`: Parameter fix in `DetumbleParameter`.
|
||||
- Set GPS set entries to invalid on MODE_OFF command.
|
||||
- Bump FSFW for bugfix in `setNormalDatapoolEntriesInvalid` where the validity was not set to false
|
||||
properly
|
||||
- Fixed usage of uint instead of int for commanding MTQ. Also fixed the range in which the ACS Ctrl
|
||||
commands the MTQ to match the actual commanding range.
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/363
|
||||
- Regression: Revert swap of SUS0 and SUS6. Those devices are on separate power lines. In a
|
||||
future fix, the calibration matrices of SUS0 and SUS6 will be swapped.
|
||||
|
||||
## Changed
|
||||
|
||||
- Update ACS scheduling to represent the actual ACS design. There is one ACS PST now for all
|
||||
timing sensitive ACS operations.
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365
|
||||
- `ACS::SensorValues` is now an ACS controller member to reduce the risk of stack overflow.
|
||||
- ACS Subsystem Sequence Mode IDs updated.
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365
|
||||
TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/130
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace addresses {
|
||||
/* Logical addresses have uint32_t datatype */
|
||||
enum logicalAddresses : address_t {
|
||||
enum LogicAddress : address_t {
|
||||
PCDU,
|
||||
|
||||
MGM_0_LIS3 = objects::MGM_0_LIS3_HANDLER,
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 3250bbf269b3326683222bb87ce7faecae63ad97
|
||||
Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17
|
@ -79,11 +79,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
||||
#if OBSW_ADD_SUN_SENSORS == 1
|
||||
SusFdir* fdir = nullptr;
|
||||
std::array<SusHandler*, 12> susHandlers = {};
|
||||
gpioId_t gpioId = gpioIds::CS_SUS_0;
|
||||
if (swap0And6) {
|
||||
gpioId = gpioIds::CS_SUS_6;
|
||||
}
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioId, SUS::MAX_CMD_SIZE,
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE,
|
||||
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
|
||||
susHandlers[0] =
|
||||
new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||
@ -125,11 +121,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
||||
fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB);
|
||||
susHandlers[5]->setCustomFdir(fdir);
|
||||
|
||||
gpioId = gpioIds::CS_SUS_6;
|
||||
if (swap0And6) {
|
||||
gpioId = gpioIds::CS_SUS_0;
|
||||
}
|
||||
spiCookie = new SpiCookie(addresses::SUS_6, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE,
|
||||
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE,
|
||||
spi::SUS_MAX1227_SPI_FREQ);
|
||||
susHandlers[6] =
|
||||
new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie);
|
||||
|
@ -486,9 +486,9 @@ void AcsController::copyMgmData() {
|
||||
}
|
||||
|
||||
void AcsController::copySusData() {
|
||||
ACS::SensorValues sensorValues;
|
||||
{
|
||||
PoolReadGuard pg(&sensorValues.susSets[0]);
|
||||
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value,
|
||||
6 * sizeof(uint16_t));
|
||||
|
@ -60,6 +60,7 @@ class AcsController : public ExtendedControllerBase {
|
||||
void announceMode(bool recursive);
|
||||
|
||||
/* ACS Datasets */
|
||||
ACS::SensorValues sensorValues;
|
||||
IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER);
|
||||
// MGMs
|
||||
acsctrl::MgmDataRaw mgmDataRaw;
|
||||
|
@ -54,21 +54,22 @@ void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1
|
||||
VectorOperations<double>::add(speedRws, deltaSpeed, rwCmdSpeed, 4);
|
||||
}
|
||||
|
||||
void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits) {
|
||||
// Convert to Unit frame
|
||||
void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator) {
|
||||
// Convert to actuator frame
|
||||
MatrixOperations<double>::multiply(*acsParameters.magnetorquesParameter.inverseAlignment,
|
||||
dipolMoment, dipolMomentUnits, 3, 3, 1);
|
||||
// Scaling along largest element if dipol exceeds maximum
|
||||
dipolMoment, dipolMomentActuator, 3, 3, 1);
|
||||
// Scaling along largest element if dipol exceeds maximum
|
||||
double maxDipol = acsParameters.magnetorquesParameter.DipolMax;
|
||||
double maxValue = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (abs(dipolMomentUnits[i]) > maxDipol) {
|
||||
maxValue = abs(dipolMomentUnits[i]);
|
||||
if (abs(dipolMomentActuator[i]) > maxDipol) {
|
||||
maxValue = abs(dipolMomentActuator[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxValue > maxDipol) {
|
||||
double scalingFactor = maxDipol / maxValue;
|
||||
VectorOperations<double>::mulScalar(dipolMomentUnits, scalingFactor, dipolMomentUnits, 3);
|
||||
VectorOperations<double>::mulScalar(dipolMomentActuator, scalingFactor, dipolMomentActuator, 3);
|
||||
}
|
||||
// scale dipole from 1 Am^2 to 1e^-4 Am^2
|
||||
VectorOperations<double>::mulScalar(dipolMomentActuator, 1e4, dipolMomentActuator, 3);
|
||||
}
|
||||
|
@ -35,9 +35,9 @@ class ActuatorCmd {
|
||||
* @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques
|
||||
*
|
||||
* @param: dipolMoment given dipol moment in spacecraft frame
|
||||
* dipolMomentUnits resulting dipol moment for every unit
|
||||
* dipolMomentActuator resulting dipol moment in actuator reference frame
|
||||
*/
|
||||
void cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits);
|
||||
void cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator);
|
||||
|
||||
protected:
|
||||
private:
|
||||
|
@ -489,7 +489,7 @@ class DipoleActuationSet : public StaticLocalDataSet<4> {
|
||||
// Refresh torque command without changing any of the set dipoles.
|
||||
void refreshTorqueing(uint16_t durationMs_) { currentTorqueDurationMs = durationMs_; }
|
||||
|
||||
void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_,
|
||||
void setDipoles(int16_t xDipole_, int16_t yDipole_, int16_t zDipole_,
|
||||
uint16_t currentTorqueDurationMs_) {
|
||||
if (xDipole.value != xDipole_) {
|
||||
}
|
||||
@ -503,7 +503,7 @@ class DipoleActuationSet : public StaticLocalDataSet<4> {
|
||||
currentTorqueDurationMs = currentTorqueDurationMs_;
|
||||
}
|
||||
|
||||
void getDipoles(uint16_t& xDipole_, uint16_t& yDipole_, uint16_t& zDipole_) {
|
||||
void getDipoles(int16_t& xDipole_, int16_t& yDipole_, int16_t& zDipole_) {
|
||||
xDipole_ = xDipole.value;
|
||||
yDipole_ = yDipole.value;
|
||||
zDipole_ = zDipole.value;
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit c3c58b95ada024e53a019c34b91f0552bfd487a7
|
||||
Subproject commit 5ed3cec20b609db435bd5663fd3edd5888fbb932
|
Loading…
x
Reference in New Issue
Block a user