Merge branch 'Wombat' into temp

Conflicts:
	sics/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl
	sics/site_ansto/instrument/hipd/config/commands/commands.tcl
	sics/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl
	sics/site_ansto/instrument/hipd/util/sics_config.ini
This commit is contained in:
Douglas Clowes
2015-02-19 15:26:13 +11:00
8 changed files with 240 additions and 149 deletions

View File

@ -1,5 +1,9 @@
set scaleval 1000.0
set scaleval 2000.0
set rampstep 100
set rampdelay 3
set motdir 1
set pulserstate 0
proc SetVoltScale {newscaleval} {
global scaleval
@ -11,17 +15,58 @@ proc VoltScale {involt} {
return [expr {($involt*1.0)/$scaleval}]
}
proc SetRampParms {_rampstep _rampdelay} {
global rampstep rampdelay
set rampstep $_rampstep
set rampdelay $_rampdelay
}
proc SetVolt {volt} {
global pulserstate
if {$volt== 0} {
PulserOff
set pulserstate 0
} else {
set pulservolt [VoltScale $volt]
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
# sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
# PulserDC $pulservolt
if {$pulserstate==0} {
PulserDC $pulservolt
PulserOn
set pulserstate 1
} else {
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
PulserOn
}
}
}
proc VoltSetStep {start step fin delay} {
set i [expr {$start*1.0}]
set loopvar 1
SetVolt $i
if {($start == $fin) || ($step == 0)} {break}
while {$loopvar} {
wait $delay
if {($start < $fin)} {
set i [expr {$i + abs($step)}]
if {$i >= $fin} {
set i $fin
set loopvar 0
}
}
if {($start > $fin)} {
set i [expr {$i - abs($step)}]
if {$i <= $fin} {
set i $fin
set loopvar 0
}
}
SetVolt $i
}
}
proc GetVolt {} {
sct_pulser transact VOLT:OFFS?
}
@ -29,25 +74,18 @@ proc GetVolt {} {
proc SingleVolt {volt oscno} {
histmem mode unlimited
newfile HISTOGRAM_XY
if {$volt== 0} {
PulserOff
} else {
set pulservolt [VoltScale $volt]
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
pulserDC $pulservolt
PulserOn
}
oscmd start $oscno
hmm countblock
SetVolt $volt
oct oscillate_count $oscno
oct oscillate start
save 0
oscmd stop
}
proc SetDC {} {
pulseroff
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
set resp [sct_pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
pulseron
}
@ -61,54 +99,57 @@ proc VoltRamp {start step fin oscno} {
set j [expr {$i*$step+$start}]
if {$j> $fin && $step > 0} {break}
if {$j< $fin && $step < 0} {break}
if {$j== 0} {
PulserOff
} else {
set pulservolt [VoltScale $j]
pulserDC $pulservolt
PulserOn
}
oscmd start $oscno
hmm countblock
SetVolt $j
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
proc VoltTextureRamp {start step fin mot tstart tstep tfin oscno} {
histmem mode unlimited
proc SingleVTexScan {mot tstart tstep tfin oscno} {
global motdir
broadcast in singlevtexscan
set loopvar 1
set i_bool 0
histmem mode unlimited
if {$motdir == 1} {
set currentmot $tstart
set i 0
while {$loopvar} {
set j [expr {$i*$step+$start}]
if {$j> $fin && $step > 0} {break}
if {$j< $fin && $step < 0} {break}
if {$j== 0} {
PulserOff
} else {
set pulservolt [VoltScale $j]
pulserDC $pulservolt
PulserOn
set currentmot $tfin
set i [expr {int(($tfin-$tstart)/$tstep)}]
}
sampledescription voltage $j
broadcast voltage $j
newfile HISTOGRAM_XY
set m 0
while {1} {
set n [expr {$m*$tstep+$tstart}]
if {$n> $tfin && $tstep > 0} {break}
if {$n< $tfin && $tstep < 0} {break}
drive $mot $n
oscmd start $oscno
while {$i_bool==0} {
drive $mot $currentmot
oct oscillate_count $oscno
oct oscillate start
hmm countblock
save $m
incr m
}
oscmd stop
save $i
if {($motdir > 0)} {
set currentmot [expr {$currentmot + $tstep}]
if {$currentmot > $tfin} {set i_bool 1}
incr i
} else {
set currentmot [expr {$currentmot - $tstep}]
if {$currentmot < $tstart} {set i_bool 1}
incr i -1
}
}
set motdir [expr {(-1*$motdir)}]
}
proc VListTexScan {voltlist mot tstart tstep tfin oscno} {
global rampstep rampdelay
set curvolt [lindex $voltlist 0]
broadcast $curvolt
SetVolt $curvolt
foreach volt $voltlist {
broadcast $volt
VoltSetStep $curvolt $rampstep $volt $rampdelay
SingleVTexScan $mot $tstart $tstep $tfin $oscno
}
}
@ -124,12 +165,10 @@ proc SquarePulseTexture {motor start step numsteps volt freq bins oscno} {
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
}
oscmd stop
}
proc UniPulseTexture {motor start step numsteps volt freq bins oscno} {
@ -144,12 +183,10 @@ proc UniPulseTexture {motor start step numsteps volt freq bins oscno} {
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
}
oscmd stop
}
@ -162,8 +199,8 @@ proc BehlkePulseTexture {motor start step numsteps freq bins oscno} {
PulserOn
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
}
}
@ -189,12 +226,11 @@ proc SquarePulseVolt {start step fin freq bins oscno} {
PulserOn
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
}
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
proc SquarePulseFreq {volt freqlist bins oscno} {
@ -209,12 +245,11 @@ proc SquarePulseFreq {volt freqlist bins oscno} {
PulserSquare $freq $pulservolt
PulserOn
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
proc BehlkePulseFreq {freqlist bins oscno} {
@ -227,12 +262,11 @@ proc BehlkePulseFreq {freqlist bins oscno} {
wait 3
PulserSquareOffs $freq 2.5 2.5
PulserOn
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
proc SinePulseFreq {volt freqlist bins oscno} {
@ -246,12 +280,11 @@ proc SinePulseFreq {volt freqlist bins oscno} {
wait 3
PulserSin $freq $pulservolt
PulserOn
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
@ -271,12 +304,11 @@ proc UniPulseFreq {volt freqlist bins oscno} {
PulserSquareOffs $freq $pulservolt $pulseroffs
PulserOn
# sct_pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $i
incr i
}
oscmd stop
}
proc UniPulseFatigue {volt freq bins oscno reps runs} {
@ -290,13 +322,14 @@ proc UniPulseFatigue {volt freq bins oscno reps runs} {
for {set i 0} {$i<$runs} {incr i} {
newfile HISTOGRAM_XYT
for {set j 0} {$j<$reps} {incr j} {
oscmd start $oscno
hmm countblock
oct oscillate_count $oscno
oct oscillate start
save $j
}
oscmd stop
}
PulserOff
set pulserstate 0
Histmem_strobo_off
}
@ -315,6 +348,7 @@ proc PulserBurst {} {
if {[string first 1 $sval] >-1} {break}
}
PulserOff
set pulserstate 0
}
@ -338,6 +372,7 @@ proc VoltPulseRun {vlo vhi freq cycl} {
sct_pulser send "BURS:NCYC $prem; NCYC?"
PulserBurst
PulserOff
set pulserstate 0
sct_pulser send "BURS:STAT OFF; STAT?"
}
@ -376,6 +411,7 @@ proc OneTri {volt period} {
sct_pulser send "BURS:NCYC 1; NCYC?"
PulserBurst
PulserOff
set pulserstat 0
}
@ -384,6 +420,9 @@ publish GetVolt user
publish SetDC user
publish SetVolt user
publish SetVoltScale user
publish SingleVTexScan user
publish VListTexScan user
publish SetRampParms user
publish SingleVolt user
publish VoltRamp user
publish SquarePulseVolt user
@ -399,5 +438,6 @@ publish SquarePulseTexture user
publish BehlkePulseTexture user
publish BehlkePulseFreq user
publish UniPulseTexture user
publish VoltSetStep user

View File

@ -54,7 +54,7 @@ proc PulserSquareOffs {Freq Volt Offs} {
proc PulserDC {Volt} {
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
set resp [sct_pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
broadcast $resp
}

View File

@ -158,13 +158,16 @@ proc RadCollScanRange {motor start step fin oscno} {
newfile HISTOGRAM_XY
while {$i_bool==0} {
drive $motor $currentmot
$motor send SH`
oct oscillate_count $oscno
oct oscillate start
hmm countblock
save $i
set currentmot [expr {$currentmot + $step}]
if {($step > 0) && ($currentmot > $fin)} {set i_bool 1}
if {($step < 0) && ($currentmot < $fin)} {set i_bool 1}
if {($i_bool == 0)} {run $motor $currentmot}
save $i
incr i
}
}
@ -173,8 +176,13 @@ publish RadCollScanRange user
#RadCollScanBi
proc RadCollScanBi {motor start step fin oscno motdir} {
set i_bool 0
set spx -12500
set spstep [expr {$spx * $step * $motdir}]
histmem stop
histmem mode unlimited
if {$motdir == 1} {
set currentmot $start
set i 0
@ -182,9 +190,10 @@ proc RadCollScanBi {motor start step fin oscno motdir} {
set currentmot $fin
set i [expr {int(($fin-$start)/$step)}]
}
drive $motor $currentmot
newfile HISTOGRAM_XY
while {$i_bool==0} {
# drive $motor $currentmot
oct oscillate_count $oscno
oct oscillate start
hmm countblock
@ -192,14 +201,24 @@ proc RadCollScanBi {motor start step fin oscno motdir} {
if {($motdir > 0)} {
set currentmot [expr {$currentmot + $step}]
if {$currentmot > $fin} {set i_bool 1}
incr i
} else {
set currentmot [expr {$currentmot - $step}]
if {$currentmot < $start} {set i_bool 1}
incr i -1
}
run $motor $currentmot
if {($i_bool == 0)} {run $motor $currentmot}
save $i
if {($motdir > 0)} {incr i 1} else {incr i -1}
# if {($i_bool == 0)} {
# $motor send SH`
# $motor send PR` $spstep
# $motor send BG`
#
# }
# save $i
}
}

View File

@ -1,7 +1,22 @@
# Euler cradle scan commands for texture runs
# AJS Dec 2010
proc EulerScan {mstart mstep mend oscno} {
ephi speed 5
ephi accel 5
ephi decel 5
echi speed 2
set motdir 1
drive echi 0 ephi $mstart
foreach chival {0 15 30 45 60 75 90} {
drive echi $chival
RadCollScanBi ephi $mstart $mstep $mend $oscno $motdir
set motdir [expr {$motdir * -1}]
}
drive echi 0 ephi $mstart
}
publish EulerScan user
# continous scan for EPHI- the euler cradle phi stage (innermost axis)
# note make sure controller 2 has the PHISCAN code in it

View File

@ -28,7 +28,7 @@ proc ::histogram_memory::init_OAT_TABLE {args} {
hmm configure fat_frame_source INTERNAL
# set resolution "double_x"
# set resolution "double_x"
switch $resolution {
"hires" {

View File

@ -26,7 +26,7 @@ set mx_Home 8390583
#set mom_Home 9274794
##set mom_Home 8391038
#set mom_Home 8147038
set mom_Home 7736816
set mom_Home 7979102
set mtth_Home 19927837
#set mphi_Home 7613516
#set mphi_Home 27847793
@ -34,6 +34,7 @@ set mphi_Home 8384818
#set mchi_Home 9050090
#set mchi_Home 25561619
set mchi_Home 8389526
#set mchi_Home 6847710
#set my_Home 6767221
set my_Home 8378212
set som_Home 17214054
@ -343,7 +344,7 @@ Motor $sample_stage_rotate $motor_driver_type [params \
asyncqueue mc2\
axis E\
units degrees\
hardlowerlim -71\
hardlowerlim -121\
hardupperlim 116\
maxSpeed 5\
maxAccel 3\
@ -363,8 +364,10 @@ Motor stth $motor_driver_type [params \
asyncqueue mc2\
axis F\
units degrees\
hardlowerlim 15.8\
hardlowerlim 13\
hardupperlim 29.7\
softlowerlim 13.4\
softupperlim 29.6\
maxSpeed 0.5\
maxAccel 0.1\
maxDecel 0.1\
@ -374,7 +377,7 @@ Motor stth $motor_driver_type [params \
bias_bits 25\
bias_bias 932070\
cntsPerX -93207]
stth softlowerlim 15.9
stth softlowerlim 13.4
stth softupperlim 29.6
stth home 28.481113
#stth home 18.981113
@ -414,28 +417,34 @@ oct long_name oct
############################
#
# Monochromator Focusing (HOPG)
#Motor mf1 $motor_driver_type [params \
# asyncqueue mc3\
# axis A\
# units degrees\
# hardlowerlim xxxx\
# hardupperlim xxxx\
# maxSpeed xxxx\
# maxAccel xxxx\
# maxDecel xxxx\
# stepsPerX xxxx\
# absEnc 1\
# absEncHome $mf1_Home\
# cntsPerX xxxx]
#setHomeandRange -motor mf1 -home 0 -lowrange 0 -uprange 360
#mf1 speed 1
#mf1 movecount $move_count
#mf1 precision 0.01
#mf1 part monochromator
#mf1 long_name mf1
set mf_config 1
switch $mf_config {
1 {
# Monochromator Focusing (HOPG)
Motor mf1 $motor_driver_type [params \
asyncqueue mc3\
axis A\
units degrees\
hardlowerlim -0.1\
hardupperlim 1.1\
maxSpeed 0.1\
maxAccel 0.1\
maxDecel 0.1\
stepsPerX 22000\
absEnc 1\
absEncHome 3965\
cntsPerX -3500]
setHomeandRange -motor mf1 -home 0 -lowrange 0 -uprange 1
mf1 speed 0.02
# mf1 movecount $move_count
mf1 precision 0.005
mf1 part monochromator
mf1 long_name mf1
}
# Monochromator Focusing (Ge)
## ffr 31/7/2012
## absEncHome was found to be 16777217 on 31/7/2012 when the
## encoder clocked over to 114 counts to give a posn
@ -444,26 +453,32 @@ oct long_name oct
## and has a 24bit range (ie max cnt=16777216)
## I set a bias of 10000 counts with absenchome = 10000
## so that SICS can drive the axis to the allowed limits.
Motor mf2 $motor_driver_type [params \
2 {
Motor mf2 $motor_driver_type [params \
asyncqueue mc3\
axis A\
units degrees\
hardlowerlim -2\
hardupperlim 2\
hardlowerlim -0.1\
hardupperlim 1.1\
maxSpeed 0.1\
maxAccel 0.1\
maxDecel 0.1\
stepsPerX 22000\
absEnc 1\
absEncHome 42768\
absEncHome 10000\
bias_bits 24\
bias_bias 10000\
cntsPerX -3500]
setHomeandRange -motor mf2 -home 0 -lowrange 0 -uprange 2
mf2 speed 0.02
mf2 precision 0.005
mf2 part monochromator
mf2 long_name mf2
setHomeandRange -motor mf2 -home 0 -lowrange 0 -uprange 1
mf2 speed 0.02
mf2 precision 0.005
mf2 part monochromator
mf2 long_name mf2
}
}
# Slit 1, right
Motor ss1r $motor_driver_type [params \

View File

@ -324,7 +324,6 @@ driver = "west_6100"
imptype = temperature
ip = 10.157.205.24
port = 502
timeout = 2000
[vf2_west4100]
asyncprotocol = modbus_ap
@ -334,5 +333,4 @@ driver = "west_6100"
imptype = temperature
ip = 10.157.205.25
port = 502
timeout = 2000

View File

@ -29,8 +29,9 @@ fileeval $cfPath(environment)/sct_agilent_33220A.tcl
fileeval $cfPath(environment)/sct_hiden_xcs.tcl
fileeval $cfPath(environment)/sct_huber_pilot.tcl
fileeval $cfPath(environment)/sct_isotech_ps.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_m2000.tcl
#fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
#fileeval $cfPath(environment)/temperature/sct_eurotherm_m2000.tcl
fileeval $cfPath(environment)/temperature/eurotherm_3200_sct.tcl
fileeval $cfPath(environment)/sct_keithley_2700.tcl
fileeval $cfPath(environment)/sct_keithley_m2700.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl
@ -62,13 +63,16 @@ fileeval $cfPath(commands)/pulser.tcl
fileeval $cfPath(commands)/hvcommands.tcl
fileeval $cfPath(commands)/vactex.tcl
fileeval $cfPath(commands)/eulerscan.tcl
fileeval $cfPath(commands)/cfcommands.tcl
fileeval $cfPath(anticollider)/anticollider.tcl
fileeval $cfPath(beamline)/sct_he3_polanal.tcl
fileeval $cfPath(hmm)/hmm_rapid.tcl
source gumxml.tcl
# Wombat only change to hvcommands' scaleval variable
SetVoltScale 2000.0
# The Alice Thing
# Qlink : 9600, 8 data, 1 stop, No Parity, None Flow
# LS340 : 9600, 7 data, 1 stop, Odd Parity, None Flow