From a8a0299b462f643ae3af458cfcf969ceb6bd7e7b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 3 Apr 2023 14:38:00 +0200 Subject: [PATCH] some adaptions, heater to off seems to work --- fsfw | 2 +- mission/controller/ThermalController.cpp | 4 ---- mission/tcs/HeaterHandler.cpp | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fsfw b/fsfw index 4f632e2c..e2e87b14 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 4f632e2c6866cee88dd9920a965aa0d079799aa3 +Subproject commit e2e87b149d91c51196c76d6b84243fce1c77a28a diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 021ad982..9ab16cf2 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1615,15 +1615,12 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { // still check whether components are out of range, which might be important information for the // top level control loop. if (heaterStates[htrCtx.switchNr].switchTransition) { - sif::debug << " heater in switch transition" << std::endl; htrCtx.doHeaterHandling = false; heaterCtrlCheckUpperLimits(htrCtx); } else { // Heater off htrCtx.switchState = heaterHandler.getSwitchState(htrCtx.switchNr); if (htrCtx.switchState == HeaterHandler::SwitchState::OFF) { - // sif::debug << " heater off" << std::endl; - // TODO: check NOP limit and maybe trigger fdir if (sensorTemp < htrCtx.tempLimit.opLowerLimit) { heaterHandler.switchHeater(htrCtx.switchNr, HeaterHandler::SwitchState::ON); sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater " @@ -1637,7 +1634,6 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { heaterCtrlCheckUpperLimits(htrCtx); // Heater on } else if (heaterHandler.getSwitchState(htrCtx.switchNr) == HeaterHandler::SwitchState::ON) { - // sif::debug << " heater on" << std::endl; if (thermalStates[thermalComponent].heating) { // We are already in a heating cycle, so need to check whether heating task is complete. if (sensorTemp >= htrCtx.tempLimit.opLowerLimit + TEMP_OFFSET) { diff --git a/mission/tcs/HeaterHandler.cpp b/mission/tcs/HeaterHandler.cpp index c6a3a121..529fe698 100644 --- a/mission/tcs/HeaterHandler.cpp +++ b/mission/tcs/HeaterHandler.cpp @@ -292,7 +292,8 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF && heater.waitMainSwitchOn) { // Just waiting for the main switch being set on return; - } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF) { + } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF or + mainSwitchState == PowerSwitchIF::SWITCH_UNKNOWN) { mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); heater.mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); heater.waitMainSwitchOn = true;