TCS Observability #733

Merged
muellerr merged 19 commits from tcs-observability into main 2023-07-11 16:48:00 +02:00
3 changed files with 22 additions and 18 deletions
Showing only changes of commit f2f73b088d - Show all commits

View File

@ -1781,7 +1781,7 @@ void ThermalController::heaterTransitionControl(
if (currentHeaterStates[i] == heaterStates[i].target) { if (currentHeaterStates[i] == heaterStates[i].target) {
// Required for max heater period control // Required for max heater period control
if (currentHeaterStates[i] == heater::SwitchState::ON) { if (currentHeaterStates[i] == heater::SwitchState::ON) {
heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS[i]); heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS_MS[i]);
heaterStates[i].heaterOnPeriod.resetTimer(); heaterStates[i].heaterOnPeriod.resetTimer();
} else { } else {
// The heater might still be one for some thermal components, so cross-check // The heater might still be one for some thermal components, so cross-check
@ -1809,6 +1809,8 @@ void ThermalController::heaterMaxDurationControl(
heaterStates[i].switchTransition = false; heaterStates[i].switchTransition = false;
heaterStates[i].heaterSwitchControlCycles = 0; heaterStates[i].heaterSwitchControlCycles = 0;
heaterHandler.switchHeater(static_cast<heater::Switch>(i), heater::SwitchState::OFF); heaterHandler.switchHeater(static_cast<heater::Switch>(i), heater::SwitchState::OFF);
triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast<uint32_t>(i),
MAX_HEATER_ON_DURATIONS_MS[i]);
// The heater might still be one for some thermal components, so cross-check // The heater might still be one for some thermal components, so cross-check
// those components // those components
crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast<heater::Switch>(i)); crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast<heater::Switch>(i));

View File

@ -35,23 +35,23 @@ class ThermalController : public ExtendedControllerBase {
static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160; static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160;
// 1 hour // 1 hour
static constexpr uint32_t MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000; static constexpr uint32_t DEFAULT_MAX_HEATER_ON_DURATION_MS = 60 * 60 * 1000;
static constexpr uint32_t MAX_HEATER_ON_DURATIONS[8] = {// PLOC PROC board static constexpr uint32_t MAX_HEATER_ON_DURATIONS_MS[8] = {// PLOC PROC board
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// PCDU PDU // PCDU PDU
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// ACS Board // ACS Board
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// OBC Board // OBC Board
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// Camera // Camera
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// STR // STR
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// DRO // DRO
MAX_HEATER_ON_DURATION_MS, DEFAULT_MAX_HEATER_ON_DURATION_MS,
// S-Band // S-Band
MAX_HEATER_ON_DURATION_MS}; DEFAULT_MAX_HEATER_ON_DURATION_MS};
ThermalController(object_id_t objectId, HeaterHandler& heater, ThermalController(object_id_t objectId, HeaterHandler& heater,
const std::atomic_bool& tcsBoardShortUnavailable, bool pollPcdu1Tmp); const std::atomic_bool& tcsBoardShortUnavailable, bool pollPcdu1Tmp);

View File

@ -100,6 +100,8 @@ static constexpr Event MGT_OVERHEATING = MAKE_EVENT(8, severity::HIGH);
static constexpr Event TCS_SWITCHING_HEATER_ON = MAKE_EVENT(9, severity::INFO); static constexpr Event TCS_SWITCHING_HEATER_ON = MAKE_EVENT(9, severity::INFO);
//! [EXPORT] : [COMMENT] P1: Module index. P2: Heater index //! [EXPORT] : [COMMENT] P1: Module index. P2: Heater index
static constexpr Event TCS_SWITCHING_HEATER_OFF = MAKE_EVENT(10, severity::INFO); 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 { enum SetId : uint32_t {
SENSOR_TEMPERATURES = 0, SENSOR_TEMPERATURES = 0,