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:
@@ -77,6 +77,15 @@ if __name__ == '__main__':
|
||||
if step is not None:
|
||||
ramping = sud.state == SudState.RAMPING
|
||||
phase = step['ramp'] if ramping and 'ramp' in step else step.get('hold', {})
|
||||
|
||||
# A ramp step whose target is below the current temperature can
|
||||
# only be reached by passive cooling - force the heater off,
|
||||
# mirroring tasks/sud.py's SudTask.
|
||||
cooling = ramping and 'ramp' in step and step['ramp']['temp'] < ctrl.get_theta_ist() - TEMP_REACHED_TOLERANCE
|
||||
ctrl.set_cooling(cooling)
|
||||
if cooling:
|
||||
print(" -> cooling down to {}".format(step['ramp']['temp']))
|
||||
|
||||
print(f"Step {step['number']}: {step['descr']}")
|
||||
apply_plant_params(step)
|
||||
if ramping and 'ramp' in step:
|
||||
|
||||
Reference in New Issue
Block a user