Merges from ics1-wombat

r2834 | ffr | 2009-12-09 17:07:45 +1100 (Wed, 09 Dec 2009) | 2 lines
This commit is contained in:
Ferdi Franceschini
2009-12-09 17:07:45 +11:00
committed by Douglas Clowes
parent 64ab146a44
commit c73c4c85c8
15 changed files with 3779 additions and 209 deletions

View File

@@ -16,55 +16,72 @@ namespace eval motor {
# @param bs beamstop, 1,2,3,4,5 or 6
# @param bx beam position in detector coordinates
# @param bz beam position in detector coordinates
# Origin of beamstop coordinate system is (bsxo, bszo) relative to frame
# Origin of detector coordinate system is (0, 0) relative to frame
# Given
# (Xb,Zb) = beam position in frame coordinates
# bx = beam x pos in detector coordinates
# bz = beam z pos in detector coordinates
# detoff = detector x pos in detector coordinates
# bsx = beamstop x pos in beamstop coordinates
# bsz = beamstop z pos in beamstop coordinates
# bszo = beamstop z origin relative to frame
# (bx+detoff, bz) = (Xb,Zb)
# (bsx, bsz+bszo) = (Xb,Zb)
# (Xbf,Zbf) = beam pos in frame coords
# (Xbd,Zbd) = beam pos in detector coords
# (Xbbs, Zbbs) = beam pos in beamstop coords
# (Xdf,Zdf) = detector pos in frame coords
# (Xbsf,Zbsf) = beamstop pos in frame coords
#
# (Xbf,Zbf) = (Xdf+Xbd, Zdf+Zbd) = (Xbsf+Xbbs, Zbsf+Zbbs)
# Origin of detector coords = frame origin
#
# Detector and beamstop motor readings with beamstop disk centers
# overlapping over detector center mark.
# Xdf = 264.542 (7283813) Zdf = 0
# Xbbs = 296.291 (8054270)
# Zbbs = 259.641 (13488244)
# Xbd = dethw, Zbd = (dethh)
#
# 264.542+dethw = Xbsf+296.291
# 0+dethh = Zbsf+259.641
#
# Xbsf = -31.749 + dethw, Zbsf = -259.641 + dethh
proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} {
set bsdriving false
set dethw [expr {[SplitReply detector_active_height_mm]/2.0}]
set dethh [expr {[SplitReply detector_active_width_mm]/2.0}]
set bsxo -33.112 + $dethw
set bszo -329.440 + $dethh
set dethw [expr {[SplitReply [detector_active_height_mm]]/2.0}]
set dethh [expr {[SplitReply [detector_active_width_mm]]/2.0}]
set Xbsf [expr -31.749 + $dethw]
set Zbsf [expr -259.641 + $dethh]
array set bsl [subst {
1 [SplitReply [bs1 softlowerlim]]
2 [SplitReply [bs2 softlowerlim]]
3 [SplitReply [bs3 softlowerlim]]
4 [SplitReply [bs4 softlowerlim]]
5 [SplitReply [bs5 softlowerlim]]
6 [SplitReply [bs6 softlowerlim]]
}]
if [ catch {
switch $bs {
"1" {
set bsmot "bs1"
set bs_target 92.79
set bsdownCmd "drive bs2 0 bs3 0 bs4 0 bs5 0 bs6 0"
set bsdownCmd "drive bs2 $bsl(2) bs3 $bsl(3) bs4 $bsl(4) bs5 $bsl(5) bs6 $bsl(6)"
}
"2" {
set bsmot "bs2"
set bs_target 86.20
set bsdownCmd "drive bs1 0 bs3 0 bs4 0 bs5 0 bs6 0"
set bsdownCmd "drive bs1 $bsl(1) bs3 $bsl(3) bs4 $bsl(4) bs5 $bsl(5) bs6 $bsl(6)"
}
"3" {
set bsmot "bs3"
set bs_target 92.54
set bsdownCmd "drive bs2 0 bs1 0 bs4 0 bs5 0 bs6 0"
set bsdownCmd "drive bs2 $bsl(2) bs1 $bsl(1) bs4 $bsl(4) bs5 $bsl(5) bs6 $bsl(6)"
}
"4" {
set bsmot "bs4"
set bs_target 86.66
set bsdownCmd "drive bs2 0 bs3 0 bs1 0 bs5 0 bs6 0"
set bsdownCmd "drive bs2 $bsl(2) bs3 $bsl(3) bs1 $bsl(1) bs5 $bsl(5) bs6 $bsl(6)"
}
"5" {
set bsmot "bs5"
set bs_target 92.50
set bsdownCmd "drive bs2 0 bs3 0 bs4 0 bs1 0 bs6 0"
set bsdownCmd "drive bs2 $bsl(2) bs3 $bsl(3) bs4 $bsl(4) bs1 $bsl(1) bs6 $bsl(6)"
}
"6" {
set bsmot "bs6"
set bs_target 85.87
set bsdownCmd "drive bs2 0 bs3 0 bs4 0 bs5 0 bs1 0"
set bsdownCmd "drive bs2 $bsl(2) bs3 $bsl(3) bs4 $bsl(4) bs5 $bsl(5) bs1 $bsl(1)"
}
default {
error "beamstop selection must be an integer from 1 to 6"
@@ -76,8 +93,8 @@ proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} {
if {$bx == "UNDEF" || $bz == "UNDEF"} {
statemon start selbs
set bsdriving true
drive $bsmot $bs_target
BeamStop -1
drive $bsmot $bs_target
eval $bsdownCmd
BeamStop $bs
set bsdriving false
@@ -88,13 +105,13 @@ proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} {
error "beam coordinates must be floats"
}
}
set bsx_target [expr {$bx-$bsxo+$detoff_val}]
set bsz_target [expr {$bz-$bszo}]
set bsx_target [expr {$bx-$Xbsf+$detoff_val}]
set bsz_target [expr {$bz-$Zbsf}]
statemon start selbs
set bsdriving true
drive $bsmot $bs_target bsx $bsx_target bsz $bsz_target
BeamStop -1
drive $bsmot $bs_target bsx $bsx_target bsz $bsz_target
eval $bsdownCmd
BeamStop $bs
set bsdriving false

View File

@@ -1,5 +1,5 @@
# $Revision: 1.29 $
# $Date: 2009-12-03 02:04:57 $
# $Revision: 1.30 $
# $Date: 2009-12-09 06:07:45 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by: $Author: ffr $
@@ -76,12 +76,20 @@ set att_Home 24782942
set bsx_Home 7578346
#set bsz_Home 10143000
set bsz_Home 10568857
set bs1_Home 13219
set bs2_Home 2506
set bs3_Home 22391
set bs4_Home 15287
set bs5_Home 6283
set bs6_Home 19123
#set bs1_Home 13219
#set bs2_Home 2506
#set bs3_Home 22391
#set bs4_Home 15287
#set bs5_Home 6283
#set bs6_Home 19123
set bs1_Home 21298
set bs2_Home 9942
set bs3_Home 30928
set bs4_Home 22111
set bs5_Home 14558
set bs6_Home 27251
set bs_cntsPerX [expr 32768.0/360.0]
set bs_stepsPerX [expr -25000.0*160.0/360.0]
set pol_Home 7500000
@@ -406,8 +414,8 @@ Motor detoff $motor_driver_type [params \
port pmc1-quokka\
axis H\
units mm\
hardlowerlim -50\
hardupperlim 500\
hardlowerlim -9\
hardupperlim 465\
maxSpeed 10\
maxAccel 1\
maxDecel 10\
@@ -417,14 +425,14 @@ Motor detoff $motor_driver_type [params \
cntsPerX [expr 8192.0/5.08]]
detoff part detector
detoff long_name detector_x
detoff softlowerlim -50
detoff softupperlim 500
detoff softlowerlim 0
detoff softupperlim 450
detoff home 0
############################
# Motor Controller 2
# Motor Controller 2
# Motor Controller 2
# Motor Controller 25
############################
#:TP at HOME
#
@@ -834,7 +842,7 @@ Motor bsx $motor_driver_type [params \
axis A\
units mm\
hardlowerlim 0\
hardupperlim 500\
hardupperlim 317\
maxSpeed 5\
maxAccel 2\
maxDecel 5\
@@ -845,7 +853,7 @@ Motor bsx $motor_driver_type [params \
bsx part detector
bsx long_name bsx
bsx softlowerlim 0
bsx softupperlim 500
bsx softupperlim 310
bsx speed 5
bsx home 0
@@ -857,7 +865,7 @@ Motor bsz $motor_driver_type [params \
axis B\
units mm\
hardlowerlim 0\
hardupperlim 400\
hardupperlim 280\
maxSpeed 5\
maxAccel 1\
maxDecel 5\
@@ -868,7 +876,7 @@ Motor bsz $motor_driver_type [params \
bsz part detector
bsz long_name bsz
bsz softlowerlim 0
bsz softupperlim 400
bsz softupperlim 275
bsz home 0
# Largest beamstop
@@ -876,8 +884,8 @@ Motor bs1 $motor_driver_type [params \
asyncqueue mc4\
axis C\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 9\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -887,9 +895,9 @@ Motor bs1 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs1 part detector
bs1 long_name bs1
bs1 softlowerlim 0
bs1 softupperlim 100
bs1 home 0
bs1 softlowerlim 11
bs1 softupperlim 95
bs1 home 90
bs1 precision 0.05
sicslist setatt bs1 link parameters_group
@@ -897,8 +905,8 @@ Motor bs2 $motor_driver_type [params \
asyncqueue mc4\
axis D\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 6\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -908,9 +916,9 @@ Motor bs2 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs2 part detector
bs2 long_name bs2
bs2 softlowerlim 0
bs2 softupperlim 100
bs2 home 0
bs2 softlowerlim 7
bs2 softupperlim 95
bs2 home 90
bs2 precision 0.05
sicslist setatt bs2 link parameters_group
@@ -918,8 +926,8 @@ Motor bs3 $motor_driver_type [params \
asyncqueue mc4\
axis E\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 9\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -929,9 +937,9 @@ Motor bs3 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs3 part detector
bs3 long_name bs3
bs3 softlowerlim 0
bs3 softupperlim 100
bs3 home 0
bs3 softlowerlim 11
bs3 softupperlim 95
bs3 home 90
bs3 precision 0.05
sicslist setatt bs3 link parameters_group
@@ -939,8 +947,8 @@ Motor bs4 $motor_driver_type [params \
asyncqueue mc4\
axis F\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 6\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -950,9 +958,9 @@ Motor bs4 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs4 part detector
bs4 long_name bs4
bs4 softlowerlim 0
bs4 softupperlim 100
bs4 home 0
bs4 softlowerlim 7
bs4 softupperlim 95
bs4 home 90
bs4 precision 0.05
sicslist setatt bs4 link parameters_group
@@ -960,8 +968,8 @@ Motor bs5 $motor_driver_type [params \
asyncqueue mc4\
axis G\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 9\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -971,9 +979,9 @@ Motor bs5 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs5 part detector
bs5 long_name bs5
bs5 softlowerlim 0
bs5 softupperlim 100
bs5 home 0
bs5 softlowerlim 11
bs5 softupperlim 95
bs5 home 90
bs5 precision 0.05
sicslist setatt bs5 link parameters_group
@@ -981,8 +989,8 @@ Motor bs6 $motor_driver_type [params \
asyncqueue mc4\
axis H\
units degrees\
hardlowerlim 0\
hardupperlim 100\
hardlowerlim 6\
hardupperlim 95\
maxSpeed 2\
maxAccel 1\
maxDecel 1\
@@ -992,9 +1000,9 @@ Motor bs6 $motor_driver_type [params \
cntsPerX $bs_cntsPerX]
bs6 part detector
bs6 long_name bs6
bs6 softlowerlim 0
bs6 softupperlim 100
bs6 home 0
bs6 softlowerlim 7
bs6 softupperlim 95
bs6 home 90
bs6 precision 0.05
sicslist setatt bs6 link parameters_group

View File

@@ -1,4 +1,4 @@
set currVelSel "two"
set currVelSel 43
namespace eval ::scobj::velocity_selector {
variable blocked_speeds
@@ -7,7 +7,7 @@ namespace eval ::scobj::velocity_selector {
set ::currVelSel [string tolower $::currVelSel]
switch $::currVelSel {
"one" {
40 {
set velsel_IP "137.157.202.73"
set velsel_port 10000
set m_dTwistAngle 48.30
@@ -24,7 +24,7 @@ namespace eval ::scobj::velocity_selector {
28301 inf
}
}
"two" {
43 {
# dc2-quokka.nbi.ansto.gov.au
set velsel_IP "137.157.202.74"
set velsel_port 10000