some fixes, this should work now
EIVE/eive-obsw/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2023-01-20 11:51:29 +01:00
parent e66567eb94
commit 694d626081
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 30 additions and 14 deletions

View File

@ -39,7 +39,7 @@ static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120;
static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 180;
static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60;
// HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation
static constexpr uint32_t SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5;
static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5;
// Maximum allowed burn time allowed by the software.
static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180;

2
fsfw

@ -1 +1 @@
Subproject commit accaf855ee53d3dc429d7bcdf1b7b89768c166b6
Subproject commit bd189518b6f91f25db1845e2657101e6bf46eec0

View File

@ -103,6 +103,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() {
}
sif::info << "S/A Deployment: Burning" << std::endl;
triggerEvent(BURN_PHASE_START, fsmInfo.burnCountdownMs, fsmInfo.dryRun);
channelAlternationCd.resetTimer();
stateMachine = BURNING;
}
if (stateMachine == BURNING) {
@ -219,7 +220,8 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const
if (stateSwitch or firstAutonomousCycle) {
if (deplState == AutonomousDeplState::FIRST_BURN or
deplState == AutonomousDeplState::SECOND_BURN) {
startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun);
startFsmOn(config::SA_DEPL_BURN_TIME_SECS, (config::SA_DEPL_BURN_TIME_SECS / 2) * 1000,
dryRun);
} else if (deplState == AutonomousDeplState::WAIT or deplState == AutonomousDeplState::DONE or
deplState == AutonomousDeplState::INIT) {
startFsmOff();
@ -283,10 +285,12 @@ bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) {
return false;
}
bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdownSecs, bool dryRun) {
bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdownSecs,
uint32_t channelAlternationIntervalMs, bool dryRun) {
if (stateMachine != StateMachine::IDLE) {
return false;
}
channelAlternationCd.setTimeout(channelAlternationIntervalMs);
if (burnCountdownSecs > config::SA_DEPL_MAX_BURN_TIME) {
burnCountdownSecs = config::SA_DEPL_MAX_BURN_TIME;
}
@ -354,8 +358,8 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId,
if (result != returnvalue::OK) {
return result;
}
uint32_t burnCountdown = cmd.getBurnTime();
if (not startFsmOn(burnCountdown, cmd.isDryRun())) {
uint32_t burnCountdown = cmd.getBurnTimeSecs();
if (not startFsmOn(burnCountdown, cmd.getSwitchIntervalMs(), cmd.isDryRun())) {
return HasActionsIF::IS_BUSY;
}
actionActive = true;

View File

@ -28,16 +28,20 @@ class ManualDeploymentCommand : public SerialLinkedListAdapter<SerializeIF> {
ManualDeploymentCommand() { setLinks(); }
void setLinks() {
setStart(&burnTime);
burnTime.setNext(&dryRun);
setStart(&burnTimeSecs);
burnTimeSecs.setNext(&switchIntervalMs);
burnTimeSecs.setNext(&dryRun);
}
uint32_t getBurnTime() const { return burnTime.entry; }
uint32_t getBurnTimeSecs() const { return burnTimeSecs.entry; }
uint32_t getSwitchIntervalMs() const { return switchIntervalMs.entry; };
bool isDryRun() const { return dryRun.entry; }
private:
SerializeElement<uint32_t> burnTime;
SerializeElement<uint32_t> burnTimeSecs;
SerializeElement<uint32_t> switchIntervalMs;
SerializeElement<uint8_t> dryRun;
};
@ -50,7 +54,14 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
public SystemObject,
public HasActionsIF {
public:
//! Manual deployment of the solar arrays. Burn time and channels are supplied with TC parameters
//! Manual deployment of the solar arrays. Burn time, channel switch interval and dry run flag
//! are supplied as parameters. There are following cases to consider
//!
//! - Channel switch interval greater or equal to burn time: Only burn one channel
//! - Channel switch interval half of burn time: Burn each channel for half of the burn time.
//!
//! The dry run flag can be used to avoid actually toggling IO pins and only test the
//! application logic.
static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05;
static constexpr DeviceCommandId_t SWITCH_OFF_DEPLOYMENT = 0x06;
@ -157,7 +168,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
PeriodicOperationDivider opDivider = PeriodicOperationDivider(5);
uint8_t retryCounter = 3;
bool startFsmOn(uint32_t burnCountdownSecs, bool dryRun);
bool startFsmOn(uint32_t burnCountdownSecs, uint32_t channelAlternationIntervalMs, bool dryRun);
void startFsmOff();
void finishFsm(ReturnValue_t resultForActionHelper);
@ -175,8 +186,9 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
*/
Countdown burnCountdown;
// Only initial value, new approach is to burn each channel half of the total burn time.
Countdown channelAlternationCd =
Countdown(config::SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS * 1000);
Countdown(config::LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS * 1000);
/**
* The message queue id of the component commanding an action will be stored in this variable.

2
tmtc

@ -1 +1 @@
Subproject commit f3c0b7567aec22db02a07d76548617b8d163fb29
Subproject commit 2b5ad32fdd56d38e8318027b67d091d9e0ea3aba