source: trunk/FACT++/ScriptsForDimCtrl/FirstDrsCalib.dim@ 13993

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