Development of EPICS-Based Data Acquisition system for Beam Loss Monitor and sX-map

Beam commissioning is underway at KEK’s Superconducting RF Test Facility (STF). Since beam diagnostics are important to realize stable operation, we have developed a time-resolved beam loss distribution monitor as one of the beam diagnostics. This monitor uses up to 16 PIN photodiodes as X-ray sensors to observe X-rays generated due to beam loss of a pulsed beam with a width of approximately 800 μs, which is divided into 100 μs intervals. Thus, 128 data can be acquired per bunch. The data is read out by an EPICS-based data acquisition system. On the other hand, we are also developing an EPICS-based data acquisition system for an inspection method for the superconducting cavities(sX-map) for the vertical test of bare cavities. sX-map strips are inserted inside the stiffener ring at the iris of superconducting cavities. In this presentation, an overview of these EPICS-based data acquisition systems and their integration with the existing control system will be presented.


STF
At the STF, technology development and performance testing of superconducting cavities and cryomodules for the International Linear Collider (ILC) has been conducted since 2006.The programs called STF-1, S1-Global, Quantum Beam, and STF-2 have been implemented and the STF-2 program is currently underway [1].STF-2 operated the first beams during February and March 2019 and demonstrated results that satisfy the specifications for ILC. Figure 1 shows the STF tunnel and cryomodules.

Beam Commissioning
In 2021, the beam pulse width of 100 µs of electron beam acceleration with an acceleration gradient of 31 MV/m has been successfully achieved.In 2022, we aim to accelerate electron beams with a beam pulse width of 726 µs, which is the beam requirement at the ILC.To achieve beam acceleration with a beam pulse width of roughly 1 ms, the increase in beam emittance and beam loss must be minimized.

Beam Loss Monitor (BLM)
BLMs using Cherenkov light to check the time structure of beam loss have already been installed.Therefore, an integrating BLM that could cover both the beam pulse width of about 1 ms and the beamline length between cryomodules of about 9 m was desired.Thus, a BLM using photodiodes to detect X-rays generated by beam loss was developed and installed in the beamline.Figure 2 shows the sensor head of BLM installed at the beamline.The sensor head consists of a photodiode, an SMA connector, and a cover that shields the light.Since the STF uses EPICS [2] for the accelerator control, it is beneficial in terms of integrated operation with the control system if the beam loss monitor readout system is an EPICS system.This led to the development of an EPICS-based readout system for the newly introduced BLM, which was also used for the sX-map described in the next section.
2. sX-map sX-map is an inspection method for superconducting cavities [3].sX-map stands for stiffener or strip X-map.sX-map detects X-rays generated from field-emitted electrons outside the cavity in the vertical test described below.

Vertical Test
In the vertical test, the fabricated superconducting cavities are evaluated for RF performance at 2K temperature.In the vertical test, the superconducting cavity is held in a cage, inserted into a dewar, and immersed in liquid helium; tests are performed to evaluate the acceleration gradient and cavity quality factor by supplying RF power.Figure 3 shows an offline test of sX-map for the vertical test of a superconducting cavity.As shown in Fig. 4, a sensor strip is inserted under the stiffener ring to observe X-rays emitted from the area bombarded by electrons due to field emission.

sX-map System
The sX-map system consists of a sensor unit that detects X-rays, a signal readout unit, and a data display unit.Figure 5 shows the sensor strip of sX-map.This sensor strip is inserted inside the stiffener rings at the iris of super-conducting cavity at the vertical test.

Readout System
The basic configuration of the readout system is almost the same for both BLM and sX-map.

Equipment Configuration
The readout system consists of Black Pill (BP) [4] and Raspberry Pi4(RP4) [5].BP is a development board with STM32F411CE[6], which accumulates and transfers ADCs data to RP4  via a USB interface.The RP4 functions as an EPICS IOC and an Ubuntu server 20.04 LTS (64bit) is running on RP4.RP4 converts data sent via USB into EPICS format and forwards it to the network.Figure 6 shows a block diagram of the readout system for BLM.
In the case of BLM, 16 external high-speed ADCs are used to convert 16 integrated analog signals from the sensors at a rate of 10 MHz.Three boxed readout units were provided in addition to the bare-board prototype unit.Each has 16 ADCs, for a total of 64 channels of ADCs. Figure 7 shows readout boxes of BLM.
In the case of sX-map, the number of ADC channels is 324 when the number of strips is 10 (up to 16 strips is assumed).The STM32F411's built-in 12-bit ADC performs multiple conversionaccumulation and captures the averaged values.By oversampling, 12-bit data is converted to 16-bit.

Readout Scheme
For BLM, 16 channels of data are collected every 100 µs for 800 µs, and a chunk of 128 data is transmitted after each pulse.One channel of data is expressed in 4-character HEX, which means that 512 characters of data are read at a time.The acquisition rate is 5 Hz.
In the case of sX-map, 324 channels of data are transferred to a single RP4.One channel   access format, and transfers the data to the network via the Ethernet interface.
3.3.EPICS EPICS7 (Ver.7.0.6) has been adopted.Using the waveform type EPICS record, all data is sent to the network in one EPICS record.Data sent in waveform types are displayed as time-divided data for individual channels.Because EPICS is a network-distributed system, BLM data can be monitored from multiple locations simultaneously.

Graphical User Interface
In the case of BLM, a Java-based display screen was developed.Figure 8 shows the measurement data display screen of BLM actually in use for beam commissioning.As shown in Fig. 8, time-resolved data for each channel is displayed.Through the same information infrastructure, which is EPICS, the operator can control the accelerator while viewing the BLM data during beam commissioning.

Performance
In the case of BLM, RP4 handles 640 data per second and in the case of sX-map handles 3240 data per second.In the past, general computer systems were often used for this of kind purpose, but RP4 was shown to be sufficient to meet the requirements.

Stability
Four RP4s were installed and started operation in the STF tunnel at the end of November 2022 for the STF-2 beam commissioning in 2022.During approximately one month of operation, one unexpected RP4 malfunction occurred on December 22, 2022.The cause of the failure was RP4 for a prototype BLM unit installed upstream and closest to the beamline without special radiation protection.The other three units were placed in a radiation-shielded area.The control network was disrupted, and after investigation, the RP4 was found to be the cause.It is believed that it was a so-called soft error caused by radiation and will be investigation in detail in 2023.

CONCLUSION
An EPICS-based readout system has been developed for beam loss monitor used in STF-2 beam commissioning.And a similar technique is being used to develop an sX-map readout system for use in the vertical test of superconducting cavities.The acquired data is transmitted over the network using EPICS channel access, and the user interface for displaying the data was developed in Java.And the readout system developed uses RP4 instead of a general computer system.The RP4 is expected to contribute to a smaller size and lower power consumption compared to a general computer system.During the month-long STF-2 beam commissioning operation, there was one malfunction, probably due to a soft error caused by radiation.An implementation for automatic recovery in the event of a malfunction will be tested on the sXmap readout system.A paper with more detailed information on sX-map will be submitted separately.

Figure 2 .
Figure 2. Sensor head of the beam loss monitor attached to the beam pipe.Radiation-resistant cable is used for connection to the readout box.

Figure 3 .
Figure 3. Offline test of sX-map before the vertical test of a superconducting cavity at JLab.

Figure 4 .
Figure 4. sX-map strip inserted under the stiffener ring of the superconducting cavity at the vertical Test.

Figure 5 .
Figure 5. Latest version of sX-map sensor strip for detecting X-ray generated by field-emitted electrons.

Figure 6 .
Figure 6.Block diagram of readout system for BLM.

Figure 7 .
Figure 7. Readout boxes of beam loss monitor.RP4 is fixed on the top cover and BP is on the control board.Four ADCs are mounted on a daughter board and four daughter boards are on the control board.

Figure 8 .
Figure 8. Graphical user interface of beam loss monitor.

Table 1
summarizes the readout parameters.