TCS heater upper burn limit #732

Merged
muellerr merged 18 commits from tcs-heater-upper-limit into main 2023-07-11 10:56:44 +02:00
3 changed files with 24 additions and 20 deletions
Showing only changes of commit 7337595d47 - Show all commits

View File

@ -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<heater::Switch>(i), HeaterHandler::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
// those components
crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast<heater::Switch>(i));

View File

@ -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,
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,

maybe we should change this to being a parameter someday

maybe we should change this to being a parameter someday

If all the changes fix the current heater issue, this mechanism will hopefully never have be used at all.. at least that is what I am hoping.

If all the changes fix the current heater issue, this mechanism will hopefully never have be used at all.. at least that is what I am hoping.
// PCDU PDU
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// ACS Board
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// OBC Board
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// Camera
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// STR
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// DRO
MAX_HEATER_ON_DURATION_MS,
DEFAULT_MAX_HEATER_ON_DURATION_MS,
// S-Band
MAX_HEATER_ON_DURATION_MS};
DEFAULT_MAX_HEATER_ON_DURATION_MS};
ThermalController(object_id_t objectId, HeaterHandler& heater,
const std::atomic_bool& tcsBoardShortUnavailable, bool pollPcdu1Tmp);

View File

@ -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,