source: branches/FACT++_part_filenames/ScriptsForDimCtrl/FirstDrsCalib.dim@ 19365

Last change on this file since 19365 was 14267, checked in by Jens Buss, 12 years ago
additional out put for wait-states in scripts
File size: 7.3 KB
Line 
1#!dimctrl --exec
2
3>
4> -------------------------------------------
5> First DRS Calibration Script starting up...
6> -------------------------------------------
7
8.w 2000
9# As a First step we want to calibrate the current, which are read from the bias crate,
10# and not take a DRS calibration, as it is mentioned in the data taking page...
11# so for this we should get the feedback and biasctrl programs into known states
12# I think it is good to try a RECONNECT to the bias, and make sure the voltage is off
13# Since we do not know, what the feedback program is doing at the moment, we should as well,
14# tell it to keep its mouth shut ... just to be sure, we know whats going on
15> stopping feedback
16FEEDBACK/STOP
17.w 2000
18# stopping should always be possible, and end in state 'Connected'(6)
19> ...waiting for FEEDBACK to be in state 6: Connected
20.s FEEDBACK 6
21> ..done
22
23#BIAS_CONTROL/RECONNECT
24# If we were disconnected, and this was the first try of the night, the bias_ctrl should
25# be in state 'VoltageOff'(7) more or less immediately
26#.s BIAS_CONTROL 3
27#.s BIAS_CONTROL 7 5000
28# if these assumptions are all wrong, then we might have been properly connected anyway,
29# and just have to ramp down... lets do it, but wait forever, in case it does not work
30> switching off bias
31BIAS_CONTROL/SET_ZERO_VOLTAGE
32.w 2000
33> ...waiting for BIAS to be in state 7: VoltageOff
34.s BIAS_CONTROL 7
35> ...done
36
37# in case we reach this line, the voltages are all off, and the feedback does not do anything
38# So lets do the current calibration, therefor we tell the bias crate to ramp up just 1 single DAC count(~22mV)
39# the result of this action is, to get bias_ctrl into the state 'VoltageOn'(9), but since we only go one DAC count it shouldn't take long
40> setting bias globally to 1 DAC
41BIAS_CONTROL/SET_GLOBAL_DAC 1
42.w 2000
43> ...waiting for BIAS to be in state 9: VoltageOn
44.s BIAS_CONTROL 9
45> ...done
46
47# now we may tell the feedback program to calibrate the currents ...
48# I do not understand, if I have to explicitely allow the feedback program to generate output,
49# or if it just produces output...
50# As far as I understand, the feedback output enable status is the same,
51# as it was before I send the STOP command... so it is unknown at this point.
52# and in addition enabling or disabling the output, when STOPed is not possible as far as I know...
53# I try to enable it anyway.
54> enabling output for feedback
55FEEDBACK/ENABLE_OUTPUT yes
56.w 2000
57> ...done
58
59> calibrating bias crate current readings...
60FEEDBACK/CALIBRATE_CURRENTS
61.w 5000
62# in order to find out when the calibration ends, we have to wait for the transistion from state
63# 'Calibrating'(13) back to 'Connected'(6)
64> ...waiting for FEEDBACK to be in state 13: Calibrating
65.s FEEDBACK 13
66> ...waiting for FEEDBACK to be in state 6: Connected
67.s FEEDBACK 6
68
69# Thomas Bretz told me, that the feedback, after this is step has disabled its output
70# and is in the mode, we might call 'temperature control' even there is no temerature beeing controlled.
71# I don't know where the voltage is ... in order to perform the calibration, the feedback had to
72# ramp up to 2V below the operational voltage, i.e. about 1V below the breakdown voltage
73
74# We want to take a DRS amplitude calibration so we have to ramp down the bias voltage.
75# this 10sec wait is needed in order for the bias not to disconect all the time...
76> ... current calibration done
77.w 10000
78
79> switching off bias
80BIAS_CONTROL/SET_ZERO_VOLTAGE
81.w 5000
82> ...waiting for BIAS to be in state 7: VoltageOff
83.s BIAS_CONTROL 7
84> ...done
85
86# So now we can take the 3 runs, which are called DRS amplitude calibration:
87# A pedestal run with ROI=1024
88# A gain calibration run with ROI=1024
89# and a second pedestal run, with the same ROI as our next data will be, i.e. ROI=300 in this case
90> taking DRS:Pedestal 1000 ...
91> ===================================================
92> OPERATOR:
93> observe Events tab and make sure there are no patches
94> with strange behaviour, which can be caused
95> by DRS-CHIP Problems
96> ===================================================
97
98FAD_CONTROL/START_DRS_CALIBRATION
99###FAD_CONTROL/SET_FILE_FORMAT 0
100MCP/START -1 1000 drs-pedestal
101> ...waiting for FAD to be in state 8: Writing Data
102.s FAD_CONTROL 8
103> ...waiting for FAD to be in state 4: Connected
104.s FAD_CONTROL 4
105> ... done
106
107> taking DRS:Gain 1000 ...
108MCP/START -1 1000 drs-gain
109> ...waiting for FAD to be in state 8: Writing Data
110.s FAD_CONTROL 8
111> ...waiting for FAD to be in state 4: Connected
112.s FAD_CONTROL 4
113> ... done
114
115> taking Pedestal 1000 ...
116MCP/START -1 1000 pedestal
117> ...waiting for FAD to be in state 8: Writing Data
118.s FAD_CONTROL 8
119> ...waiting for FAD to be in state 4: Connected
120.s FAD_CONTROL 4
121> ... done
122
123# okay this is the DRS calibration for the next few runs.
124# we are now asked to take again a pedestal run, which can be used, to
125# calculate the electronics noise for instance ... since the shutter is closed and the
126# voltage is off .. there should not be alot of signal in it :-)
127> taking crosscheck Pedestal 1000 ...
128FAD_CONTROL/SET_FILE_FORMAT 2
129###FAD_CONTROL/SET_FILE_FORMAT 0
130MCP/START -1 1000 pedestal
131> ...waiting for FAD to be in state 8: Writing Data
132.s FAD_CONTROL 8
133> ...waiting for FAD to be in state 4: Connected
134.s FAD_CONTROL 4
135> ... done
136
137# now we want to take a run, with dark counts events
138# so we need to ramp up the voltage
139# we want to use the 'current control' more so we give the commands for this...
140> switching on current controll feedback ...
141FEEDBACK/STOP
142FEEDBACK/START_CURRENT_CONTROL 0.0
143FEEDBACK/ENABLE_OUTPUT yes
144# the feedback should be in state 'CurrentControl'(12) now
145# the feedback should be in state 'CurrentCtrlIdle'(9) now since 30.05.12
146> ...waiting for FEEDBACK to be in state 9: CurrentCtrlIdle
147.s FEEDBACK 9
148> ... done
149> switching on bias
150# now we give the feedback a hint, that it may ramp ...
151BIAS_CONTROL/SET_GLOBAL_DAC 1
152# after this command the bias_ctrl should be in state 'VoltageOn'(9) after a second or so
153> ...waiting for BIAS to be in state 9: VoltageOn
154.s BIAS_CONTROL 9
155> ...1 DAC globally set
156# then usually it takes some time until the feedback has enough information to really start controlling the voltage
157# when the feedback actually kicks in, the bias is first in state 'Ramping'(5) for some seconds and finally in 'VoltageOn'(9)
158# again
159> ...waiting for BIAS to be in state 5: Ramping
160.s BIAS_CONTROL 5
161> ...ramping to nominal voltage
162> ...waiting for BIAS to be in state 9: VoltageOn
163.s BIAS_CONTROL 9
164> ...bias on
165# here we should wait 45 sec in order for the current control to get enough current readings and temp readings to stabilize..
166> waiting 45sec for the current control to stabilize...
167.w 45000
168> ... done
169
170# so now we can take the dark count run ...
171# this might be changed in the future ... either the number of events or the the ROI might be changed
172# then the DRS calibration above, and the pedestal run in between have to be changed as well.
173> taking Pedestal with BIAS on 3000 ...
174MCP/START -1 3000 pedestal
175> ...waiting for FAD to be in state 8: Writing Data
176.s FAD_CONTROL 8
177> ...waiting for FAD to be in state 4: Connected
178.s FAD_CONTROL 4
179> ... done
180
181# at the end the bias voltage should be ramped down, since in a few seconds a shifter wit ha flashlight
182# will come out to open the shutter...
183> switching OFF bias ...
184BIAS_CONTROL/SET_ZERO_VOLTAGE
185> ...waiting for BIAS to be in state 7: VoltageOff
186.s BIAS_CONTROL 7
187> ...done
188>
189> This is the end of First DRS Calibration
190> ----------------------------------------------------
191>
Note: See TracBrowser for help on using the repository browser.