magfield.tcl: introduce timeout for ramp to fielf

This commit is contained in:
2023-09-06 08:40:18 +02:00
parent fd196d939a
commit fd9f99e752

View File

@ -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} {