From e7a478489e3d131d89e710404da4616111744574 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 20 Feb 2013 18:19:44 +1100 Subject: [PATCH] Copied in-situ modifications from ics1-quokka. --- .../magneticField/sct_oxford_ips.tcl | 15 ++- .../hipadaba_configuration_common.tcl | 2 - .../instrument/config/scan/scan_common_1.tcl | 11 ++ .../instrument/sans/config/INSTCFCOMMON.TXT | 4 + .../sans/config/anticollider/acscript.txt | 2 + .../sans/config/environment/environment.tcl | 58 ++++++++++ .../magneticField/oxford_labview.tcl | 10 +- .../instrument/sans/config/hmm/detector.tcl | 7 +- .../sans/config/hmm/detector_ordela.tcl | 60 +++++++++- .../config/hmm/nhq200_detector_config.tcl | 17 +++ .../config/hmm/ordela_detector_config.tcl | 33 ++++++ .../config/motors/motor_configuration.tcl | 103 +++++++++++++----- .../motors/positmotor_configuration.tcl | 20 ++-- site_ansto/instrument/sans/config/plc/plc.tcl | 2 +- .../sans/config/velsel/sct_velsel.tcl | 5 +- .../instrument/sans/config/velsel/velsel.tcl | 25 +++-- .../instrument/sans/quokka_configuration.tcl | 3 + 17 files changed, 299 insertions(+), 78 deletions(-) create mode 100644 site_ansto/instrument/sans/config/hmm/nhq200_detector_config.tcl create mode 100644 site_ansto/instrument/sans/config/hmm/ordela_detector_config.tcl diff --git a/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl b/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl index fd974df9..048919ac 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl @@ -8,7 +8,7 @@ namespace eval ::scobj::ips120 { # /envcont/setpoint # /envcont/sensor/value proc debug_log {args} { - set fd [open "/tmp/ips120.log" a] + set fd [open "../log/ips120.log" a] puts $fd "[clock format [clock seconds] -format "%T"] $args" close $fd } @@ -94,9 +94,9 @@ debug_log "setPoint new data for $tc_root [sct] result=$par" hset $tc_root/status "busy" sct print "status: busy" hset $tc_root/drive_state "START" + hsetprop $tc_root/setpoint driving 1 } catch_message ] if {$catch_status != 0} { - hsetprop $tc_root/setpoint driving 0 return -code error $catch_message } sct print "setPoint: [hget $tc_root/drive_state]" @@ -455,8 +455,7 @@ debug_log "rdState $tc_root error scan status = $rslt on $my_status" set setpoint [sct target] set lolimit [hval $tc_root/lowerlimit] set hilimit [hval $tc_root/upperlimit] - if {$setpoint < $lolimit || $setpoint > $hilimit} { - sct driving 0 + if {$setpoint <= $lolimit || $setpoint => $hilimit} { error "setpoint violates limits" } return OK @@ -646,8 +645,8 @@ debug_log "Registering node $nodeName for write callback" createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass } - hsetprop $scobj_hpath/sensor/value lowerlimit -12 - hsetprop $scobj_hpath/sensor/value upperlimit 12 + hsetprop $scobj_hpath/sensor/value lowerlimit -10 + hsetprop $scobj_hpath/sensor/value upperlimit 10 hsetprop $scobj_hpath/sensor/value units "T" hfactory $scobj_hpath/apply_tolerance plain user int @@ -745,7 +744,7 @@ debug_log "Registering node $nodeName for write callback" # @param port, the IP protocol port number of the device # @param _tol (optional), this is the initial tolerance setting proc add_ips120 {name IP port {_tol 5.0}} { - set fd [open "/tmp/ips120.log" a] + set fd [open "../log/ips120.log" a] if {[SplitReply [environment_simulation]]=="false"} { puts $fd "makesctcontroller sct_ips120 oxford ${IP}:$port" makesctcontroller sct_ips120 oxford ${IP}:$port @@ -758,7 +757,7 @@ proc add_ips120 {name IP port {_tol 5.0}} { } puts stdout "file evaluation of sct_oxford_ips.tcl" -set fd [open "/tmp/ips120.log" w] +set fd [open "../log/ips120.log" w] puts $fd "file evaluation of sct_oxford_ips.tcl" close $fd diff --git a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl index eb35bdb8..d1713c59 100644 --- a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl +++ b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl @@ -11,8 +11,6 @@ source $cfPath(hipadaba)/instdict_specification.tcl source $cfPath(hipadaba)/common_instrument_dictionary.tcl -InstallHdb - namespace eval ::hdb { namespace export buildHDB attlist diff --git a/site_ansto/instrument/config/scan/scan_common_1.tcl b/site_ansto/instrument/config/scan/scan_common_1.tcl index 421cb2f5..a3747156 100644 --- a/site_ansto/instrument/config/scan/scan_common_1.tcl +++ b/site_ansto/instrument/config/scan/scan_common_1.tcl @@ -76,6 +76,15 @@ proc ::scan::hmm_scan_collect {sobj uobj point} { clientput "Monitor $bmn [SplitReply [$bmon getcounts]]" } } +proc ::scan::hmscanend_event {} { + ::scan::runscan_cmd -set feedback status IDLE +} +publish ::scan::hmscanend_event user + +proc ::scan::bmonscanend_event {} { + ::scan::hdb_bmonscan -set feedback status IDLE +} +publish ::scan::bmonscanend_event user proc ::scan::ic_initialize {} { if [ catch { @@ -117,6 +126,8 @@ proc ::scan::ic_initialize {} { savetype text=save,nosave force boolean }] + scriptcallback connect hmscan SCANEND ::scan::hmscanend_event + scriptcallback connect bmonscan SCANEND ::scan::bmonscanend_event } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message diff --git a/site_ansto/instrument/sans/config/INSTCFCOMMON.TXT b/site_ansto/instrument/sans/config/INSTCFCOMMON.TXT index fdce0e26..e8a87ed3 100644 --- a/site_ansto/instrument/sans/config/INSTCFCOMMON.TXT +++ b/site_ansto/instrument/sans/config/INSTCFCOMMON.TXT @@ -21,7 +21,11 @@ config/environment/temperature/sct_julabo_lh45.tcl config/environment/temperature/sct_lakeshore_340.tcl config/environment/temperature/sct_lakeshore_336.tcl config/environment/temperature/sct_qlink.tcl +config/environment/temperature/sct_watlow_st4.tcl config/environment/temperature/sct_rvasm2.tcl +config/environment/temperature/sct_oxford_itc.tcl +config/environment/magneticField/sct_bruker_BEC1.tcl config/environment/magneticField/sct_oxford_ips.tcl config/environment/magneticField/sct_oxford_labview.tcl + config/motors/sct_jogmotor_common.tcl diff --git a/site_ansto/instrument/sans/config/anticollider/acscript.txt b/site_ansto/instrument/sans/config/anticollider/acscript.txt index 0c444e85..947eee92 100644 --- a/site_ansto/instrument/sans/config/anticollider/acscript.txt +++ b/site_ansto/instrument/sans/config/anticollider/acscript.txt @@ -1,3 +1,5 @@ # Forbid detector motion when the detector voltage is on forbid {-inf inf} for det when dhv1 in {800 inf} forbid {-inf inf} for detoff when dhv1 in {800 inf} +forbid {-inf 625} for det when hez in {-inf 647} +forbid {-inf inf} for hez when det in {-inf 625} diff --git a/site_ansto/instrument/sans/config/environment/environment.tcl b/site_ansto/instrument/sans/config/environment/environment.tcl index 23c5c4d4..90027643 100644 --- a/site_ansto/instrument/sans/config/environment/environment.tcl +++ b/site_ansto/instrument/sans/config/environment/environment.tcl @@ -16,6 +16,21 @@ switch [string tolower $envtemp] { } } } + "brukerjulabo" { + add_bruker_BEC1 ma1 137.157.202.80 4444 0.1 + add_lh45 tc1 137.157.202.78 4003 0.5 + proc ::histogram_memory::pre_count {} { + catch { + hset /sample/tc1/sensor/start_temperature [hval /sample/tc1/sensor/value] + hset /sample/tc1/sensor/end_temperature [hval /sample/tc1/sensor/value] + } + } + proc ::histogram_memory::post_count {} { + catch { + hset /sample/tc1/sensor/end_temperature [hval /sample/tc1/sensor/value] + } + } + } "rhqc" { puts "Configuring RHQC" # 9600 8 1 None None Enable @@ -56,6 +71,49 @@ switch [string tolower $envtemp] { tuning 0 interval 10 } + hfactory /sics/tc2/sensor/start_sensorValueA plain user float + hfactory /sics/tc2/sensor/end_sensorValueA plain user float +# ::scobj::hinitprops tc2 sensor/start_sensorValueA sensor/end_sensorValueA + hsetprop /sics/tc2/sensor/start_sensorValueA nxalias start_sensorValueA + hsetprop /sics/tc2/sensor/end_sensorValueA nxalias start_sensorValueB + foreach {prop propval} { + control true + data true + nxsave true + mutable true + klass parameter + sdsinfo ::nexus::scobj::sdsinfo + long_name tc2 + } { + hsetprop /sics/tc2/sensor/start_sensorValueA $prop $propval + hsetprop /sics/tc2/sensor/end_sensorValueA $prop $propval + } + proc ::histogram_memory::pre_count {} { + catch { + set fPath "magnetic" + hset /sics/$fPath/start_magnetic [hval /sics/$fPath/magneticField] + + hset /sics/$fPath/start_temperature_s1 [hval /sics/$fPath/Temp_s1] + hset /sics/$fPath/start_temperature_s2 [hval /sics/$fPath/Temp_s2] + hset /sics/$fPath/start_temperature_s3 [hval /sics/$fPath/Temp_s3] + # Set lakeshore temperatures at start of acquisition + hset /sample/tc2/sensor/start_sensorValueA [hval /sample/tc2/sensor/sensorValueA] + hset /sample/tc2/sensor/end_sensorValueA [hval /sample/tc2/sensor/sensorValueA] + } + } + + proc ::histogram_memory::post_count {} { + catch { + set fPath "magnetic" + hset /sics/$fPath/end_magnetic [hval /sics/$fPath/magneticField] + + hset /sics/$fPath/end_temperature_s1 [hval /sics/$fPath/Temp_s1] + hset /sics/$fPath/end_temperature_s2 [hval /sics/$fPath/Temp_s2] + hset /sics/$fPath/end_temperature_s3 [hval /sics/$fPath/Temp_s3] + # Set lakeshore temperature at end of acquisition + hset /sample/tc2/sensor/end_sensorValueA [hval /sample/tc2/sensor/sensorValueA] + } + } } "11tmagnetvti" { puts "Configuring 11TMagnet with VTI" diff --git a/site_ansto/instrument/sans/config/environment/magneticField/oxford_labview.tcl b/site_ansto/instrument/sans/config/environment/magneticField/oxford_labview.tcl index f5a6e62d..f875c3d7 100644 --- a/site_ansto/instrument/sans/config/environment/magneticField/oxford_labview.tcl +++ b/site_ansto/instrument/sans/config/environment/magneticField/oxford_labview.tcl @@ -1,12 +1,12 @@ -fileeval $cfPath(environment)/magnetic/sct_oxford_labview.tcl +fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl -# PORT 22 +# PORT 55001 ::scobj::magnetic::mkMagnetic { name "magnetic" - IP 137.157.201.91 - PORT 55001 + IP 137.157.202.80 + PORT 22 tuning 0 - interval 10 + interval 3 } diff --git a/site_ansto/instrument/sans/config/hmm/detector.tcl b/site_ansto/instrument/sans/config/hmm/detector.tcl index 326dc9a3..990c8758 100644 --- a/site_ansto/instrument/sans/config/hmm/detector.tcl +++ b/site_ansto/instrument/sans/config/hmm/detector.tcl @@ -1,6 +1 @@ -# Detector voltage controller -fileeval $cfPath(hmm)/sct_orhvps_common.tcl -::scobj::dethvps::init ca1-quokka 4001 4.1 -dhv1 max 2600 -dhv1 lower 19 -dhv1 upper 57 +fileeval $cfPath(hmm)/ordela_detector_config.tcl diff --git a/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl b/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl index 8b9de19c..0fc20428 100644 --- a/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl +++ b/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl @@ -2,19 +2,46 @@ proc ord_get_pot { potxy potnumber } { for { set rsp "Bad" } { $rsp == "Bad" } { } { - set potname [ format "%s%d" $potxy [expr $potnumber ^ 3] ] +# set potname [ format "%s%d" $potxy [expr $potnumber ^ 3] ] # set rspall [ dhv1 cmd P $potname ] - set rspall [ sct_dhv1 transact "P $potname" ] +# NOTE: new driver (ie sct_dhv) re-orders lower 2 bits + set potname [ format "%s%d" $potxy $potnumber ] + set rspall [ sct_dhv transact "P $potname" ] set rsp [lindex [split $rspall " "] 1] +# MJL sometimes the driver returns '=' or '', fix that... +# ALSO the driver sometimes returns TCL internal strings, reject non-numeric data +# ALSO the driver sometimes returns 65, fix that (range 0 to 63) + set rspval 0 + if { $rsp == "=" || $rsp == "" || [scan $rsp %d rspval] != 1 } { set rsp "Bad" } + if { $rspval < 0 } { set rspval 0 } + if { $rspval > 63 } { set rspval 63 } } - return $rsp + return $rspval } Publish ord_get_pot User proc ord_set_pot { potxy potnumber potvalue } { - set potname [ format "%s%d" $potxy [expr $potnumber ^ 3] ] +# set potname [ format "%s%d" $potxy [expr $potnumber ^ 3] ] # set rsp [ dhv1 cmd p $potname $potvalue ] - set rsp [ sct_dhv1 transact "p $potname $potvalue" ] +# NOTE: new driver (ie sct_dhv) re-orders lower 2 bits +# MJL 9/10 Added retry code in case write failed. + for { set rsp "Bad" } { $rsp == "Bad" } { } { + set potname [ format "%s%d" $potxy $potnumber ] +# MJL It seems that the pots can somehow get set to '65'. I believe this might be returned when the read +# is invalid (e.g. perhaps the read query is corrupted, then the pot index is out of range and the controller +# responds with '65' to let us know that). So it happened that some read pot values appeared to be '65'. +# But if the sct_dhv transact ever attempts to send '65' to a pot, it seems that it hangs forever. +# Another problem in the driver... Just limit the value to 0 - 63 as it should be + if { $potvalue < 0 } { set potvalue 0 } + if { $potvalue > 63 } { set potvalue 63 } +#clientput "About to transact: " $potname " " $potvalue + set rsp [ sct_dhv transact "p $potname $potvalue" ] +# MJL sometimes the driver returns absolute bollocks, looks like strings from inside the TCL interpreter. +# Under this condition, assume the write failed, although we can't really tell without reading back value, but don't bother. +# Just flag anything that's not 'ACK' as 'Bad' i.e. do retries. +# clientput "Response:" $rsp + if { $rsp != "ACK" } { set rsp "Bad" } + } return $rsp } Publish ord_set_pot User @@ -133,6 +160,27 @@ proc ord_load_pot_all { filename } { } Publish ord_load_pot_all User + +proc ord_load_pot_all_old_format { filename } { +# When saved by the 21000N software, the first row is y in reversed order and the second row is x in normal order +# This routine reads the file, then reorders the values to normal x then y order + ord_load_pot_all $filename + global ord_pot_all_x + global ord_pot_all_y + set ord_pot_all_x_old_format $ord_pot_all_x + set ord_pot_all_y_old_format $ord_pot_all_y + set ord_pot_all_x "" + set ord_pot_all_y "" + for { set ixy 0 } { $ixy <= 191 } { incr ixy } { + lappend ord_pot_all_x [lindex $ord_pot_all_y_old_format $ixy] + lappend ord_pot_all_y [lindex $ord_pot_all_x_old_format [expr 191 - $ixy]] + } + clientput " All pot settings reordered from 21000N format to normal format." + clientput "x settings:" $ord_pot_all_x + clientput "y settings:" $ord_pot_all_y +} +Publish ord_load_pot_all_old_format User + set histogram_xy "" set histogram_x "" set histogram_y "" @@ -157,7 +205,7 @@ proc ord_get_histogram_xy { bs_x_l bs_x_h bs_y_l bs_y_h roi_x_l roi_x_h roi_y_l global histogram_x global histogram_y clientput "Retrieving 2D xy histogram..." - set histogram_xy [ lreplace [ split [ hmm get 1 ] ] 0 1 ] + set histogram_xy [ lreplace [ split [ ::histogram_memory::gethmm HISTOPERIOD_XY ] ] 0 1 ] if { ($bs_x_l > $bs_x_h || $bs_y_l > $bs_y_h) && $roi_x_l == 0 && $roi_x_h == 191 && $roi_y_l == 0 && $roi_y_h == 191 } { set get_full_histogram 1 clientput "Calculating 2D histograms over full detector area..." diff --git a/site_ansto/instrument/sans/config/hmm/nhq200_detector_config.tcl b/site_ansto/instrument/sans/config/hmm/nhq200_detector_config.tcl new file mode 100644 index 00000000..6214cce7 --- /dev/null +++ b/site_ansto/instrument/sans/config/hmm/nhq200_detector_config.tcl @@ -0,0 +1,17 @@ +# Detector voltage controller + +set sim_mode [SplitReply [detector_simulation]] + +if {$::sim_mode == "true"} { + EvFactory new dhv1 sim +} else { +clientput "FastCom Detector Voltage control" +makeasyncqueue acq NHQ200 ca1-quokka 4002 +evfactory new dhv1 nhq200 acq 1 +dhv1 tolerance 5 +dhv1 rate 10 +dhv1 upper 2250 +dhv1 lower 775 +dhv1 max 2600 +#dhv1 lock +} diff --git a/site_ansto/instrument/sans/config/hmm/ordela_detector_config.tcl b/site_ansto/instrument/sans/config/hmm/ordela_detector_config.tcl new file mode 100644 index 00000000..fd7732cc --- /dev/null +++ b/site_ansto/instrument/sans/config/hmm/ordela_detector_config.tcl @@ -0,0 +1,33 @@ +# Detector voltage controller +# Baud: 19200, Data bits: 8, Stop bits: 1, Parity: None, Flow: None, FIFO: Enable, Interface: RS485-4wire +fileeval $cfPath(hmm)/sct_orhvps_common.tcl +# Old Moxa (before 17/9/2010) in Quokka cabin +#::scobj::dethvps::init ca1-quokka 4001 4.1 +#dhv1 max 2600 +#dhv1 lower 19 +#dhv1 upper 57 + + +# New Moxa (after 17/9/2010) near Quokka tank +#::scobj::dethvps::init 137.157.202.86 4002 4.1 +# Spare detector max voltage and pot values +#dhv1 max 2405 +#dhv1 lower 19 +#dhv1 upper 59 + +# 22/6/2011 +set dhv1Max_SN006 2405 +set upper_SN006 55 + +set dhv1Max_SN003 2600 +set upper_SN003 57 + +set dhvMax $dhv1Max_SN006 +set dhvUpper $upper_SN006 + +::scobj::dethvps::init 137.157.202.71 4001 [expr 0.1 * $dhvMax /63.0] +# Voltage = potval * (dhv1.max / 63) +# if potval = 60 and dhv1.max = 2400 then voltage = 60 * 2400/63 = 2285.7V +dhv1 max $dhvMax +dhv1 lower 19 +dhv1 upper $dhvUpper diff --git a/site_ansto/instrument/sans/config/motors/motor_configuration.tcl b/site_ansto/instrument/sans/config/motors/motor_configuration.tcl index 389c2972..a6767903 100644 --- a/site_ansto/instrument/sans/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/sans/config/motors/motor_configuration.tcl @@ -4,7 +4,7 @@ ::utility::mkVar FastShutter text manager FastShutter false instrument true false # SET TO 1 TO USE THE TILT STAGE ie sample phi and chi -set use_tiltstage 0 +set use_tiltstage 1 set animal quokka set sim_mode [SplitReply [motor_simulation]] @@ -51,16 +51,19 @@ set bs125sign -1 set bs34sign 1 #Measured absolute encoder reading at home position -set samchi_Home 7808328 -set samphi_Home 7675008 +set samchi_Home 538302 +set samphi_Home 432405 set samx_Home 7420441 set samy_Home 7101486 set samz_Home 9944901 set samthet_Home 23004075 -set det_Home 7055209 +#set det_Home 8204259 +#set det_Home 8204624 +set det_Home 8204623 set detoff_Home 6857213 -set srce_Home 7281463 +# set srce_Home 7281463 ffr 30/1/2013: set new home=7282984 because enc val increased by 1521 after culvert job +set srce_Home 7282984 set apx_Home 12965422 set apz_Home 7500000 set att_Home 24782942 @@ -79,6 +82,10 @@ set bs_cntsPerX [expr 32768.0/360.0] set bs_stepsPerX [expr -25000.0*160.0/360.0] set pol_Home 7500000 +set hez_Home 497988176 +set hez_StepsPerX [expr -100.0 * 25000.0 / 14.0] +set hez_CntsPerX [expr 819200.0 / 14.0] + #HERE ARE THE LATEST VALUES set pent_Home 8146159 # Guide Positions Mirrotron ffr 2009-07-18 @@ -185,19 +192,19 @@ Motor samchi $motor_driver_type [params \ port pmc1-quokka\ axis A\ units degrees\ - hardlowerlim -20\ - hardupperlim 20\ - maxSpeed 1\ - maxAccel 5\ - maxDecel 5\ + hardlowerlim -14.6\ + hardupperlim 15\ + maxSpeed 0.5\ + maxAccel 0.25\ + maxDecel 0.25\ stepsPerX 25000\ absEnc 1\ absEncHome $samchi_Home\ cntsPerX 8192] samchi part sample samchi long_name sample_chi -samchi softlowerlim -20 -samchi softupperlim 20 +samchi softlowerlim -14.6 +samchi softupperlim 15 samchi home 0 # Sample tilt across beam [-20,+20] degrees @@ -207,19 +214,19 @@ Motor samphi $motor_driver_type [params \ port pmc1-quokka\ axis B\ units degrees\ - hardlowerlim -20\ - hardupperlim 20\ - maxSpeed 1\ - maxAccel 5\ - maxDecel 5\ - stepsPerX 25000\ + hardlowerlim -15\ + hardupperlim 12\ + maxSpeed 0.5\ + maxAccel 0.25\ + maxDecel 0.25\ + stepsPerX -25000\ absEnc 1\ absEncHome $samphi_Home\ - cntsPerX 8192] + cntsPerX -8192] samphi part sample samphi long_name sample_phi -samphi softlowerlim -20 -samphi softupperlim 20 +samphi softlowerlim -15 +samphi softupperlim 11 samphi home 0 } # Sample translation across beam [0,1000] mm @@ -227,6 +234,7 @@ Motor samx $motor_driver_type [params \ asyncqueue mc1\ host mc1-quokka\ port pmc1-quokka\ + action MC1\ axis C\ units mm\ hardlowerlim -500\ @@ -322,11 +330,14 @@ set det_StepsPerX [expr (25000.0*70.0)/377.0] set det_CntsPerX [expr 8192.0/377.0] # Detector translation along beam [0,20000] mm +# default hardlowerlim 488 +# default det softlowerlim 510 +# default hardupperlim 19320 +# default det softupperlim 19250 Motor det $motor_driver_type [params \ asyncqueue mc1\ host mc1-quokka\ port pmc1-quokka\ - action MC1\ axis G\ units mm\ hardlowerlim 488\ @@ -337,15 +348,20 @@ Motor det $motor_driver_type [params \ stepsPerX $det_StepsPerX\ absEnc 1\ absEncHome $det_Home\ - cntsPerX $det_CntsPerX] + cntsPerX $det_CntsPerX\ + nopowersave 1] +det backlash_offset 5 det part detector det long_name detector_y det precision 1 -det softlowerlim 500 -det softupperlim 19310 -det home 350.5 +det softlowerlim 510 +det softupperlim 19250 +det home 445 det speed 53 -det Blockage_Fail 0 +det Blockage_Check_Interval 5 +det Blockage_Thresh 10 +det Blockage_Ratio 1.1 +det Blockage_Fail 1 # Detector translation across beam [-50,450] mm # Looks like an non-metric screw pitch 0.2 inches / turn @@ -690,8 +706,8 @@ srce long_name srce srce home 180 srce softlowerlim -10 srce softupperlim 340 -srce speed 1 srce precision 0.1 +srce speed 1 srce posit_1 $srce_Home srce posit_2 [expr $srce_Home - (1 * 5 * 8192)] srce posit_3 [expr $srce_Home - (2 * 5 * 8192)] @@ -774,6 +790,31 @@ att speed 5 att home -120 att precision 0.1 +Motor hez $motor_driver_type [params \ + asyncqueue mc3\ + axis H\ + units mm\ + hardlowerlim 0\ + hardupperlim 649\ + maxSpeed 1.12\ + maxAccel 0.5\ + maxDecel 1\ + stepsPerX $hez_StepsPerX\ + absEnc 1\ + absEncHome $hez_Home\ + cntsPerX $hez_CntsPerX] +#hez backlash_offset 5 +hez part collimator +hez long_name hez +hez precision 0.1 +hez softlowerlim 1 +hez softupperlim 648 +hez home 0 +hez speed 1 +#hez Blockage_Check_Interval 5 +#hez Blockage_Thresh 10 +#hez Blockage_Ratio 1.1 +#hez Blockage_Fail 1 ############################ # Motor Controller 4 # Motor Controller 4 @@ -840,6 +881,7 @@ Motor bs1 $motor_driver_type [params \ absEnc 1\ absEncHome $bs1_Home\ cntsPerX $bs_cntsPerX] +bs1 Blockage_Thresh 1.0 bs1 part detector bs1 long_name bs1 bs1 softlowerlim 11 @@ -860,6 +902,7 @@ Motor bs2 $motor_driver_type [params \ absEnc 1\ absEncHome $bs2_Home\ cntsPerX $bs_cntsPerX] +bs2 Blockage_Thresh 1.0 bs2 part detector bs2 long_name bs2 bs2 softlowerlim 7 @@ -880,6 +923,7 @@ Motor bs3 $motor_driver_type [params \ absEnc 1\ absEncHome $bs3_Home\ cntsPerX $bs_cntsPerX] +bs3 Blockage_Thresh 1.0 bs3 part detector bs3 long_name bs3 bs3 softlowerlim 11 @@ -900,6 +944,7 @@ Motor bs4 $motor_driver_type [params \ absEnc 1\ absEncHome $bs4_Home\ cntsPerX $bs_cntsPerX] +bs4 Blockage_Thresh 1.0 bs4 part detector bs4 long_name bs4 bs4 softlowerlim 7 @@ -920,6 +965,7 @@ Motor bs5 $motor_driver_type [params \ absEnc 1\ absEncHome $bs5_Home\ cntsPerX $bs_cntsPerX] +bs5 Blockage_Thresh 1.0 bs5 part detector bs5 long_name bs5 bs5 softlowerlim 11 @@ -940,6 +986,7 @@ Motor bs6 $motor_driver_type [params \ absEnc 1\ absEncHome $bs6_Home\ cntsPerX $bs_cntsPerX] +bs6 Blockage_Thresh 1.0 bs6 part detector bs6 long_name bs6 bs6 softlowerlim 7 diff --git a/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl b/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl index e3bf78c3..773a0940 100644 --- a/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl +++ b/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl @@ -35,16 +35,16 @@ set 20sample_table { } set 10sample_table { - 1 453.7 - 2 411.7 - 3 369.7 - 4 327.7 - 5 285.7 - 6 203.7 - 7 161.7 - 8 119.7 - 9 77.7 - 10 35.7 + 1 203.40042 + 2 161.40042 + 3 119.40042 + 4 77.40042 + 5 35.40042 + 6 -46.5996 + 7 -88.5996 + 8 -130.5996 + 9 -172.5996 + 10 -214.5996 } mkPosit sct_mc1 sampleNum float samx sample $20sample_table diff --git a/site_ansto/instrument/sans/config/plc/plc.tcl b/site_ansto/instrument/sans/config/plc/plc.tcl index 006047be..df325317 100644 --- a/site_ansto/instrument/sans/config/plc/plc.tcl +++ b/site_ansto/instrument/sans/config/plc/plc.tcl @@ -1,6 +1,6 @@ set sim_mode [SplitReply [plc_simulation]] if {$sim_mode == "false"} { - MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001 + MakeAsyncQueue plc_chan SafetyPLC 137.157.211.22 30001 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl b/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl index 3ed07c14..566f6df9 100644 --- a/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl +++ b/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl @@ -208,7 +208,8 @@ proc rdPwdAck {} { set speedvar [expr 0.2*$rspeed/100] if {[hval $root/status] == "busy"} { set target [hgetpropval $root/setspeed target] - if {$rspeed != $target} { +# rspeed doesn't always match the speed you sent, eg If you send 15922 the velsel says it got 15923 + if {[expr abs($rspeed - $target)] > 1} { hset $root/device_error "Resending target speed $target" hset $root/setspeed $target" return idle @@ -459,7 +460,7 @@ proc halt {root} { set fmtspeed [format "%5d" $speed] sct send "N#SOS#SPEED $fmtspeed" sct target $lambda - hsetprop $vs_root/setspeed target $speed + hsetprop $vs_root/setspeed target $fmtspeed hset $vs_root/status "busy" statemon start nvs_speed statemon start nvs_lambda diff --git a/site_ansto/instrument/sans/config/velsel/velsel.tcl b/site_ansto/instrument/sans/config/velsel/velsel.tcl index 38ed74e3..4564450b 100644 --- a/site_ansto/instrument/sans/config/velsel/velsel.tcl +++ b/site_ansto/instrument/sans/config/velsel/velsel.tcl @@ -5,6 +5,21 @@ namespace eval ::scobj::velocity_selector { variable blocked_speeds variable velsel_IP variable velsel_port + variable nvs40Par + variable nvs43Par + variable velsel_ID + + set nvs40Par(m_dTwistAngle) 48.30 + set nvs40Par(m_dLength) 0.250 + set nvs40Par(m_iMaxSpeed) 28300.0 + set nvs40Par(rBeamCenter) 0.1100 + set nvs40Par(VNeutron) 3955.98 + + set nvs43Par(m_dTwistAngle) 37.6 + set nvs43Par(m_dLength) 0.250 + set nvs43Par(m_iMaxSpeed) 21000.0 + set nvs43Par(rBeamCenter) 0.1100 + set nvs43Par(VNeutron) 3955.98 # Set configuration parameters for either the NVS40 or NVS43 velocity selector set ::currVelSel [string tolower $::currVelSel] @@ -13,11 +28,6 @@ namespace eval ::scobj::velocity_selector { set velsel_ID "NVS40" set velsel_IP "137.157.202.73" set velsel_port 10000 - set m_dTwistAngle 48.30 - set m_dLength 0.250 - set m_iMaxSpeed 28300.0 - set rBeamCenter 0.1100 - set VNeutron 3955.98 set ::scobj::velocity_selector::UID "NVS" set ::scobj::velocity_selector::PWD "NVS" set ::scobj::velocity_selector::blocked_speeds { @@ -32,11 +42,6 @@ namespace eval ::scobj::velocity_selector { set velsel_ID "NVS43" set velsel_IP "137.157.202.74" set velsel_port 10000 - set m_dTwistAngle 37.6 - set m_dLength 0.250 - set m_iMaxSpeed 21000.0 - set rBeamCenter 0.1100 - set VNeutron 3955.98 set ::scobj::velocity_selector::UID "NVS" set ::scobj::velocity_selector::PWD "NVS" set ::scobj::velocity_selector::blocked_speeds { diff --git a/site_ansto/instrument/sans/quokka_configuration.tcl b/site_ansto/instrument/sans/quokka_configuration.tcl index ffffe552..6d33c4dd 100644 --- a/site_ansto/instrument/sans/quokka_configuration.tcl +++ b/site_ansto/instrument/sans/quokka_configuration.tcl @@ -35,9 +35,12 @@ fileeval $cfPath(commands)/commands.tcl fileeval $cfPath(anticollider)/anticollider.tcl fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl fileeval $cfPath(environment)/temperature/sct_qlink.tcl +fileeval $cfPath(environment)/temperature/sct_watlow_st4.tcl fileeval $cfPath(environment)/temperature/sct_rvasm2.tcl #fileeval $cfPath(environment)/magneticField/sct_oxford_ips.tcl +fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl fileeval $cfPath(environment)/magneticField/oxford_labview.tcl +fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl fileeval $cfPath(environment)/environment.tcl fileeval $cfPath(environment)/sct_rheometer.tcl fileeval $cfPath(environment)/sct_protek_common.tcl