From fd9f99e752a602ad0a273a78f744b8fd824f43ca Mon Sep 17 00:00:00 2001 From: sans Date: Wed, 6 Sep 2023 08:40:18 +0200 Subject: [PATCH] magfield.tcl: introduce timeout for ramp to fielf --- tcl/drivers/magfield.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcl/drivers/magfield.tcl b/tcl/drivers/magfield.tcl index 23a7192..0f14003 100644 --- a/tcl/drivers/magfield.tcl +++ b/tcl/drivers/magfield.tcl @@ -247,8 +247,13 @@ proc magfield::run {} { if {[sct phase] != 0 || abs($tf - $pf) > $tol || $pm != 1} { # we have to go to persistent field if {![sct leads_at_field]} { + if {[sct phase] == 2 && $now > [silent $now sct start_phase2] + 300} { + sct phase 1 + clientlog "timeout ramping to persistent field -> redo" + } if {[sct phase] < 2} { sct phase 2 ;# ramping leads to field + sct start_phase2 $now msg "ramp to persistent field $pf" lassign [check_field $pf] ok if {!$ok} {