Merge from Wombat, except sics_config.ini

Conflicts:
	sics/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl
	sics/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl
	sics/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl
	sics/site_ansto/instrument/config/hmm/hmm_object.tcl
	sics/site_ansto/instrument/hipd/config/commands/eulerscan.tcl
	sics/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl
	sics/site_ansto/instrument/hipd/util/sics_config.ini
	sics/site_ansto/instrument/server_config.tcl
This commit is contained in:
Douglas Clowes
2014-06-24 17:20:27 +10:00
parent 3f8f5fcba7
commit 648c8003b7
6 changed files with 179 additions and 126 deletions

View File

@@ -1,107 +1,130 @@
# Euler cradle scan commands for texture runs
# AJS Dec 2010
# SetHistoSync: sets the histogram to receive $framenum worth of frames on receiving
# TTL pulse in frame sync input. Note: Framebuffer should be set to OFF for long runs
proc SetHistoSync {framenum} {
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 SetHistoSync 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
proc KillEphi {} {
ephi send HX2
ephi send STC
ephi reset
}
# Euler cradle scan commands for texture runs
# AJS Dec 2010
# SetHistoSync: sets the histogram to receive $framenum worth of frames on receiving
# TTL pulse in frame sync input. Note: Framebuffer should be set to OFF for long runs
proc SetHistoSync {framenum} {
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 SetHistoSync 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
oat_table -set Y {-0.5 3.5} NYC 128
histmem loadconf
histmem fsrce INTERNAL
proc ::histogram_memory::pre_count {} {}
}
publish SetHistoNormal user
proc SetHistoOneShot {frq framenum } {
histmem stop
oct speed 0.25
oct accel 0.25
oct decel 0.25
drive oct 0
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
oat_table -set Y {-0.5 15.5} NYC 16
histmem freq $frq
histmem loadconf
histmem fsrce INTERNAL
histmem mode unlimited
}
publish SetHistoOneShot user
# continous scan for EPHI- the euler cradle phi stage (innermost axis)
# note make sure controller 2 has the PHISCAN code in it
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
proc KillEphi {} {
ephi send HX2
ephi send STC
ephi reset
}