TCS heater upper burn limit #732
@ -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
|
||||
|
||||
|
@ -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<heater::Switch>(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<heater::Switch>(i), HeaterHandler::SwitchState::OFF);
|
||||
triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast<uint32_t>(i),
|
||||
MAX_HEATER_ON_DURATIONS_MS[i]);
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user