init config for kookaburra
r3441 | jgn | 2012-03-05 15:14:55 +1100 (Mon, 05 Mar 2012) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
0c98267e84
commit
49bcdfb9e8
1
site_ansto/instrument/kookaburra/DMC2280/README.txt
Normal file
1
site_ansto/instrument/kookaburra/DMC2280/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
Programs for the DMC2280 controllers.
|
||||
80
site_ansto/instrument/kookaburra/DMC2280/controller4.txt
Normal file
80
site_ansto/instrument/kookaburra/DMC2280/controller4.txt
Normal file
@@ -0,0 +1,80 @@
|
||||
NO TE: TAIPAN - CONTROLLER 4
|
||||
NO TE:
|
||||
NO TE: $Revision: 1.2 $
|
||||
NO TE: $Date: 2007-09-24 01:28:42 $
|
||||
NO TE: Author: Dan Bartlett
|
||||
NO TE: Last revision by: $Author: dbx $
|
||||
NO TE:
|
||||
NO TE: A-SPARE
|
||||
NO TE: B-SPARE
|
||||
NO TE: C-SPARE
|
||||
NO TE: D-SPARE
|
||||
NO TE: E-VIRTUAL SOURCE RIGHT, +VE OPEN, 6mm/TURN
|
||||
NO TE: F-VIRTUAL SOURCE LEFT, -VE OPEN, 6mm/TURN
|
||||
NO TE: G-SPARE
|
||||
NO TE: H-SPARE
|
||||
NO TE: 55mm GAP AT LIMITS, EQUAL ABOUT BEAM CL
|
||||
NO ----------------------------------------
|
||||
#AUTO
|
||||
NO TE: THIS IS THE PROGRAM THAT RUNS AUTOMATICALLY ON CONTROLLER STARTUP
|
||||
MT-2,-2,-2,-2,-2,-2,-2,-2;'CONFIGURES ALL AXES AS STEPPER
|
||||
MO;' FIRST TIME MOTOR OFF
|
||||
CN 1;' CONFIGURES LIMIT SWITCHES TO ACCEPT NC CONTACTS
|
||||
II 8,,,0;' CONFIGURES THE 8TH INPUT TO ACTIVATE THE #ININT ROUTINE
|
||||
OP 65280;' SETS OUTPUTS 9-16 ON = RELAYS OFF
|
||||
IA 137,157,203,134;' CONFIGURES IP ADDRESS
|
||||
AC ,,,,25000,25000,,;' SET ACELERATION
|
||||
DC ,,,,25000,25000,,;' SET DECELERATION
|
||||
SP ,,,,12500,12500,,;' SET SPEED
|
||||
JS #THREAD0
|
||||
EN
|
||||
NO ----------------------------------------
|
||||
#THREAD0
|
||||
NO TE: THERE MUST BE A THREAD RUNNING FOR #LIMSWI, #TCPERR AND #ININT TO WORK
|
||||
NO TE: CHECKS IF SPEEDS ARE ABOVE MAXIMUM ALLOWED
|
||||
NO IF (_SPA>50000)
|
||||
NO SPA=50000
|
||||
NO ENDIF
|
||||
NO IF (_SPB>50000)
|
||||
NO SPB=50000
|
||||
NO ENDIF
|
||||
NO IF (_SPC>50000)
|
||||
NO SPC=50000
|
||||
NO ENDIF
|
||||
NO IF (_SPD>50000)
|
||||
NO SPD=50000
|
||||
NO ENDIF
|
||||
IF (_SPE<>12500)
|
||||
SPE=12500
|
||||
ENDIF
|
||||
IF (_SPF<>12500)
|
||||
SPF=12500
|
||||
ENDIF
|
||||
NO IF (_SPG>50000)
|
||||
NO SPG=50000
|
||||
NO ENDIF
|
||||
NO IF (_SPH>50000)
|
||||
NO SPH=50000
|
||||
NO ENDIF
|
||||
NO TE: CHECKS TO SEE IF DECELERATIONS OK
|
||||
IF (_DCE<>25000)
|
||||
DCE=25000
|
||||
ENDIF
|
||||
IF (_DCF<>25000)
|
||||
DCF=25000
|
||||
ENDIF
|
||||
JP #THREAD0
|
||||
EN
|
||||
NO ----------------------------------------
|
||||
#TCPERR
|
||||
NO TE: EMPTY ROUTINE FOR A TCP ERROR
|
||||
RE
|
||||
NO ----------------------------------------
|
||||
#ININT
|
||||
NO TE: INTERUPT ROUTINE TO STOP ALL AXES
|
||||
NO TE: WHEN SAFETY & INTERLOCK SYSTEM REQUESTS IT
|
||||
STA,B,C,D,E,F,G,H
|
||||
AM
|
||||
MO
|
||||
RI
|
||||
NO ----------------------------------------
|
||||
67
site_ansto/instrument/kookaburra/DMC2280/controller5.txt
Normal file
67
site_ansto/instrument/kookaburra/DMC2280/controller5.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
NO TE: TAIPAN - CONTROLLER 5
|
||||
NO TE:
|
||||
NO TE: $Revision: 1.2 $
|
||||
NO TE: $Date: 2007-09-24 01:29:31 $
|
||||
NO TE: Author: Dan Bartlett
|
||||
NO TE: Last revision by: $Author: dbx $
|
||||
NO TE:
|
||||
NO TE: A-SECONDARY SHUTTER, +VE OPEN, 6mm/TURN
|
||||
NO TE: ONE AXIS CONTROLLER ONLY
|
||||
NO ----------------------------------------
|
||||
#AUTO
|
||||
NO TE: THIS IS THE PROGRAM THAT RUNS AUTOMATICALLY ON CONTROLLER STARTUP
|
||||
SHA
|
||||
MTA=-2;'CONFIGURES ALL AXES AS STEPPER
|
||||
CN 1;' CONFIGURES LIMIT SWITCHES TO ACCEPT NC CONTACTS
|
||||
IA 137,157,203,135;' CONFIGURES IP ADDRESS
|
||||
ACA=100000;' SET ACELERATION
|
||||
DCA=100000;' SET DECELERATION
|
||||
SPA=50000;' SET SPEED
|
||||
JS #THREAD0
|
||||
EN
|
||||
NO ----------------------------------------
|
||||
#THREAD0
|
||||
NO TE: CONTROLS THE SECONDARY SHUTTER
|
||||
NO TE: INPUT 5=SECONDARY SHUTTER CLOSE SIGNAL 1
|
||||
NO TE: INPUT 6=SECONDARY SHUTTER CLOSE SIGNAL 2
|
||||
NO TE: INPUT 7=SECONDARY SHUTTER OPEN SIGNAL 1
|
||||
NO TE: INPUT 8=SECONDARY SHUTTER OPEN SIGNAL 2
|
||||
IF ((_TI0&192)=0)&(_BGA=0)&(_LFA=1)
|
||||
NO TE: INPUTS 7,8 EXCLUSIVELY ACTIVE(0) & NOT MOVING & NOT ALREADY OPEN
|
||||
NO TE: SECONDARY SHUTTER COMMANDED TO OPEN
|
||||
NO TE: INPUTS 1,2,3 AND 4 ARE MASKED OUT BY THE &192
|
||||
PRA=580000;'APROX 140mm
|
||||
BGA
|
||||
ENDIF
|
||||
IF ((_TI0&192<>0)&(_LRA=1)
|
||||
NO TE: INPUTS 7,8 NOT EXCLUSIVELY ACTIVE(0) & NOT ALREADY CLOSED
|
||||
NO TE: SECONDARY SHUTTER COMMANDED TO CLOSE
|
||||
NO TE: INPUTS 1,2,3 AND 4 ARE MASKED OUT BY THE &192
|
||||
STA;' STOP ANY MOTION
|
||||
AMA;' AFTER MOTION IS STOPPED
|
||||
PRA=-580000;' APROX 140mm
|
||||
BGA;' DRIVE SHUTTER CLOSED TO LIMIT SWITCH
|
||||
AMA
|
||||
ENDIF
|
||||
JP #THREAD0
|
||||
EN
|
||||
NO ----------------------------------------
|
||||
#TCPERR
|
||||
NO TE: EMPTY ROUTINE FOR A TCP ERROR
|
||||
RE
|
||||
NO ----------------------------------------
|
||||
#CMDERR
|
||||
NO TE: THIS IS A ROUTINE TO HANDLE COMMAND ERRORS
|
||||
ZS0;' ZERO STACK
|
||||
EN1
|
||||
NO ----------------------------------------
|
||||
#MONSWI
|
||||
NO TE: THIS IS A ROUTINE TO MONITOR THE POSITION
|
||||
NO TE: OF THE SECONDARY SHUTTER
|
||||
IF (_LFA=1)&(_LRA=1)
|
||||
MG {EA}, "SS NOT OPEN, NOT CLOSED"
|
||||
WT200
|
||||
ENDIF
|
||||
JP #MONSWI
|
||||
EN
|
||||
NO ----------------------------------------
|
||||
5
site_ansto/instrument/kookaburra/MANIFEST.TXT
Normal file
5
site_ansto/instrument/kookaburra/MANIFEST.TXT
Normal file
@@ -0,0 +1,5 @@
|
||||
kookaburra_configuration.tcl
|
||||
sics_ports.tcl
|
||||
script_validator_ports.tcl
|
||||
config
|
||||
util
|
||||
5
site_ansto/instrument/kookaburra/Makefile
Normal file
5
site_ansto/instrument/kookaburra/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
make -C config
|
||||
|
||||
clean:
|
||||
make -C config clean
|
||||
18
site_ansto/instrument/kookaburra/config/INSTCFCOMMON.TXT
Normal file
18
site_ansto/instrument/kookaburra/config/INSTCFCOMMON.TXT
Normal file
@@ -0,0 +1,18 @@
|
||||
config/source/source_common.tcl
|
||||
config/anticollider/anticollider_common.tcl
|
||||
config/plc/plc_common_1.tcl
|
||||
config/counter/counter_common_1.tcl
|
||||
config/hipadaba/hipadaba_configuration_common.tcl
|
||||
config/hipadaba/common_instrument_dictionary.tcl
|
||||
config/hipadaba/instdict_specification.tcl
|
||||
config/hmm/hmm_configuration_common_1.tcl
|
||||
config/hmm/hmm_cylindrical_detector_configuration.tcl
|
||||
config/hmm/hmm_object.tcl
|
||||
config/hmm/anstohm_linked.xml
|
||||
config/hmm/sct_orhvps_common.tcl
|
||||
config/scan/scan_common_1.hdd
|
||||
config/scan/scan_common_1.tcl
|
||||
config/nexus/nxscripts_common_1.tcl
|
||||
config/commands/commands_common.tcl
|
||||
config/motors/sct_positmotor_common.tcl
|
||||
config/motors/sct_jogmotor_common.tcl
|
||||
4
site_ansto/instrument/kookaburra/config/Makefile
Normal file
4
site_ansto/instrument/kookaburra/config/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
all:
|
||||
|
||||
|
||||
clean:
|
||||
@@ -0,0 +1,4 @@
|
||||
# Forbid detector motion when the detector voltage is on
|
||||
# comment out -- Jing
|
||||
#forbid {-inf inf} for det when dhv1 in {800 inf}
|
||||
#forbid {-inf inf} for detoff when dhv1 in {800 inf}
|
||||
@@ -0,0 +1,14 @@
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
|
||||
source $cfPath(anticollider)/anticollider_common.tcl
|
||||
|
||||
# NOTE: This is called with a list of motorname target pairs
|
||||
proc ::anticollider::enable {args} {
|
||||
if {[SplitReply [::anticollider::protect_detector]] == "false"} {
|
||||
return "false"
|
||||
} else {
|
||||
return "true"
|
||||
}
|
||||
}
|
||||
|
||||
::anticollider::loadscript acscript.txt
|
||||
@@ -0,0 +1,10 @@
|
||||
fileeval $cfPath(beamline)/sct_hv.tcl
|
||||
|
||||
::scobj::hv::mkHV {
|
||||
name "hv"
|
||||
IP localhost
|
||||
PORT 55010
|
||||
tuning 1
|
||||
interval 3
|
||||
}
|
||||
|
||||
193
site_ansto/instrument/kookaburra/config/beamline/sct_hv.tcl
Normal file
193
site_ansto/instrument/kookaburra/config/beamline/sct_hv.tcl
Normal file
@@ -0,0 +1,193 @@
|
||||
###########################################################################################################################
|
||||
# @file Proptocols between SICS and High Voltage Controller
|
||||
#
|
||||
# This is a driver for SICS to make following communication with the High Voltage Controller
|
||||
#
|
||||
#
|
||||
# 1. SICS uses TCP/IP protocol to interact with the HV component who shall provide an IP address
|
||||
# together with an port number.
|
||||
#
|
||||
# 2. Commands From SICS to HV component,
|
||||
# 1. HV_START hv1=xxx, i1=xxx, hv2=xxx, i2=xxx
|
||||
# :: Responses from HV component back to SICS are either
|
||||
# OK (if the system start correctly), or
|
||||
# Error Message (if the system does not start normally, the error message shall indicate
|
||||
# type of the errors)
|
||||
#
|
||||
# 2. HV_STOP (This will stop/shutdown the HV component totally)
|
||||
#
|
||||
# 3. HV_RESET (This will reset the HV component using the hv/i values specified in the Gumtree client GUI)
|
||||
# :: Responses from HV component back to SICS are either
|
||||
# OK (if the system start correctly), or
|
||||
# Error Message (if the system does not start normally, the error message will indicate type of the errors)
|
||||
#
|
||||
# 4. HV_STATUS (This command will send to HV component automatically and regularly, i.e. every 1 sec)
|
||||
# :: Responses from HV component back to SICS is "hv1=xxx, i1=xxx, hv2=xxx, i2=xxx, system=rampingup;\n",
|
||||
# SICS uses this information to update their values in the SICS system and on the Gumtree client as well.
|
||||
#
|
||||
# 3. HV parameters to be dsiaplyed on the Gumtree GUI are, hv1, i1, hv2, i2, system
|
||||
#
|
||||
# Author: Jing Chen (jgn@ansto.gov.au) July 2011
|
||||
#
|
||||
# The HV Controller can be installed with the following command,
|
||||
# ::scobj::hv::mkHV {
|
||||
# name "hv"
|
||||
# IP localhost
|
||||
# PORT 55010
|
||||
# tuning 1
|
||||
# interval 1
|
||||
#
|
||||
##############################################################################################################################
|
||||
|
||||
|
||||
namespace eval ::scobj::hv {
|
||||
}
|
||||
|
||||
proc ::scobj::hv:setting {par} {
|
||||
|
||||
set newPara [sct target]
|
||||
|
||||
if{[sct oldStatus] != $newPara} {
|
||||
set oldStatus $newPara
|
||||
switch $par {
|
||||
"hv1" {set comm "hv_set hv1 $newPara"}
|
||||
"hv2" {set comm "hv_set hv2 $newPara"}
|
||||
"i1" {set comm "hv_set i1 $newPara"}
|
||||
"i2" {set comm "hv_set i2 $newPara"}
|
||||
default {error "ERROR: illegal parameters, try "hv1","hv2","i1" or "i2""
|
||||
return idle}
|
||||
}
|
||||
|
||||
sct send $comm
|
||||
return checkReply
|
||||
} else {
|
||||
return idle
|
||||
}
|
||||
}
|
||||
|
||||
proc ::scobj::hv::checkReplyFunc {basePath} {
|
||||
set replyStr [sct result]
|
||||
#analysis the reply from the HV Device
|
||||
if {[string first "Error" $replyStr] != -1} {
|
||||
broadcast "ERROR command, check again!!"
|
||||
}
|
||||
hset $basePath/msg $replyStr
|
||||
return idle
|
||||
}
|
||||
|
||||
##
|
||||
|
||||
# @brief send "hv_get" command to the HV device and obtain the latest values of those parameters
|
||||
proc ::scobj::hv::getParaFunc {} {
|
||||
set comm "hv_get"
|
||||
sct send $comm
|
||||
return rdParaState
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Read and record the parameters' values from the HV device
|
||||
proc ::scobj::hv::rdParaStateFunc {basePath} {
|
||||
set replyStr [sct result]
|
||||
#broadcast "Reply from hv_get: $replyStr"
|
||||
|
||||
if {[string first "Error" $replyStr] != -1} {
|
||||
broadcast "ERROR: cannot get the current parameters setting from the HV device, check again!"
|
||||
} elseif {$replyStr != [sct oldval]} {
|
||||
sct oldval $replyStr
|
||||
broadcast "oldval = [sct oldval]"
|
||||
set s1 [string trimright $replyStr "\n"]
|
||||
set s2 [split $s1 "=;"]
|
||||
|
||||
array set paraArr $s2
|
||||
|
||||
hset $basePath/hv1 $paraArr(hv1)
|
||||
hset $basePath/i1 $paraArr(i1)
|
||||
hset $basePath/hv2 $paraArr(hv2)
|
||||
hset $basePath/i2 $paraArr(i2)
|
||||
|
||||
#broadcast "HV1:$paraArr(hv1); I1:$paraArr(i1); HV2:$paraArr(hv2); I2:$paraArr(i2)\n"
|
||||
|
||||
sct utime readtime
|
||||
}
|
||||
|
||||
return idle
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# @brief Make a HV Controller
|
||||
#
|
||||
# @param argList, {name "hv" IP localhost PORT 65123 tuning 1 interval 1}
|
||||
#
|
||||
# name: name of hv controller object
|
||||
# IP: IP address of RF generator moxa box
|
||||
# PORT: Port number assigned to the generator on the moxa-box
|
||||
# tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions
|
||||
# interval: polling and ramping interval in seconds.
|
||||
|
||||
proc ::scobj::hv::mkHV {argList} {
|
||||
# Generate parameter array from the argument list
|
||||
foreach {k v} $argList {
|
||||
set KEY [string toupper $k]
|
||||
set pa($KEY) $v
|
||||
}
|
||||
|
||||
MakeSICSObj $pa(NAME) SCT_OBJECT
|
||||
sicslist setatt $pa(NAME) klass instrument
|
||||
sicslist setatt $pa(NAME) long_name $pa(NAME)
|
||||
hsetprop /sics/$pa(NAME) status "IDLE"
|
||||
|
||||
hfactory /sics/$pa(NAME)/hv1 plain user int
|
||||
hfactory /sics/$pa(NAME)/hv2 plain user int
|
||||
hfactory /sics/$pa(NAME)/i1 plain user int
|
||||
hfactory /sics/$pa(NAME)/i2 plain user int
|
||||
hfactory /sics/$pa(NAME)/msg plain user text
|
||||
|
||||
#makesctcontroller sct_hv rfamp $pa(IP):$pa(PORT)
|
||||
makesctcontroller sct_hv std $pa(IP):$pa(PORT)
|
||||
|
||||
hfactory /sics/$pa(NAME)/status plain user text
|
||||
hsetprop /sics/$pa(NAME)/status read ::scobj::hv::getParaFunc
|
||||
hsetprop /sics/$pa(NAME)/status rdParaState ::scobj::hv::rdParaStateFunc /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/status oldval UNKNOWN
|
||||
hset /sics/$pa(NAME)/status idle
|
||||
|
||||
hsetprop /sics/$pa(NAME)/status tuning $pa(TUNING)
|
||||
|
||||
# Initialise properties required for generating the API for GumTree and to save data
|
||||
::scobj::hinitprops $pa(NAME) hv1 i1 hv2 i2 msg
|
||||
|
||||
sct_hv poll /sics/$pa(NAME)/status $pa(INTERVAL)
|
||||
|
||||
if {$pa(TUNING)} {
|
||||
hfactory /sics/$pa(NAME)/set_hv1 plain user int
|
||||
hfactory /sics/$pa(NAME)/set_hv2 plain user int
|
||||
hfactory /sics/$pa(NAME)/set_i1 plain user int
|
||||
hfactory /sics/$pa(NAME)/set_i2 plain user int
|
||||
|
||||
::scobj::hinitprops $pa(NAME) status set_hv1 set_hv2 set_i1 set_i2
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_hv1 write ::scobj::hv:setting "hv1"
|
||||
hsetprop /sics/$pa(NAME)/set_hv1 checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_hv1 oldStatus UNKNOWN
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_hv2 write ::scobj::hv:setting "hv2"
|
||||
hsetprop /sics/$pa(NAME)/set_hv2 checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_hv2 oldStatus UNKNOWN
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_i1 write ::scobj::hv:setting "i1"
|
||||
hsetprop /sics/$pa(NAME)/set_i1 checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_i1 oldStatus UNKNOWN
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_i2 write ::scobj::hv:setting "i2"
|
||||
hsetprop /sics/$pa(NAME)/set_i2 checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
hsetprop /sics/$pa(NAME)/set_i2 oldStatus UNKNOWN
|
||||
|
||||
sct_hv write /sics/$pa(NAME)/set_hv1 $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_hv2 $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_i1 $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_i2 $pa(INTERVAL)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
|
||||
namespace eval ::scobj::chopper {
|
||||
|
||||
# MakeSICSObj disk_chopper SCT_OBJECT user int
|
||||
# sicslist setatt disk_chopper klass NXdisk_chopper
|
||||
# sicslist setatt disk_chopper long_name disk_chopper
|
||||
|
||||
proc sndMBquery {rdScript cmd nextReq} {
|
||||
set chN [sct chopper]
|
||||
sct nextSndReq $nextReq
|
||||
sct send "$chN:$cmd"
|
||||
return $rdScript
|
||||
}
|
||||
|
||||
proc sndMBset {root cmd} {
|
||||
set val [sct target]
|
||||
#TODO convert val to appropriate units, if [convfact] then val = val * [sct convfact]
|
||||
sct send "$cmd:$val"
|
||||
sct target 0
|
||||
return RDSETREPLY
|
||||
}
|
||||
proc rdStatus {root statnode fields} {
|
||||
set currCh [sct chopper]
|
||||
set chPath $root/ch$currCh/$statnode
|
||||
set oldval [hgetpropval $chPath oldval]
|
||||
set val [sct result]
|
||||
if {[string match "ASCERR:*" $val]} {
|
||||
sct geterror $val
|
||||
return idle
|
||||
}
|
||||
if {$val != $oldval} {
|
||||
hsetprop $chPath oldval $val
|
||||
binary scan [binary format c $val] B* binNum
|
||||
set bitfield [split $binNum ""]
|
||||
foreach n $fields b $bitfield {
|
||||
hset $chPath/$n $b
|
||||
}
|
||||
}
|
||||
return [sct nextSndReq]
|
||||
}
|
||||
proc rdSysStatus {root nodes} {
|
||||
# Read status byte and set nodes for each bit
|
||||
set currCh [sct chopper]
|
||||
set chPath $root/ch$currCh/system_status
|
||||
set oldval [hgetpropval $chPath oldval]
|
||||
set val [sct result]
|
||||
if {[string match "ASCERR:*" $val]} {
|
||||
sct geterror $val
|
||||
return idle
|
||||
}
|
||||
if {$val != $oldval} {
|
||||
hsetprop $chPath oldval $val
|
||||
binary scan [binary format c $val] B* binNum
|
||||
set bitfield [split $binNum ""]
|
||||
binary scan [binary format c $oldval] B* oldbinNum
|
||||
set oldbitfield [split $oldbinNum ""]
|
||||
foreach n $nodes b $bitfield ob $oldbitfield {
|
||||
if {$b != $ob} {
|
||||
hset $chPath/$n $b
|
||||
}
|
||||
}
|
||||
}
|
||||
return [sct nextSndReq]
|
||||
}
|
||||
proc rdIntLkStatus {root nodes} {
|
||||
# Read status byte and set nodes for each bit
|
||||
set currCh [sct chopper]
|
||||
set chPath $root/ch$currCh/intlck_status
|
||||
set oldval [hgetpropval $chPath oldval]
|
||||
set val [sct result]
|
||||
if {[string match "ASCERR:*" $val]} {
|
||||
sct geterror $val
|
||||
return idle
|
||||
}
|
||||
if {$val != $oldval} {
|
||||
hsetprop $chPath oldval $val
|
||||
binary scan [binary format c $val] B* binNum
|
||||
set bitfield [split $binNum ""]
|
||||
binary scan [binary format c $oldval] B* oldbinNum
|
||||
set oldbitfield [split $oldbinNum ""]
|
||||
foreach n $nodes b $bitfield ob $oldbitfield {
|
||||
if {$b != $ob} {
|
||||
hset $chPath/$n $b
|
||||
}
|
||||
}
|
||||
}
|
||||
return [sct nextSndReq]
|
||||
}
|
||||
##
|
||||
# Reads a list of values in the result and assigns them to the nodes in the args list
|
||||
proc rdVal {root nodes} {
|
||||
set currCh [sct chopper]
|
||||
set values [sct result]
|
||||
set chPath $root/ch$currCh
|
||||
if {[string match "ASCERR:*" $values]} {
|
||||
sct geterror $values
|
||||
hset $chPath/device_error $values
|
||||
return idle
|
||||
}
|
||||
if {[hval $chPath/device_error] != ""} {
|
||||
hset $chPath/device_error ""
|
||||
}
|
||||
foreach n $nodes v $values {
|
||||
set oldval [hval $chPath/$n]
|
||||
# if {$n == "speed_setpt"} {
|
||||
# broadcast rdVal,$n $chPath/$n: oldval=$oldval, v=$v
|
||||
# }
|
||||
if {$v != $oldval} {
|
||||
# if {$n == "speed_setpt"} {
|
||||
# broadcast rdVal,$n: hset $chPath/$n $v
|
||||
# }
|
||||
hset $chPath/$n $v
|
||||
}
|
||||
}
|
||||
set nextReq [sct nextSndReq]
|
||||
if {$nextReq == "NXTCHOPPER"} {
|
||||
if {$currCh < [sct chMax] } {
|
||||
incr currCh
|
||||
sct chopper $currCh
|
||||
} else {
|
||||
sct chopper 1
|
||||
return idle
|
||||
}
|
||||
}
|
||||
return $nextReq
|
||||
}
|
||||
|
||||
proc rdSetCmdReply {root chPath} {
|
||||
set reply [sct result]
|
||||
if {[string match "ASCERR:*" $reply]} {
|
||||
sct geterror $reply
|
||||
hset $chPath/device_error $reply
|
||||
return idle
|
||||
}
|
||||
if {[hval $chPath/device_error] != ""} {
|
||||
hset $chPath/device_error ""
|
||||
}
|
||||
sct_fermi queue $root progress read
|
||||
return idle
|
||||
}
|
||||
# Create chopper control
|
||||
set scobjNS ::scobj::chopper
|
||||
set sim_mode false
|
||||
set pollrate 5
|
||||
MakeSICSObj fermi_chopper SCT_OBJECT user int
|
||||
sicslist setatt fermi_chopper klass NXfermi_chopper
|
||||
set fermiPath /sics/fermi_chopper
|
||||
::scobj::hinitprops fermi_chopper
|
||||
if {$sim_mode == "false"} {
|
||||
makesctcontroller sct_fermi tcpmodbus 137.157.202.213:502
|
||||
}
|
||||
hsetprop $fermiPath chopper 1
|
||||
|
||||
set intlck_fields {test_mode cc_shutdown_req dsp_summ_shtdwn cooling_loss spd_sensor_loss ref_sig_loss over_temp vac_fail overspeed_or_breakfail cc_wd_fail ext_fault ups_fail emerg_stop pos_alarm osc_fail dsp_wd_fail}
|
||||
|
||||
set chMax 1
|
||||
hsetprop $fermiPath chMax $chMax
|
||||
for {set chN 1} {$chN <= $chMax} {incr chN} {
|
||||
set chname ch$chN
|
||||
sicslist setatt fermi_chopper klass NXfermi_chopper
|
||||
sicslist setatt fermi_chopper long_name fermi_chopper
|
||||
hfactory $fermiPath/$chname plain user float
|
||||
set chPath $fermiPath/$chname
|
||||
hfactory $chPath/device_error plain user text
|
||||
|
||||
foreach field {
|
||||
system_status intlck_status rotation_speed
|
||||
phase_veto_count phase_nonveto_count phase_acc
|
||||
phase_rep phase_ok vetowin100ns
|
||||
vetowin50ns mode speed_setpt
|
||||
prop_gain int_gain phase_gain
|
||||
ref_delay ref_period sync_srce motdir idle_toggle
|
||||
} {
|
||||
hfactory $fermiPath/$chname/$field plain user float
|
||||
}
|
||||
hsetprop $chPath/system_status oldval "UNKNOWN"
|
||||
hsetprop $chPath/intlck_status oldval "UNKNOWN"
|
||||
|
||||
foreach field {
|
||||
avc_on motdir phase_locked lev_complete alarm run up_to_speed ok
|
||||
} {
|
||||
hfactory $fermiPath/$chname/system_status/$field plain user int
|
||||
}
|
||||
foreach field $intlck_fields {
|
||||
hfactory $fermiPath/$chname/intlck_status/$field plain user int
|
||||
}
|
||||
|
||||
|
||||
hfactory $chPath/control plain user none
|
||||
hfactory $chPath/control/device_error plain user text
|
||||
|
||||
foreach {n cmd} [subst -nocommands {
|
||||
set_rotspeed "$chN:16:1000:1:U32"
|
||||
set_prop_gain "$chN:16:1004:1:F32"
|
||||
set_int_gain "$chN:16:1006:1:F32"
|
||||
set_phase_gain "$chN:16:1008:1:F32"
|
||||
set_ref_delay "$chN:16:1010:1:U32"
|
||||
set_ref_period "$chN:16:1012:1:U32"
|
||||
set_sync_source "$chN:16:1014:1:U32"
|
||||
set_motor_dir "$chN:16:1016:1:U32"
|
||||
start "$chN:5:1"
|
||||
stop "$chN:5:2"
|
||||
idle_toggle "$chN:5:3"
|
||||
reset "$chN:5:4"
|
||||
}] {
|
||||
hfactory $chPath/control/$n plain user float
|
||||
hsetprop $chPath/control/$n write ${scobjNS}::sndMBset $chPath $cmd
|
||||
hsetprop $chPath/control/$n RDSETREPLY ${scobjNS}::rdSetCmdReply $fermiPath $chPath/control
|
||||
if {$sim_mode == "false"} {
|
||||
sct_fermi write $chPath/control/$n
|
||||
}
|
||||
}
|
||||
}
|
||||
# Each Req chains to a rdVal proc which chains to the next req
|
||||
# Add a next state property
|
||||
#TODO Read idle_toggle status
|
||||
hsetprop $fermiPath nextSndReq "UNKNOWN"
|
||||
hsetprop $fermiPath read ${scobjNS}::sndMBquery "RDSYSSTAT" "3:10:1:U16" "INTLKREQ"
|
||||
hsetprop $fermiPath "NXTCHOPPER" ${scobjNS}::sndMBquery "RDSYSSTAT" "3:10:1:U16" "INTLKREQ"
|
||||
hsetprop $fermiPath "INTLKREQ" ${scobjNS}::sndMBquery "RDINTLKSTAT" "3:12:1:U16" "ROTSPDREQ"
|
||||
hsetprop $fermiPath "ROTSPDREQ" ${scobjNS}::sndMBquery "RDROTSPD" "3:14:1:U16" "VETOINF"
|
||||
hsetprop $fermiPath "VETOINF" ${scobjNS}::sndMBquery "RDVETOINF" "3:18:2:U32" "PHASEINF"
|
||||
hsetprop $fermiPath "PHASEINF" ${scobjNS}::sndMBquery "RDPHASEINF" "3:24:3:F32" "VETO"
|
||||
hsetprop $fermiPath "VETO" ${scobjNS}::sndMBquery "RDVETO" "3:30:3:U32" "ROTSPSET"
|
||||
hsetprop $fermiPath "ROTSPSET" ${scobjNS}::sndMBquery "RDROTSPSET" "3:1000:1:U32" "GAINPHASE"
|
||||
hsetprop $fermiPath "GAINPHASE" ${scobjNS}::sndMBquery "RDGAINPHASE" "3:1004:3:F32" "SYNMOTDIR"
|
||||
hsetprop $fermiPath "SYNMOTDIR" ${scobjNS}::sndMBquery "RDSYNMOTDIR" "3:1010:4:U32" "IDLETOGGLE"
|
||||
hsetprop $fermiPath "IDLETOGGLE" ${scobjNS}::sndMBquery "RDIDLE" "1:3:1" "NXTCHOPPER"
|
||||
|
||||
|
||||
hsetprop $fermiPath "RDSYSSTAT" ${scobjNS}::rdStatus $fermiPath system_status {avc_on motdir phase_locked lev_complete alarm run up_to_speed ok}
|
||||
hsetprop $fermiPath "RDINTLKSTAT" ${scobjNS}::rdStatus $fermiPath intlck_status $intlck_fields
|
||||
hsetprop $fermiPath "RDROTSPD" ${scobjNS}::rdVal $fermiPath rotation_speed
|
||||
hsetprop $fermiPath "RDVETOINF" ${scobjNS}::rdVal $fermiPath {phase_veto_count phase_nonveto_count}
|
||||
hsetprop $fermiPath "RDPHASEINF" ${scobjNS}::rdVal $fermiPath {phase_acc phase_rep phase_ok}
|
||||
hsetprop $fermiPath "RDVETO" ${scobjNS}::rdVal $fermiPath {vetowin100ns vetowin50ns mode}
|
||||
hsetprop $fermiPath "RDROTSPSET" ${scobjNS}::rdVal $fermiPath speed_setpt
|
||||
hsetprop $fermiPath "RDGAINPHASE" ${scobjNS}::rdVal $fermiPath {prop_gain int_gain phase_gain}
|
||||
hsetprop $fermiPath "RDSYNMOTDIR" ${scobjNS}::rdVal $fermiPath {ref_delay ref_period sync_srce motdir}
|
||||
hsetprop $fermiPath "RDIDLE" ${scobjNS}::rdVal $fermiPath idle_toggle
|
||||
|
||||
|
||||
if {$sim_mode == "false"} {
|
||||
sct_fermi poll $fermiPath $pollrate
|
||||
sct_fermi queue $fermiPath progress read
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# Author : Jing Chen (jgn@ansto.gov.au)
|
||||
|
||||
source $cfPath(commands)/commands_common.tcl
|
||||
|
||||
namespace eval motor {
|
||||
# is_homing_list = comma separated list of motors which are safe to send "home"
|
||||
variable is_homing_list ""
|
||||
}
|
||||
|
||||
proc ::commands::isc_initialize {} {
|
||||
::commands::ic_initialize
|
||||
}
|
||||
122
site_ansto/instrument/kookaburra/config/commands/monodrive.tcl
Normal file
122
site_ansto/instrument/kookaburra/config/commands/monodrive.tcl
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
# Drive the 3 Monochromator blades as a "bunch"
|
||||
#
|
||||
# Author: Jing Chen, jgn@ansto.gov.au
|
||||
#
|
||||
# Date: 11/11/2011
|
||||
|
||||
# get a specified parameter value of a motor
|
||||
proc getSetting {mot field} {
|
||||
|
||||
switch $field {
|
||||
"position" {
|
||||
set tmpStr1 [$mot]
|
||||
set tmpStr2 [split $tmpStr1 "="]
|
||||
array set tmpstr3 $tmpStr2
|
||||
set ind "$mot "
|
||||
return $tmpstr3($ind)
|
||||
}
|
||||
"softlowerlim" {
|
||||
set tmpStr1 [$mot softlowerlim]
|
||||
set tmpStr2 [split $tmpStr1 "="]
|
||||
array set tmpstr3 $tmpStr2
|
||||
set ind "$mot.softlowerlim "
|
||||
return $tmpstr3($ind)
|
||||
}
|
||||
"softupperlim" {
|
||||
set tmpStr1 [$mot softupperlim]
|
||||
set tmpStr2 [split $tmpStr1 "="]
|
||||
array set tmpstr3 $tmpStr2
|
||||
set ind "$mot.softupperlim "
|
||||
return $tmpstr3($ind)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# DriveMono: drive the 3 Monochromators to translate as a "bunch"
|
||||
proc DriveMono {mot focus} {
|
||||
variable currAngleMoma
|
||||
variable currAngleMomb
|
||||
variable currAngleMomc
|
||||
|
||||
variable mraPosition
|
||||
variable mraSoftlowerlim
|
||||
variable mraSoftupperlim
|
||||
variable mrbPosition
|
||||
variable mrbSoftlowerlim
|
||||
variable mrbSoftupperlim
|
||||
variable mrcPosition
|
||||
variable mrcSoftlowerlim
|
||||
variable mrcSoftupperlim
|
||||
|
||||
variable translateDis
|
||||
|
||||
variable moveFlag
|
||||
|
||||
# set moveFlag to 1 to move the three motors
|
||||
set moveFlag 1
|
||||
|
||||
# Record current angle positions of the three motors
|
||||
set currAngleMoma [getSetting moma position]
|
||||
set currAngleMomb [getSetting momb position]
|
||||
set currAngleMomc [getSetting momc position]
|
||||
|
||||
# Get current focus positions of the three motors mra, mrb and mrc
|
||||
set mraPosition [getSetting mra position]
|
||||
set mrbPosition [getSetting mrb position]
|
||||
set mrcPosition [getSetting mrc position]
|
||||
|
||||
# Get soft lower/upper limits of mra, mrb and mrc
|
||||
set mraSoftlowerlim [getSetting mra softlowerlim]
|
||||
set mraSoftupperlim [getSetting mra softupperlim]
|
||||
set mrbSoftlowerlim [getSetting mrb softlowerlim]
|
||||
set mrbSoftupperlim [getSetting mrb softupperlim]
|
||||
set mrcSoftlowerlim [getSetting mrc softlowerlim]
|
||||
set mrcSoftupperlim [getSetting mrc softupperlim]
|
||||
|
||||
# Calculate moving distance
|
||||
set translateDis [expr $focus - [getSetting $mot position]]
|
||||
|
||||
# Determine if the movement is within the ranges of the three motors
|
||||
if {[expr $mraPosition + $translateDis] > $mraSoftupperlim ||
|
||||
[expr $mraPosition + $translateDis] < $mraSoftlowerlim} {
|
||||
broadcast "Error: the movement is out of the range limit of motor mra"
|
||||
set moveFlag 0
|
||||
}
|
||||
|
||||
if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim ||
|
||||
[expr $mrbPosition + $translateDis] < $mrbSoftlowerlim} {
|
||||
broadcast "Error: the movement is out of the range limit of motor mrb"
|
||||
set moveFlag 0
|
||||
}
|
||||
|
||||
if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim ||
|
||||
[expr $mrcPosition + $translateDis] < $mrcSoftlowerlim} {
|
||||
broadcast "Error: the movement is out of the range limit of motor mrc"
|
||||
set moveFlag 0
|
||||
}
|
||||
|
||||
# move the three motors
|
||||
if {$moveFlag == 1} {
|
||||
# Unlock the three motors
|
||||
mra fixed -1
|
||||
mrb fixed -1
|
||||
mrc fixed -1
|
||||
|
||||
drive moma $currAngleMomb momc $currAngleMomb
|
||||
drive mra [expr $mraPosition + $translateDis] mrb [expr $mrbPosition + $translateDis] mrc [expr $mrcPosition + $translateDis]
|
||||
drive moma $currAngleMoma momc $currAngleMomc
|
||||
|
||||
# Lock the three motors again
|
||||
mra fixed 1
|
||||
mrb fixed 1
|
||||
mrc fixed 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
publish DriveMono user
|
||||
|
||||
|
||||
28
site_ansto/instrument/kookaburra/config/counter/counter.tcl
Normal file
28
site_ansto/instrument/kookaburra/config/counter/counter.tcl
Normal file
@@ -0,0 +1,28 @@
|
||||
source $cfPath(counter)/counter_common_1.tcl
|
||||
|
||||
## TODO Put all the counter macros in the counter namespace
|
||||
namespace eval counter {
|
||||
variable isc_numchannels
|
||||
variable isc_monitor_address
|
||||
variable isc_portlist
|
||||
variable isc_beam_monitor_list
|
||||
proc set_sobj_attributes {} {
|
||||
}
|
||||
}
|
||||
|
||||
proc ::counter::isc_initialize {} {
|
||||
if [catch {
|
||||
variable isc_numchannels
|
||||
variable isc_monitor_address
|
||||
variable isc_portlist
|
||||
variable isc_beam_monitor_list {MONITOR_1 MONITOR_2 MONITOR_3}
|
||||
|
||||
set isc_monitor_address "das1-[SplitReply [instrument]]"
|
||||
set isc_portlist [list 33000 33001 33002 33003 33004 33005 33006 33007]
|
||||
set isc_numchannels [llength $isc_beam_monitor_list]
|
||||
::counter::ic_initialize
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error "$message"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
source $cfPath(hipadaba)/hipadaba_configuration_common.tcl
|
||||
@@ -0,0 +1,121 @@
|
||||
# Author Jing Chen (jgn@ansto.gove.au)
|
||||
|
||||
|
||||
source $cfPath(hmm)/hmm_configuration_common_1.tcl
|
||||
source $cfPath(hmm)/hmm_cylindrical_detector_configuration.tcl
|
||||
set sim_mode [SplitReply [hmm_simulation]]
|
||||
|
||||
proc ::histogram_memory::init_OAT_TABLE {} {
|
||||
if [ catch {
|
||||
|
||||
OAT_TABLE X -setdata MAX_CHAN 8
|
||||
OAT_TABLE Y -setdata MAX_CHAN 1024
|
||||
OAT_TABLE X -setdata BMIN -0.5
|
||||
OAT_TABLE X -setdata BMAX 7.5
|
||||
OAT_TABLE Y -setdata BMIN -0.5
|
||||
OAT_TABLE Y -setdata BMAX 1023.5
|
||||
|
||||
OAT_TABLE -set X { 7.5 6.5 } NXC 8 Y { -0.5 0.5 } NYC 1024 T { 0 200000 } NTC 1
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
|
||||
proc CAT_TABLE {args} {
|
||||
return {
|
||||
<CAT>
|
||||
<WIX APPLY="ENABLE" MIN_RAW="0" MAX_RAW="7" TABLE_SIZE="8">
|
||||
<link_numeric_file filename="../../kookaburra_wix.dat" default_filename="../HMconfig/Default/kookaburra_wix.dat" />
|
||||
</WIX>
|
||||
<OFFSET_Y_PER_X APPLY="ENABLE" MIN_RAW="0" MAX_RAW="7" TABLE_SIZE="8" BASE_VAL="0">
|
||||
<link_numeric_file filename="../../kookaburra_offset_y_per_x.dat" default_filename="../HMconfig/Default/kookaburra_offset_y_per_x.dat" />
|
||||
</OFFSET_Y_PER_X>
|
||||
<MAGNIFY APPLY="ENABLE" MIN_RAW="0" MAX_RAW="7" TABLE_SIZE="8" DIRECTION="X" MAX_IN="1023" MAX_OUT="1023" RANGE="UNSIGNED">
|
||||
<link_numeric_file filename="../../kookaburra_magnify.dat" default_filename="../HMconfig/Default/kookaburra_magnify.dat" />
|
||||
</MAGNIFY>
|
||||
</CAT>
|
||||
}
|
||||
}
|
||||
|
||||
proc ::histogram_memory::init_CAT_TABLE {} {
|
||||
CAT_TABLE -set MESYTEC_MPSD8_CHANNEL_GAINS {
|
||||
1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00
|
||||
}
|
||||
CAT_TABLE -set MESYTEC_MPSD8_THRESHOLDS { 10 }
|
||||
CAT_TABLE -set MESYTEC_TUBE_PAIR_RESISTANCE_RATIOS {
|
||||
1. 1. 1. 1. 1. 1. 1. 1.
|
||||
}
|
||||
CAT_TABLE -set MESYTEC_TUBE_MAGNIFICATIONS {
|
||||
1. 1. 1. 1. 1. 1. 1. 1.
|
||||
}
|
||||
CAT_TABLE -set MESYTEC_TUBE_OFFSETS {
|
||||
0. 0. 0. 0. 0. 0. 0. 0.
|
||||
}
|
||||
CAT_TABLE -set MESYTEC_TUBE_HISTOGRAM_WEIGHTS {
|
||||
1 1 1 1 1 1 1 1
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Return the detector position
|
||||
proc ::histogram_memory::detector_posn_degrees {} {
|
||||
return [SplitReply [stth]]
|
||||
}
|
||||
|
||||
proc ::histogram_memory::pre_count {} {}
|
||||
proc ::histogram_memory::post_count {} {}
|
||||
proc ::histogram_memory::isc_initialize {} {
|
||||
# Instrument specific X and Y dimension names
|
||||
variable INST_NXC "oat_nxc_eff"
|
||||
variable INST_NYC "oat_nyc_eff"
|
||||
|
||||
if [ catch {
|
||||
::histogram_memory::init_hmm_objs
|
||||
if {$::sim_mode == "true"} {
|
||||
hmm configure oat_ntc_eff 1
|
||||
hmm configure $INST_NYC 1024
|
||||
hmm configure $INST_NXC 8
|
||||
}
|
||||
BAT_TABLE -init
|
||||
# CAT_TABLE -init
|
||||
SAT_TABLE -init
|
||||
OAT_TABLE -init
|
||||
FAT_TABLE -init
|
||||
::histogram_memory::ic_initialize
|
||||
::histogram_memory::set_graphtype "two_theta" "boundaries"
|
||||
|
||||
# MJL TODO detector geometry for Kookaburra TBD. Figures need revision during commissioning
|
||||
# Width = 25mm spacing * 8 tubes = 5000mm (??? degree coverage)
|
||||
# Height = 1015mm (tube length)
|
||||
# Radius = 2400mm
|
||||
detector_active_height_mm 1015
|
||||
detector_active_height_mm lock
|
||||
detector_active_width_mm 5000
|
||||
detector_active_width_mm lock
|
||||
detector_radius_mm 2400.0
|
||||
detector_radius_mm lock
|
||||
|
||||
# hmm configure FAT_SIMULATED_EVENT_Y0 $y_bb0
|
||||
# hmm configure FAT_SIMULATED_EVENT_Y1 $ybbmax
|
||||
# hmm configure FAT_SIMULATED_EVENT_X0 $x_bb0
|
||||
# hmm configure FAT_SIMULATED_EVENT_X1 $xbbmax
|
||||
::histogram_memory::init_OAT_TABLE
|
||||
::histogram_memory::init_SAT_TABLE
|
||||
# ::histogram_memory::init_CAT_TABLE
|
||||
::histogram_memory::upload_config Filler_defaults
|
||||
|
||||
set ::histogram_memory::histmem_axes(HOR) /instrument/detector/x_pixel_angular_offset
|
||||
set ::histogram_memory::histmem_axes(VER) /instrument/detector/y_pixel_offset
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
|
||||
proc histmem {cmd args} {
|
||||
eval "_histmem $cmd $args"
|
||||
}
|
||||
publish histmem user
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
###
|
||||
# Oscillating collimator control
|
||||
# oscmd start n -- will run the oscillator motor rco for n cycles and send a stop to the histmem
|
||||
|
||||
|
||||
MakeOscillator oscmd rco
|
||||
|
||||
proc rco_cb {} {
|
||||
hmm pause
|
||||
}
|
||||
publish rco_cb user
|
||||
|
||||
scriptcallback connect rco MOTEND rco_cb
|
||||
|
||||
@@ -0,0 +1,860 @@
|
||||
# Author: Jing Chen (jgn@ansto.gov.au)
|
||||
# All Motors are 25000 steps per motor revolution
|
||||
|
||||
# SET TO 1 TO USE THE TILT STAGE ie sample phi and chi
|
||||
set use_tiltstage 0
|
||||
|
||||
set animal kookaburra
|
||||
set sim_mode [SplitReply [motor_simulation]]
|
||||
|
||||
# Setup addresses of Galil DMC2280 controllers.
|
||||
set dmc2280_controller1(host) mc1-$animal
|
||||
set dmc2280_controller1(port) pmc1-$animal
|
||||
|
||||
set dmc2280_controller2(host) mc2-$animal
|
||||
set dmc2280_controller2(port) pmc2-$animal
|
||||
|
||||
set dmc2280_controller3(host) mc3-$animal
|
||||
set dmc2280_controller3(port) pmc3-$animal
|
||||
|
||||
set dmc2280_controller4(host) mc4-$animal
|
||||
set dmc2280_controller4(port) pmc4-$animal
|
||||
|
||||
set dmc2280_controller5(host) mc5-$animal
|
||||
set dmc2280_controller5(port) pmc5-$animal
|
||||
|
||||
set dmc2280_controller6(host) mc6-$animal
|
||||
set dmc2280_controller6(port) pmc6-$animal
|
||||
|
||||
if {$sim_mode == "true"} {
|
||||
set motor_driver_type asim
|
||||
} else {
|
||||
set motor_driver_type DMC2280
|
||||
# MakeAsyncQueue mc1 DMC2280 $dmc2280_controller1(host) $dmc2280_controller1(port)
|
||||
# MakeAsyncQueue mc2 DMC2280 $dmc2280_controller2(host) $dmc2280_controller2(port)
|
||||
MakeAsyncQueue mc3 DMC2280 $dmc2280_controller3(host) $dmc2280_controller3(port)
|
||||
MakeAsyncQueue mc4 DMC2280 $dmc2280_controller4(host) $dmc2280_controller4(port)
|
||||
# MakeAsyncQueue mc6 DMC2280 $dmc2280_controller6(host) $dmc2280_controller6(port)
|
||||
}
|
||||
|
||||
|
||||
#Measured absolute encoder reading at home position
|
||||
set dummy_Home 0
|
||||
|
||||
set ftz_Home 0
|
||||
set ptz_Home 0
|
||||
set pom_Home 0
|
||||
set stth_Home 0
|
||||
set mtth_Home 0
|
||||
|
||||
set sv1_Home 0
|
||||
set sh1_Home 0
|
||||
set sv2_Home 0
|
||||
set sh2_Home 0
|
||||
set gom_Home 0
|
||||
set scor_Home 0
|
||||
|
||||
# AND abs Encoder Reading with FFF to get the lowest 12 bits only
|
||||
#set mra_Home 4286
|
||||
set mra_Home 191
|
||||
#set moma_Home 8386659
|
||||
set moma_Home 2147
|
||||
#set mrb_Home 294
|
||||
set mrb_Home 294
|
||||
#set momb_Home 8386694
|
||||
set momb_Home 2182
|
||||
#set mrc_Home 4558982
|
||||
set mrc_Home 86
|
||||
#set momc_Home 12499198
|
||||
set momc_Home 2302
|
||||
|
||||
set mphi_Home 0
|
||||
set mchi_Home 8383096
|
||||
set mx_Home 8390604
|
||||
set my_Home 8391084
|
||||
set mom_Home 8389414
|
||||
|
||||
set rco_Home 0
|
||||
set rcz_Home 0
|
||||
set bsr_Home 0
|
||||
set gv1_Home 0
|
||||
set gv2_Home 0
|
||||
|
||||
|
||||
# set movecount high to reduce the frequency of
|
||||
# hnotify messages to a reasonable level
|
||||
set move_count 100
|
||||
|
||||
############################
|
||||
# Motor Controller 1
|
||||
# Motor Controller 1
|
||||
# Motor Controller 1
|
||||
############################
|
||||
#
|
||||
|
||||
# Dummy translation motor, useful for testing scans
|
||||
|
||||
#Motor dummy_motor asim [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis A\
|
||||
units mm\
|
||||
hardlowerlim -500\
|
||||
hardupperlim 500\
|
||||
maxSpeed 1\
|
||||
maxAccel 5\
|
||||
maxDecel 5\
|
||||
stepsPerX [expr 25000.0/5.0]\
|
||||
absEnc 1\
|
||||
absEncHome $dummy_Home\
|
||||
cntsPerX [expr 8192.0/5.0]]
|
||||
#dummy_motor part instrument
|
||||
#dummy_motor long_name dummy_motor
|
||||
#dummy_motor softlowerlim -500
|
||||
#dummy_motor softupperlim 500
|
||||
#dummy_motor home 0
|
||||
|
||||
# mc1: Polariser & Spin Flipper - Z translation slide
|
||||
# Moto: 100:1 gear, 2mm pitch
|
||||
set ptzStepRate [expr (300000.0/100.0)/2.0]
|
||||
|
||||
Motor ptz $motor_driver_type [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis B\
|
||||
units mm\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 500\
|
||||
maxSpeed [expr 400000.0/300000.0]\
|
||||
maxAccel [expr 150000.0/300000.0]\
|
||||
maxDecel [expr 150000.0/300000.0]\
|
||||
stepsPerX $ptzStepRate\
|
||||
absEnc 1\
|
||||
absEncHome $ptz_Home\
|
||||
cntsPerX 4096]
|
||||
ptz part crystal
|
||||
ptz long_name ptz
|
||||
ptz softlowerlim 0
|
||||
ptz softupperlim 500
|
||||
ptz home 0
|
||||
|
||||
#if $use_tiltstage {
|
||||
# mc1: Beryllium / Graphite filter shared - Z translation slide
|
||||
# Moto: 100:1 gear, 2mm pitch
|
||||
set ftzStepRate [expr (300000.0/100.0)/2.0]
|
||||
|
||||
Motor ftz $motor_driver_type [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis C\
|
||||
units mm\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 500\
|
||||
maxSpeed [expr 400000.0/300000.0]\
|
||||
maxAccel [expr 150000.0/300000.0]\
|
||||
maxDecel [expr 150000.0/300000.0]\
|
||||
stepsPerX $ftzStepRate\
|
||||
absEnc 1\
|
||||
absEncHome $ftz_Home\
|
||||
cntsPerX 4096]
|
||||
ftz part crystal
|
||||
ftz long_name ftz
|
||||
ftz softlowerlim 0
|
||||
ftz softupperlim 500
|
||||
ftz home 0
|
||||
}
|
||||
|
||||
# mc1: Polariser (& Spin Flipper) - Rotation + - 2 deg about polariser (i.e, The Elbow)
|
||||
set pomSetRate 25000
|
||||
|
||||
Motor pom $motor_driver_type [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis E\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 2\
|
||||
maxSpeed [expr 250000.0/$pomSetRate]\
|
||||
maxAccel [expr 25000.0/$pomSetRate]\
|
||||
maxDecel [expr 25000.0/$pomSetRate]\
|
||||
stepsPerX $pomSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $pom_Home\
|
||||
cntsPerX 4096]
|
||||
pom part crystal
|
||||
pom long_name pom
|
||||
pom softlowerlim 0
|
||||
pom softupperlim 2
|
||||
pom home 0
|
||||
|
||||
# mc1: Sample/Detector Chamber Rotation (Detector)
|
||||
set stthSetRate 25000
|
||||
|
||||
Motor stth $motor_driver_type [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis F\
|
||||
units degrees\
|
||||
hardlowerlim -125\
|
||||
hardupperlim 8\
|
||||
maxSpeed [expr 150000.0/$stthSetRate]\
|
||||
maxAccel [expr 5000.0/$stthSetRate]\
|
||||
maxDecel [expr 5000.0/$stthSetRate]\
|
||||
stepsPerX $stthSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $stth_Home\
|
||||
cntsPerX 4096]
|
||||
stth part detector
|
||||
stth long_name stth
|
||||
stth softlowerlim -125
|
||||
stth softupperlim 8
|
||||
stth home 0
|
||||
|
||||
# mc1: Instrument Drive System (Main Drive)
|
||||
set mtthSetRate 25000
|
||||
|
||||
Motor mtth $motor_driver_type [params \
|
||||
asyncqueue mc1\
|
||||
host mc1-kookaburra\
|
||||
port pmc1-kookaburra\
|
||||
axis G\
|
||||
units mm\
|
||||
hardlowerlim 40\
|
||||
hardupperlim 140\
|
||||
maxSpeed [expr 150000.0/$mtthSetRate]\
|
||||
maxAccel [expr 25000.0/$mtthSetRate]\
|
||||
maxDecel [expr 25000.0/$mtthSetRate]\
|
||||
stepsPerX $mtthSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $mtth_Home\
|
||||
cntsPerX 4096]
|
||||
mtth part detector
|
||||
mtth long_name mtth
|
||||
mtth softlowerlim 40
|
||||
mtth softupperlim 140
|
||||
mtth home 0
|
||||
|
||||
|
||||
############################
|
||||
# Motor Controller 2
|
||||
# Motor Controller 2
|
||||
# Motor Controller 2
|
||||
############################
|
||||
#
|
||||
|
||||
# mc2: Slits Set AB1- (After Beryllium Filter) (2 blades and 1 Motor & Encoder set)
|
||||
set sv1SetRate 25000
|
||||
|
||||
Motor sv1 $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis A\
|
||||
units mm\
|
||||
hardlowerlim -2\
|
||||
hardupperlim 60\
|
||||
maxSpeed [expr 25000.0/$sv1SetRate]\
|
||||
maxAccel [expr 25000.0/$sv1SetRate]\
|
||||
maxDecel [expr 25000.0/$sv1SetRate]\
|
||||
stepsPerX $sv1SetRate\
|
||||
absEnc 1\
|
||||
absEncHome $sv1_Home\
|
||||
cntsPerX 4096]
|
||||
sv1 part aperture
|
||||
sv1 long_name sv1
|
||||
sv1 softlowerlim -2
|
||||
sv1 softupperlim 60
|
||||
sv1 home 0
|
||||
|
||||
# mc2: Slits Set AB2- (After Beryllium Filter) (2 blades and 1 Motor & Encoder set)
|
||||
set sh1SetRate 25000
|
||||
|
||||
Motor sh1 $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis B\
|
||||
units mm\
|
||||
hardlowerlim -2\
|
||||
hardupperlim 50\
|
||||
maxSpeed [expr 25000.0/$sh1SetRate]\
|
||||
maxAccel [expr 25000.0/$sh1SetRate]\
|
||||
maxDecel [expr 25000.0/$sh1SetRate]\
|
||||
stepsPerX $sh1SetRate\
|
||||
absEnc 1\
|
||||
absEncHome $sh1_Home\
|
||||
cntsPerX 4096]
|
||||
sh1 part aperture
|
||||
sh1 long_name sh1
|
||||
sh1 softlowerlim -2
|
||||
sh1 softupperlim 50
|
||||
sh1 home 0
|
||||
|
||||
# mc2: Slits Set AF1- (After Fermi Chopper) (2 blades and 1 Motor & Encoder set)
|
||||
set sv2SetRate 25000
|
||||
|
||||
Motor sv2 $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis C\
|
||||
units mm\
|
||||
hardlowerlim -2\
|
||||
hardupperlim 40\
|
||||
maxSpeed [expr 25000.0/$sv2SetRate]\
|
||||
maxAccel [expr 25000.0/$sv2SetRate]\
|
||||
maxDecel [expr 25000.0/$sv2SetRate]\
|
||||
stepsPerX $sv2SetRate\
|
||||
absEnc 1\
|
||||
absEncHome $sv2_Home\
|
||||
cntsPerX 4096]
|
||||
sv2 part aperture
|
||||
sv2 long_name sv2
|
||||
sv2 softlowerlim -2
|
||||
sv2 softupperlim 40
|
||||
sv2 home 0
|
||||
|
||||
# mc2: Slits Set AF2- (After Fermi Chopper) (2 blades and 1 Motor & Encoder set)
|
||||
set sh2SetRate 25000
|
||||
|
||||
Motor sh2 $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis D\
|
||||
units mm\
|
||||
hardlowerlim -2\
|
||||
hardupperlim 30\
|
||||
maxSpeed [expr 25000.0/$sh2SetRate]\
|
||||
maxAccel [expr 25000.0/$sh2SetRate]\
|
||||
maxDecel [expr 25000.0/$sh2SetRate]\
|
||||
stepsPerX $sh2SetRate\
|
||||
absEnc 1\
|
||||
absEncHome $sh2_Home\
|
||||
cntsPerX 4096]
|
||||
sh2 part aperture
|
||||
sh2 long_name sh2
|
||||
sh2 softlowerlim -2
|
||||
sh2 softupperlim 30
|
||||
sh2 home 0
|
||||
|
||||
# mc2: Graphite filter rotation stage (post 1st slit and post 1st Fermi chopper)
|
||||
set gomSetRate 25000
|
||||
|
||||
Motor gom $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis E\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 15\
|
||||
maxSpeed [expr 50000.0/$gomSetRate]\
|
||||
maxAccel [expr 25000.0/$gomSetRate]\
|
||||
maxDecel [expr 25000.0/$gomSetRate]\
|
||||
stepsPerX $gomSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $gom_Home\
|
||||
cntsPerX 4096]
|
||||
gom part sample
|
||||
gom long_name gom
|
||||
gom softlowerlim 0
|
||||
gom softupperlim 15
|
||||
gom home 0
|
||||
|
||||
# mc2: Sample rotation correction - 10 deg rotation
|
||||
set scorSetRate 25000
|
||||
|
||||
Motor scor $motor_driver_type [params \
|
||||
asyncqueue mc2\
|
||||
host mc2-kookaburra\
|
||||
port pmc2-kookaburra\
|
||||
axis F\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 360\
|
||||
maxSpeed [expr 50000.0/$scorSetRate]\
|
||||
maxAccel [expr 25000.0/$scorSetRate]\
|
||||
maxDecel [expr 25000.0/$scorSetRate]\
|
||||
stepsPerX $scorSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $scor_Home\
|
||||
cntsPerX 4096]
|
||||
scor part sample
|
||||
scor long_name scor
|
||||
scor softlowerlim 0
|
||||
scor softupperlim 360
|
||||
scor home 0
|
||||
|
||||
############################
|
||||
# Motor Controller 3
|
||||
# Motor Controller 3
|
||||
# Motor Controller 3
|
||||
############################
|
||||
#
|
||||
|
||||
# ROTATION STAGES 120:1 PLUS GEARBOX 8:1
|
||||
# ROTATION STAGE RESOLVER 360:55
|
||||
|
||||
# FOCUS STAGE GEARBOX 6:1
|
||||
# FOCUS STAGE RESOLVER DIRECT 310 DEG, 3527 COUNTS USABLE RANGE
|
||||
|
||||
# Computes Monochromator step rates (steps per degree) of focusing and Rotation
|
||||
# 1 unit here is 1 degree
|
||||
set monoRotateStepsPerUnit [expr 25000.0*8.0*120.0/360.0]
|
||||
|
||||
# Encode reading at the roation, 1 unit here is 1 degree
|
||||
set MonoRotateCntsPerUnit [expr 4096.0*360.0/55.0/360.0]
|
||||
|
||||
# Setup Focus range as min = 0 and max = 1, working range = 0 to 1 (310 degrees)
|
||||
# or, 0 for full focus and 1 for non focus
|
||||
# Focusing rate 25000 steps * 6:1 gears = 150000, 1 unit here is 310 degrees
|
||||
set monoFocusStepsPerUnit [expr -25000.0*6.0*310.0/360.0]
|
||||
|
||||
# Encode reading at Focusing stage, 1 unit here is 310 degrees
|
||||
set monoFocusCntsPerUnit [expr 4096.0*310.0/360.0]
|
||||
|
||||
# Max speed for Focusing , -- currently set as 0.083
|
||||
# speed unit here is 310 degrees
|
||||
set monoFocusSpeed 0.05
|
||||
set monoFocusMaxSpeed 0.083
|
||||
|
||||
# Precision setting turn/move, or 310*turn/move (degrees)
|
||||
set monoFocusprecision 0.001
|
||||
|
||||
# mc3: Monochromator Focusing 1 - Focus
|
||||
Motor mra $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis A\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 1\
|
||||
precision $monoFocusprecision\
|
||||
maxSpeed $monoFocusMaxSpeed\
|
||||
maxAccel [expr 25000.0/25000.0]\
|
||||
maxDecel [expr 25000.0/25000.0]\
|
||||
stepsPerX $monoFocusStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $mra_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $monoFocusCntsPerUnit]
|
||||
mra speed $monoFocusSpeed
|
||||
mra accel $monoFocusSpeed
|
||||
mra decel $monoFocusSpeed
|
||||
mra part crystal
|
||||
mra long_name mra
|
||||
mra softlowerlim 0
|
||||
mra softupperlim 1
|
||||
mra home 0
|
||||
# fix the motor
|
||||
mra fixed -1
|
||||
|
||||
# mc3: Monochromator Focusing 1 - Rotation
|
||||
Motor moma $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis B\
|
||||
units degrees\
|
||||
hardlowerlim -72.003174\
|
||||
hardupperlim -20.0379\
|
||||
maxSpeed 0.5\
|
||||
maxAccel 0.5\
|
||||
maxDecel 0.5\
|
||||
stepsPerX $monoRotateStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $moma_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $MonoRotateCntsPerUnit]
|
||||
moma part crystal
|
||||
moma long_name moma
|
||||
moma softlowerlim -70
|
||||
moma softupperlim -20.537842
|
||||
moma home -45
|
||||
|
||||
# mc3: Monochromator Focusing 2 - Focus
|
||||
Motor mrb $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis C\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 1\
|
||||
precision $monoFocusprecision\
|
||||
maxSpeed $monoFocusMaxSpeed\
|
||||
maxAccel [expr 25000.0/25000.0]\
|
||||
maxDecel [expr 25000.0/25000.0]\
|
||||
stepsPerX $monoFocusStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $mrb_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $monoFocusCntsPerUnit]
|
||||
mrb speed $monoFocusSpeed
|
||||
mrb accel $monoFocusSpeed
|
||||
mrb decel $monoFocusSpeed
|
||||
mrb part crystal
|
||||
mrb long_name mrb
|
||||
mrb softlowerlim 0
|
||||
mrb softupperlim 1
|
||||
mrb home 0
|
||||
# fix the motor
|
||||
mrb fixed -1
|
||||
|
||||
# mc3: Monochromator Focusing 2 - Rotation
|
||||
Motor momb $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis D\
|
||||
units degree\
|
||||
hardlowerlim -72.003174\
|
||||
hardupperlim -20.198975\
|
||||
maxSpeed 0.5\
|
||||
maxAccel 0.5\
|
||||
maxDecel 0.5\
|
||||
stepsPerX $monoRotateStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $momb_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $MonoRotateCntsPerUnit]
|
||||
momb part crystal
|
||||
momb long_name momb
|
||||
momb softlowerlim -70
|
||||
momb softupperlim -20.698975
|
||||
momb home -45
|
||||
|
||||
# mc3: Monochromator Focusing 3 - Focus
|
||||
Motor mrc $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis E\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 1\
|
||||
precision $monoFocusprecision\
|
||||
maxSpeed $monoFocusMaxSpeed\
|
||||
maxAccel [expr 25000.0/25000.0]\
|
||||
maxDecel [expr 25000.0/25000.0]\
|
||||
stepsPerX $monoFocusStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $mrc_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $monoFocusCntsPerUnit]
|
||||
mrc speed $monoFocusSpeed
|
||||
mrc accel $monoFocusSpeed
|
||||
mrc decel $monoFocusSpeed
|
||||
mrc part crystal
|
||||
mrc long_name mrc
|
||||
mrc softlowerlim 0
|
||||
mrc softupperlim 1
|
||||
mrc home 0
|
||||
# fix the motor
|
||||
mrc fixed -1
|
||||
|
||||
# mc3: Monochromator Focusing 3 - Rotation
|
||||
Motor momc $motor_driver_type [params \
|
||||
asyncqueue mc3\
|
||||
host mc3-kookaburra\
|
||||
port pmc3-kookaburra\
|
||||
axis F\
|
||||
units degree\
|
||||
hardlowerlim -72.003174\
|
||||
hardupperlim -21.246338\
|
||||
maxSpeed 0.5\
|
||||
maxAccel 0.5\
|
||||
maxDecel 0.5\
|
||||
stepsPerX $monoRotateStepsPerUnit\
|
||||
absEnc 1\
|
||||
absEncHome $momc_Home\
|
||||
bias_bits 12\
|
||||
cntsPerX $MonoRotateCntsPerUnit]
|
||||
momc part crystal
|
||||
momc long_name momc
|
||||
momc softlowerlim -70
|
||||
momc softupperlim -21.746338
|
||||
momc home -45
|
||||
|
||||
|
||||
############################
|
||||
# Motor Controller 4
|
||||
# Motor Controller 4
|
||||
# Motor Controller 4
|
||||
############################
|
||||
#
|
||||
|
||||
# mc4: Monochromator crystal stages tilt stage - G270
|
||||
set mphiSetRate 25000
|
||||
|
||||
Motor mphi $motor_driver_type [params \
|
||||
asyncqueue mc4\
|
||||
host mc4-kookaburra\
|
||||
port pmc4-kookaburra\
|
||||
axis A\
|
||||
units degrees\
|
||||
hardlowerlim -5\
|
||||
hardupperlim 5\
|
||||
maxSpeed [expr 50000.0/25000.0]\
|
||||
maxAccel [expr 12500.0/25000.0]\
|
||||
maxDecel [expr 12500.0/25000.0]\
|
||||
stepsPerX $mphiSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $mphi_Home\
|
||||
cntsPerX 4096]
|
||||
mphi part crystal
|
||||
mphi long_name mphi
|
||||
mphi softlowerlim -5
|
||||
mphi softupperlim 5
|
||||
mphi home 0
|
||||
|
||||
# mc4: Monochromator crystal stages tilt stage - G350
|
||||
set mchiSetRate 25000
|
||||
|
||||
Motor mchi $motor_driver_type [params \
|
||||
asyncqueue mc4\
|
||||
host mc4-kookaburra\
|
||||
port pmc4-kookaburra\
|
||||
axis B\
|
||||
units degrees\
|
||||
hardlowerlim -5\
|
||||
hardupperlim 5\
|
||||
maxSpeed [expr 50000.0/25000.0]\
|
||||
maxAccel [expr 12500.0/25000.0]\
|
||||
maxDecel [expr 12500.0/25000.0]\
|
||||
stepsPerX $mchiSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $mchi_Home\
|
||||
cntsPerX 4096]
|
||||
mchi part crystal
|
||||
mchi long_name mchi
|
||||
mchi softlowerlim -5
|
||||
mchi softupperlim 5
|
||||
mchi home 0
|
||||
mchi speed 0.2
|
||||
mchi accel 0.1
|
||||
mchi decel 0.1
|
||||
|
||||
# mc4: Monochromator crystal stages Linear stage X - T250
|
||||
set mxSetRate 25000
|
||||
|
||||
Motor mx $motor_driver_type [params \
|
||||
asyncqueue mc4\
|
||||
host mc4-kookaburra\
|
||||
port pmc4-kookaburra\
|
||||
axis C\
|
||||
units mm\
|
||||
hardlowerlim -20\
|
||||
hardupperlim 20\
|
||||
maxSpeed [expr 50000.0/25000.0]\
|
||||
maxAccel [expr 12500.0/25000.0]\
|
||||
maxDecel [expr 12500.0/25000.0]\
|
||||
stepsPerX $mxSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $mx_Home\
|
||||
cntsPerX 4096]
|
||||
mx part crystal
|
||||
mx long_name mx
|
||||
mx softlowerlim -20
|
||||
mx softupperlim 20
|
||||
mx home 0
|
||||
mx speed 1.0
|
||||
|
||||
# mc4: Monochromator crystal stages Linear stage Y - T250
|
||||
set mySetRate 25000
|
||||
|
||||
Motor my $motor_driver_type [params \
|
||||
asyncqueue mc4\
|
||||
host mc4-kookaburra\
|
||||
port pmc4-kookaburra\
|
||||
axis D\
|
||||
units mm\
|
||||
hardlowerlim -20\
|
||||
hardupperlim 20\
|
||||
maxSpeed [expr 50000.0/25000.0]\
|
||||
maxAccel [expr 12500.0/25000.0]\
|
||||
maxDecel [expr 12500.0/25000.0]\
|
||||
stepsPerX $mySetRate\
|
||||
absEnc 1\
|
||||
absEncHome $my_Home\
|
||||
cntsPerX 4096]
|
||||
my part crystal
|
||||
my long_name my
|
||||
my softlowerlim -10
|
||||
my softupperlim 10
|
||||
my home 0
|
||||
my speed 1.0
|
||||
|
||||
# mc4: Monochromator crystal stages Rotation stage - R275
|
||||
set momSetRate 25000
|
||||
|
||||
Motor mom $motor_driver_type [params \
|
||||
asyncqueue mc4\
|
||||
host mc4-kookaburra\
|
||||
port pmc4-kookaburra\
|
||||
axis E\
|
||||
units degrees\
|
||||
hardlowerlim -15\
|
||||
hardupperlim 15\
|
||||
maxSpeed [expr 50000.0/25000.0]\
|
||||
maxAccel [expr 12500.0/25000.0]\
|
||||
maxDecel [expr 12500.0/25000.0]\
|
||||
stepsPerX $momSetRate\
|
||||
absEnc 1\
|
||||
absEncHome $mom_Home\
|
||||
cntsPerX 4096]
|
||||
mom speed 0.5
|
||||
mom part crystal
|
||||
mom long_name mom
|
||||
mom softlowerlim -15
|
||||
mom softupperlim 15
|
||||
mom home 0
|
||||
|
||||
|
||||
############################
|
||||
# Motor Controller 6
|
||||
# Motor Controller 6
|
||||
# Motor Controller 6
|
||||
############################
|
||||
#
|
||||
|
||||
# mc6: Radial Collimator -- Oscillator
|
||||
Motor rco $motor_driver_type [params \
|
||||
asyncqueue mc6\
|
||||
host mc6-kookaburra\
|
||||
port pmc6-kookaburra\
|
||||
axis A\
|
||||
units mm\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 180\
|
||||
maxSpeed 50000\
|
||||
maxAccel 60000\
|
||||
maxDecel 60000\
|
||||
stepsPerX 4096\
|
||||
absEnc 1\
|
||||
absEncHome $rco_Home\
|
||||
cntsPerX 4096]
|
||||
rco part collimator
|
||||
rco long_name rco
|
||||
rco softlowerlim 0
|
||||
rco softupperlim 180
|
||||
rco home 0
|
||||
|
||||
# mc6: Radial Collimator -- Z Translation
|
||||
Motor rcz $motor_driver_type [params \
|
||||
asyncqueue mc6\
|
||||
host mc6-kookaburra\
|
||||
port pmc6-kookaburra\
|
||||
axis B\
|
||||
units mm\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 180\
|
||||
maxSpeed 50000\
|
||||
maxAccel 60000\
|
||||
maxDecel 60000\
|
||||
stepsPerX 4096\
|
||||
absEnc 1\
|
||||
absEncHome $rcz_Home\
|
||||
cntsPerX 4096]
|
||||
rcz part collimator
|
||||
rcz long_name rcz
|
||||
rcz softlowerlim 0
|
||||
rcz softupperlim 180
|
||||
rcz home 0
|
||||
|
||||
# mc6: Beam Stop Stage - Rotation
|
||||
Motor bsr $motor_driver_type [params \
|
||||
asyncqueue mc6\
|
||||
host mc6-kookaburra\
|
||||
port pmc6-kookaburra\
|
||||
axis C\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 180\
|
||||
maxSpeed 50000\
|
||||
maxAccel 60000\
|
||||
maxDecel 60000\
|
||||
stepsPerX 4096\
|
||||
absEnc 1\
|
||||
absEncHome $bsr_Home\
|
||||
cntsPerX 4096]
|
||||
bsr part sample
|
||||
bsr long_name bsr
|
||||
bsr softlowerlim 0
|
||||
bsr softupperlim 180
|
||||
bsr home 0
|
||||
|
||||
# mc6: Isolation Vaue -- Axis 1, currently this Axis is set to read ONLY to read the encoder
|
||||
Motor gv1 $motor_driver_type [params \
|
||||
asyncqueue mc6\
|
||||
host mc6-kookaburra\
|
||||
port pmc6-kookaburra\
|
||||
axis E\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 180\
|
||||
maxSpeed 50000\
|
||||
maxAccel 60000\
|
||||
maxDecel 60000\
|
||||
stepsPerX 4096\
|
||||
absEnc 1\
|
||||
absEncHome $gv1_Home\
|
||||
cntsPerX 4096]
|
||||
gv1 part sample
|
||||
gv1 long_name gv1
|
||||
gv1 softlowerlim 0
|
||||
gv1 softupperlim 180
|
||||
gv1 home 0
|
||||
# fix the motor
|
||||
gv1 fixed -1
|
||||
|
||||
# mc6: Isolation Vaue -- Axis 2, currently this Axis is set to read ONLY to read the encoder
|
||||
Motor gv2 $motor_driver_type [params \
|
||||
asyncqueue mc6\
|
||||
host mc6-kookaburra\
|
||||
port pmc6-kookaburra\
|
||||
axis F\
|
||||
units degrees\
|
||||
hardlowerlim 0\
|
||||
hardupperlim 180\
|
||||
maxSpeed 30000\
|
||||
maxAccel 60000\
|
||||
maxDecel 60000\
|
||||
stepsPerX 4096\
|
||||
absEnc 1\
|
||||
absEncHome $gv2_Home\
|
||||
cntsPerX 4096]
|
||||
gv2 part sample
|
||||
gv2 long_name gv2
|
||||
gv2 softlowerlim 0
|
||||
gv2 softupperlim 180
|
||||
gv2 home 0
|
||||
# fix the motor
|
||||
gv2 fixed -1
|
||||
|
||||
proc motor_set_sobj_attributes {} {
|
||||
}
|
||||
# END MOTOR CONFIGURATION
|
||||
|
||||
# According to http://www.nexusformat.org/Design units must conform to
|
||||
# http://www.unidata.ucar.edu/software/udunits/udunits-1/udunits.txt
|
||||
# So we use "count" for dimensionless decimal numbers
|
||||
#set vc_units count
|
||||
#make_coll_motor_2 c1 section_1 pc1 pc2 $vc_units
|
||||
#make_coll_motor_1 c2 section_2 pc3 $vc_units
|
||||
#make_coll_motor_1 c3 section_3 pc4 $vc_units
|
||||
#make_coll_motor_1 c4 section_4 pc5 $vc_units
|
||||
#make_coll_motor_1 c5 section_5 pc6 $vc_units
|
||||
#make_coll_motor_1 c6 section_6 pc7 $vc_units
|
||||
#make_coll_motor_1 c7 section_7 pc8 $vc_units
|
||||
#make_coll_motor_1 c8 section_8 pc9 $vc_units
|
||||
#make_coll_motor_1 c9 section_9 pc10 $vc_units
|
||||
#unset vc_units
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# Author: Jing Chen (jgn@ansto.gov.au)
|
||||
|
||||
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||
|
||||
set port1 [portnum pmc1-kookaburra]
|
||||
set port2 [portnum pmc2-kookaburra]
|
||||
set port3 [portnum pmc3-kookaburra]
|
||||
set port4 [portnum pmc4-kookaburra]
|
||||
set port5 [portnum pmc5-kookaburra]
|
||||
set port6 [portnum pmc6-kookaburra]
|
||||
|
||||
makesctcontroller sct_mc1 std mc1-kookaburra:$port1
|
||||
makesctcontroller sct_mc2 std mc2-kookaburra:$port2
|
||||
makesctcontroller sct_mc3 std mc3-kookaburra:$port3
|
||||
makesctcontroller sct_mc4 std mc4-kookaburra:$port4
|
||||
makesctcontroller sct_mc5 std mc5-kookaburra:$port5
|
||||
makesctcontroller sct_mc6 std mc6-kookaburra:$port6
|
||||
|
||||
|
||||
# label pos
|
||||
#index position
|
||||
set 20sample_table {
|
||||
1 453.7
|
||||
2 411.7
|
||||
3 369.7
|
||||
4 327.7
|
||||
5 285.7
|
||||
6 203.7
|
||||
7 161.7
|
||||
8 119.7
|
||||
9 77.7
|
||||
10 35.7
|
||||
11 -46.3
|
||||
12 -88.3
|
||||
13 -130.3
|
||||
14 -172.3
|
||||
15 -214.3
|
||||
16 -296.3
|
||||
17 -338.3
|
||||
18 -380.3
|
||||
19 -422.3
|
||||
20 -464.3
|
||||
}
|
||||
|
||||
#mkPosit sct_mc1 sampleNum float samx sample $20sample_table
|
||||
|
||||
#diameter position
|
||||
set auto_ap_table {
|
||||
2.5 0
|
||||
5.0 -23
|
||||
7.5 -47
|
||||
10.0 -72
|
||||
12.5 -98
|
||||
15.0 -125
|
||||
17.5 -153
|
||||
20.0 -183
|
||||
25.0 -215
|
||||
30.0 -250
|
||||
}
|
||||
#mkPosit sct_mc3 diameter float apx sample $auto_ap_table
|
||||
|
||||
3
site_ansto/instrument/kookaburra/config/nexus/Makefile
Normal file
3
site_ansto/instrument/kookaburra/config/nexus/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
all:
|
||||
|
||||
clean:
|
||||
@@ -0,0 +1,4 @@
|
||||
source $cfPath(nexus)/nxscripts_common_1.tcl
|
||||
proc ::nexus::isc_initialize {} {
|
||||
::nexus::ic_initialize
|
||||
}
|
||||
8
site_ansto/instrument/kookaburra/config/plc/plc.tcl
Normal file
8
site_ansto/instrument/kookaburra/config/plc/plc.tcl
Normal file
@@ -0,0 +1,8 @@
|
||||
set sim_mode [SplitReply [plc_simulation]]
|
||||
if {$sim_mode == "false"} {
|
||||
# MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001
|
||||
# MakeSafetyPLC plc plc_chan 0
|
||||
}
|
||||
|
||||
source $cfPath(plc)/plc_common_1.tcl
|
||||
|
||||
6
site_ansto/instrument/kookaburra/config/scan/scan.tcl
Normal file
6
site_ansto/instrument/kookaburra/config/scan/scan.tcl
Normal file
@@ -0,0 +1,6 @@
|
||||
source $cfPath(scan)/scan_common_1.tcl
|
||||
proc ::scan::pre_hmm_scan_prepare {} {}
|
||||
|
||||
proc ::scan::isc_initialize {} {
|
||||
::scan::ic_initialize
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Author Jing Chen (jgn@ansto.gov.au)
|
||||
|
||||
source $cfPath(source)/source_common.tcl
|
||||
|
||||
proc ::source::isc_initialize {} {
|
||||
::source::ic_initialize "thermal"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Author: Jing Chen (jgn@ansto.gov.au)
|
||||
|
||||
# Required by server_config.tcl
|
||||
VarMake Instrument Text Internal
|
||||
Instrument kookaburra
|
||||
Instrument lock
|
||||
|
||||
#START SERVER CONFIGURATION SECTION
|
||||
source util/dmc2280/dmc2280_util.tcl
|
||||
source sics_ports.tcl
|
||||
source server_config.tcl
|
||||
#END SERVER CONFIGURATION SECTION
|
||||
|
||||
########################################
|
||||
# INSTRUMENT SPECIFIC CONFIGURATION
|
||||
|
||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||
|
||||
fileeval $cfPath(source)/source.tcl
|
||||
fileeval $cfPath(motors)/motor_configuration.tcl
|
||||
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||
#fileeval $cfPath(motors)/extraconfig.tcl
|
||||
fileeval $cfPath(plc)/plc.tcl
|
||||
fileeval $cfPath(counter)/counter.tcl
|
||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(scan)/scan.tcl
|
||||
fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(commands)/monodrive.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
fileeval $cfPath(beamline)/hv_control.tcl
|
||||
|
||||
source gumxml.tcl
|
||||
|
||||
::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
|
||||
::anticollider::protect_detector "true"
|
||||
|
||||
# fix all motors
|
||||
foreach m [sicslist type motor] {
|
||||
if {$m == "motor" || $m == "dummy_motor"} {
|
||||
# skipit
|
||||
} else {
|
||||
clientput fix $m position
|
||||
$m fixed 1
|
||||
}
|
||||
}
|
||||
|
||||
server_init
|
||||
###########################################
|
||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||
|
||||
# You can add extra-configuration code in ../extraconfig.tcl
|
||||
@@ -0,0 +1,4 @@
|
||||
set quieckport sics-quieck-val-kookaburra
|
||||
set serverport sics-server-val-kookaburra
|
||||
set interruptport sics-interrupt-val-kookaburra
|
||||
set telnetport sics-telnet-val-kookaburra
|
||||
4
site_ansto/instrument/kookaburra/sics_ports.tcl
Normal file
4
site_ansto/instrument/kookaburra/sics_ports.tcl
Normal file
@@ -0,0 +1,4 @@
|
||||
set quieckport sics-quieck-kookaburra
|
||||
set serverport sics-server-kookaburra
|
||||
set interruptport sics-interrupt-kookaburra
|
||||
set telnetport sics-telnet-kookaburra
|
||||
Reference in New Issue
Block a user