TCS ctrl bugfix
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2023-07-06 19:57:23 +02:00
parent ee4285075a
commit 12ff365433
2 changed files with 11 additions and 5 deletions

View File

@ -1687,8 +1687,9 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) {
// Heater off
if (htrCtx.switchState == HeaterHandler::SwitchState::OFF) {
if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) {
sif::info << "TCS: Heater " << static_cast<int>(thermalComponent) << " ON" << std::endl;
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, thermalComponent);
sif::info << "TCS: Heater " << (int)htrCtx.switchNr << " for component "
<< static_cast<int>(currThermalComponent) << " ON" << std::endl;
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, currThermalComponent);
heaterStates[htrCtx.switchNr].switchTransition = true;
heaterStates[htrCtx.switchNr].target = HeaterHandler::SwitchState::ON;
} else {
@ -1704,8 +1705,9 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) {
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 and heaterCtrlAllowed()) {
sif::info << "TCS: Heater " << static_cast<int>(thermalComponent) << " OFF" << std::endl;
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::OFF, thermalComponent);
sif::info << "TCS: Heater " << (int)htrCtx.switchNr << " for component "
<< static_cast<int>(currThermalComponent) << " OFF" << std::endl;
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::OFF, currThermalComponent);
heaterStates[htrCtx.switchNr].switchTransition = true;
heaterStates[htrCtx.switchNr].target = HeaterHandler::SwitchState::OFF;
}
@ -1755,9 +1757,10 @@ void ThermalController::heaterTransitionControl(const HeaterSwitchStates& curren
if (heaterStates[i].switchTransition) {
if (currentHeaterStates[i] == heaterStates[i].target) {
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;
}