Changeset 13110


Ignore:
Timestamp:
03/14/12 21:19:38 (13 years ago)
Author:
neise
Message:
complete rework, based on comments of TB
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/ScriptsForDimCtrl/FirstDrsCalib

    r13087 r13110  
    1 # Making sure bias is off
     1# dimctrl script
     2.! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     3.! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    24.! echo `date -u` "First DRS Calibration Script starting up..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    35.! echo `date -u` "-------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    4 .! echo `date -u` "reconnecting to bias crate / switching bias ON / disabling feedback" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    5 BIAS_CONTROL/RECONNECT
    6 .! echo `date -u` "wating for RECONNECT --> voltageOff" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    7 .s BIAS_CONTROL 7 5000
    8 FEEDBACK/START_CURRENT_CONTROL 0.00
    9 FEEDBACK/ENABLE_OUTPUT 1
    10 .w 3000
     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
    1133BIAS_CONTROL/SET_GLOBAL_DAC 1
     34.w 2000
    1235.s BIAS_CONTROL 9
    13 FEEDBACK/ENABLE_OUTPUT 0
    14 FEEDBACK/STOP
    15 .s FEEDBACK 6
    16 .w 500
    17 .! echo `date -u` "calibrating bias crate current readings..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     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
    1848FEEDBACK/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)
    1952.s FEEDBACK 13
    2053.s FEEDBACK 6
    21 .w 3000
    22 FEEDBACK/START_CURRENT_CONTROL 0.00
    23 .w 500
    24 FEEDBACK/ENABLE_OUTPUT 1
     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
    2565BIAS_CONTROL/SET_ZERO_VOLTAGE
     66.w 5000
    2667.s BIAS_CONTROL 7
    27 .! echo `date -u` "bias voltage is switched off" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     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
    2874FAD_CONTROL/START_DRS_CALIBRATION
    29 
    30 .! echo `date -u` "taking DRS:Pedestal 1000 ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     75###FAD_CONTROL/SET_FILE_FORMAT 0 
    3176MCP/START -1 1000 drs-pedestal
    3277.s FAD_CONTROL 8
     
    4691.! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    4792
     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 :-)
    4897.! echo `date -u` "taking crosscheck Pedestal 1000 ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    4998FAD_CONTROL/SET_FILE_FORMAT 2
     99###FAD_CONTROL/SET_FILE_FORMAT 0
    50100MCP/START -1 1000 pedestal
    51101.s FAD_CONTROL 8
     
    53103.! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    54104
     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...
    55108.! 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 ...
    56116BIAS_CONTROL/SET_GLOBAL_DAC 1
     117# after this command the bias_ctrl should be in state 'VoltageOn'(9) after a second or so
    57118.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
    58122.s BIAS_CONTROL 5
    59123.s BIAS_CONTROL 9
    60124.! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    61125
    62 .! echo `date -u` "taking Pedestal with BIAS on 1000 ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    63 MCP/START -1 1000 pedestal
     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
    64131.s FAD_CONTROL 8
    65132.s FAD_CONTROL 4
    66133.! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    67134
     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...
    68137.! echo `date -u` "switching OFF bias ..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    69138BIAS_CONTROL/SET_ZERO_VOLTAGE
    70139.s BIAS_CONTROL 7
    71 .! echo `date -u` "... done" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    72140
     141.! echo `date -u` "This is the end of First DRS Calibration" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    73142.! echo `date -u` "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    74 .! echo `date -u` "This is the end of First DRS Calibration" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     143.! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
     144.! echo `date -u` " " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
Note: See TracChangeset for help on using the changeset viewer.