source: trunk/FACT++/ScriptsForDimCtrl/FirstDrsCalib@ 13110

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