From 648c8003b73399c2726e6444da489c7e2d692429 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 24 Jun 2014 17:20:27 +1000 Subject: [PATCH] Merge from Wombat, except sics_config.ini Conflicts: sics/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl sics/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl sics/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl sics/site_ansto/instrument/config/hmm/hmm_object.tcl sics/site_ansto/instrument/hipd/config/commands/eulerscan.tcl sics/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl sics/site_ansto/instrument/hipd/util/sics_config.ini sics/site_ansto/instrument/server_config.tcl --- .../hipd/config/commands/eulerscan.tcl | 237 ++++++++++-------- .../hipd/config/hmm/hmm_configuration.tcl | 16 +- .../instrument/hipd/config/hmm/hmm_rapid.tcl | 13 +- .../config/motors/euler_configuration.tcl | 9 +- .../config/motors/motor_configuration.tcl | 15 +- .../instrument/hipd/wombat_configuration.tcl | 15 +- 6 files changed, 179 insertions(+), 126 deletions(-) diff --git a/site_ansto/instrument/hipd/config/commands/eulerscan.tcl b/site_ansto/instrument/hipd/config/commands/eulerscan.tcl index 9a07c365..954453cd 100644 --- a/site_ansto/instrument/hipd/config/commands/eulerscan.tcl +++ b/site_ansto/instrument/hipd/config/commands/eulerscan.tcl @@ -1,107 +1,130 @@ - -# Euler cradle scan commands for texture runs -# AJS Dec 2010 - - -# SetHistoSync: sets the histogram to receive $framenum worth of frames on receiving -# TTL pulse in frame sync input. Note: Framebuffer should be set to OFF for long runs - -proc SetHistoSync {framenum} { - histmem stop - bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum - bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } - fat_table -set NOS_PERIODS $framenum - oat_table -set T {0 2200000} NTC 1 - histmem loadconf - histmem fsrce EXTERNAL -} - -publish SetHistoSync user - -# SetHistoNormal: resets the histo for standard operation - -proc SetHistoNormal {} { - histmem stop - bat_table -set NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 - bat_table -set NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0 PERIOD_INDICES { 0} - fat_table -set NOS_PERIODS 1 - oat_table -set T {0 2200000} NTC 1 - histmem loadconf - histmem fsrce INTERNAL - proc ::histogram_memory::pre_count {} {} -} - -# continous scan for EPHI- the euler cradle phi stage (innermost axis) -# note make sure controller 2 has the PHISCAN code in it - -publish SetHistoNormal user - - -proc EphiCtsScan {start step range steptime} { - -# magic number: steps per rotation for phi - set ephisteps -12500 - set ephispeed [expr {($step*1.0)/$steptime}] - set numsteps [expr {round($range/$step)}] -# broadcast $omspeed $numsteps - -# run ephi to start angle -1 so that first pulse signals as ephi crosses 0 angle -# at correct velocity - ephi accel 1 - ephi decel 1 - ephi speed 3 - drive ephi [expr {$start-1}] - ephi speed $ephispeed - ephi accel [expr {$ephispeed*1.2}] - -# now set ephi parameters to galil and clear the bit - - set scval [expr {($range+2.2)*$ephisteps}] - set stval [expr {$ephisteps * $step}] -broadcast $scval $stval - som send CTLEN=$scval - som send CTSTEP=$stval -# som send OMN = [expr {$numsteps+1}] - som send CB5 - - proc ::histogram_memory::pre_count {} { - ephi send "XQ #EPHSCAN,2" - } - - histmem mode unlimited - histmem start block - - newfile HISTOPERIOD_XY - for {set i 0} {$i<$numsteps} {incr i} {save $i} - ephi speed 1 - - -# this we needed when it didn't work properly -# proc ::histogram_memory::pre_count {} {} -# ephi send SHC -# ephi send SPC=25000 -# ephi send BCG -# wait 3 -# ephi send "XQ #THREAD0,0" -# wait 3 -# ephi reset -} -publish EphiCtsScan user - -proc EulerCtsScan {range step steptime} { - set numsteps [expr {round($range/$step)}] - SetHistoSync $numsteps - foreach chi {0 15 30 45 60 75 90} { - drive echi $chi - EphiCtsScan [expr {-$range/2}] $step $range $steptime - } -# SetHistoNormal -} - -publish EulerCtsScan user - -proc KillEphi {} { - ephi send HX2 - ephi send STC - ephi reset -} +# Euler cradle scan commands for texture runs +# AJS Dec 2010 + + +# SetHistoSync: sets the histogram to receive $framenum worth of frames on receiving +# TTL pulse in frame sync input. Note: Framebuffer should be set to OFF for long runs + +proc SetHistoSync {framenum} { + histmem stop + bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum + bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } + fat_table -set NOS_PERIODS $framenum + oat_table -set T {0 2200000} NTC 1 + histmem loadconf + histmem fsrce EXTERNAL +} + +publish SetHistoSync user + +# SetHistoNormal: resets the histo for standard operation + +proc SetHistoNormal {} { + histmem stop + bat_table -set NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 + bat_table -set NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0 PERIOD_INDICES { 0} + fat_table -set NOS_PERIODS 1 + oat_table -set T {0 2200000} NTC 1 + oat_table -set Y {-0.5 3.5} NYC 128 + histmem loadconf + histmem fsrce INTERNAL + proc ::histogram_memory::pre_count {} {} +} + +publish SetHistoNormal user + +proc SetHistoOneShot {frq framenum } { + histmem stop + oct speed 0.25 + oct accel 0.25 + oct decel 0.25 + drive oct 0 + bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum + bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } + fat_table -set NOS_PERIODS $framenum + oat_table -set T {0 2200000} NTC 1 + oat_table -set Y {-0.5 15.5} NYC 16 + histmem freq $frq + + histmem loadconf + histmem fsrce INTERNAL + histmem mode unlimited + +} + + +publish SetHistoOneShot user + +# continous scan for EPHI- the euler cradle phi stage (innermost axis) +# note make sure controller 2 has the PHISCAN code in it + + + +proc EphiCtsScan {start step range steptime} { + +# magic number: steps per rotation for phi + set ephisteps -12500 + set ephispeed [expr {($step*1.0)/$steptime}] + set numsteps [expr {round($range/$step)}] +# broadcast $omspeed $numsteps + +# run ephi to start angle -1 so that first pulse signals as ephi crosses 0 angle +# at correct velocity + ephi accel 1 + ephi decel 1 + ephi speed 3 + drive ephi [expr {$start-1}] + ephi speed $ephispeed + ephi accel [expr {$ephispeed*1.2}] + +# now set ephi parameters to galil and clear the bit + + set scval [expr {($range+2.2)*$ephisteps}] + set stval [expr {$ephisteps * $step}] +broadcast $scval $stval + som send CTLEN=$scval + som send CTSTEP=$stval +# som send OMN = [expr {$numsteps+1}] + som send CB5 + + proc ::histogram_memory::pre_count {} { + ephi send "XQ #EPHSCAN,2" + } + + histmem mode unlimited + histmem start block + + newfile HISTOPERIOD_XY + for {set i 0} {$i<$numsteps} {incr i} {save $i} + ephi speed 1 + + +# this we needed when it didn't work properly +# proc ::histogram_memory::pre_count {} {} +# ephi send SHC +# ephi send SPC=25000 +# ephi send BCG +# wait 3 +# ephi send "XQ #THREAD0,0" +# wait 3 +# ephi reset +} +publish EphiCtsScan user + +proc EulerCtsScan {range step steptime} { + set numsteps [expr {round($range/$step)}] + SetHistoSync $numsteps + foreach chi {0 15 30 45 60 75 90} { + drive echi $chi + EphiCtsScan [expr {-$range/2}] $step $range $steptime + } +# SetHistoNormal +} + +publish EulerCtsScan user + +proc KillEphi {} { + ephi send HX2 + ephi send STC + ephi reset +} diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl index 1b36b4cc..47087171 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl @@ -27,6 +27,9 @@ proc ::histogram_memory::init_OAT_TABLE {args} { hmm configure fat_frame_frequency $freq hmm configure fat_frame_source INTERNAL + + # set resolution "double_x" + switch $resolution { "hires" { FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 32 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED @@ -36,10 +39,19 @@ proc ::histogram_memory::init_OAT_TABLE {args} { FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 } + "double_x" { + FAT_TABLE -set MULTI_HOST_HISTO_SWITCH_OVERLAP 16 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 989.5 } NXC 496 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 + } "double_y_968x128" { FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED BNL_STATUS_MASK_MULTI_Y 1000h - OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 3.5 } NYC 256 T { 0 20000 } NTC 1 + OAT_TABLE -set X { 991.5 987.5 } NXC 248 Y { -0.5 1.5 } NYC 256 T { 0 20000 } NTC 1 } + "lores_484x64" { + FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 4 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED + OAT_TABLE -set X { 991.5 983.5 } NXC 124 Y { -0.5 7.5 } NYC 64 T { 0 20000 } NTC 1 + } + default { # Default to std_968x128 FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP 8 MULTI_HOST_HISTO_JOIN_STITCH_ORDER INVERTED @@ -135,6 +147,8 @@ proc ::histogram_memory::isc_initialize {} { detector_radius_mm lock ::histogram_memory::init_OAT_TABLE res "std_968x128" +# ::histogram_memory::init_OAT_TABLE res "double_x" + ::histogram_memory::upload_config Filler_defaults set ::histogram_memory::histmem_axes(HOR) /instrument/detector/x_pixel_angular_offset diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl index b8a8ab47..43f851a0 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl @@ -57,15 +57,20 @@ Publish histmem_period_single User # #} -proc histmem_period_sequence {Np} { +proc histmem_period_sequence {Np Nt} { global n_periods set n_periods $Np - FAT_TABLE -set NOS_PERIODS $Np - BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE $Np + #FAT_TABLE -set NOS_PERIODS $Np + #BAT_TABLE -set PERIOD_INDICES { 0 1} NO_BAT_ENTRIES $Np NO_BAT_PERIODS $Np NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 + OAT_TABLE -set T {0 $Nt} NTC $Np + FAT_TABLE -set FRAME_BUFFER DISABLE + histmem clockscale 1000000 histmem loadconf - histset_XYperiod +# newfile HISTOGRAM_XYT } + + proc histmem_period_sequence_off {} { global n_periods set n_periods $Np diff --git a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl index 1d0f3cee..cb4b340e 100644 --- a/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/euler_configuration.tcl @@ -1,8 +1,9 @@ # This must be loaded by motor_configuration.tcl set ephi_Home 26575217 -set echi_Home 24224381 +#set echi_Home 24224381 #set echi_Home 8919294 +set echi_Home 24207159 set eom_Home 23165482 # Sample Tilt 1, euler omega stage @@ -32,7 +33,7 @@ Motor echi $motor_driver_type [params \ axis B\ units degrees\ hardlowerlim -45\ - hardupperlim 100\ + hardupperlim 120\ maxSpeed 2\ maxAccel 2\ maxDecel 2\ @@ -42,7 +43,7 @@ Motor echi $motor_driver_type [params \ cntsPerX 8192] setHomeandRange -motor echi -home 0 -lowrange 10 -uprange 95 echi softlowerlim -10 -echi softupperlim 99 +echi softupperlim 120 echi home 0 echi speed 1 echi movecount $move_count @@ -53,7 +54,7 @@ echi long_name euler_chi # Sample Trans 1, upper, y Motor ephi $motor_driver_type [params \ asyncqueue mc2\ - axis D\ + axis C\ units degrees\ hardlowerlim -185\ hardupperlim 185\ diff --git a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl index 78077583..ad8d84b6 100644 --- a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl @@ -38,7 +38,10 @@ set my_Home 8378212 set som_Home 17214054 set stth_Home 1036498 #set stth_Home 32855991 -set oct_Home 7743768 +#set oct_Home 7743534 +set oct_Home 7741090 + + #Measured or computed slit motor steps per millimetre # 125 steps * 161:1 gears = 20125 @@ -274,7 +277,7 @@ Motor mom $motor_driver_type [params \ axis E\ units degrees\ hardlowerlim -5\ - hardupperlim 173\ + hardupperlim 183\ maxSpeed 1\ maxAccel 1\ maxDecel 1\ @@ -334,7 +337,7 @@ Motor $sample_stage_rotate $motor_driver_type [params \ axis E\ units degrees\ hardlowerlim -71\ - hardupperlim 111\ + hardupperlim 116\ maxSpeed 5\ maxAccel 1\ maxDecel 1\ @@ -342,7 +345,7 @@ Motor $sample_stage_rotate $motor_driver_type [params \ absEnc 1\ absEncHome $som_Home\ cntsPerX 4096] -setHomeandRange -motor $sample_stage_rotate -home 0 -lowrange -70 -uprange 110 +setHomeandRange -motor $sample_stage_rotate -home 0 -lowrange -70 -uprange 116 $sample_stage_rotate speed 1 $sample_stage_rotate precision 0.02 $sample_stage_rotate part sample @@ -381,7 +384,7 @@ Motor oct $motor_driver_type [params \ axis G\ units degrees\ hardlowerlim -1.5\ - hardupperlim 2.5\ + hardupperlim 8.5\ maxSpeed 2.0\ maxAccel 5.0\ maxDecel 5.0\ @@ -390,7 +393,7 @@ Motor oct $motor_driver_type [params \ absEncHome $oct_Home\ cntsPerX -465] oct softlowerlim -1.4 -oct softupperlim 2.4 +oct softupperlim 8.4 oct home 0 oct speed 0.5 oct precision 0.02 diff --git a/site_ansto/instrument/hipd/wombat_configuration.tcl b/site_ansto/instrument/hipd/wombat_configuration.tcl index 33f36fbf..7512cde2 100644 --- a/site_ansto/instrument/hipd/wombat_configuration.tcl +++ b/site_ansto/instrument/hipd/wombat_configuration.tcl @@ -37,8 +37,8 @@ fileeval $cfPath(environment)/temperature/sct_qlink.tcl fileeval $cfPath(environment)/temperature/west400.tcl fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl -#fileeval $cfPath(environment)/he3/sct_he3.tcl -#fileeval $cfPath(environment)/he3/sct_hmp_power.tcl +fileeval $cfPath(environment)/he3/sct_he3.tcl +fileeval $cfPath(environment)/he3/sct_hmp_power.tcl fileeval $cfPath(environment)/magneticField/sct_green_magnet.tcl fileeval $cfPath(hmm)/hmm_configuration.tcl fileeval $cfPath(nexus)/nxscripts.tcl @@ -65,13 +65,20 @@ SetVoltScale 2000.0 # Eurotherm # add_et2000 name IP PORT MODBUS_ADDR TOL # add_et2000 et2000 10.157.205.19 502 1 5 - +# add tcf1 west400 10.157.205.19 502 # Using a Keithley 2700 mulitimeter to read pressure # add_k2700 pressure 137.157.201.86 4004 "\r" # Lakeshore 370 Resistance Bridge -# add_lakeshore_370 ls370 137.157.201.86 4002 2.0 +# add_lakeshore_370 ls370 137.157.201.86 4001 2.0 +# stabdard cf8 + +# LS336 01 at 205.28 +# LS336 02 at 205.29 +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_ls340 tc3 137.157.201.86 4001 "\r\n" 1.0 1.0 server_init ###########################################