A Versatile Board for Event-Driven Data Acquisition
Abstract
:1. Introduction
- A more flexible triggering mechanism incorporating not only external trigger sources, but also internal triggers generated by given conditions on the signal level, in order to automatically start an event readout, possibly triggering other devices.
- An ROI size not constrained to the internal memory size, but one that is able to sustain post-trigger samples streaming. In this scenario, the number of pre-trigger samples will still be limited by the size of the circular memory buffer, but the number of post-trigger samples is no longer limited by such size, provided the data transfer rate can withstand the sampling frequency.
- A flexible usage of internal and external clocks. External clocks are required to ensure timing consistency among waveforms acquired by different devices, because of the unavoidable clock drift when using internal clock sources. However, the timing system currently used in the test facility limits the frequency of the distributed clock to 1 MHz, and data acquisition at higher frequencies would require PLL in order to be locked in phase. When handling event-driven data acquisition, in our case, it is important to discriminate events and to discard events that are triggered by spurious noise rather than by real physical events. Events recorded by different devices within a time window of 1 µs can be safely assumed to be originated by a real event, taking into account the dimension of the experimental plant (~100 m) and the speed of light. Timestamping event occurrence based on the 1MHz external clock provides, therefore, enough precision without implementing additional PLLs. Moreover, internal clocks can be used for fast data acquisition during the ROI interval, being the clock drift among devices negligible within the ROI time window.
- Availability of high-speed ADC converter. The 125 MHz sampling speed that can be achieved for two ADC channels available in the RP board is adequate for capturing the relevant information, such as rise time, overshoot and oscillations.
- Zynq architecture. The Zynq SoC used in the RP board is well suited for our applications, where fast signal handling, such as triggering and circular buffer management, is carried out in FPGA, and other functions, such as overall management and data transfer, are carried out by the embedded ARM processor. The available RAM (2 or 4 GB) allows temporary data storage, and the 1Gbit Ethernet connection allows full remote control.
- Reduced cost. Cheap solutions are always preferred over expensive ones, but in our case, this fact is further stressed as the RP boards are hosted in a hostile environment with high risk of electrical damage, such as the 1 MV high-voltage deck. As a consequence, a mortality rate due to electrical discharges has to be taken into account.
- Reduced board form factor and insulation capability. The overall design of the RP board is meant to replicate the success of small-factor devices, where solutions that are easy to carry and plug represent a key to success. This proved to also be effective within our experimental environment, where a spread location deployment is needed to acquire data in a large facility, and where the high-voltage application very often asks for a strong electrical insulation. In these situations, we indeed used the complete RP as an isolated device, linked with the network via fiber media converters and powered with separated isolation transformers or even with battery supply.
2. Motivations
- Limits in the available functions, confined to the available components in the framework. Despite the richness of the component toolbox, no available component could fit our specific requirements.
- Limits in performance. Performance is a key factor in our project because the event-driven acquisition must be able to face cascades of events that may occur at a high rate. While the frameworks allow composing components, the way data flow is managed is transparent to the user and cannot be optimized.
3. Architecture
- Pre- and post-trigger samples: samples before and after the trigger to be acquired. While the number of pre-trigger samples is limited by the dimension of the used circular buffer (block memory), the maximum number of post-trigger samples is, in principle, unlimited, provided the data flow rate in the readout is fast enough to avoid the circular buffer overflow (see below).
- Trigger mode: specifies the trigger logic. It can be an external digital signal or internally detected, based on some conditions on the level of the input signal, in this case; however, an external trigger must be provided in order to enable the triggering logic and to properly timestamp trigger occurrences. The trigger can be single, i.e., the device is triggered once after being armed, or multiple, i.e., the device is allowed to be quickly retriggered after the ROI has been acquired.
- Clock mode: specifies how acquired samples are timestamped. Its possible values are
- ○
- Internal: sampling and trigger timestamping are derived from the internal 125MHz FPGA clock. The lower sampling speed is specified via a clock divide register.
- ○
- External: sampling and trigger timestamping are derived from an external clock signal.
- ○
- External trigger: sampling is driven by the (possibly divided) internal clock, while trigger timestamping is derived from an external clock signal. This feature is useful in our application for long-lasting event acquisition, where sporadic events must be recorded over a long period (up to one hour). The acquisition of the single events requires high sampling frequency, much larger than the 1 MHz external clock reference used for inter-module synchronization. In this case, event timestamping is based on the external clock, while the high-frequency sampling clock is internally generated.
- (a)
- Directly to the Linux driver via a FIFO component (XILINX AXI Stream FIFO IP [15]) mapped onto memory registers. An interrupt is generated when data are available, and then the FIFO is directly read by the driver code.
- (b)
- Via Direct Memory Access (DMA). In this case, the DMA controller will issue an interrupt when the ROI has been acquired.
4. Data Transfer Performance
- 1.
- Burst overflow, occurring when data coming from a single burst (whose size is PreTriggerSamples + PostTriggerSamples) are transferred to the readout FIFO in a time that is too short in respect to that required for reading data from the FIFO. This occurs when a very high sampling frequency is selected and the sum of pre and post samples exceeds the size of the readout FIFO that has been set to 16 kBytes due to the limitation of available FPGA memory resources in the Zynq 7010 System used in the RP board.
- 2.
- Streaming overflow that occurs when the average data throughput, i.e., the event occurrence frequency multiplied by the burst size, is larger than the average data transfer from the readout FIFO.
- 1.
- Carrying out control computation directly in FPGA. This solution allows for the fastest control but is limited in computation. Simple PID control can be implemented in this way (and indeed PID blocks are available in the PyRPL toolkit), but more complex algorithms requiring floating point computation cannot be implemented directly in FPGA.
- 2.
- Carrying out control computation in the embedded ARM processor. In this case, it is necessary to transfer data from the FPGA into processor memory and vice versa.
5. Data Integration
6. Applications
- 1.
- Spectral analysis of the Radio Frequency sources. In this measurement, the RP board has been used to provide, in real time, spectral analysis of signals from the Radio Frequency (RF) source used to ionize hydrogen in the beam source. In this application, FFT analysis is performed on the fly during data acquisition in order to acquire spectral information of the acquired RF signal. This is achieved by acquiring at high speed (125 MHz) bursts of data samples that are triggered at a constant rate of 1 kHz. The acquired bursts are then transferred in real time to the ARM processor, where FFT analysis is carried out on the fly for that bunch of data and then transferred to the central CODAS via the network.
- 2.
- Beamlet current measurement. The H− ion current beam accelerated by the acceleration grids has been divided in a number of beamlets that cross the grids. Figure 4 shows the holes in the acceleration grids for letting the beamlets traverse it.
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Toigo, V.; Dal Bello, S.; Bigi, M.; Boldrin, M.; Chitarin, G.; Grando, L.; Luchetta, A.; Marcuzzi, D.; Pasqualotto, R.; Pomaro, N. Progress in the ITER neutral beam test facility. Nucl. Fusion 2019, 59, 086058. [Google Scholar] [CrossRef]
- ITER Home Page. Available online: https://www.iter.org/ (accessed on 9 January 2024).
- Luchetta, A.; Taliercio, C.; Cruz, N.; Martini, G.; Manduchi, G.; Rigoni, A.; Trevisan, T.; Paolucci, F.; Labate, C.; Breda, M.; et al. As built design of the control systems of the ITER full-size beam source SPIDER in the neutral beam test facility—A critical review. Fusion Eng. Des. 2023, 191, 0113624. [Google Scholar] [CrossRef]
- CAEN DT2740 Digitizer Web Page. Available online: https://www.caen.it/products/dt2740/ (accessed on 26 February 2024).
- RedPitaya Home Page. Available online: https://redpitaya.com/ (accessed on 9 January 2024).
- SCPI Server. Available online: https://redpitaya.readthedocs.io/en/latest/appsFeatures/remoteControl/scpi.html (accessed on 9 January 2024).
- Gjura, M.; Batagelj, B. A Simple Infrared (IR) Optical Wireless Communication (OWC) Interface attached to a low-cost open-source measurement and control instrument—Red Pitaya. In Proceedings of the 30th International Conference on Systems, Signals and Image Processing (IWSSIP), Ohrid, North Macedonia, 27–29 June 2023. [Google Scholar]
- Ruiz-Vargas, A.; Arkwright, J.W.; Ivorra, A. A portable bioimpedance measurement system based on Red Pitaya for monitoring and detecting abnormalities in the gastrointestinal tract. In Proceedings of the 2016 IEEE EMBS Conference on Biomedical Engineering and Sciences (IECBES), Kuala Lumpur, Malaysia, 4–8 December 2016. [Google Scholar]
- PyRPL Home Page. Available online: https://pyrpl.readthedocs.io/en/latest/ (accessed on 9 January 2024).
- Neuhaus, L.; Metzdorff, R.; Chua, S.; Jacqmin, T.; Briant, T.; Heidmann, A.; Cohadon, P.; Deléglise, S. PyRPL (Python Red Pitaya Lockbox)—An open-source software package for FPGA-controlled quantum optics experiments. In Proceedings of the 2017 European Conference on Lasers and Electro-Optics and European Quantum Electronics Conference, Munich, Germany, 25–29 June 2017; Optica Publishing Group: Washington, DC, USA, 2017. [Google Scholar]
- Preuschoff, T.; Schlosser, M.; Birkl, G. Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya). Rev. Sci. Instrum. 2020, 91, 083001. [Google Scholar] [CrossRef] [PubMed]
- Wiegand, B.; Leykauf, B.; Jördens, R.; Krutzik, M. Linien: A versatile, user-friendly, open-source FPGA-based tool for frequency stabilization and spectroscopy parameter optimization. Rev. Sci. Instrum. 2022, 93, 063001. [Google Scholar] [CrossRef] [PubMed]
- Lagrange, D.; Mauran, N.; Schwab, L.; Legrand, B. Low Latency Demodulation for High-Frequency Atomic Force Microscopy Probes. IEEE Trans. Contr. Sys. Tech. 2021, 29, 2264–2270. [Google Scholar] [CrossRef]
- XILINX Block Memory Generator. Available online: https://www.xilinx.com/products/intellectual-property/block_memory_generator.html (accessed on 9 January 2024).
- XILINX AXI Streaming FIFO. Available online: https://www.xilinx.com/products/intellectual-property/axi_fifo.html (accessed on 9 January 2024).
- XILINX Vivado Design Suite. Available online: https://www.xilinx.com/products/design-tools/vivado.html (accessed on 9 January 2024).
- Rigoni, A.; Manduchi, G.; Luchetta, A.; Taliercio, C.; Schroeder, T. A framework for the integration of the development process of Linux FPGA System on Chip devices. Fusion Eng. Des. 2018, 128, 122–125. [Google Scholar] [CrossRef]
- Shepherd, A.; Pouradier-Duteil, B.; Patton, T.; Pimazzoni, A.; Garola, A.R.; Sartori, E.; Serianni, G. Initial Results From the SPIDER Beamlet Current Diagnostic. IEEE Trans. Plasma Sci. 2022, 50, 3906–3912. [Google Scholar] [CrossRef]
- Patton, T.; Shepherd, A.; Pouradier Duteil, B.; Rigoni Garola, A.; Brombin, M.; Candeloro, V.; Manduchi, G.; Pavei, M.; Pasqualotto, R.; Pimazzoni, A.; et al. Design and Development of a Diagnostic System for a Non-Intercepting Direct Measure of the SPIDER Ion Source Beamlet Current. Sensors 2023, 23, 6211. [Google Scholar] [CrossRef] [PubMed]
- Duteil, B.P.; Shepherd, A.; Patton, T.; Garola, A.R.; Casagrande, R. First characterization of the SPIDER beam AC component with the Beamlet Current Monitor. Fusion Eng. Des. 2023, 190, 113529. [Google Scholar] [CrossRef]
- Bastos, M.C.; Fernqvist, G.; Hudson, G.; Pett, J.; Cantone, A.; Power, F.; Saab, A.; Halvarsson, B.; Pickering, J. High accuracy current measurement in the main power converters of the large hadron collider. IEEE Instrum. Meas. Mag. 2014, 17, 66–73. [Google Scholar] [CrossRef]
- Ziegler, S.; Woodward, R.C.; Iu, C.; Borle, L.J. Current Sensing Techniques: A Review. IEEE Sens. J. 2009, 9, 354–376. [Google Scholar] [CrossRef]
- Available online: https://content.redpitaya.com/blog/red-pitaya-finding-its-way-in-the-world-of-nuclear-fusion (accessed on 8 January 2023).
Component | ioctl Commands | Comment |
---|---|---|
Register | <device>_GET_<register> <device>_SET_<register> | Configuration registers declared in the FPGA configuration are mapped against pairs of ioctl() commands for reading and writing the 32 bit register value. <device> is the name assigned to the whole device. <register> is the name assigned to the register in the FPGA configuration |
DMA Controller | <device>_SET_DMA_BUFLEN <device>_GET_DMA_BUFLEN <device>_ARM_DMA <device>_START_DMA <device>_STOP_DMA <device>_GET_DMA_DATA | If a DMA controller is declared in the FPGA configuration, the corresponding set of ioctl commands is generated |
FIFO interface | <device>_CLEAR_<fifo> <device>_GET_LEN_<fifo> <device>_GET_VAL_<fifo> | For every declared FIFO in the FPGA configuration, the corresponding set of ioctl commands is generated. If one FIFO instance is used for synchronizing data readout (i.e., not using DMA), the generated read() implementation will synchronize on data availability for that FIFO. <fifo> is the name assigned to the FIFO component in the FPGA configuration. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Manduchi, G.; Rigoni, A.; Trevisan, L.; Patton, T. A Versatile Board for Event-Driven Data Acquisition. Sensors 2024, 24, 1631. https://doi.org/10.3390/s24051631
Manduchi G, Rigoni A, Trevisan L, Patton T. A Versatile Board for Event-Driven Data Acquisition. Sensors. 2024; 24(5):1631. https://doi.org/10.3390/s24051631
Chicago/Turabian StyleManduchi, Gabriele, Andrea Rigoni, Luca Trevisan, and Tommaso Patton. 2024. "A Versatile Board for Event-Driven Data Acquisition" Sensors 24, no. 5: 1631. https://doi.org/10.3390/s24051631
APA StyleManduchi, G., Rigoni, A., Trevisan, L., & Patton, T. (2024). A Versatile Board for Event-Driven Data Acquisition. Sensors, 24(5), 1631. https://doi.org/10.3390/s24051631