Merge branch 'RELEASE-3_1' into RELEASE-3_2

Conflicts:
	sics/site_ansto/instrument/reflectometer/platypus_configuration.tcl
This commit is contained in:
Douglas Clowes
2015-04-17 13:54:48 +10:00
12 changed files with 415 additions and 244 deletions

View File

@ -0,0 +1,16 @@
#!/bin/bash
echo me:${0}
. $(dirname ${0})/common
status=${?}
echo root:${status}:${root}
if [ ! ${status} ]; then
exit 1
fi
gnome-terminal \
--tab --title="Motors" \
--working-directory=${root}/fakeGalil \
--command="${root}/fakeGalil/SIM_GALIL.py -w pelican" \
--tab --title="Bash" \
--working-directory=${root} \
--command="bash"

View File

@ -1,6 +1,6 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent # vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver watlow_mrm = { driver watlow_mrm = {
protocol = std protocol = modbus
sobj_priv_type = 'user float' sobj_priv_type = 'user float'
class = environment class = environment
simulation_group = environment_simulation simulation_group = environment_simulation

View File

@ -61,8 +61,8 @@ proc ::scobj::watlow_mrm::add_driver {name device_class simulation_flag ip_addre
::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" ::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port} makesctcontroller sct_${name} aqadapter ${tcp_port}
} else { } else {
::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" ::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} modbus ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} makesctcontroller sct_${name} modbus ${ip_address}:${tcp_port}
} }
} else { } else {
::scobj::watlow_mrm::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for watlow_mrm" ::scobj::watlow_mrm::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for watlow_mrm"
@ -131,7 +131,7 @@ proc ::scobj::watlow_mrm::read_config {} {
if { [string equal -nocase ${asyncqueue} "sct"] } { if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip] set ip_address [dict get $v ip]
set tcp_port [dict get $v port] set tcp_port [dict get $v port]
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} makesctcontroller sct_${name} modbus ${ip_address}:${tcp_port}
} else { } else {
makesctcontroller sct_${name} aqadapter ${asyncqueue} makesctcontroller sct_${name} aqadapter ${asyncqueue}
} }

View File

@ -16,6 +16,12 @@ if {$sim_mode == "true"} {
#MakeAsyncQueue mc3 DMC2280 [dict get $::MOTOR_HOSTPORT MC3 HOST] [dict get $::MOTOR_HOSTPORT MC3 PORT] #MakeAsyncQueue mc3 DMC2280 [dict get $::MOTOR_HOSTPORT MC3 HOST] [dict get $::MOTOR_HOSTPORT MC3 PORT]
} }
set sample_stage_rotate "normal_sample_stage"
if { [ info exists ::config_dict ] } {
if { [ dict exists $::config_dict sample_stage implementation ] } {
set sample_stage_rotate [ dict get $::config_dict sample_stage implementation ]
}
}
# Dummy translation motor, useful for testing scans # Dummy translation motor, useful for testing scans
set dummy_Home 0 set dummy_Home 0
@ -135,14 +141,15 @@ sy softlowerlim -50
sy softupperlim 230 sy softupperlim 230
sy home 0 sy home 0
# mc1: Sample rotation axis if {[string equal -nocase ${sample_stage_rotate} "normal_sample_stage"]} {
# Gearbox 100:1, screw pitch 356:1 # mc1: Sample rotation axis
# Encoder 2P17 # Gearbox 100:1, screw pitch 356:1
#set stth_Home 821487 # Encoder 2P17
set stth_Home 0 #set stth_Home 821487
#set stthStepRate [expr -$motorrate*100.0] set stth_Home 0
set stthStepRate -2478000 #set stthStepRate [expr -$motorrate*100.0]
Motor stth $motor_driver_type [params \ set stthStepRate -2478000
Motor stth $motor_driver_type [params \
asyncqueue mc1\ asyncqueue mc1\
host mc1-dingo\ host mc1-dingo\
port pmc1-dingo\ port pmc1-dingo\
@ -150,7 +157,7 @@ Motor stth $motor_driver_type [params \
units degree\ units degree\
hardlowerlim -722\ hardlowerlim -722\
hardupperlim 722\ hardupperlim 722\
maxSpeed 0.12\ maxSpeed 2.0\
maxAccel 1\ maxAccel 1\
maxDecel 1\ maxDecel 1\
stepsPerX $stthStepRate\ stepsPerX $stthStepRate\
@ -158,18 +165,19 @@ Motor stth $motor_driver_type [params \
absEncHome $stth_Home\ absEncHome $stth_Home\
nopowersave 1\ nopowersave 1\
cntsPerX 93206.75556 ] cntsPerX 93206.75556 ]
stth speed 0.1 stth speed 0.5
stth accel 0.1 stth accel 0.1
stth decel 0.1 stth decel 0.1
stth part sample stth part sample
stth long_name stth stth long_name stth
stth softlowerlim 0.01 stth softlowerlim 0.01
stth softupperlim 359.99 stth softupperlim 359.99
stth home 0 stth home 0
#stth bias_bits 25 #stth bias_bits 25
#stth bias_bias -33432264 #stth bias_bias -33432264
stth rotary_bits 25 stth rotary_bits 25
stth creep_offset 0.05 stth creep_offset 0.05
}
# mc1: detection Z-stage Translation # mc1: detection Z-stage Translation
# Gearbox 5:1, Gear ratio 16:1, pitch 4mm # Gearbox 5:1, Gear ratio 16:1, pitch 4mm
@ -199,14 +207,15 @@ dz softlowerlim 0
dz softupperlim 170 dz softupperlim 170
dz home 0 dz home 0
# mc1:H Sample rotation axis if {[string equal -nocase ${sample_stage_rotate} "soma"]} {
# Resolver 2,048 counts per degree # mc1:H Sample rotation axis
# Motor 12,500 steps per degree # Resolver 2,048 counts per degree
# Positive steps are CCW viewed from above # Motor 12,500 steps per degree
set soma_Home 9867748 # Positive steps are CCW viewed from above
#set somaStepRate [expr -$motorrate*100.0] set soma_Home 9867748
set somaStepRate 12500 #set somaStepRate [expr -$motorrate*100.0]
Motor soma $motor_driver_type [params \ set somaStepRate 12500
Motor soma $motor_driver_type [params \
asyncqueue mc1\ asyncqueue mc1\
host mc1-dingo\ host mc1-dingo\
port pmc1-dingo\ port pmc1-dingo\
@ -222,17 +231,57 @@ Motor soma $motor_driver_type [params \
absEncHome $soma_Home\ absEncHome $soma_Home\
nopowersave 1\ nopowersave 1\
cntsPerX 2048 ] cntsPerX 2048 ]
soma speed 0.1 soma speed 0.1
soma accel 0.1 soma accel 0.1
soma decel 0.1 soma decel 0.1
soma part sample soma part sample
soma long_name soma soma long_name soma
soma softlowerlim -1 soma softlowerlim -1
soma softupperlim 361 soma softupperlim 361
soma home 0 soma home 0
#soma bias_bits 25 #soma bias_bits 25
#soma rotary_bits 25 #soma rotary_bits 25
soma creep_offset 0.05 soma creep_offset 0.05
}
if {[string equal -nocase ${sample_stage_rotate} "somb"]} {
# mc1:D,H Sample rotation axis
# Resolver 4,096 counts per degree
# Motor 10*25,000 steps per degree
# Positive steps are CCW viewed from above
set somb_Home [expr 2**23]
#set sombStepRate [expr -$motorrate*100.0]
set sombStepRate [expr 10 * 25000]
Motor somb $motor_driver_type [params \
asyncqueue mc1\
host mc1-dingo\
port pmc1-dingo\
axis D\
encoderaxis H\
units degree\
hardlowerlim -722\
hardupperlim 722\
maxSpeed 0.4\
maxAccel 1\
maxDecel 1\
stepsPerX $sombStepRate\
absEnc 1\
absEncHome $somb_Home\
nopowersave 1\
cntsPerX 4096 ]
somb speed 0.1
somb accel 0.1
somb decel 0.1
somb part sample
somb long_name somb
somb softlowerlim -1
somb softupperlim 361
somb home 0
somb bias_bits 24
somb bias_bias [expr 2**23]
#somb rotary_bits 25
somb creep_offset 0.05
}
############################ ############################

View File

@ -124,6 +124,28 @@ terminator = \r\n
tol1 = 1.0 tol1 = 1.0
tol2 = 1.0 tol2 = 1.0
[ls336_05]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_06]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_11] [ls336_11]
desc = "Lakeshore 336 temperature controller" desc = "Lakeshore 336 temperature controller"
driver = "ls336" driver = "ls336"
@ -207,3 +229,10 @@ imptype = multimeter
ip = 10.157.205.37 ip = 10.157.205.37
port = 4001 port = 4001
[soma]
desc = "This is alternative Sample Omega A"
imptype = motion_axis
[somb]
desc = "This is alternative Sample Omega B"
imptype = motion_axis

View File

@ -6,7 +6,7 @@
namespace eval cf { namespace eval cf {
variable wall_lag 10 variable wall_lag 10
variable wall_max 300 variable wall_max 200
variable sample_tolerance 5 variable sample_tolerance 5
variable wall_tolerance 5 variable wall_tolerance 5
variable wall_set true variable wall_set true
@ -28,6 +28,27 @@ namespace eval cf {
if {$_base_control == false} {set base_control false} else {set base_control true} if {$_base_control == false} {set base_control false} else {set base_control true}
} }
proc RampOn {rate} {
variable base_set
variable wall_set
hset /sample/tc1/control/ramp_Loop_1 1,$rate
if {$base_set} {hset /sample/tc1/control/ramp_Loop_2 1,$rate}
if {$wall_set} {hset /sample/tc2/control/ramp_Loop_1 1,$rate}
wait 5
}
proc RampOff {} {
variable base_set
variable wall_set
hset /sample/tc1/control/ramp_Loop_1 0,5
if {$base_set} {hset /sample/tc1/control/ramp_Loop_2 0,5}
if {$wall_set} {hset /sample/tc2/control/ramp_Loop_1 0,5}
wait 5
}
proc WallParams {_wall_lag _wall_max _wall_tolerance} { proc WallParams {_wall_lag _wall_max _wall_tolerance} {
variable wall_lag variable wall_lag
@ -48,7 +69,7 @@ namespace eval cf {
if {$tempc < 4} {set tempc 4} if {$tempc < 4} {set tempc 4}
if {$tempc > $wall_max} {set tempc $wall_max} if {$tempc > $wall_max} {set tempc $wall_max}
hset /sample/tc1/sensor/setpoint1 $temp hset /sample/tc1/sensor/setpoint1 $temp
if {$base_set} {hset /sample/tc1/sensor/setpoint2 $tempc} if {$base_set} {hset /sample/tc1/sensor/setpoint2 $temp}
if {$wall_set} {hset /sample/tc2/sensor/setpoint1 $tempc} if {$wall_set} {hset /sample/tc2/sensor/setpoint1 $tempc}
} }
@ -62,7 +83,7 @@ namespace eval cf {
if {$tempc < 4} {set tempc 4} if {$tempc < 4} {set tempc 4}
if {$tempc > $wall_max} {set tempc $wall_max} if {$tempc > $wall_max} {set tempc $wall_max}
set drstr "drive tc1_driveable \$temp" set drstr "drive tc1_driveable \$temp"
if {$base_control} {append drstr " tc1_driveable2 \$tempc"} if {$base_control} {append drstr " tc1_driveable2 \$temp"}
if {$wall_control} {append drstr " tc2_driveable \$tempc"} if {$wall_control} {append drstr " tc2_driveable \$tempc"}
eval $drstr eval $drstr
} }
@ -86,6 +107,7 @@ namespace eval cf {
proc TempRun {temp delay numsteps oscno} { proc TempRun {temp delay numsteps oscno} {
RampOff
TempDrive $temp TempDrive $temp
wait $delay wait $delay
newfile HISTOGRAM_XY newfile HISTOGRAM_XY
@ -97,7 +119,8 @@ namespace eval cf {
} }
} }
proc RampRun {start step fin oscno delay} { proc StepRun {start step fin oscno delay} {
RampOff
histmem mode unlimited histmem mode unlimited
newfile HISTOGRAM_XY newfile HISTOGRAM_XY
set loopvar 1 set loopvar 1
@ -116,7 +139,8 @@ namespace eval cf {
} }
} }
proc StepRun {start step fin oscno delay} { proc StepWaitRun {start step fin oscno delay} {
RampOff
histmem mode unlimited histmem mode unlimited
newfile HISTOGRAM_XY newfile HISTOGRAM_XY
set loopvar 1 set loopvar 1
@ -135,6 +159,36 @@ namespace eval cf {
} }
} }
proc RampRun {start rate fin oscno} {
RampOff
TempSet $start
wait 5
set tim1 [clock seconds]
set tlength [expr abs($start-$fin)/($rate/60.0)]
broadcast $rate $tlength
RampOn $rate
wait 5
TempSet $fin
set bool 0
set i 0
histmem mode unlimited
newfile HISTOGRAM_XY
while {$bool==0} {
oct oscillate_count $oscno
oct oscillate start
hmm countblock
save $i
incr i
set tim2 [expr [clock seconds]-$tim1]
broadcast $tim2
if {$tim2>$tlength} {set bool 1}
}
RampOff
}
proc HeaterOn {} { proc HeaterOn {} {
variable base_set variable base_set
variable wall_set variable wall_set
@ -144,10 +198,20 @@ namespace eval cf {
if {$wall_set} {hset /sample/tc2/heater/heaterRange 5} if {$wall_set} {hset /sample/tc2/heater/heaterRange 5}
} }
proc HeaterOff {} {
variable base_set
variable wall_set
hset /sample/tc1/heater/heaterRange_1 0
if {$base_set} {hset /sample/tc1/heater/heaterRange_2 0}
if {$wall_set} {hset /sample/tc2/heater/heaterRange 0}
}
proc GetTemp {} { proc GetTemp {} {
variable base_set variable base_set
set t1top [hget /sample/tc1/sensor/sensorValueA] set t1top [hget /sample/tc1/sensor/sensorValueA]
broadcast "sample top : $t1top" broadcast "sample top : $t1top"
if {$base_set} { if {$base_set} {
set t1base [hget /sample/tc1/sensor/sensorValueB] set t1base [hget /sample/tc1/sensor/sensorValueB]
broadcast "sample base: $t1base" broadcast "sample base: $t1base"

View File

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

View File

@ -97,7 +97,7 @@ SetVoltScale 1000.0
# LS336 02 at 205.29 # LS336 02 at 205.29
# add_sct_ls336 tc2 10.157.205.30 7777 "\r\n" 1.0 1.0 # add_sct_ls336 tc2 10.157.205.30 7777 "\r\n" 1.0 1.0
# add_sct_ls336 tc1 10.157.205.31 7777 "\r\n" 1.0 1.0 # add_sct_ls336 tc1 10.157.205.31 7777 "\r\n" 1.0 1.0
# add_sct_ls340 tc3 137.157.201.86 4001 "\r\n" 1.0 1.0 # add_sct_ls340 tc3 137.157.201.86 4002 "\r\n" 1.0 1.0
server_init server_init
########################################### ###########################################

View File

@ -19,7 +19,8 @@ proc ::histogram_memory::init_OAT_TABLE {} {
hmm configure fat_frame_source EXTERNAL hmm configure fat_frame_source EXTERNAL
# OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000 # OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000
OAT_TABLE -set X { 56.5 -56.5 } NXC 1 Y { 110.5 109.5 } NYC 221 T { 0 40 } NTC 1000 # OAT_TABLE -set X { 56.5 -56.5 } NXC 1 Y { 110.5 109.5 } NYC 221 T { 0 40 } NTC 1000
OAT_TABLE -set X { 60.5 -60.5 } NXC 1 Y { 110.5 109.5 } NYC 221 T { 0 40 } NTC 1000
} message ] { } message ] {
if {$::errorCode=="NONE"} {return $message} if {$::errorCode=="NONE"} {return $message}
return -code error $message return -code error $message

View File

@ -27,6 +27,7 @@ fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(counter)/counter.tcl
fileeval $cfPath(environment)/sct_syr.tcl fileeval $cfPath(environment)/sct_syr.tcl
fileeval $cfPath(environment)/syringe_pump_sct.tcl fileeval $cfPath(environment)/syringe_pump_sct.tcl
fileeval $cfPath(environment)/isotech_ps_sct.tcl
fileeval $cfPath(environment)/knauer_pump_sct.tcl fileeval $cfPath(environment)/knauer_pump_sct.tcl
fileeval $cfPath(environment)/sct_mvp.tcl fileeval $cfPath(environment)/sct_mvp.tcl
fileeval $cfPath(environment)/mvp_valve_sct.tcl fileeval $cfPath(environment)/mvp_valve_sct.tcl
@ -40,6 +41,7 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl
fileeval $cfPath(environment)/temperature/ls336_sct.tcl fileeval $cfPath(environment)/temperature/ls336_sct.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
fileeval $cfPath(environment)/temperature/ls340_sct.tcl fileeval $cfPath(environment)/temperature/ls340_sct.tcl
fileeval $cfPath(environment)/temperature/julabo_lh45_sct.tcl
fileeval $cfPath(environment)/temperature/julabo_lh45_gen_sct.tcl fileeval $cfPath(environment)/temperature/julabo_lh45_gen_sct.tcl
fileeval $cfPath(environment)/temperature/oxford_mercury_sct.tcl fileeval $cfPath(environment)/temperature/oxford_mercury_sct.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl

View File

@ -47,11 +47,21 @@ set 10sample_table {
10 -214.5996 10 -214.5996
} }
set 5sample_table {
1 120
2 60
3 0
4 -60
5 -120
}
if { [ info exists ::config_dict ] } { if { [ info exists ::config_dict ] } {
if { [ dict exists $::config_dict sample_stage implementation ] } { if { [ dict exists $::config_dict sample_stage implementation ] } {
set implementation [ dict get $::config_dict sample_stage implementation ] set implementation [ dict get $::config_dict sample_stage implementation ]
if {$implementation == "normal_sample_stage"} { if {$implementation == "normal_sample_stage"} {
# Don't make posit motor # Don't make posit motor
} elseif {$implementation == "5_pos_sample_tumbler"} {
mkPosit sct_mc1 sampleNum float samx sample $5sample_table
} elseif {$implementation == "10_pos_sample_stage"} { } elseif {$implementation == "10_pos_sample_stage"} {
mkPosit sct_mc1 sampleNum float samx sample $10sample_table mkPosit sct_mc1 sampleNum float samx sample $10sample_table
} elseif {$implementation == "20_pos_sample_stage"} { } elseif {$implementation == "20_pos_sample_stage"} {

View File

@ -510,7 +510,7 @@ Motor m1 $motor_driver_type [params \
maxDecel 0.25\ maxDecel 0.25\
stepsPerX 100000\ stepsPerX 100000\
absEnc 1\ absEnc 1\
absEncHome 16189898\ absEncHome 16190612\
cntsPerX -2048] cntsPerX -2048]
m1 part crystal m1 part crystal
m1 long_name m1 m1 long_name m1