diff --git a/CHANGELOG.md b/CHANGELOG.md index b2f94be2..5788400d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ will consitute of a breaking change warranting a new major release: equal or above v4. However, this software version is compatible to both v3 and v4 of the firmware. - The firmware version variables are global statics inititalized early during the program runtime now. This makes it possible to check the firmware version earlier. +- The TCS controller will now always command heaters OFF when being blind for thermal + components (no sensors available), irrespective of current switch state. ## Fixed @@ -29,6 +31,10 @@ will consitute of a breaking change warranting a new major release: - Small fixes for TMP1075 FDIR: Use strange and missed reply counters. - TCS controller: Last heater (S-band heater) was skipped for transition completion checks. +- TCS controller: A helper member to track the elapsed heater control cycles was not reset + properly, which could lead to switch transitions being completed immediately. This can + lead to weird bugs like heaters being commanded ON twice and can potentially lead to + other bugs. - TMP1075: Devices did not go to OFF mode when being set faulty. - Update PL PCDU 1 in TCS mode tree on the EM. - TMP1075: Possibly ignored health commands. diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index efc874bc..932cbad6 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1621,8 +1621,7 @@ void ThermalController::ctrlComponentTemperature(HeaterContext& htrCtx) { // No sensors available, so switch the heater off. We can not perform control tasks if we // are blind.. if (chooseHeater(htrCtx.switchNr, htrCtx.redSwitchNr)) { - if (heaterCtrlAllowed() and - (heaterHandler.getSwitchState(htrCtx.switchNr) == heater::SwitchState::ON)) { + if (heaterCtrlAllowed()) { heaterSwitchHelper(htrCtx.switchNr, heater::SwitchState::OFF, ctrlCtx.thermalComponent); } } @@ -1706,7 +1705,8 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { return; } - htrCtx.switchState = heaterHandler.getSwitchState(htrCtx.switchNr); + htrCtx.switchState = + static_cast(heaterInfo.heaterSwitchState[htrCtx.switchNr]); // Heater off if (htrCtx.switchState == heater::SwitchState::OFF) { if (ctrlCtx.sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) { @@ -1789,9 +1789,10 @@ void ThermalController::heaterTransitionControl( crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); } heaterStates[i].switchTransition = false; + heaterStates[i].heaterSwitchControlCycles = 0; continue; } - if (heaterStates[i].heaterSwitchControlCycles > 3) { + if (heaterStates[i].heaterSwitchControlCycles > 5) { heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; } diff --git a/mission/tcs/HeaterHandler.cpp b/mission/tcs/HeaterHandler.cpp index c97a404a..a1964d74 100644 --- a/mission/tcs/HeaterHandler.cpp +++ b/mission/tcs/HeaterHandler.cpp @@ -419,13 +419,13 @@ ReturnValue_t HeaterHandler::getAllSwitchStates(std::arraygetId(); }