| 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
|
|---|
| 14 | FEEDBACK/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
|
|---|
| 26 | BIAS_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
|
|---|
| 33 | BIAS_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.
|
|---|
| 44 | FEEDBACK/ENABLE_OUTPUT yes
|
|---|
| 45 | .w 2000
|
|---|
| 46 |
|
|---|
| 47 | .! echo `date -u` "calibrating bias crate current readings..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 48 | FEEDBACK/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 |
|
|---|
| 65 | BIAS_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
|
|---|
| 74 | FAD_CONTROL/START_DRS_CALIBRATION
|
|---|
| 75 | ###FAD_CONTROL/SET_FILE_FORMAT 0
|
|---|
| 76 | MCP/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
|
|---|
| 82 | MCP/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
|
|---|
| 88 | MCP/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
|
|---|
| 98 | FAD_CONTROL/SET_FILE_FORMAT 2
|
|---|
| 99 | ###FAD_CONTROL/SET_FILE_FORMAT 0
|
|---|
| 100 | MCP/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
|
|---|
| 109 | FEEDBACK/STOP
|
|---|
| 110 | FEEDBACK/START_CURRENT_CONTROL 0.0
|
|---|
| 111 | FEEDBACK/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 ...
|
|---|
| 116 | BIAS_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 | # here we should wait 45 sec in order for the current control to get enough current readings and temp readings to stabilize..
|
|---|
| 125 | .! echo `date -u` "...waiting 45sec for the current control..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 126 | .w 45000
|
|---|
| 127 | .! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 128 |
|
|---|
| 129 | # so now we can take the dark count run ...
|
|---|
| 130 | # this might be changed in the future ... either the number of events or the the ROI might be changed
|
|---|
| 131 | # then the DRS calibration above, and the pedestal run in between have to be changed as well.
|
|---|
| 132 | .! echo `date -u` "taking Pedestal with BIAS on 3000 ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 133 | MCP/START -1 3000 pedestal
|
|---|
| 134 | .s FAD_CONTROL 8
|
|---|
| 135 | .s FAD_CONTROL 4
|
|---|
| 136 | .! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 137 |
|
|---|
| 138 | # at the end the bias voltage should be ramped down, since in a few seconds a shifter wit ha flashlight
|
|---|
| 139 | # will come out to open the shutter...
|
|---|
| 140 | .! echo `date -u` "switching OFF bias ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 141 | BIAS_CONTROL/SET_ZERO_VOLTAGE
|
|---|
| 142 | .s BIAS_CONTROL 7
|
|---|
| 143 |
|
|---|
| 144 | .! echo `date -u` "This is the end of First DRS Calibration" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 145 | .! echo `date -u` "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 146 | .! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|
| 147 | .! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
|
|---|