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

@@ -13,17 +13,21 @@ command SetRadColl {
float time
float range
} {
catch {
set spd [expr 2.0*$range / $time]
oct softlowerlim [expr -abs($range/2.0) - 0.5]
oct softupperlim [expr abs($range/2.0) + 0.5]
oct maxretry 5
oct accel 0.25
oct speed 0.25
oct decel 0.25
drive oct [expr abs($range/2.0)]
oct speed $spd
oct accel $spd
oct accel [expr $spd*5]
oct decel [expr $spd*5]
oct maxretry 0
} msg
clientput $msg
}
# SimpleRun
command SimpleRun {
@@ -31,12 +35,12 @@ float=0:inf steptime
int=1:inf numsteps
} {
RadCollOff
# RadCollOff
histmem mode time
histmem preset $steptime
newfile HISTOGRAM_XY
for {set i 0} {$i < $numsteps} {incr i} {
histmem start block
hmm countblock
save $i
}
}
@@ -49,13 +53,13 @@ int=1:inf numsteps
float=0:inf steptime
} {
RadCollOff
# RadCollOff
histmem mode time
histmem preset $steptime
newfile HISTOGRAM_XY
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
histmem start block
hmm countblock
save $i
}
}
@@ -65,14 +69,16 @@ int=1:inf oscno
int=1:inf reps
} {
RadCollOn $oscno
# RadCollOn $oscno
histmem mode unlimited
newfile HISTOGRAM_XY
for {set i 0} {$i < $reps} {incr i} {
histmem start block
oscmd start $oscno
hmm countblock
save $i
}
RadCollOff
oscmd stop
# RadCollOff
}
# RadCollTimed
command RadCollTimed {
@@ -105,15 +111,17 @@ int=1:inf numsteps
int=1:inf oscno
} {
RadCollOn $oscno
# RadCollOn $oscno
histmem mode unlimited
newfile HISTOGRAM_XY
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
histmem start block
oscmd start $oscno
hmm countblock
save $i
}
RadCollOff
# RadCollOff
oscmd stop
}
}
namespace import ::ajscmds::*

View File

@@ -30,6 +30,10 @@ proc ::histogram_memory::init_OAT_TABLE {args} {
FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED
OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1
}
"double_y_968x128" {
FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED BNL_STATUS_MASK_MULTI_Y 1000h
OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 256 T { 0 20000 } NTC 1
}
default {
# Default to std_968x128
FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED

View File

@@ -1,33 +1,89 @@
# Test script for multi period acquisition and saving.
# latest mods 21 Oct 09 based on info from Ferdi - ajs
set nos_periods 1
set n_periods 1
proc open_hist_file {} {
newfile HISTOGRAM_XY
}
proc histset_XY {} {
set histstr "proc open_hist_file {} {newfile HISTOGRAM_XY}"
eval $histstr
}
proc histset_XYperiod {} {
set histstr "proc open_hist_file {} {newfile HISTOPERIOD_XY}"
eval $histstr
}
proc histset_XYT {} {
set histstr "proc open_hist_file {} {newfile HISTOGRAM_XYT}"
eval $histstr
}
proc histset_XYTperiod {} {
set histstr "proc open_hist_file {} {newfile HISTOPERIOD_XYT}"
}
proc histmem_period_single { } {
# Because bugs may not yet have been corrected in hmm_configuration_common_1.tcl,
# apply the default settings before attempting del/clear.
global nos_periods
set nos_periods 1
global n_periods
set n_periods 1
FAT_TABLE -set NOS_PERIODS 1
FAT_TABLE -del NOS_PERIODS
BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0
BAT_TABLE -clear
# FAT_TABLE -del NOS_PERIODS
# BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0
BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1
histmem loadconf
# BAT_TABLE -clear
histset_XY
}
Publish histmem_period_single User
proc histmem_period_sequence { Np Nf } {
# orig version of this pre Oct 09
#
#proc histmem_period_sequence { Np Nf } {
# Note - sequence needs to be at least 2 periods.
global nos_periods
set nos_periods $Np
FAT_TABLE -set NOS_PERIODS $Np
BAT_TABLE -set PERIOD_INDICES { 0 1 } NO_BAT_ENTRIES $Np NO_BAT_PERIODS $Np NO_REPEAT_ENTRY $Nf NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1
# global n_periods
# set n_periods $Np
# set fatstr "FAT_TABLE -set NOS_PERIODS $Np"
# set fatstr2 "FAT_TABLE -set PERIOD_INDICES { 0 1 }"
# set batstr "BAT_TABLE -set NO_BAT_ENTRIES $Np NO_BAT_PERIODS $Np NO_REPEAT_ENTRY $Nf NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1"
# eval $fatstr
# eval $fatstr2
# eval $batstr
# histmem loadconf
#
#}
proc histmem_period_sequence {Np} {
global n_periods
set n_periods $Np
FAT_TABLE -set NOS_PERIODS $Np
BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE $Np
histmem loadconf
histset_XYperiod
}
proc histmem_period_sequence_off {} {
global n_periods
set n_periods $Np
FAT_TABLE -set NOS_PERIODS 1
BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0
histmem loadconf
histset_XYperiod
}
Publish histmem_period_sequence User
proc histmem_save_period_sequence { } {
global nos_periods
newfile HISTOGRAM_XYT
for { set i 0 } { $i < $nos_periods } { incr i } {
hmm configure read_data_period_number $i
global n_periods
open_hist_file
for { set i 0 } { $i < $n_periods } { incr i } {
# hmm configure read_data_period_number $i
save $i
}
}
@@ -42,6 +98,7 @@ proc histmem_period_strobo {Freq Bins} {
# OAT_TABLE -set T { 0 $bintime } NTC $Bins
eval $oatstr
histmem loadconf
histset_XYT
}
Publish histmem_period_strobo User
@@ -49,6 +106,7 @@ proc histmem_strobo_off {} {
histmem fsrce INTERNAL
OAT_TABLE -set T { 0 200000 } NTC 1
histmem loadconf
histset_XY
}
Publish histmem_strobo_off User
@@ -69,8 +127,8 @@ proc histmem_acquire_period_sequence { Np Nf } {
# clientput "tc1 reading is: " [tc1 get]
global nos_periods
for { set i 0 } { $i < $nos_periods } { incr i } {
global n_periods
for { set i 0 } { $i < $n_periods } { incr i } {
# after $dlytime
# set current_period -1
# while { $current_period < $i } {

View File

@@ -2,7 +2,7 @@
set ephi_Home 6647698
set echi_Home 8919294
set eom_Home 22960659
set eom_Home 23165482
# Sample Tilt 1, euler omega stage
Motor eom $motor_driver_type [params \
@@ -30,8 +30,8 @@ Motor echi $motor_driver_type [params \
asyncqueue mc2\
axis B\
units degrees\
hardlowerlim -20\
hardupperlim 95\
hardlowerlim -32\
hardupperlim 97\
maxSpeed 1\
maxAccel 1\
maxDecel 1\

View File

@@ -32,11 +32,14 @@ if {$sim_mode == "true"} {
}
#Measured absolute encoder reading at home position
set mx_Home 7464891
#set mx_Home 7464891
set mx_Home 23263535
set mom_Home 9274794
set mtth_Home 19927837
set mphi_Home 7613516
set mchi_Home 9050090
#set mphi_Home 7613516
set mphi_Home 27847793
#set mchi_Home 9050090
set mchi_Home 25561619
set my_Home 6767221
set som_Home 17214054
set stth_Home 2896180
@@ -241,7 +244,7 @@ Motor mtth $motor_driver_type [params \
asyncqueue mc1\
axis F\
units degrees\
hardlowerlim 45\
hardlowerlim 40.7\
hardupperlim 120.5\
maxSpeed 0.2\
maxAccel 0.2\
@@ -253,7 +256,7 @@ Motor mtth $motor_driver_type [params \
absEnc 1\
absEncHome $mtth_Home\
cntsPerX -93207]
mtth softlowerlim 45
mtth softlowerlim 40.75
mtth softupperlim 120
mtth home 90
mtth speed 0.2
@@ -281,7 +284,7 @@ Motor som $motor_driver_type [params \
units degrees\
hardlowerlim -110\
hardupperlim 160\
maxSpeed 1\
maxSpeed 5\
maxAccel 1\
maxDecel 1\
stepsPerX 12500\
@@ -299,7 +302,7 @@ Motor stth $motor_driver_type [params \
asyncqueue mc2\
axis F\
units degrees\
hardlowerlim -120\
hardlowerlim 5\
hardupperlim 30\
maxSpeed 0.5\
maxAccel 0.1\
@@ -308,7 +311,7 @@ Motor stth $motor_driver_type [params \
absEnc 1\
absEncHome $stth_Home\
cntsPerX -93207]
stth softlowerlim -120
stth softlowerlim 5
stth softupperlim 30
stth home 0
stth speed 0.5
@@ -323,16 +326,16 @@ Motor oct $motor_driver_type [params \
axis G\
units degrees\
hardlowerlim -2\
hardupperlim 2\
maxSpeed 1.0\
maxAccel 1.0\
maxDecel 1.0\
hardupperlim 4.2\
maxSpeed 2.0\
maxAccel 5.0\
maxDecel 5.0\
stepsPerX 56762\
absEnc 1\
absEncHome $oct_Home\
cntsPerX -465]
oct softlowerlim -2
oct softupperlim 2
oct softupperlim 4
oct home 0
oct speed 0.5
oct precision 0.01
@@ -373,17 +376,17 @@ Motor mf2 $motor_driver_type [params \
axis A\
units degrees\
hardlowerlim 0\
hardupperlim 1\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
hardupperlim 2\
maxSpeed 0.1\
maxAccel 0.1\
maxDecel 0.1\
stepsPerX 22000\
absEnc 1\
absEncHome 350\
cntsPerX 14000]
setHomeandRange -motor mf2 -home 0 -lowrange 0 -uprange 1
mf2 speed 0.1
mf2 precision 0.01
setHomeandRange -motor mf2 -home 0 -lowrange 0 -uprange 2
mf2 speed 0.02
mf2 precision 0.005
mf2 part monochromator
mf2 long_name mf2