Make sure spin flipper code in rfamp.c is initialised

Fixed drive bugs in lakeshore drivers.
r3071 | ffr | 2011-02-25 18:27:31 +1100 (Fri, 25 Feb 2011) | 2 lines
This commit is contained in:
Ferdi Franceschini
2011-02-25 18:27:31 +11:00
committed by Douglas Clowes
parent 009fdbfc29
commit 7371a561d9
30 changed files with 10384 additions and 75 deletions

View File

@@ -35,14 +35,14 @@ namespace eval exp_mode {
#3=DB
#4=Single
variable c1ht_pos
set valid_modes [list SB DB FOC MT POL]
set c1ht_pos [list 1057 806.7 557.1 320 68.9]
set valid_modes [list SB DB FOC MT POL POLANAL]
set c1ht_pos [list 1057 806.7 557.1 320 68.9 68.9]
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 - (POL, MT, FOC, DB, SB)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,mt,focussing,DB,single)"
Clientput "Mode is: $::exp_mode::valid_modes - (POL, POLANAL, MT, FOC, DB, SB)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt,focussing,DB,single)"
} else {
if { [catch {::exp_mode::set_guide_element $arg} errMsg] } {
Clientput $errMsg
@@ -81,7 +81,6 @@ namespace eval exp_mode {
return -code ok
}
}
##
@@ -94,8 +93,8 @@ proc ::exp_mode::set_guide_element { arg } {
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)"
Clientput "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt, focussing, DB, single)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,polarisation and analysis, mt, focussing, DB, single)"
}
if {[catch {::exp_mode::checkMotionAndDrive c1ht [lindex $c1ht_pos [lsearch $::exp_mode::valid_modes $arg]]} errMsg]} {
@@ -113,9 +112,9 @@ proc ::exp_mode::set_omega { arg } {
return -code error "Please set the mode first"
}
if {$arg<0} {
return -code error "omega must be greater than 0"
}
# 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.
@@ -188,6 +187,15 @@ proc ::exp_mode::set_omega { arg } {
}
run sth $arg st3vt 0
}
POLANAL {
if { [catch {
checkMotion sth $arg
checkMotion st3vt 0
} errMsg ] } {
return -code error $errMsg
}
run sth $arg st3vt 0
}
default {
return -code error "omega driving not specified for that mode"
}
@@ -207,9 +215,9 @@ proc ::exp_mode::set_two_theta { arg } {
if {$expomega == "NaN"} {
return -code error "please set omega first"
}
if {$arg<0} {
return -code error "two_theta is less than 0"
}
# if {$arg<0} {
# return -code error "two_theta is less than 0"
# }
set argrad [deg2rad $arg] ;#2theta position in radians
set omegarad [deg2rad $expomega]
@@ -287,23 +295,37 @@ proc ::exp_mode::set_two_theta { arg } {
run st4vt $h2 dz $h1
}
POL {
set d1 [SplitReply [dy]]
set d2 [expr [SplitReply [slit4_distance]] - [SplitReply [sample_distance]]]
set h1 [expr $d1 * tan($argrad)]
set h2 [expr $d2 * tan($argrad)]
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
if { [catch {
checkMotion st4vt $h2
checkMotion dz $h1
} errMsg ] } {
return -code error $errMsg
}
run st4vt $h2 dz $h1 analz -200 analtilt 0
}
POLANAL {
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]
set ang1 [expr $arg]
if { [catch {isszst4vtsafe st4vt $h2} errMsg]} {return -code error $errMsg}
if { [catch {
checkMotion st4vt $h2
checkMotion dz $h1
checkMotion analz $h3
checkMotion analtilit $ang1
checkMotion analtilt $ang1
} errMsg ] } {
return -code error $errMsg
}
run st4vt $h2 dz $h1 analz $h3 analtilit $ang1
run st4vt $h2 dz $h1 analz $h3 analtilt $ang1
}
default {
return -code error "two_theta not defined for that mode: $expmode"