-
The experimental platform of the Schottky resonator at CSRe focuses on the information in the frequency domain, e.g., revolution frequencies and phases of the ions[6]. DAQ system, consisting of a spectrum analyzer and an in-phase and quadrature(IQ) data recorder, is enough to extract the required information. The resonant frequency of the Schottky resonator is 243±2 MHz[9]. The required frequency span is expected to be within 6 MHz. The R&S FSVR 7 spectrum analyzer, which provides the frequency range from 10 kHz to 7 GHz to sufficiently cover the typical frequency span in measurements[10], samples and digitizes the input signals as the frequency analysis required. We chose the R&S IQR 100 IQ recorder to record and export data files to the server. It has a high-volume (1 TB) solid-state drive(SSD) to bypass the memory limit for the single file size, which satisfies the demand of the acquisition of data files in both large size and large amount for decay events[11].
Since, due to the unavailability of the on-site instrument operations during the in-beam experiments, and the inefficient and inconvenient native remote desktops, the designing of a remote control system is laid out. The preliminary system with a command-line interface (CLI) has been established in 2016[12]. In the beam time of 2016 and 2017, it has successfully collected hundreds of valid data files without any interruption.
However, the shortcomings of CLI, i.e., are inconvenient and unintuitive operations for the users and the occasional freezing of the operating system of the IQ recorder appeal to an upgrade of the preliminary system. A new system has been developed in 2018 to strengthen the reliability and stability, as well as to provide a convenient and intuitive man-machine interface[13].
Moreover, an independent trigger system to appropriately initiate the DAQ, and a remotely controllable button pusher for the IQ recorder are supplementary for the whole system to run smoothly.
Combining all these components as shown in Fig. 1, the experimental platform has been finally deployed with the connections of signal and network cables.
2.1.
The DAQ software
-
To reinforce the maneuverability of the DAQ system of the Schottky resonator, an applicable and user-friendly graphical user interface(GUI) has replaced the preliminary CLI and has been in utilization since the beam time of Jan. 2018. Besides the fundamental functions realized by CLI, all required acquisition parameters can be directly set in the GUI version. It also provides different file-collecting modes and trigger modes to adapt to various experimental situations.
2.1.1.
Interface structure
-
The main functions of the DAQ software include the visualization of the processing status and the operation controls of the DAQ devices. Therefore, the GUI interface, displayed in Fig. 2, is divided into three units for the status display, the parameters setting, and the control buttons, respectively.
Several areas spread out the GUI as the function unit of status display. At the top of the GUI locates the group of progress bars of the devices status and the current acquired file information. Different colors of the progress bar emphasize a particular status—red for ‘wait to start’, orange for ‘work in process’, and green for ‘work finished’. The labels next to the progress bars are updated immediately before recording the file with the ordinal number of the total files and the file name formed with the timestamp of the beginning of the collection. At the bottom of the GUI locates an acquisition log with the detailed time information and the status bar for the feedback of current operation.
The input bars for the four customized parameters are placed in the middle of the GUI. These four are very crucial for the acquisition, i.e., ‘center frequency’ aims at the target ions, ‘span’ to determines the sampling rate, ‘reference level’ ensures an appropriate magnitude of signals, and the ‘duration’ covers a whole experimental event. The combination of a check box and an input bar for the maximum file number performs as the switch for a limited acquisition by a fixed number.
The buttons with intuitive icons control the corresponding tasks of changing mode or starting a job. The button with finger icon is the switch between the auto-trigger mode with a plain effect and manual trigger mode with a pressed effect. The button for the parameters setting employs these effects as well to show whether the parameters are applied or not. The button sharing the functions of executing and terminating the whole acquisition process expresses the particular operation with the play and pause icons, respectively. Besides, a special hotkey is set to guarantee a safe exit of the program when all the processes are finished. The usual cross at the top right corner implements the force quit.
2.1.2.
Program design
-
The DAQ interface is required to deal with the interaction between the users and the system as well as the interaction between the system and the DAQ devices simultaneously, which leads to a dual-threaded GUI program. Since each particular operation of the DAQ devices is supposed to run one by one, thus a modular structure contributes in handling the operation sequence. The control flow of the DAQ system is shown in Fig. 3. During the process of data acquisition, data first stream from the spectrum analyzer to the IQ recorder via the R&S wide standardized transmission protocol, and then is encapsulated into a data file, which is finally transferred to the server via the server message block(SMB) protocol. These procedures are controlled by the commands to the R&S instruments. The standard commands for programmable instruments(SCPI) from the server are packed in sockets and sent to the R&S instruments via TCP/IP protocol in the assigned processing module. Each processing module, as illustrated in Fig. 4, executes a process of the DAQ device in the DAQ thread, and updates the status of the corresponding GUI elements in the GUI thread. The flexible and high-performance GUI for the system is implemented with PyQt5, the Python wrapper of Qt5. Being benefited from the features of PyQt5, the signal-slot callback technique builds the connection between two threads. The signals with the current status of DAQ operations hook the slot functions of updating the GUI elements. Moreover, the dual-threaded modular programming helps to conduct the interface with high stability and maintainability.
2.2.
The data monitor
-
The data acquisition system would not be completed if no data monitoring measures are taken. Being deployed on the server, the data monitor runs continuously to watch the upcoming data files and display the information therein in real time[14]. This is necessary and also advantageous for the prompt adjustment of the experimental condition so as to maximize the beam-time efficiency.
Since for the Schottky spectroscopy, the information can best be interpreted in the frequency domain, the fast Fourier transform(FFT) is crucial to deal with the raw data taken in the time domain. The data monitor utilizes the PyFFTW, a Python wrapper of the popular FFTW library, to perform the FFT. The data monitor also provides various options to properly estimate the power spectral density of the digitized RF signal from the Schottky resonator. The users can select from the periodogram estimate[15], the modified periodogram with common windows, the Welch's overlapped segment averaging[16], and the Thomson's multitaper estimate[17]. These methods all have variants in one-dimensional(1D) and two-dimensional(2D) forms to produce a frequency spectrum or a time-frequency spectrogram, where the latter is more suitable to observe a dynamic process like the $ \beta $-decay.
For the sake of convenience, the interface of the data monitor is also based on a user-friendly GUI, of which a typical screenshot is shown in Fig. 5. After a data folder has been specified, the data monitor lists all the archived files within that folder on the right column of the GUI. By default, the GUI automatically refreshes once a new file has arrived at the server. It is, however, possible to disable this feature in case one would like to look into the file in the history. The plots of the currently selected file in both time and frequency domains are displayed on the left and central columns of the GUI. The time plot shows the magnitude of the in-phase and quadrature components of the raw data[18]. It is critically important to reveal whether the reference level for the data acquisition is adequate. That is, e.g., a clipped spectrum implies a deficient reference level, which should be increased immediately in the data acquisition GUI. Also, in the displayed frequency spectrum and the time frequency spectrogram, 1D plot can be taken as a slice from the 2D plot. It can be obtained by dragging the white thin horizontal line in the 2D plot and the 1D plot is updated accordingly.
The program of the GUI is implemented by taking advantage of PyQt5 and PyQtGraph. Thanks to the signal-slot technique provided by PyQt5, the computation-heavy and time-consuming FFT subprocess is diverted to a separate thread in order to keep the GUI responsive to the user operations. The displayed plots can smoothly be zoomed, moved, and scaled, also owing to the particular optimization of the PyQtGraph for the real-time plotting. In addition, a crosshair is provided to precisely read values from the plots, which can be observed at the bottom of the GUI.
2.3.
Additional components
-
Utilizing only a spectrum analyzer and an IQ recorder is enough for collecting one data file. However, issues of fully relying on these two devices emerged during the continuous trigger mode.
The procedure of saving one data file in an IQ recorder might not be launched and the whole processing might get stuck after several times of triggering when working under the built-in External Trigger mode. Since it is non-expected for the R&S IQ recorder and is caused by a designed flaw of the original field-programmable gate array(FPGA), an additional independent trigger system is in high demand.
The occasional blue screen of the death(OBSD) of the IQ recorder in a long-term run is another problem. To remotely reboot the IQ recorder during the valuable beam time is on the agenda. Considering the state of the IQ recorder depending on both the AC power switch at the rear panel and the state of the standby key at the front panel[11], a controllable button pusher is implemented to help to reboot.
2.3.1.
Independent trigger system
-
The waveform of the trigger signal for the beam injection approximates a TTL signal with jitters. It has a rapidly falling edge from 4 to 0 V and a width of 50$ \mu {\rm s} $.
Considering the manual trigger is the only reliable choice in the long-time working of the IQ recorder, a proper trigger system may call the server for executing the acquisition when the TTL signal is at the falling edge.
To implement this idea, we choose an open-source microcontroller board Arduino Yún with the ability of reading the analog input and supporting a Linux distribution. The onboard Ethernet port builds a bridge of communication between the board and the server.
To detect the falling edge of the signal, a circuit in which two identical resistors of 1 kΩ and a diode are connected in series was designed. The divided voltage of one resistor is fed into the analog input of the board for measurement, instead of total voltage from the trigger signal, to protect the board from being burned by an excessive instantaneous voltage. The diode is to rectify a potential reverse current caused by jitters from the trigger signal. The completed trigger system and a dustproof box are displayed in Fig. 6.
Due to occasionally unstable power supply during the beam time and low voltage TTL(LVTTL) of the microcontroller varying in a relatively large range according to the power input, directly converting the trigger signal to the digital level could not always catch the right trigger in the long-term run. Therefore, we turned out to use an analog comparator to detect the falling edge. The analog comparator only compares to a threshold, which turns to be a fast and safe scheme[19]. When the TTL signal is lower than a particular voltage, i.e., the falling edge is detected, the analog comparator responds to quickly pop a separate interrupt. Then the native library Bridge of the Arduino will set up and run the Linux shell-command netcat to send triggered message to the server. This version of independent trigger system has been applied since the beam time of 2017.
2.3.2.
Remotely controllable button pusher
-
For the design of the pusher, the limited space provided for the motion of the pushing rod leads to a challenge of mechanism and manufacture. A step motor is always a priority for a micro-motion device. With the mechanism of the cam, which transforms the rotational motion of the eccentric wheel to the reciprocating linear motion of the rod, the pusher driven by the step motor can overcome this difficulty. A motor driver board of ULA2003A chip controls the step motor following the network commands from the remote server sent by the program, which is executed on the local microcomputer, the raspberry pi. Besides, the motor requires an extra power supply of 12 V. The whole connection of the components of the button pusher is illustrated in Fig. 7.
To provide an effective operation to the users, we built up a GUI with two display modes to control the button pusher, as Fig. 8 shows. The normal mode covers the basic operations of the pusher. Turning on the power button leads to a back-and-forth motion of the rod with a short pause in between, while the turning off requires a longer pause to wait for the power cut-off of the IQ recorder. The debug mode is intended for the calibration of the starting point of the rod. The position of the rod can be modified by setting the steps of the motor rotation. Only the assigned key combination can invoke this hidden mode.