reflectometer commands.tcl motor_configuration.tcl parameters.tcl and platypus_configuration.tcl

Merged in-situ changes from ics1-platypus

r2835 | ffr | 2009-12-09 18:16:26 +1100 (Wed, 09 Dec 2009) | 3 lines
This commit is contained in:
Ferdi Franceschini
2009-12-09 18:16:26 +11:00
committed by Douglas Clowes
parent c73c4c85c8
commit 4380176000
4 changed files with 92 additions and 47 deletions

View File

@@ -36,12 +36,12 @@ namespace eval exp_mode {
#4=Single #4=Single
variable c1ht_pos variable c1ht_pos
set valid_modes [list SB DB FOC MT POL] set valid_modes [list SB DB FOC MT POL]
set c1ht_pos [list 1057 806.7 557.1 200 200] set c1ht_pos [list 1057 806.7 557.1 200 0.1]
command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's
global ::exp_mode::valid_modes global ::exp_mode::valid_modes
if {[lsearch $::exp_mode::valid_modes $arg] == -1} { if {[lsearch $::exp_mode::valid_modes $arg] == -1} {
Clientput "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)" Clientput "Mode is: $::exp_mode::valid_modes - (POL, MT, FOC, DB, SB)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)" return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)"
} else { } else {
if { [catch {::exp_mode::set_guide_element $arg} errMsg] } { if { [catch {::exp_mode::set_guide_element $arg} errMsg] } {
@@ -59,6 +59,11 @@ namespace eval exp_mode {
command omega_2theta { float arg1 float arg2 } { command omega_2theta { float arg1 float arg2 } {
#need to set omega first. This is because #need to set omega first. This is because
#for Single bounce the twotheta positions depend on the angle of incidence #for Single bounce the twotheta positions depend on the angle of incidence
# whenever omega_2theta is called, or the mode is changed, the slits should close
# this is to save the detector from being overloaded.
# the following line does the job. However, it is duplicated when the mode is set in
# set_omega, so it is commented out for now.
# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg} if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg}
if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg} if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg}
return -code ok return -code ok
@@ -74,6 +79,7 @@ proc ::exp_mode::set_guide_element { arg } {
global ::exp_mode::c1ht_pos global ::exp_mode::c1ht_pos
global ::exp_mode::valid_modes global ::exp_mode::valid_modes
drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
if {[lsearch $::exp_mode::valid_modes $arg] == -1} { if {[lsearch $::exp_mode::valid_modes $arg] == -1} {
Clientput "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)" Clientput "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)" return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)"
@@ -97,6 +103,9 @@ proc ::exp_mode::set_omega { arg } {
if {$arg<0} { if {$arg<0} {
return -code error "omega must be greater than 0" return -code error "omega must be greater than 0"
} }
#the modes is set to ensure that the right guide element is in place
#someone may have changed it by hand. DO NOT REMOVE THIS FUNCTIONALITY
#as it also has the effect of closing all the ssXvg gaps for safety.
if {[catch {::exp_mode::set_guide_element $expmode} errMsg]} { if {[catch {::exp_mode::set_guide_element $expmode} errMsg]} {
return -code error $errMsg ;#make sure the guide element is moved. return -code error $errMsg ;#make sure the guide element is moved.
@@ -146,6 +155,10 @@ proc ::exp_mode::set_omega { arg } {
if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg} if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg}
} }
POL {
if {[catch {checkMotionAndDrive st3vt 0} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive sth $arg} errMsg]} {return -code error $errMsg}
}
default { default {
return -code error "omega driving not specified for that mode" return -code error "omega driving not specified for that mode"
} }
@@ -158,11 +171,11 @@ publish ::exp_mode::set_omega user
proc ::exp_mode::set_two_theta { arg } { proc ::exp_mode::set_two_theta { arg } {
set expmode [SplitReply [mode]] set expmode [SplitReply [mode]]
set expomega [SplitReply [omega]] set expomega [SplitReply [omega]]
if {[lsearch $::exp_mode::valid_modes $expmode] == -1} { if {[lsearch $::exp_mode::valid_modes $expmode] == -1} {
return -code error "please set the mode and omega first" return -code error "please set the mode and omega first"
} }
if {$expomega == "NaN"} { if {$expomega == "NaN"} {
return -code error "please set omega first" return -code error "please set omega first"
} }
@@ -176,7 +189,7 @@ proc ::exp_mode::set_two_theta { arg } {
Clientput $expmode Clientput $expmode
switch $expmode { switch $expmode {
SB { ;#checked ARJN 081231 SB { ;#checked ARJN 081231
set d1 [expr [SplitReply [slit4_distance]] - [SplitReply [sample_distance]]] set d1 [expr [SplitReply [slit4_distance]] - [SplitReply [sample_distance]]]
set d2 [expr [SplitReply [slit4_distance]] - [SplitReply [guide1_distance]]] set d2 [expr [SplitReply [slit4_distance]] - [SplitReply [guide1_distance]]]
set h1 [expr -1. * $d2 * tan($omegarad)] ;#distance if 2theta is zero, i.e. the direct beam set h1 [expr -1. * $d2 * tan($omegarad)] ;#distance if 2theta is zero, i.e. the direct beam
set b [expr $d1 / cos($omegarad)] set b [expr $d1 / cos($omegarad)]
@@ -235,6 +248,21 @@ proc ::exp_mode::set_two_theta { arg } {
if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg}
} }
POL {
set d1 [SplitReply [dy]]
set d2 [expr [SplitReply [slit4_distance]] - [SplitReply [sample_distance]]]
set d3 [expr [SplitReply [anal_distance]] - [SplitReply [sample_distance]]]
set h1 [expr $d1 * tan($argrad)]
set h2 [expr $d2 * tan($argrad)]
set h3 [expr $d3 * tan($argrad)]
set ang1 [expr $arg + 0.8]
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive st4vt $h2} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive dz $h1} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive analz $h3} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive analtilt $ang1} errMsg]} {return -code error $errMsg}
}
default { default {
return -code error "two_theta not defined for that mode: $expmode" return -code error "two_theta not defined for that mode: $expmode"
} }

View File

@@ -34,7 +34,7 @@ if {$sim_mode == "true"} {
#Measured absolute encoder reading at home position #Measured absolute encoder reading at home position
set bz_home 8142000 set bz_home 8142000
set c1ht_home 8265000 set c1ht_home 8152065
set m1ro_home 134658 set m1ro_home 134658
set bat_home 8308518 set bat_home 8308518
set st3vt_home 5250496 set st3vt_home 5250496
@@ -46,7 +46,7 @@ set sphi_home 7450470
set sx_home 8574000 set sx_home 8574000
set sy_home 7500000 set sy_home 7500000
set sz_home 8927484 set sz_home 8927484
set dy_home 8838649 set dy_home 8860668
set dz_home 7788617 set dz_home 7788617
#Measured or computed step rate for sz (Sample Raise) #Measured or computed step rate for sz (Sample Raise)
@@ -872,44 +872,54 @@ ss4r backlash_offset -0.5
ss4r precision 0.005 ss4r precision 0.005
## Polarization Analyzer Vertical Translation, Z ## Polarization Analyzer Vertical Translation, Z
#Motor anzvt $motor_driver_type [params \ #double entry ball screw, 25mm pitch, with 100:1 gearbox
# asyncqueue mc2\ #before 100:1 gearbox was put in absEncHome was 19475318
# axis xxxx\ #with 100:1 gearbox in the absEncHome has changed.
# units mm\ Motor analz $motor_driver_type [params \
# maxSpeed 1\ asyncqueue mc2\
# maxAccel 1\ axis F\
# maxDecel 1\ units mm\
# stepsPerX 25000\ hardlowerlim 0\
# absEnc 1\ hardupperlim 1215\
# absEncHome 7500000\ maxSpeed 1.5\
# cntsPerX 8192] maxAccel 0.5\
#anzvt part polarizer maxDecel 0.5\
#anzvt long_name z_translation stepsPerX [expr 25000/0.25]\
#anzvt hardlowerlim xxxx absEnc 1\
#anzvt hardupperlim xxxx absEncHome 7983619\
#anzvt softlowerlim xxxx cntsPerX [expr 8192./25.] ]
#anzvt softupperlim xxxx analz part polarizer
#anzvt home 0 analz long_name z_translation
analz softlowerlim 0
analz softupperlim 1227
analz home 591.699
analz backlash_offset -0.5
analz precision 0.004
analz speed 1
## Polarization Analyzer Rotation ## Polarization Analyzer Rotation
#Motor anro $motor_driver_type [params \ set analtilt_lowerlim -12
# asyncqueue mc2\ set analtilt_upperlim 12
# axis xxxx\ Motor analtilt $motor_driver_type [params \
# units mm\ asyncqueue mc2\
# hardlowerlim -10\ axis D\
# hardupperlim 10\ units degrees\
# maxSpeed 1\ hardlowerlim $analtilt_lowerlim\
# maxAccel 1\ hardupperlim $analtilt_upperlim\
# maxDecel 1\ maxSpeed 1\
# stepsPerX 25000\ maxAccel 1\
# absEnc 1\ maxDecel 1\
# absEncHome 7500000\ stepsPerX -25000\
# cntsPerX 8192] absEnc 1\
#anro part polarizer absEncHome 14520671\
#anro long_name rotation cntsPerX -8192]
#anro softlowerlim -10 analtilt part polarizer
#anro softupperlim 10 analtilt long_name rotation
#anro home 0 analtilt softlowerlim $analtilt_lowerlim
analtilt softupperlim $analtilt_upperlim
analtilt backlash_offset 0.5
analtilt precision 0.01
analtilt home 0
#proc SplitReply { text } { #proc SplitReply { text } {
# set l [split $text =] # set l [split $text =]

View File

@@ -50,6 +50,8 @@ foreach vn {
detector_distance 10000 detector_distance 10000
detector_base 300 detector_base 300
anal_distance 1808
anal_base 20
slit4_distance 5527 slit4_distance 5527
slit4_base 20 slit4_base 20
sample_distance 5129 sample_distance 5129

View File

@@ -1,5 +1,5 @@
# $Revision: 1.23 $ # $Revision: 1.24 $
# $Date: 2009-11-24 22:56:47 $ # $Date: 2009-12-09 07:16:26 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by: $Author: ffr $ # Last revision by: $Author: ffr $
@@ -27,6 +27,7 @@ fileeval $cfPath(motors)/positmotor_configuration.tcl
fileeval $cfPath(parameters)/parameters.tcl fileeval $cfPath(parameters)/parameters.tcl
fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(counter)/counter.tcl
fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_3xx.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_3xx.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl
fileeval $cfPath(nexus)/nxscripts.tcl fileeval $cfPath(nexus)/nxscripts.tcl
@@ -40,6 +41,10 @@ source gumxml.tcl
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false ::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
::anticollider::protect_detector "true" ::anticollider::protect_detector "true"
# Driver for Bruker BEC1 power supply (1-Tesla Magnet) - beta
# driver short-name IP-address MoxaPort Tolerance(Amps)
#add_bruker_BEC1 ma1 137.157.202.145 4003 0.1
server_init server_init
########################################### ###########################################
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly. # WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.