diff --git a/site_ansto/instrument/reflectometer/config/commands/commands.tcl b/site_ansto/instrument/reflectometer/config/commands/commands.tcl index 17ea4dd5..04e0ab92 100644 --- a/site_ansto/instrument/reflectometer/config/commands/commands.tcl +++ b/site_ansto/instrument/reflectometer/config/commands/commands.tcl @@ -36,12 +36,12 @@ namespace eval exp_mode { #4=Single variable c1ht_pos 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 global ::exp_mode::valid_modes 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)" } else { if { [catch {::exp_mode::set_guide_element $arg} errMsg] } { @@ -59,6 +59,11 @@ namespace eval exp_mode { command omega_2theta { float arg1 float arg2 } { #need to set omega first. This is because #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_two_theta $arg2} errMsg]} {return -code error $errMsg} return -code ok @@ -74,6 +79,7 @@ proc ::exp_mode::set_guide_element { arg } { global ::exp_mode::c1ht_pos 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} { 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)" @@ -97,6 +103,9 @@ proc ::exp_mode::set_omega { arg } { if {$arg<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]} { 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 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 { 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 } { set expmode [SplitReply [mode]] - set expomega [SplitReply [omega]] + set expomega [SplitReply [omega]] - if {[lsearch $::exp_mode::valid_modes $expmode] == -1} { - return -code error "please set the mode and omega first" - } + if {[lsearch $::exp_mode::valid_modes $expmode] == -1} { + return -code error "please set the mode and omega first" + } if {$expomega == "NaN"} { return -code error "please set omega first" } @@ -176,7 +189,7 @@ proc ::exp_mode::set_two_theta { arg } { Clientput $expmode switch $expmode { 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 h1 [expr -1. * $d2 * tan($omegarad)] ;#distance if 2theta is zero, i.e. the direct beam 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 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 { return -code error "two_theta not defined for that mode: $expmode" } diff --git a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl index 1c044e4b..744b2612 100644 --- a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl @@ -34,7 +34,7 @@ if {$sim_mode == "true"} { #Measured absolute encoder reading at home position set bz_home 8142000 -set c1ht_home 8265000 +set c1ht_home 8152065 set m1ro_home 134658 set bat_home 8308518 set st3vt_home 5250496 @@ -46,7 +46,7 @@ set sphi_home 7450470 set sx_home 8574000 set sy_home 7500000 set sz_home 8927484 -set dy_home 8838649 +set dy_home 8860668 set dz_home 7788617 #Measured or computed step rate for sz (Sample Raise) @@ -872,44 +872,54 @@ ss4r backlash_offset -0.5 ss4r precision 0.005 ## Polarization Analyzer Vertical Translation, Z -#Motor anzvt $motor_driver_type [params \ -# asyncqueue mc2\ -# axis xxxx\ -# units mm\ -# maxSpeed 1\ -# maxAccel 1\ -# maxDecel 1\ -# stepsPerX 25000\ -# absEnc 1\ -# absEncHome 7500000\ -# cntsPerX 8192] -#anzvt part polarizer -#anzvt long_name z_translation -#anzvt hardlowerlim xxxx -#anzvt hardupperlim xxxx -#anzvt softlowerlim xxxx -#anzvt softupperlim xxxx -#anzvt home 0 +#double entry ball screw, 25mm pitch, with 100:1 gearbox +#before 100:1 gearbox was put in absEncHome was 19475318 +#with 100:1 gearbox in the absEncHome has changed. +Motor analz $motor_driver_type [params \ + asyncqueue mc2\ + axis F\ + units mm\ + hardlowerlim 0\ + hardupperlim 1215\ + maxSpeed 1.5\ + maxAccel 0.5\ + maxDecel 0.5\ + stepsPerX [expr 25000/0.25]\ + absEnc 1\ + absEncHome 7983619\ + cntsPerX [expr 8192./25.] ] +analz part polarizer +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 -#Motor anro $motor_driver_type [params \ -# asyncqueue mc2\ -# axis xxxx\ -# units mm\ -# hardlowerlim -10\ -# hardupperlim 10\ -# maxSpeed 1\ -# maxAccel 1\ -# maxDecel 1\ -# stepsPerX 25000\ -# absEnc 1\ -# absEncHome 7500000\ -# cntsPerX 8192] -#anro part polarizer -#anro long_name rotation -#anro softlowerlim -10 -#anro softupperlim 10 -#anro home 0 +set analtilt_lowerlim -12 +set analtilt_upperlim 12 +Motor analtilt $motor_driver_type [params \ + asyncqueue mc2\ + axis D\ + units degrees\ + hardlowerlim $analtilt_lowerlim\ + hardupperlim $analtilt_upperlim\ + maxSpeed 1\ + maxAccel 1\ + maxDecel 1\ + stepsPerX -25000\ + absEnc 1\ + absEncHome 14520671\ + cntsPerX -8192] +analtilt part polarizer +analtilt long_name rotation +analtilt softlowerlim $analtilt_lowerlim +analtilt softupperlim $analtilt_upperlim +analtilt backlash_offset 0.5 +analtilt precision 0.01 +analtilt home 0 #proc SplitReply { text } { # set l [split $text =] diff --git a/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl b/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl index b292452a..16036082 100644 --- a/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl +++ b/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl @@ -50,6 +50,8 @@ foreach vn { detector_distance 10000 detector_base 300 +anal_distance 1808 +anal_base 20 slit4_distance 5527 slit4_base 20 sample_distance 5129 diff --git a/site_ansto/instrument/reflectometer/platypus_configuration.tcl b/site_ansto/instrument/reflectometer/platypus_configuration.tcl index 960bd588..80e518af 100644 --- a/site_ansto/instrument/reflectometer/platypus_configuration.tcl +++ b/site_ansto/instrument/reflectometer/platypus_configuration.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.23 $ -# $Date: 2009-11-24 22:56:47 $ +# $Revision: 1.24 $ +# $Date: 2009-12-09 07:16:26 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -27,6 +27,7 @@ fileeval $cfPath(motors)/positmotor_configuration.tcl fileeval $cfPath(parameters)/parameters.tcl fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(counter)/counter.tcl +fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_3xx.tcl fileeval $cfPath(hmm)/hmm_configuration.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 ::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 ########################################### # WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.