Proto-II Calibration Data
The data recorded in the Proto-II cosmic-ray runs have calibration data since Run 682. (See Run Summary) The calibration data are taken automatically at the beginning of
each run. The way this mechanism is implemented is... eh, nontrivial. This document may tell you how.
Steps for running Calibration
1. Type cd $BFROOT/detector/dch/DchProto2 in the terminal window & hit return.
2.Type source DchTestStand/setup.csh & hit return.
3.Type startXyplex & hit return.
4.A small window will appear on the screen having two options.
a)ROC26
b)JAY
Click on ROC26.
5.Type startCalib in the terminal window & hit return.
6.Another small window aill appear having three options.
a)Reboot ROM
b)Run Calibration on the ROM
c)Validate Calibration
click on Reboot.Then Run Calibration.
7.Enter configuration key as 4a2 .
8.Check if it runs successfully.If yes,then go to step 9.If no,then try to fix the errors.
9.Validate Calibration.
Design
The purpose of the calibration data is to measure the response of the electonics, and not of the chamber. In particular we are interested in calibrating
- the conversion factor (ns/count) of each TDC, and
- the time offset (t0) of each TDC,
which is achieved by injecting a small amount of charge to the input of the preamplifier at known timing. The amplifier chip has a built-in calibration curcuit that generates such pulses according to external control inputs:
- CALDAC - Analog level input (0-1V). Controls the amount of injected charge.
- CAL33X - TTL level input. Selects the range of the amount of injected charge.
- SEL0, SEL1, SEL2, SEL3 - TTL level input. Selects which channel (0-3) is calibrated.
- STROBE - Differential logic input. Triggers the calibration pulse.
The calibration of the TDCs is done with a fixed amount of charge, i.e., CALDAC and CAL33X are kept constant. The four channels in the preamplifier chip have to be calibrated one at a time, i.e., SEL0-3 are activated one by one. STROBE determines the
timing of the calibration pulse. The TDC calibration is done by varying the time delay td from the TDC start signal to STROBE and fitting the TDC count as a linear function of td.
In the (hopefully) near future, we will attempt to calibrate the FADCs as well. The amplitude of the calibration pulse must be varied for this.
Implementation
Hardware
The calibration circuit is built into the preamplifier chip. The preamplifier board has an 12bit DAC to control CALDAC. The DAC generates 0 to 4.095V for the input value between 0 and 4095, which is loaded serially through the digital I/O of the board.
The value written to the DAC has to be between 0 and 1000. The CAL33X bit is controlled by a shift register which is loaded through the same digital I/O as the DAC.
The STROBE signal is generated by sending a TTL pulse to the preamplifier board through a 50 ohm LEMO cable. The TTL pulse is generated by a CAMAC digital gate generator. The gate generator has two channels: channel A is used to start the TDCs, and
channel B is used to trigger a pulse generator which sends a TTL pulse to the LEMO cable.
In summary, a calibration pulse is generated by
- Loading bit patterns to CALDAC and CAL33X through the digital I/O,
- Setting delays to the CAMAC gate generator, and
- Generating a pulse from the gate generator by a CAMAC command.
Software - VxWorks Side
The above procedure is executed by vxuserDCH running on VxWorks. This is controlled by EPICS channel access mechanism through the configuration parameter blocks 0 and 1. The variables in block 0 is defined in vxuserDCH.c as:
#define C0_CALDAC 0 /* calib DAC (mV) */
#define C0_THRESH 1 /* disc threshold (mV) */
#define C0_CAL33X 2 /* calib x33 switch (0/1) */
#define C0_DGAIN 3 /* digital gain switch (0/1) */
#define C0_CALPAT 4 /* calib ch pattern (0..5, see below) */
#define C0_NDELAY 5 /* # of delay steps */
#define C0_STEP 6 /* calib delay step (ns) */
#define C0_NPULSE 7 /* # of pulses per delay */
#define C0_DELAY 8 /* calib delay (ns) */
#define C0_COSMIC 9 /* enable cosmic trigger (0/1) */
The variables are initialized by VxSETUP as:
LOADPARAM LoadConfigParams0
0
0 "CALDAC (mV)" 100.
1 "THRESH (mV)" 260.
2 "CAL33X" 0.
3 "DGAIN" 0.
4 "CALPAT" 0.
5 "NDELAY" 10.
6 "STEP (ns)" 100.
7 "NPULSE" 10.
8 "DELAY (ns)" 0.
9 "COSMIC" 1.
;
Updating the variables CALDAC, CAL33X and DELAY sets up the corresponding hardware parameters in the way you expect. The variable CALPAT activates SEL1-3 as:
- CALPAT = 0: All off
- CALPAT = 1: 1st channel group on, others off
- CALPAT = 2: 2nd channel group on, others off
- CALPAT = 3: 3rd channel group on, others off
- CALPAT = 4: 4th channel group on, others off
- CALPAT = 5: All on
The numbering scheme for the channel groups is unfortunately non-linear, and is defined in vxuserDCH.c as:
unsigned int dcac_cal[32]={
0, 0, 0, 0, 0, 0, 0, 0,
4, 1, 3, 2, 2, 3, 1, 4,
4, 1, 3, 2, 2, 3, 1, 4,
0, 0, 0, 0, 0, 0, 0, 0
};
where dcac_cal[i] is the number of group i-th channel on the preamplifier board belongs to. (Channels with dcac_cal[i] == 0 are not read out.)
Setting COSMIC variable activates/inhibits triggers from the scintillation counters. It should be set to 0 during the calibration, and should be set to non-zero during the normal data taking.
The variables in block 1 do not have any special meanings, except that updating them triggers the gate generator and thus a calibration pulse is generated.
In summary, a calibration pulse is generated by
- Setting the variables CALDAC, CAL33X, CALPAT, DELAY and COSMIC in the configuration block 0, and
- Updating configuration block 1.
In addition, the variables NDELAY, STEP and NPULSE defines the number of different delay values, the delay step, and the number of pulses at each delay point. They are read by the Unix side script Start.cmd which is discussed in the next
section.
Software - Unix Side
The calibration sequence is controlled by a shell script Start.cmd which is executed on goldeneye by clicking the `Start' button on the run control panel. All communication between the Unix side and the VxWorks side is made through the two
channel access commands:
- caget Mn:OrcMonitor.x - Reads variable x in block n.
- caput Cn:OrcConfigure.x value - Writes value to variable x in block n.
The variable name x must be given by a letter `A', `B', ..., `J'.
After starting a new run, Start.cmd sends the following commands to the VxWorks side:
- Read all 10 variables in block 0 and write them back. This is necessary to avoid losing the original values set by
VxSETUP.
- Read NDELAY, STEP and NPULSE.
- Set COSMIC to 0.
- Loop 4 times.
- Set CALPAT to 1, 2, 3, 4.
- Loop NDELAY times.
- Setting DELAY to STEP, 2 × STEP, etc.
- Loop NPULSE times and write to block 1. This generates NPULSE calibration pulses.
- Set COSMIC to 1.
- Continue with normal data taking.
Masahiro Morii 05-Jun-1997
|