From 0cff1f7c3cc9471e3c261d45e0777d2840e3f472 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 19 Feb 2015 15:51:41 +1100 Subject: [PATCH] Pullback from Kookaburra 2015-02-19 --- .../anticollider/anticollider_common.tcl | 26 ++++++++++--------- .../config/environment/sct_knauer_pump.tcl | 4 +-- .../temperature/sct_lakeshore_370.tcl | 2 +- .../temperature/sct_oxford_mercury.tcl | 2 +- .../config/anticollider/acscript.txt | 17 +++++++++--- .../config/anticollider/anticollider.tcl | 21 +++++++++++++++ .../config/motors/motor_configuration.tcl | 12 ++++----- .../kookaburra/config/scan/scan.tcl | 2 +- .../kookaburra/kookaburra_configuration.tcl | 3 +++ 9 files changed, 62 insertions(+), 27 deletions(-) diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index 209a3522..011ad101 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -93,6 +93,7 @@ proc ::anticollider::genveto {veto_rules} { lappend condlist $mot $range } lappend veto_region($vp(for)) [list $vp(forbid) @and $condlist] + unset condlist } elseif [info exists vp(when)] { lappend veto_region($vp(for)) [list $vp(forbid) $vp(when) $vp(in)] } else { @@ -132,12 +133,12 @@ proc ::anticollider::veto_region_acscript {args} { foreach row $veto_region($regmot) { if { [lindex $row 1] == "@and"} { set forbid [lindex $row 0] - set veto 0 + set veto 1 foreach {mot range} [lindex $row 2] { set pos [SplitReply [$mot]] foreach {lower upper} [join $range] { - if {$pos >= $lower && $pos <= $upper} { - set veto 1 + if {$pos < $lower || $pos > $upper} { + set veto 0 break } } @@ -147,7 +148,10 @@ proc ::anticollider::veto_region_acscript {args} { } else { foreach {min max} $forbid {} if {$min <= $target && $target <= $max} { - error "ERROR:The range ($forbid) is forbidden for $regmot when [lindex $row 2]" + foreach {mot range} [lindex $row 2] { + lappend msg [list $mot in $range] + } + error "ERROR:The range ($forbid) is forbidden for $regmot when [join $msg { and }]" } } } else { @@ -212,15 +216,13 @@ proc ::anticollider::init {} { lappend ::anticollider::scripts ::anticollider::veto_region_acscript proc ::anticollider::acscript {args} { set catch_status [ catch { - if {[::anticollider::enable $args] == "false"} { - return - } else { - foreach {regmot target} $args { - anticollision add 0 $regmot $target - } + foreach {regmot target} $args { + anticollision add 0 $regmot $target } - foreach script $::anticollider::scripts { - $script {*}$args + if {[::anticollider::enable $args] == "true"} { + foreach script $::anticollider::scripts { + $script {*}$args + } } } message ] handle_acscript_exception $catch_status $message diff --git a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl index 1f269659..bc80d54a 100644 --- a/site_ansto/instrument/config/environment/sct_knauer_pump.tcl +++ b/site_ansto/instrument/config/environment/sct_knauer_pump.tcl @@ -3,7 +3,7 @@ # namespace eval ::scobj::knauer_pump { - set debug_threshold 0 + set debug_threshold 5 } proc ::scobj::knauer_pump::debug_log {tc_root debug_level debug_string} { @@ -1115,7 +1115,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio } hsetprop ${scobj_hpath} klass ${device_class} hsetprop ${scobj_hpath} data true - hsetprop ${scobj_hpath} debug_threshold 0 + hsetprop ${scobj_hpath} debug_threshold 5 if {[string equal -nocase "${simulation_flag}" "false"]} { ansto_makesctdrive ${name}_pump_volume_setp ${scobj_hpath}/pump/volume/setp ${scobj_hpath}/pump/volume/pval ${sct_controller} } diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl index 74233b4a..6fe63945 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl @@ -50,7 +50,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index 22ebad6b..67266192 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -58,7 +58,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" diff --git a/site_ansto/instrument/kookaburra/config/anticollider/acscript.txt b/site_ansto/instrument/kookaburra/config/anticollider/acscript.txt index 8ab23c54..b7ef8bc9 100644 --- a/site_ansto/instrument/kookaburra/config/anticollider/acscript.txt +++ b/site_ansto/instrument/kookaburra/config/anticollider/acscript.txt @@ -1,4 +1,13 @@ -# Forbid detector motion when the detector voltage is on -# comment out -- Jing -#forbid {-inf inf} for det when dhv1 in {800 inf} -#forbid {-inf inf} for detoff when dhv1 in {800 inf} +# Prevent m2om encoder from driving into sample holder. +forbid {10 inf} for m2om whenall {m2y in {-inf 200} m2om in {-inf 10}} +forbid {-inf 170} for m2om whenall {m2y in {-inf 200} m2om in {170 inf}} +forbid {-inf inf} for m2om whenall {m2y in {-inf 200} m2om in {11 169}} +forbid {-inf 200} for m2y when m2om in {10 170} + +# Following two rules allow recovery if m2om position has crept above 10 or below 170 +forbid {11 inf} for m2om whenall {m2y in {-inf 200} m2om in {10 11}} +forbid {-inf 169} for m2om whenall {m2y in {-inf 200} m2om in {169 170}} + +# Protect long Cd tunnel +forbid {-5.65 inf} for m2x when m2om in {170 182} +forbid {55.43 inf} for m2x when m2om in {-2 10} diff --git a/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl b/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl index 85a5de00..c0a09f35 100644 --- a/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl @@ -12,3 +12,24 @@ proc ::anticollider::enable {args} { } ::anticollider::loadscript acscript.txt + +# Default enable or disable anticollision for all axes +# TODO: Provide a list of motors to enable or disable +proc anticollider {args} { + set usage "Usage: anticollider (enable | disable)" + if {$args == "enable"} { + # TODO change protect_detector to just 'protect' + ::anticollider::protect_detector "true" + } elseif {$args == "disable"} { + ::anticollider::protect_detector "false" + } elseif {$args == "help"} { + clientput $usage + } else { + if {[SplitReply [::anticollider::protect_detector]] == "false"} { + clientput "Anticollision disabled on all axes" + } else { + clientput "Anticollision enabled on all axes" + } + } +} +publish anticollider user diff --git a/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl b/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl index 3a3cc835..bbaa44f5 100644 --- a/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl @@ -235,7 +235,7 @@ Motor m1chi $motor_driver_type [params \ cntsPerX [expr 131072*100.0/68.681]\ nopowersave 1] m1chi precision 0.001 -m1chi speed 0.200 +m1chi speed 0.137362 m1chi part crystal m1chi long_name m1chi m1chi softlowerlim -2 @@ -435,7 +435,7 @@ Motor samz $motor_driver_type [params \ stepsPerX [expr 25000.0 * 100 / 10.0]\ cntsPerX 819.2\ absEnc 1\ - absEncHome 72607] + absEncHome 75330] samz part sample samz long_name samz samz softlowerlim 0 @@ -590,7 +590,7 @@ Motor m2chi $motor_driver_type [params \ cntsPerX [expr 131072*100.0/68.681]\ nopowersave 1] m2chi precision 0.001 -m2chi speed 0.200 +m2chi speed 0.137362 m2chi part crystal m2chi long_name m2chi m2chi softlowerlim -2 @@ -610,7 +610,7 @@ Motor m2om $motor_driver_type [params \ port pmc3-kookaburra\ axis F\ units degrees\ - hardlowerlim 0\ + hardlowerlim -2\ hardupperlim 182\ maxSpeed [expr 300000.0/$m2omSetRate]\ maxAccel [expr 25000.0/$m2omSetRate]\ @@ -673,7 +673,7 @@ Motor m2y $motor_driver_type [params \ axis H\ units mm\ hardlowerlim -4.35\ - hardupperlim 357.9\ + hardupperlim 400\ maxSpeed [expr 100000.0/$m2ySetRate]\ maxAccel [expr 25000.0/$m2ySetRate]\ maxDecel [expr 25000.0/$m2ySetRate]\ @@ -685,7 +685,7 @@ m2y speed 0.5 m2y part crystal m2y long_name m2y m2y softlowerlim -4.3 -m2y softupperlim 355 +m2y softupperlim 399 m2y home 0 diff --git a/site_ansto/instrument/kookaburra/config/scan/scan.tcl b/site_ansto/instrument/kookaburra/config/scan/scan.tcl index d2dadee7..491719c7 100644 --- a/site_ansto/instrument/kookaburra/config/scan/scan.tcl +++ b/site_ansto/instrument/kookaburra/config/scan/scan.tcl @@ -32,7 +32,7 @@ proc thresholdscan {minVoltage maxVoltage stepVoltage minBMThreshold manBMThresh clientput "Start scanning loop now" for {set vol $minVoltage} {$vol <= $maxVoltage} {incr vol $stepVoltage} { - emHV1 $vol +# emHV1 $vol set curCount "" for {set thres $minBMThreshold} {$thres <= $manBMThreshold} {incr thres $stepBMThreshold} { clientput "set thredshold to $thres" diff --git a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl index b719b85e..f1f984cc 100644 --- a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl +++ b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl @@ -45,6 +45,8 @@ fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl fileeval $cfPath(environment)/sct_protek_common.tcl fileeval $cfPath(environment)/sct_protekmm.tcl fileeval $cfPath(environment)/temperature/sct_julabo_lh45_gen.tcl +fileeval $cfPath(environment)/sct_rheometer.tcl +fileeval $cfPath(environment)/sct_antonparr_MCR500.tcl fileeval $cfPath(counter)/sct_bm.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(nexus)/nxscripts.tcl @@ -54,6 +56,7 @@ fileeval $cfPath(commands)/commands.tcl fileeval $cfPath(anticollider)/anticollider.tcl fileeval $cfPath(parameters)/parameters.tcl + source gumxml.tcl ::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false