A versatile data acquisition system for time resolved X-ray scattering using gas proportional detectors with delay line readout

A versatile data acquisition system for time resolved X-ray scattering using gas proportional detectors with delay line readout

ARTICLE IN PRESS Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520 A versatile data acquisition system for time resolved X-ra...

255KB Sizes 0 Downloads 60 Views

ARTICLE IN PRESS

Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

A versatile data acquisition system for time resolved X-ray scattering using gas proportional detectors with delay line readout W. Shanga,1, B. Robrahna, F. Goldingb, M.H.J. Kocha,* a

European Molecular Biology Laboratory, EMBL c/o DESY, Notkestrasse 85, D-22603 Hamburg, Germany b Francis Golding Associates, Westholme, Westbourne Drive, Lancaster LA1 5EE, UK Received 13 January 2004; received in revised form 24 March 2004; accepted 8 April 2004 Available online 15 June 2004

Abstract A data acquisition system for time resolved X-ray scattering experiments using linear, quadrant or area gas proportional detectors with delay line readout based on commercially available hardware (National Instruments) is described. The system can easily be configured for recording data from point detectors (e.g. photomultipliers and photodiodes) and/or ancillary data only. Applications involving measurements with two different types of time to digital converters illustrate the features and performances of the system. r 2004 Elsevier B.V. All rights reserved. PACS: 07.05.Hd; 07.85.Qe; 61.10.Eq Keywords: Small angle X-ray scattering; Time to digital converter

1. Introduction For many applications of small angle X-ray (SAXS) and neutron scattering to biochemical systems or synthetic polymers the key factor is not intensity or high brilliance but rather a high signal to background ratio in the camera and a high *Corresponding author. Tel.: +49-4089-902-113; fax: +494089-902-149. E-mail address: [email protected] (M.H.J. Koch). 1 Present address: Universit.at Munster, . Institut fur . Angewandte Physik, Corrensstrasse 2/4, D-48149 Munster, . Germany. E-mail: [email protected]

signal to noise ratio in the detection system. Gas proportional detectors, which are effectively noise free compared to integrating detectors like imaging plates and CCD detectors, have therefore been extensively used on laboratory and synchrotron radiation or neutron sources. Conventional gas proportional detectors cannot cope with the intensities at third generation synchrotron radiation sources. In contrast, at these very high intensities the noise associated with CCD detectors or its effects can partly be eliminated by cooling and short time framing. Where rapid time framing is required gas detectors

0168-9002/$ - see front matter r 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.nima.2004.04.220

ARTICLE IN PRESS 514

W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

macromolecules or semi-crystalline polymers, based on commercially available hardware. A block diagram of the system is shown in Fig. 1 and Table 1 summarizes its main features. The performance of the system is illustrated below together with results obtained with two different types of time to digital converters (TDC) in NIM standard, developed under the PASERO project [2]. The two TDC modules (N110 and TSC1002), which cover different types of applications, can be read out with the PCI 6533 (also known as PCIDIO-32HS) data acquisition card from National Instruments (www.ni.com). The N110 TDC [3], a four channel TDC with common start based on the AMS110 ASIC, is optimized for the readout of area detectors with continuous delay lines. It can, however, also be used with linear detectors or for time-of-flight measurements. The TSC1002 [4], based on an ASIC implementing time to space conversion is optimized for the readout of 16 short (B20 ns) delay line segments. Linear detectors with continuous delay lines can be read out using an additional 16-channel delay

are, however, still the best choice (see e.g. Ref. [1]). Improvements in the optics of conventional sources nowadays allow a range of time resolved measurements on synthetic polymers and the relatively longer measurement times also make gas detectors the preferred alternative. It can thus be expected that with simple readout systems such devices will continue to be useful in future. For many potential users the high end data acquisition systems used at large facilities, which have hitherto largely been based on the CAMAC or VME standards are too expensive and complex to maintain. Acquisition cards for laboratory sources tend, on the other hand, to have limited capabilities for simultaneously recording X-ray scattering patterns and ancillary data. Moreover, it is often desirable to be able to transport a familiar acquisition system to a large facility or to be able to use it in the laboratory during preparation of experiments. As part of an investigation of different alternatives for the readout of gas detectors we have developed a simple PC based data acquisition system for scattering experiments on non-crystalline systems, such as solutions of biological

PC

NIM modules Cathode

D A E T E Anode C T O Cathode R B

AMP

AMP

INTERFACE

D I S C

T D C

AMP

PCI6533

MUX /CTR

INH

FRM

PCI6602

V/F

EXT

TRIG

Fig. 1. Block diagram of the acquisition system shown here with a linear detector (AMP: preamplifiers, DISC: constant fraction discriminator (Phillips Scientific #715), TDC: time to digital converter, V/F: voltage to frequency converter), interface with multiplexer/counter (MUX/CTR). Details about the signals are given in the text.

ARTICLE IN PRESS W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

515

Table 1 Main specifications of the data acquisition system defined by the interface Maximum resolution (X and Y) of linear or area detector patterns Maximum number of frames Minimum frame length Maximum frame length Number of cycles Maximum cycle length Start input Trigger output Control level output Number of counter inputs (LEMO) TDC input Frame selection output (multiplexing of signals from two detectors) a b

TSC1002: 10 bits N110: 14 bits 64 K 500 msa 7 or 70 mina 1b 11.9 h Keyboard or external trigger (EXT) One pulse (TRIG) in a single programmable frame Single level started with TRIG and reset by INH 3 34 pin ribbon cable or NI68 pin cable Modulo 2 (2 outputs) and modulo 4 counters (4 outputs)

Depends on the minimum frequency of the input signal (For details see text). Multiple cycles will be implemented for linear detectors.

Fig. 2. Timing diagram of the INH and FRM signals generated with the PCI-6602 card.

module (DL1001, Smart Silicon Systems, Lausanne) and area detectors can be read out using two TSC1002 in master/slave mode.

2. Data acquisition In time resolved measurements time is sliced in a number of alternating wait frames, during which no measurement takes place, and active frames. The complete set of frames defines a cycle. Most measurements consist of one cycle but for reversible systems or systems where the amount of sample is not limiting, several cycles can be accumulated to obtain better statistics. In the simplest case—static measurements—there is only

one cycle with a single wait/active frame. Traditionally time resolved X-ray scattering experiments are controlled by a time frame generator (TFG) in order to be independent of the speed of the computer. Ancillary data (e.g. intensity of the direct beam) are collected in the counters/memory of a calibration channel unit (CCU) driven by voltage to frequency converters. In the present system, the functions of the TFG and CCU are implemented with the PCI-6602 counter/timer card from National Instruments, which has eight independent counters. As illustrated in Fig. 2, counter 1 generates a single pulse (INH) corresponding to the duration of the cycle using the single pulse generation routine provided by the driver software. This signal gates two trains

ARTICLE IN PRESS 516

W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

of frame pulses with opposite polarity (FRM+ and FRM ) generated by counters 2 and 3 using the gated pulse train generation routine. As indicated in Fig. 1, the INH and FRM signals are used to control the interface between the TDC and the PCI 6533 card. Counters 4 6 on the PCI 6602 card are used to record ancillary data by counting the number of external TTL pulses (e.g. from the voltage to frequency converters) between the rising edges of the FRM+ and FRM pulses. At the rising edge of the FRM pulse the contents of these counters (i.e. the number of counts integrated over the previous active frame) is transferred to the software buffer. This is done with the buffered two-signal edge-separation routine, where the input signal is effectively used as an external clock for the counter. This method introduces some limitations on the framing rate due to the 32-bit onboard counter and the frequency range of the input signal. If the minimum input frequency is below the framing rate incorrect values will be obtained as some framing transitions will not be registered by the system. In our case the V/F has a frequency range of 0–1 or 0–10 MHz. To avoid overflow of the 32bit counter the duration of the active frames must thus be limited to between 7 and 70 min depending on the output frequency of the V/F. Finally, of the two remaining counters one is used to output a pulse (TRIG) in a single user-defined frame (e.g. to switch a device on or off) and one to receive an external pulse (EXT) used to start the data acquisition. The interface also provides the possibility to use the TRIG pulse to start a level which is reset by the INH signal at the end of a cycle.

For applications like the present one where there is a continuous input for defined periods, the PCI 6533 card is used to transfer data from the port to a circular buffer in the PC memory via DMA channels. In this double buffering mode the card starts writing data into the first half of the circular buffer, which the program can copy and process as soon as the device starts writing to the second half. When the second half is full the card returns to the first and overwrites the previous data, while the program processes the data in the second half. This process is repeated indefinitely until stopped. Double-buffered data acquisition is frequently used to implement continuous data input on a PC running under a non-real time operating system. Difficulties may occur at high count rates when the buffer is too small. In the present system, when the time to fill a half buffer on the PCI-6533 is shorter than the CPU time needed to process its content, some data are simply overwritten before being processed. Given a PC with even a modest configuration this can always be avoided by increasing the buffer size. As a rule of thumb smooth operation is obtained when the value of the buffer size in kbytes equals that of the count rate in kHz. Each data point acquired by the PCI 6533 card is a 32 bit number, where, as illustrated in Fig. 3, the two most significant bits define whether the word contains a frame number (00) or data (01, 10 or 11). The frame word (00) is generated by the interface using a counter which is driven by the FRM signal and reset by the INH signal as illustrated in Fig. 4. The 16 least significant bits of the frame word define the frame number. In the

Fig. 3. Bit format of the frame word and the data word for the N110 TDC and the TSC1002

ARTICLE IN PRESS W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

Start

FRM Count

INH

Reset

Sequence Engine

4X4 bit counter

# 32 B

Halt

0 1 2 3 4 5 1x2x3x4 2x3 3

#16 A TDC Data

517

TDC Data/ Frame number

A/B

8 X 4 bit MUX

#32 A

Strobe B

MUX

A/B Strobe

Fig. 4. Block diagram of the interface module generating the frame information under control of the PCI-6602.

data word the data of the X and Y channels are defined by 14 bits each in the case of the N110 TDC and up to three groups of 10 bits in the case of the TSC1002, depending on the mode of operation. The interface which is built into a 2U NIM module, outputs data only during the active frames (i.e. when the FRM level is low). The present version of the program histograms the data immediately, but this feature can be suspended for specific applications. In most practical cases, especially with linear detectors, the very large number of frames, which is available (64 K), can be used to compensate for the fact that, in contrast to the original CAMAC system [5], the duration of the wait and active frames are not individually programmable. The interface provides, however, the possibility of using any arbitrary framing sequence for the collection of X-ray data within the duration of a cycle defined by the INH level by using an external source for the FRM signal. The data from the PCI 6533 are decoded to obtain the number of the channel to be incremented in the histogram, which is plotted on the screen during the experiments and, if required, saved at the end of the cycle for further analysis. In the case of the TSC1002 the data are collected in 16 partially overlapping segments. The counts of equivalent channels must be reallocated to obtain

Fig. 5. Scattering pattern of a mat of linear polyethylene single crystals collected with the TSC1002 before (bottom) and after (top) reallocating the counts in equivalent channels [10]. The vertical lines in the lower pattern correspond to the unused first and last channel in each ASIC. The patterns have been displaced vertically for better visualization.

the final scattering pattern as illustrated in Fig. 5 for a typical scattering pattern of synthetic polymers. This feature is built into the program and the option exists to visualize and store the patterns in their final form or as original data. All patterns are stored in OTOKO format [6] or as ASCII lists.

ARTICLE IN PRESS 518

W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520 Enable PCI-6533

Enable PCI-6602 counters Enable PCI-6602 pulse generation

YES

Start upon external trigger?

NO

Check external trigger NO

External trigger detected?

YES

Start PCI-6602 pulse generation Start software clock Check cycle pulse status

Check PCI-6533 buffer

YES YES

Buffer half full?

NO

Process buffer/ Build histogram

Cycle ended?

NO Plot histogram

Stop software clock Stop PCI-6602 pulse generation Stop PCI-6602 counters

Stop PCI-6533

Fig. 6. Flow chart of the data acquisition program.

As illustrated in the flow chart in Fig. 6, once the acquisition program is started the PCI 6533 card is first enabled and waits for data. The PCI 6602 generates the INH and FRM signals which are used to synchronize the interface and the counters (4–6 in this case) which simultaneously start recording data from their inputs. The loop in the flow chart is only schematic since the Windows program, which is written in C and based on the NI-DAQ driver (National Instruments), is driven by messages (e.g. the message indicating that a half-buffer is full). The NI-DAQ driver is solely responsible for checking the status of the buffer (half buffer full or not) and sending messages. The data transfer rate is entirely determined by the DMA controller on the PCI 6533 card (13.3 MBauds for the N110-TDC in handshaking Level-Ack mode and 80 Mbauds for the TSC1002 in handshaking burst mode). The software is thus only responsible for processing and displaying the data from the interface module via the PCI 6533. This guarantees that all time critical actions are under hardware control.

3. Using two detectors It is often useful to record scattering patterns in different ranges of scattering vectors simultaneously (e.g. overlapping ranges to cover a larger range of scattering vectors, for example in solution scattering of proteins, or separate ranges as in simultaneous small and wide angle X-ray scattering (SWAXS) measurements on semi-crystalline polymers [7]. There are several approaches to this which differ significantly in cost and reliability: detectors connected in series and with their anode signals OR-ed with a single TDC and acquisition system, independent detector, discriminator sharing the TDC and acquisition system or two completely independent systems. In any case, as the preamplifiers on detectors cannot drive long lines it is necessary to keep the connections to the discriminators (Phillips Scientific #715) short. Failure to do so leads to selective loss of counts in areas of high count rate, which are only indirectly due to space charge effects. Indeed, as delay lines made from SMT

ARTICLE IN PRESS W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

519

Fig. 7. Scattering patterns of a sample of poly(e-caprolactone) recorded with a single linear detector (top) and with two linear detectors connected in series (bottom) at different total count rates. Note that, despite the lower count rate on the SAXS detector in the second case, the apparent space charge effects are more pronounced due to the resistance of the delay lines. The curves have been displaced for better visualization.

Fig. 8. Scattering patterns of Ag-behenate uncorrected for detector response, collected with two independent linear detectors in overlapping angular ranges and merged pattern (bottom). The number of data points has been reduced by a factor of three in the small angle region and two in the wide angle region.

components have a non-negligible DC resistance (7 O) the effects of the reduction of pulse heights due to space charge effects become more pronounced when detectors are connected in series. This is illustrated in Fig. 7 for a pattern of a synthetic polymer collected at different total count rates in the SAXS and SWAXS mode. Whereas the pattern collected with a single detector is hardly affected up to a total rate of 200 kHz, significant distortions arise above 80 kHz in the SWAXS pattern, collected without rejection of simultaneous events, which also result in an increase in the apparent background. Note that the wide angle X-ray scattering (WAXS) pattern is hardly affected. There is thus an advantage whenever possible to separate the two detectors without loosing the exact synchronization between them. The simplest way is to electronically delay the cathode signals by a time corresponding exactly to the delay of the delay line through which they would have passed if the two detectors had been connected in series and OR-ing all sets of signals sent to the TDC. Measurement of two independent scattering patterns allows one, however, to make full use of the resolution of the system. For static and slow

processes this can be done by multiplexing the signals of the detectors using, for example, a MX1001 multiplexer (Smart Silicon System, Lausanne), which alternatingly switches the two sets of three signals (anode and cathodes) of the two detectors under control of an external level, synchronized with FRM . For this purpose, the interface provides the outputs of a modulo 2 and a modulo 4 counter which can be driven by the FRM signal or a level controlled by TRIG and reset by the INH signal. These signals can be used to collect two groups of frames each corresponding to one detector during the same cycle. This is also useful because the count rates in the WAXS detector are often nearly an order of magnitude higher and the data collection times can be correspondingly shorter. If their angular ranges overlap, the patterns are easily merged by software as illustrated in Fig. 8. With a relatively inexpensive data acquisition system like the one above it becomes possible to use two independent systems operating in a master–slave mode. This option, which provides the best spatial and temporal resolution, is easily implemented using the EXT and TRG signals (counters 7 and 8 of PCI 6602).

ARTICLE IN PRESS 520

W. Shang et al. / Nuclear Instruments and Methods in Physics Research A 530 (2004) 513–520

diodes or photomultipliers or other sources of ancillary data. The examples above illustrate that this simple and inexpensive system covers most applications encountered in time resolved X-ray detection.

5. Note added in proof Fig. 9. Cut-out (436  181 pixels) of a diffraction pattern of collagen collected with an area detector and a N110 TDC, displayed on a logarithmic scale using the program OTOKOBMP.

The final version of the program implements buffered semiperiod counting for the PCI 6602 card, to make the minimum frame length (5 ms) independent of the frequency of the input singal.

4. Area detectors The N110 TDC can readily be used to collect data with area detectors. The use of the TSC1002 for area detectors is only justified with segmented delay line detectors. An example of a fibre pattern (collagen) collected with the N110 TDC and a standard area detector [8] is shown in Fig. 9. During data collection the images can be displayed using a simple false colouring algorithm [9] or in grey scale. A single data acquisition system can be used with two area detectors using multiplexers. With two systems working in master/slave mode it becomes, if necessary, possible to use any combination of linear and area detectors without loss of synchrony. Although the system has been designed for the N110 and TSC1002 time to digital converters, it is easily transferable to any device which is compatible with the PCI 6533. The software can also be configured to run with the PCI 6602 card only. This then provides a fast acquisition system for a variety of applications including those relying on point detectors like ionization chambers, photo-

References [1] R. Neutze, R. Wouts, S. Techert, J. Davidsson, M. Kocsis, A. Kirrander, F. Schotte, N. Wulff, Phys. Rev. Lett. 87 (2001) Art. No. 195508 1. [2] M.H.J. Koch, C. Boulin, F. Briquet-Laugier, A. Epstein, S. Sheldon, E. Beloeuvre, A. Gabriel, C. Herv!e, M. Kocsis, A. Koschuch, P. Laggner, W. Leingartner, C. de Raad Iseli, T. Reimann, F. Golding, K. Torki, Nucl. Instr. and Meth. A 467–468 (2001) 1156. [3] C. Herv!e, K. Torki, Nucl. Instr. and Meth. A 481 (2001) 566. [4] C. de Raad Iseli, T. Reimann, F. Golding, C. Boulin, A. Epstein, E. Beloeuvre, A. Gabriel, M.H.J. Koch, Nucl. Instr. and Meth. A 467–468 (2001) 1152. [5] J. Bordas, M.H.J. Koch, P.N. Clout, E. Dorrington, C. Boulin, A. Gabriel, J. Phys. E. 13 (1980) 938. [6] C. Boulin, R. Kempf, M.H.J. Koch, S.M. Mc Laughlin, Nucl. Instr. and Meth. A 249 (1986) 399. [7] G. Rapp, A. Gabriel, M. Dosi"ere, M.H.J. Koch, Nucl. Instr. and Meth. A 357 (1995) 178. [8] A. Gabriel, F. Dauvergne, Nucl. Instr. and Meth. 201 (1982) 223. [9] D.J. Thomas, J. Appl. Cryst. 22 (1989) 498. [10] S. Hocquet, M. Dosi"ere, A. Thierry, T.B. Lotz, M.H.J. Koch, N. Dubreuil, D.A. Ivanov, Macromolecules 36 (2003) 8376.