Force the heater off and show a "Cool down" indicator during a passive cooldown
A ramp step whose target is below the current actual temperature can only be reached by ambient cooling - the heater can't actively cool. SudTask now detects this once per ramp phase and calls the controller's new set_cooling() override (forces y=0, bypassing the FSM) instead of waiting for its hysteresis-based IDLE transition. The GUI shows a blinking blue "Cool down" label in the status bar while this is active. Progression already only advances once theta_ist matches theta_soll regardless of direction, so no change was needed there.
This commit is contained in:
@@ -61,6 +61,14 @@ class SudTask(ATask):
|
||||
ramping = self.sud.state == SudState.RAMPING
|
||||
phase = ramp if ramping and ramp is not None else hold
|
||||
|
||||
# A ramp step whose target is below the current temperature can
|
||||
# only be reached by passive cooling - force the heater off for
|
||||
# its whole duration (decided once, here, rather than re-checked
|
||||
# every tick) instead of relying on the controller's own FSM to
|
||||
# notice and idle out.
|
||||
cooling = ramping and ramp is not None and ramp['temp'] < self.tc.get_theta_ist() - TEMP_REACHED_TOLERANCE
|
||||
self.tc.set_cooling(cooling)
|
||||
|
||||
if step is not None:
|
||||
self.apply_plant_params(step)
|
||||
if ramping and ramp is not None:
|
||||
@@ -76,6 +84,7 @@ class SudTask(ATask):
|
||||
'Rate': ramp.get('rate') if ramp else None,
|
||||
'Duration': hold.get('duration') if (hold is not None and not ramping) else None,
|
||||
'WaitForUser': step.get('user_wait_for_continue', False) if step else None,
|
||||
'Cooling': cooling,
|
||||
}}))
|
||||
|
||||
def on_state_changed(self, value):
|
||||
|
||||
Reference in New Issue
Block a user