From ce19f30325b6bf29cc41694ebfab9ca04a2ccc48 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 6 Jul 2023 22:06:54 +0200 Subject: [PATCH 01/11] continue max heater duration --- mission/controller/ThermalController.cpp | 46 +++++++++++++++++++++--- mission/controller/ThermalController.h | 25 +++++++++++++ tmtc | 2 +- 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index fca71acc..603a72ea 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -209,8 +209,12 @@ void ThermalController::performControlOperation() { } else { transitionWhenHeatersOffCycles++; } - } else if (mode != MODE_OFF and not tcsBrdShortlyUnavailable) { - performThermalModuleCtrl(heaterSwitchStateArray); + } else if (mode != MODE_OFF) { + if (not tcsBrdShortlyUnavailable) { + performThermalModuleCtrl(heaterSwitchStateArray); + } + heaterTransitionControl(heaterSwitchStateArray); + heaterMaxDurationControl(heaterSwitchStateArray); } } @@ -1586,9 +1590,8 @@ void ThermalController::performThermalModuleCtrl(const HeaterSwitchStates& heate eBandTooHotFlag = false; } } - - heaterTransitionControl(heaterSwitchStates); } + void ThermalController::ctrlComponentTemperature(HeaterContext& htrCtx) { if (selectAndReadSensorTemp(htrCtx)) { if (chooseHeater(htrCtx.switchNr, htrCtx.redSwitchNr)) { @@ -1613,6 +1616,7 @@ bool ThermalController::selectAndReadSensorTemp(HeaterContext& htrCtx) { sensors[i].second > SANITY_LIMIT_LOWER_TEMP and sensors[i].second < SANITY_LIMIT_UPPER_TEMP) { sensorTemp = sensors[i].second; + currentSensorIndex = i; thermalStates[thermalComponent].errorCounter = 0; return true; } @@ -1689,7 +1693,6 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) { sif::info << "TCS: Heater " << static_cast(thermalComponent) << " ON" << std::endl; heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, thermalComponent); - heaterStates[htrCtx.switchNr].switchTransition = true; heaterStates[htrCtx.switchNr].target = HeaterHandler::SwitchState::ON; } else { // Even if heater control is now allowed, we can update the state. @@ -1754,6 +1757,11 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren for (unsigned i = 0; i < 7; i++) { if (heaterStates[i].switchTransition) { if (currentHeaterStates[i] == heaterStates[i].target) { + // Required for max heat period control + if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { + heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS[i]); + heaterStates[i].heaterOnPeriod.resetTimer(); + } heaterStates[i].switchTransition = false; continue; } @@ -1765,6 +1773,26 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren } } } + +void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& currentHeaterStates) { + for (unsigned i = 0; i < heater::Switch::NUMBER_OF_SWITCHES; i++) { + if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON and + heaterStates[i].heaterOnPeriod.hasTimedOut()) { + heaterStates[i].switchTransition = false; + heaterStates[i].heaterSwitchControlCycles = 0; + heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); + for (unsigned j = 0; j < thermalStates.size(); j++) { + if (thermalStates[j].heating and thermalStates[j].heaterSwitch == i) { + timeval currentTime; + Clock::getClockMonotonic(¤tTime); + thermalStates[j].heating = false; + thermalStates[j].heaterEndTime = currentTime.tv_sec; + } + } + } + } +} + uint32_t ThermalController::tempFloatToU32() const { auto sensorTempAsFloat = static_cast(sensorTemp); uint32_t tempRaw = 0; @@ -1799,6 +1827,11 @@ bool ThermalController::heaterCtrlAllowed() const { return submode != SUBMODE_NO void ThermalController::resetThermalStates() { for (auto& thermalState : thermalStates) { thermalState.heating = false; + thermalState.errorCounter = 0; + thermalState.heaterStartTime = 0; + thermalState.heaterEndTime = 0; + thermalState.sensorIndex = 0; + thermalState.heaterSwitch = heater::Switch::NUMBER_OF_SWITCHES; } } @@ -1809,6 +1842,9 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, Clock::getClockMonotonic(¤tTime); if (state == HeaterHandler::SwitchState::ON) { heaterHandler.switchHeater(switchNr, state); + heaterStates[switchNr].switchTransition = true; + thermalStates[componentIdx].sensorIndex = currentSensorIndex; + thermalStates[componentIdx].heaterSwitch = switchNr; thermalStates[componentIdx].heating = true; thermalStates[componentIdx].heaterStartTime = currentTime.tv_sec; } else { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 2518a13e..6695e7e7 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -48,8 +48,11 @@ struct TempLimits { struct ThermalState { uint8_t errorCounter; + // Which sensor is used for this component? + uint8_t sensorIndex = 0; // Is heating on for that thermal module? bool heating = false; + // Which switch is being used for heating the component heater::Switch heaterSwitch = heater::Switch::NUMBER_OF_SWITCHES; // Heater start time and end times as UNIX seconds. Please note that these times will be updated // when a switch command is sent, with no guarantess that the heater actually went on. @@ -61,6 +64,7 @@ struct HeaterState { bool switchTransition; HeaterHandler::SwitchState target; uint8_t heaterSwitchControlCycles; + Countdown heaterOnPeriod; }; using HeaterSwitchStates = std::array; @@ -102,6 +106,25 @@ class ThermalController : public ExtendedControllerBase { static constexpr int16_t SANITY_LIMIT_LOWER_TEMP = -80; static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160; + // 1 hour + static constexpr uint32_t MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; + static constexpr uint32_t MAX_HEATER_ON_DURATIONS[8] = {// PLOC PROC board + MAX_HEATER_ON_DURATION_MS, + // PCDU PDU + MAX_HEATER_ON_DURATION_MS, + // ACS Board + MAX_HEATER_ON_DURATION_MS, + // OBC Board + MAX_HEATER_ON_DURATION_MS, + // Camera + MAX_HEATER_ON_DURATION_MS, + // STR + MAX_HEATER_ON_DURATION_MS, + // DRO + MAX_HEATER_ON_DURATION_MS, + // S-Band + MAX_HEATER_ON_DURATION_MS}; + ThermalController(object_id_t objectId, HeaterHandler& heater, const std::atomic_bool& tcsBoardShortUnavailable, bool pollPcdu1Tmp); virtual ~ThermalController(); @@ -256,6 +279,7 @@ class ThermalController : public ExtendedControllerBase { TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0); double sensorTemp = INVALID_TEMPERATURE; + uint8_t currentSensorIndex = 0; ThermalComponents thermalComponent = NONE; bool redSwitchNrInUse = false; MessageQueueId_t camId = MessageQueueIF::NO_QUEUE; @@ -348,6 +372,7 @@ class ThermalController : public ExtendedControllerBase { void ctrlMpa(); void ctrlScexBoard(); void heaterTransitionControl(const HeaterSwitchStates& currentHeaterStates); + void heaterMaxDurationControl(const HeaterSwitchStates& currentHeaterStates); void setMode(Mode_t mode, Submode_t submode); uint32_t tempFloatToU32() const; bool tooHotHandler(object_id_t object, bool& oneShotFlag); diff --git a/tmtc b/tmtc index c48f04ee..5785bbd0 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c48f04eed5152f319b217870292968fb67b763d4 +Subproject commit 5785bbd0ccb045e072f347a5ff2265c610d3872c From c558a117b038fb678221f311f530c4f00097ff5b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 6 Jul 2023 22:21:00 +0200 Subject: [PATCH 02/11] some docs --- mission/controller/ThermalController.cpp | 39 +++++++++++++++--------- mission/controller/ThermalController.h | 14 +++++++++ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index da508f33..4ff06fef 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1693,7 +1693,6 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) { sif::info << "TCS: Heater " << static_cast(thermalComponent) << " ON" << std::endl; heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, thermalComponent); - heaterStates[htrCtx.switchNr].target = HeaterHandler::SwitchState::ON; } else { // Even if heater control is now allowed, we can update the state. thermalStates[thermalComponent].heating = false; @@ -1757,10 +1756,14 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren for (unsigned i = 0; i < heater::Switch::NUMBER_OF_SWITCHES; i++) { if (heaterStates[i].switchTransition) { if (currentHeaterStates[i] == heaterStates[i].target) { - // Required for max heat period control + // Required for max heater period control if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS[i]); heaterStates[i].heaterOnPeriod.resetTimer(); + } else { + // The heater might still be one for some thermal components, so cross-check + // those components + crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); } heaterStates[i].switchTransition = false; continue; @@ -1781,14 +1784,9 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); - for (unsigned j = 0; j < thermalStates.size(); j++) { - if (thermalStates[j].heating and thermalStates[j].heaterSwitch == i) { - timeval currentTime; - Clock::getClockMonotonic(¤tTime); - thermalStates[j].heating = false; - thermalStates[j].heaterEndTime = currentTime.tv_sec; - } - } + // The heater might still be one for some thermal components, so cross-check + // those components + crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); } } } @@ -1836,19 +1834,20 @@ void ThermalController::resetThermalStates() { } void ThermalController::heaterSwitchHelper(heater::Switch switchNr, - HeaterHandler::SwitchState state, + HeaterHandler::SwitchState targetState, unsigned componentIdx) { timeval currentTime; Clock::getClockMonotonic(¤tTime); - if (state == HeaterHandler::SwitchState::ON) { - heaterHandler.switchHeater(switchNr, state); + if (targetState == HeaterHandler::SwitchState::ON) { + heaterHandler.switchHeater(switchNr, targetState); + heaterStates[switchNr].target = HeaterHandler::SwitchState::ON; heaterStates[switchNr].switchTransition = true; thermalStates[componentIdx].sensorIndex = currentSensorIndex; thermalStates[componentIdx].heaterSwitch = switchNr; thermalStates[componentIdx].heating = true; thermalStates[componentIdx].heaterStartTime = currentTime.tv_sec; } else { - heaterHandler.switchHeater(switchNr, state); + heaterHandler.switchHeater(switchNr, targetState); thermalStates[componentIdx].heating = false; thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec; } @@ -1873,6 +1872,18 @@ ThermalController::~ThermalController() { } } +void ThermalController::crossCheckHeaterStateOfComponentsWhenHeaterGoesOff( + heater::Switch switchIdx) { + for (unsigned j = 0; j < thermalStates.size(); j++) { + if (thermalStates[j].heating and thermalStates[j].heaterSwitch == switchIdx) { + timeval currentTime; + Clock::getClockMonotonic(¤tTime); + thermalStates[j].heating = false; + thermalStates[j].heaterEndTime = currentTime.tv_sec; + } + } +} + void ThermalController::tooHotHandlerWhichClearsOneShotFlag(object_id_t object, bool& oneShotFlag) { // Clear the one shot flag is the component is in acceptable temperature range. if (not tooHotHandler(object, oneShotFlag) and not componentAboveUpperLimit) { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 6695e7e7..021be00e 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -371,8 +371,22 @@ class ThermalController : public ExtendedControllerBase { void ctrlTx(); void ctrlMpa(); void ctrlScexBoard(); + + /** + * The transition of heaters might take some time. As long as a transition is + * going on, the TCS controller works in a reduced form. This function takes care + * of tracking transition and capturing their completion. + * @param currentHeaterStates + */ void heaterTransitionControl(const HeaterSwitchStates& currentHeaterStates); + /** + * Control tasks to prevent heaters being on for prolonged periods. Ideally, this + * should never happen, but this task prevents bugs from causing heaters to stay on + * for a long time, which draws a lot of power. + * @param currentHeaterStates + */ void heaterMaxDurationControl(const HeaterSwitchStates& currentHeaterStates); + void crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(heater::Switch switchIdx); void setMode(Mode_t mode, Submode_t submode); uint32_t tempFloatToU32() const; bool tooHotHandler(object_id_t object, bool& oneShotFlag); From ff7d0b3989d5cc0014bbcaa549227625ae035b10 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Jul 2023 11:57:00 +0200 Subject: [PATCH 03/11] compile fixes --- mission/controller/ThermalController.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index f0cf3bd2..be88b760 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1693,7 +1693,7 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) { sif::info << "TCS: Heater " << static_cast(htrCtx.switchNr) << " for component " << static_cast(currThermalComponent) << " ON" << std::endl; - heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, thermalComponent); + heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, currThermalComponent); } else { // Even if heater control is now allowed, we can update the state. thermalStates[currThermalComponent].heating = false; @@ -1790,6 +1790,8 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); + } else if (currentHeaterStates[i] == HeaterHandler::SwitchState::OFF) { + heaterStates[i].heaterOnPeriod.resetTimer(); } } } @@ -1841,8 +1843,8 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, unsigned componentIdx) { timeval currentTime; Clock::getClockMonotonic(¤tTime); - if (state == HeaterHandler::SwitchState::ON) { - heaterHandler.switchHeater(switchNr, state); + if (targetState == HeaterHandler::SwitchState::ON) { + heaterHandler.switchHeater(switchNr, targetState); heaterStates[switchNr].target = HeaterHandler::SwitchState::ON; heaterStates[switchNr].switchTransition = true; thermalStates[componentIdx].sensorIndex = currentSensorIndex; @@ -1852,7 +1854,7 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast(currThermalComponent), static_cast(switchNr)); } else { - heaterHandler.switchHeater(switchNr, state); + heaterHandler.switchHeater(switchNr, targetState); thermalStates[componentIdx].heating = false; thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec; triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast(currThermalComponent), From 7337595d47af96639654325998c8ae2b79e9326b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Jul 2023 12:03:34 +0200 Subject: [PATCH 04/11] add event --- mission/controller/ThermalController.cpp | 8 +++--- mission/controller/ThermalController.h | 34 ++++++++++++------------ mission/controller/tcsDefs.h | 2 ++ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index be88b760..aefce4ca 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1759,8 +1759,8 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren if (heaterStates[i].switchTransition) { if (currentHeaterStates[i] == heaterStates[i].target) { // Required for max heater period control - if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { - heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS[i]); + if (currentHeaterStates[i] == heater::SwitchState::ON) { + heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS_MS[i]); heaterStates[i].heaterOnPeriod.resetTimer(); } else { // The heater might still be one for some thermal components, so cross-check @@ -1786,7 +1786,9 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre heaterStates[i].heaterOnPeriod.hasTimedOut()) { heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; - heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); + heaterHandler.switchHeater(static_cast(i), heater::SwitchState::OFF); + triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), + MAX_HEATER_ON_DURATIONS_MS[i]); // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 82896116..6376f501 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -107,23 +107,23 @@ class ThermalController : public ExtendedControllerBase { static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160; // 1 hour - static constexpr uint32_t MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; - static constexpr uint32_t MAX_HEATER_ON_DURATIONS[8] = {// PLOC PROC board - MAX_HEATER_ON_DURATION_MS, - // PCDU PDU - MAX_HEATER_ON_DURATION_MS, - // ACS Board - MAX_HEATER_ON_DURATION_MS, - // OBC Board - MAX_HEATER_ON_DURATION_MS, - // Camera - MAX_HEATER_ON_DURATION_MS, - // STR - MAX_HEATER_ON_DURATION_MS, - // DRO - MAX_HEATER_ON_DURATION_MS, - // S-Band - MAX_HEATER_ON_DURATION_MS}; + static constexpr uint32_t DEFAULT_MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; + static constexpr uint32_t MAX_HEATER_ON_DURATIONS_MS[8] = {// PLOC PROC board + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // PCDU PDU + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // ACS Board + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // OBC Board + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // Camera + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // STR + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // DRO + DEFAULT_MAX_HEATER_ON_DURATION_MS, + // S-Band + DEFAULT_MAX_HEATER_ON_DURATION_MS}; ThermalController(object_id_t objectId, HeaterHandler& heater, const std::atomic_bool& tcsBoardShortUnavailable, bool pollPcdu1Tmp); diff --git a/mission/controller/tcsDefs.h b/mission/controller/tcsDefs.h index c77d9352..6442b51a 100644 --- a/mission/controller/tcsDefs.h +++ b/mission/controller/tcsDefs.h @@ -22,6 +22,8 @@ static constexpr Event MGT_OVERHEATING = MAKE_EVENT(8, severity::HIGH); static constexpr Event TCS_SWITCHING_HEATER_ON = MAKE_EVENT(9, severity::INFO); //! [EXPORT] : [COMMENT] P1: Module index. P2: Heater index static constexpr Event TCS_SWITCHING_HEATER_OFF = MAKE_EVENT(10, severity::INFO); +//! [EXPORT] : [COMMENT] P1: Heater index. P2: Maximum burn time for heater. +static constexpr Event TCS_HEATER_MAX_BURN_TIME_REACHED = MAKE_EVENT(11, severity::MEDIUM); enum SetId : uint32_t { SENSOR_TEMPERATURES = 0, From b662e220e13c563ca0a915feef58c92031192828 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Jul 2023 12:06:39 +0200 Subject: [PATCH 05/11] bump tmtc --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 7 +++++-- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 1 + generators/bsp_q7s_events.csv | 1 + generators/events/translateEvents.cpp | 7 +++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 9 files changed, 21 insertions(+), 10 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 30774cf9..b98926e5 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 298 translations. + * @brief Auto-generated event translation file. Contains 299 translations. * @details - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateEvents.h" @@ -288,6 +288,7 @@ const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TCS_SWITCHING_HEATER_ON_STRING = "TCS_SWITCHING_HEATER_ON"; const char *TCS_SWITCHING_HEATER_OFF_STRING = "TCS_SWITCHING_HEATER_OFF"; +const char *TCS_HEATER_MAX_BURN_TIME_REACHED_STRING = "TCS_HEATER_MAX_BURN_TIME_REACHED"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -872,6 +873,8 @@ const char *translateEvents(Event event) { return TCS_SWITCHING_HEATER_ON_STRING; case (14110): return TCS_SWITCHING_HEATER_OFF_STRING; + case (14111): + return TCS_HEATER_MAX_BURN_TIME_REACHED_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index c073905f..458081f9 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 171 translations. - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index a26b0cdc..3f1bbb77 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -282,6 +282,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14108;0x371c;MGT_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14109;0x371d;TCS_SWITCHING_HEATER_ON;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h 14110;0x371e;TCS_SWITCHING_HEATER_OFF;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h +14111;0x371f;TCS_HEATER_MAX_BURN_TIME_REACHED;MEDIUM;P1: Heater index. P2: Maximum burn time for heater.;mission/controller/tcsDefs.h 14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h 14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index a26b0cdc..3f1bbb77 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -282,6 +282,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14108;0x371c;MGT_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14109;0x371d;TCS_SWITCHING_HEATER_ON;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h 14110;0x371e;TCS_SWITCHING_HEATER_OFF;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h +14111;0x371f;TCS_HEATER_MAX_BURN_TIME_REACHED;MEDIUM;P1: Heater index. P2: Maximum burn time for heater.;mission/controller/tcsDefs.h 14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h 14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 30774cf9..b98926e5 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 298 translations. + * @brief Auto-generated event translation file. Contains 299 translations. * @details - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateEvents.h" @@ -288,6 +288,7 @@ const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TCS_SWITCHING_HEATER_ON_STRING = "TCS_SWITCHING_HEATER_ON"; const char *TCS_SWITCHING_HEATER_OFF_STRING = "TCS_SWITCHING_HEATER_OFF"; +const char *TCS_HEATER_MAX_BURN_TIME_REACHED_STRING = "TCS_HEATER_MAX_BURN_TIME_REACHED"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -872,6 +873,8 @@ const char *translateEvents(Event event) { return TCS_SWITCHING_HEATER_ON_STRING; case (14110): return TCS_SWITCHING_HEATER_OFF_STRING; + case (14111): + return TCS_HEATER_MAX_BURN_TIME_REACHED_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 379265c6..5a9af4d7 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 30774cf9..b98926e5 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 298 translations. + * @brief Auto-generated event translation file. Contains 299 translations. * @details - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateEvents.h" @@ -288,6 +288,7 @@ const char *HEATER_NOT_OFF_FOR_OFF_MODE_STRING = "HEATER_NOT_OFF_FOR_OFF_MODE"; const char *MGT_OVERHEATING_STRING = "MGT_OVERHEATING"; const char *TCS_SWITCHING_HEATER_ON_STRING = "TCS_SWITCHING_HEATER_ON"; const char *TCS_SWITCHING_HEATER_OFF_STRING = "TCS_SWITCHING_HEATER_OFF"; +const char *TCS_HEATER_MAX_BURN_TIME_REACHED_STRING = "TCS_HEATER_MAX_BURN_TIME_REACHED"; const char *TX_TIMER_EXPIRED_STRING = "TX_TIMER_EXPIRED"; const char *BIT_LOCK_TX_ON_STRING = "BIT_LOCK_TX_ON"; const char *POSSIBLE_FILE_CORRUPTION_STRING = "POSSIBLE_FILE_CORRUPTION"; @@ -872,6 +873,8 @@ const char *translateEvents(Event event) { return TCS_SWITCHING_HEATER_ON_STRING; case (14110): return TCS_SWITCHING_HEATER_OFF_STRING; + case (14111): + return TCS_HEATER_MAX_BURN_TIME_REACHED_STRING; case (14201): return TX_TIMER_EXPIRED_STRING; case (14202): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 379265c6..5a9af4d7 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-07-06 19:00:21 + * Generated on: 2023-07-07 12:06:06 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 069f84d2..15d25b4c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 069f84d2207c03e8d334cfce3f7dd530babe17b0 +Subproject commit 15d25b4c5b7ad21603a83a6c09835f5c97273b17 From fa85cc4d78aa5f6aa53635e36979e2929463475c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Jul 2023 12:22:37 +0200 Subject: [PATCH 06/11] pls compile --- mission/controller/ThermalController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index aefce4ca..ce66ccc1 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1759,7 +1759,7 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren if (heaterStates[i].switchTransition) { if (currentHeaterStates[i] == heaterStates[i].target) { // Required for max heater period control - if (currentHeaterStates[i] == heater::SwitchState::ON) { + if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS_MS[i]); heaterStates[i].heaterOnPeriod.resetTimer(); } else { @@ -1786,7 +1786,7 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre heaterStates[i].heaterOnPeriod.hasTimedOut()) { heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; - heaterHandler.switchHeater(static_cast(i), heater::SwitchState::OFF); + heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), MAX_HEATER_ON_DURATIONS_MS[i]); // The heater might still be one for some thermal components, so cross-check From df3755d6cce0ceb9dd65f9f27ec1b2bf0a42bf2a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Jul 2023 16:18:16 +0200 Subject: [PATCH 07/11] done --- CHANGELOG.md | 2 ++ mission/controller/ThermalController.cpp | 7 ++++++- mission/controller/ThermalController.h | 7 ++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5788400d..4a257fc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ will consitute of a breaking change warranting a new major release: - Two events for heaters being commanded ON and OFF by the TCS controller - Upper limit for burn time of TCS heaters. Currently set to 1 hour for each heater. + This mechanism will only track the burn time for heaters which were commanded by the + TCS controller. # [v6.0.0] 2023-07-02 diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index ce66ccc1..b0f0f9d1 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1762,7 +1762,9 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS_MS[i]); heaterStates[i].heaterOnPeriod.resetTimer(); + heaterStates[i].trackHeaterMaxPeriod = true; } else { + heaterStates[i].trackHeaterMaxPeriod = false; // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); @@ -1782,10 +1784,13 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& currentHeaterStates) { for (unsigned i = 0; i < heater::Switch::NUMBER_OF_SWITCHES; i++) { + // Right now, we only track the maximum duration for heater which were commanded by the TCS + // controller. if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON and - heaterStates[i].heaterOnPeriod.hasTimedOut()) { + heaterStates[i].trackHeaterMaxPeriod and heaterStates[i].heaterOnPeriod.hasTimedOut()) { heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; + heaterStates[i].trackHeaterMaxPeriod = false; heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), MAX_HEATER_ON_DURATIONS_MS[i]); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 6376f501..74e06cf5 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -61,9 +61,10 @@ struct ThermalState { }; struct HeaterState { - bool switchTransition; - HeaterHandler::SwitchState target; - uint8_t heaterSwitchControlCycles; + bool switchTransition = false; + HeaterHandler::SwitchState target = HeaterHandler::SwitchState::OFF; + uint8_t heaterSwitchControlCycles = 0; + bool trackHeaterMaxPeriod = false; Countdown heaterOnPeriod; }; From 33de08eafc010e78c6c5caa7751801f68adea39f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Jul 2023 13:28:36 +0200 Subject: [PATCH 08/11] this should be better --- dummies/TemperatureSensorInserter.cpp | 9 ++++++++- dummies/TemperatureSensorInserter.h | 1 + mission/controller/ThermalController.cpp | 22 ++++++++++++++-------- mission/controller/ThermalController.h | 5 +++-- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index dc94195e..43065b83 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -15,7 +15,7 @@ TemperatureSensorInserter::TemperatureSensorInserter( tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {} ReturnValue_t TemperatureSensorInserter::initialize() { - testCase = TestCase::NONE; + testCase = TestCase::COLD_PLOC_STAYS_COLD; return returnvalue::OK; } @@ -126,6 +126,13 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { sif::debug << "Setting CAM temperature back to normal" << std::endl; max31865DummyMap[objects::RTD_2_IC5_4K_CAMERA]->setTemperature(0, true); } + break; + } + case (TestCase::COLD_PLOC_STAYS_COLD): { + if (cycles == 15) { + sif::debug << "Setting cold PLOC temperature" << std::endl; + max31865DummyMap[objects::RTD_0_IC3_PLOC_HEATSPREADER]->setTemperature(-40, true); + } } } cycles++; diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 006b0639..9da83bc9 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -33,6 +33,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject COLD_STR_CONSECUTIVE = 5, COLD_CAMERA = 6, COLD_PLOC_CONSECUTIVE = 7, + COLD_PLOC_STAYS_COLD = 8 }; int iteration = 0; uint32_t cycles = 0; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index b0f0f9d1..acfa8568 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1791,9 +1791,10 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; heaterStates[i].trackHeaterMaxPeriod = false; - heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), MAX_HEATER_ON_DURATIONS_MS[i]); + heaterSwitchHelper(static_cast(i), HeaterHandler::SwitchState::OFF, + std::nullopt); // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); @@ -1847,23 +1848,28 @@ void ThermalController::resetThermalStates() { void ThermalController::heaterSwitchHelper(heater::Switch switchNr, HeaterHandler::SwitchState targetState, - unsigned componentIdx) { + std::optional componentIdx) { timeval currentTime; Clock::getClockMonotonic(¤tTime); if (targetState == HeaterHandler::SwitchState::ON) { heaterHandler.switchHeater(switchNr, targetState); heaterStates[switchNr].target = HeaterHandler::SwitchState::ON; heaterStates[switchNr].switchTransition = true; - thermalStates[componentIdx].sensorIndex = currentSensorIndex; - thermalStates[componentIdx].heaterSwitch = switchNr; - thermalStates[componentIdx].heating = true; - thermalStates[componentIdx].heaterStartTime = currentTime.tv_sec; + if (componentIdx.has_value()) { + unsigned componentIdxVal = componentIdx.value(); + thermalStates[componentIdxVal].sensorIndex = currentSensorIndex; + thermalStates[componentIdxVal].heaterSwitch = switchNr; + thermalStates[componentIdxVal].heating = true; + thermalStates[componentIdxVal].heaterStartTime = currentTime.tv_sec; + } triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast(currThermalComponent), static_cast(switchNr)); } else { heaterHandler.switchHeater(switchNr, targetState); - thermalStates[componentIdx].heating = false; - thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec; + if (componentIdx.has_value()) { + thermalStates[componentIdx.value()].heating = false; + thermalStates[componentIdx.value()].heaterEndTime = currentTime.tv_sec; + } triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast(currThermalComponent), static_cast(switchNr)); } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 74e06cf5..7ba86487 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -24,6 +24,7 @@ #include #include +#include /** * NOP Limit: Hard limit for device, usually from datasheet. Device damage is possible lif NOP limit @@ -110,7 +111,7 @@ class ThermalController : public ExtendedControllerBase { // 1 hour static constexpr uint32_t DEFAULT_MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; static constexpr uint32_t MAX_HEATER_ON_DURATIONS_MS[8] = {// PLOC PROC board - DEFAULT_MAX_HEATER_ON_DURATION_MS, + 60 * 1000, // PCDU PDU DEFAULT_MAX_HEATER_ON_DURATION_MS, // ACS Board @@ -347,7 +348,7 @@ class ThermalController : public ExtendedControllerBase { void heaterSwitchHelperAllOff(); void heaterSwitchHelper(heater::Switch switchNr, HeaterHandler::SwitchState state, - unsigned componentIdx); + std::optional componentIdx); void ctrlAcsBoard(); void ctrlMgt(); From ce2755e161f3a0525d12be0c7e26d84e81a3b5a0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Jul 2023 13:56:30 +0200 Subject: [PATCH 09/11] that should be it --- dummies/TemperatureSensorInserter.cpp | 10 +++++++++- dummies/TemperatureSensorInserter.h | 3 ++- mission/controller/ThermalController.cpp | 2 -- mission/controller/ThermalController.h | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 43065b83..bce48606 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -15,7 +15,7 @@ TemperatureSensorInserter::TemperatureSensorInserter( tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {} ReturnValue_t TemperatureSensorInserter::initialize() { - testCase = TestCase::COLD_PLOC_STAYS_COLD; + testCase = TestCase::COLD_CAMERA_STAYS_COLD; return returnvalue::OK; } @@ -133,6 +133,14 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { sif::debug << "Setting cold PLOC temperature" << std::endl; max31865DummyMap[objects::RTD_0_IC3_PLOC_HEATSPREADER]->setTemperature(-40, true); } + break; + } + case (TestCase::COLD_CAMERA_STAYS_COLD): { + if (cycles == 15) { + sif::debug << "Setting cold PLOC temperature" << std::endl; + max31865DummyMap[objects::RTD_2_IC5_4K_CAMERA]->setTemperature(-40, true); + } + break; } } cycles++; diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 9da83bc9..9ca3c936 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -33,7 +33,8 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject COLD_STR_CONSECUTIVE = 5, COLD_CAMERA = 6, COLD_PLOC_CONSECUTIVE = 7, - COLD_PLOC_STAYS_COLD = 8 + COLD_PLOC_STAYS_COLD = 8, + COLD_CAMERA_STAYS_COLD = 9 }; int iteration = 0; uint32_t cycles = 0; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index acfa8568..7451e684 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1798,8 +1798,6 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); - } else if (currentHeaterStates[i] == HeaterHandler::SwitchState::OFF) { - heaterStates[i].heaterOnPeriod.resetTimer(); } } } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 7ba86487..9399cab1 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -111,7 +111,7 @@ class ThermalController : public ExtendedControllerBase { // 1 hour static constexpr uint32_t DEFAULT_MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; static constexpr uint32_t MAX_HEATER_ON_DURATIONS_MS[8] = {// PLOC PROC board - 60 * 1000, + DEFAULT_MAX_HEATER_ON_DURATION_MS, // PCDU PDU DEFAULT_MAX_HEATER_ON_DURATION_MS, // ACS Board From 53d53e8771b45ac6ad3b000987e60ca8856970a8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Jul 2023 16:33:29 +0200 Subject: [PATCH 10/11] disable test case --- dummies/TemperatureSensorInserter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index bce48606..942231f5 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -15,7 +15,7 @@ TemperatureSensorInserter::TemperatureSensorInserter( tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {} ReturnValue_t TemperatureSensorInserter::initialize() { - testCase = TestCase::COLD_CAMERA_STAYS_COLD; + testCase = TestCase::NONE; return returnvalue::OK; } From ed7d75a777eead05d90c1374282efc9882c4fa48 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 11 Jul 2023 10:44:46 +0200 Subject: [PATCH 11/11] thermal controller --- mission/controller/ThermalController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index c21d3e08..49fa7e20 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1818,7 +1818,7 @@ bool ThermalController::heaterCtrlAllowed() const { return submode != SUBMODE_NO void ThermalController::resetThermalStates() { for (auto& thermalState : thermalStates) { thermalState.heating = false; - thermalState.errorCounter = 0; + thermalState.noSensorAvailableCounter = 0; thermalState.heaterStartTime = 0; thermalState.heaterEndTime = 0; thermalState.sensorIndex = 0;