configurationi init
r3261 | jgn | 2011-11-18 14:12:45 +1100 (Fri, 18 Nov 2011) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
e11fa134b5
commit
a5d0ed919d
104
site_ansto/instrument/pelican/config/commands/monodrive.tcl
Normal file
104
site_ansto/instrument/pelican/config/commands/monodrive.tcl
Normal file
@@ -0,0 +1,104 @@
|
||||
|
||||
# Drive the 3 Monochromator blades as a "bunch"
|
||||
#
|
||||
# Author: Jing Chen, jgn@ansto.gov.au
|
||||
#
|
||||
# Date: 11/11/2011
|
||||
|
||||
|
||||
# DriveMono: drive the 3 Monochromators to translating as a "bunch"
|
||||
|
||||
proc DriveMono {motor pos angle} {
|
||||
histmem stop
|
||||
bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum
|
||||
bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 }
|
||||
fat_table -set NOS_PERIODS $framenum
|
||||
oat_table -set T {0 2200000} NTC 1
|
||||
histmem loadconf
|
||||
histmem fsrce EXTERNAL
|
||||
}
|
||||
|
||||
publish DriveMono user
|
||||
|
||||
# SetHistoNormal: resets the histo for standard operation
|
||||
|
||||
proc SetHistoNormal {} {
|
||||
histmem stop
|
||||
bat_table -set NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1
|
||||
bat_table -set NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0 PERIOD_INDICES { 0}
|
||||
fat_table -set NOS_PERIODS 1
|
||||
oat_table -set T {0 2200000} NTC 1
|
||||
histmem loadconf
|
||||
histmem fsrce INTERNAL
|
||||
proc ::histogram_memory::pre_count {} {}
|
||||
}
|
||||
|
||||
# continous scan for EPHI- the euler cradle phi stage (innermost axis)
|
||||
# note make sure controller 2 has the PHISCAN code in it
|
||||
|
||||
publish SetHistoNormal user
|
||||
|
||||
|
||||
proc EphiCtsScan {start step range steptime} {
|
||||
|
||||
# magic number: steps per rotation for phi
|
||||
set ephisteps -12500
|
||||
set ephispeed [expr {($step*1.0)/$steptime}]
|
||||
set numsteps [expr {round($range/$step)}]
|
||||
# broadcast $omspeed $numsteps
|
||||
|
||||
# run ephi to start angle -1 so that first pulse signals as ephi crosses 0 angle
|
||||
# at correct velocity
|
||||
ephi accel 1
|
||||
ephi decel 1
|
||||
ephi speed 3
|
||||
drive ephi [expr {$start-1}]
|
||||
ephi speed $ephispeed
|
||||
ephi accel [expr {$ephispeed*1.2}]
|
||||
|
||||
# now set ephi parameters to galil and clear the bit
|
||||
|
||||
set scval [expr {($range+2.2)*$ephisteps}]
|
||||
set stval [expr {$ephisteps * $step}]
|
||||
broadcast $scval $stval
|
||||
som send CTLEN=$scval
|
||||
som send CTSTEP=$stval
|
||||
# som send OMN = [expr {$numsteps+1}]
|
||||
som send CB5
|
||||
|
||||
proc ::histogram_memory::pre_count {} {
|
||||
ephi send "XQ #EPHSCAN,2"
|
||||
}
|
||||
|
||||
histmem mode unlimited
|
||||
histmem start block
|
||||
|
||||
newfile HISTOPERIOD_XY
|
||||
for {set i 0} {$i<$numsteps} {incr i} {save $i}
|
||||
ephi speed 1
|
||||
|
||||
|
||||
# this we needed when it didn't work properly
|
||||
# proc ::histogram_memory::pre_count {} {}
|
||||
# ephi send SHC
|
||||
# ephi send SPC=25000
|
||||
# ephi send BCG
|
||||
# wait 3
|
||||
# ephi send "XQ #THREAD0,0"
|
||||
# wait 3
|
||||
# ephi reset
|
||||
}
|
||||
publish EphiCtsScan user
|
||||
|
||||
proc EulerCtsScan {range step steptime} {
|
||||
set numsteps [expr {round($range/$step)}]
|
||||
SetHistoSync $numsteps
|
||||
foreach chi {0 15 30 45 60 75 90} {
|
||||
drive echi $chi
|
||||
EphiCtsScan [expr {-$range/2}] $step $range $steptime
|
||||
}
|
||||
# SetHistoNormal
|
||||
}
|
||||
|
||||
publish EulerCtsScan user
|
||||
|
||||
Reference in New Issue
Block a user