Development of a new control interface for the electron gun pulser of TLS Linac

The electron gun control system, which serves as the TLS LINAC’s power source, has been in operation for more than two decades. Since some components of a previously designed circuit have aged and been discontinued, the control system will become unreliable and irreparable. A new control interface of electron gun pulser has been developed to improve the operational stability and future maintenance of the electron gun control system. To achieve remote control, an SBC (single-board computer) equipped with a high-precision AD/DA expansion board was used as a control interface. The signal processing circuit module generates the bias and b-plus voltages that are output to the electron gun and also provides instant feedback voltage readings. For easier maintenance, the new electron gun pulser control modules have been assembled into a single box. Furthermore, this software architecture of control interface has been based on the EPICS framework and integrated with an existing TLS control system. The efforts of rejuvenating electron gun pulser control system are described in this paper.


Introduction
The Taiwan Light Source (TLS) [1] of the National Synchrotron Radiation Research Center (NSRRC) is a third-generation synchrotron light source with an energy of 1.5 GeV.Electrons of the accelerator will be ejected from the electron gun of linear accelerator and accelerated by a series of accelerating elements before being transferred to the storage ring for stable storage.The TLS electron gun generates electrons by heating the cathode filament.Applying a grid-bias voltage will suppress the electrons at the cathode and applying a b-plus voltage will push them out.By applying a pulse signal to the grid in front of the cathode, electrons will be able to overcome the bias and emit electrons.
The components of the current electronic gun control system are as follows: The control computer is the VMbus-base ILC, the frequency voltage converter (F/V converter) outputs control voltage, the I/O controller sets and reads the bias and grid voltage, and the trigger unit controls the voltage applied to the electron gun grid.Since the current electron gun control system has been in operation for more than 20 years, several of its components are aging, which will decrease the system's stability.In addition, some of the parts utilized in the earlier designed circuit have been discontinued.Therefore, improving the stability of the electron gun control system and decreasing the difficulty of maintenance are critical to the accelerator's operation.
The next generation of home-made TLS electron gun pulser control interface is designed based on the EPICS [2] framework since the TLS control system is gradually converting to the EPICS framework.To provide the function of operating the electron gun, the new control system utilizes a single-board computer with AD/DA expansion board as an input-output controller (IOC).It can reduce the cost of equipment maintenance more than the VMEbus based control system.The advantage of its small size allows for the integration of the control module and circuit module into one case, which not only significantly reduces the equipment's space requirements and power requirements, but also enhances the convenience of future maintenance.

System architecture of the electron gun pulser
The existing TLS electron gun controller has been upgraded to an EPICS-based electron gun pulser control device.Related components include the external trigger signal source, operating computer, and graphical user interface (GUI), as well as the control module and signal processing circuit in the control box.The architecture of the control system is shown in Fig. 1.Since the control box will be installed on the -140 kV HV-deck, an optical fiber connection is required between the control box and devices outside the HV-deck devices in order to avoid high voltage from interfering with the transmitted data.The trigger signal is transmitted via optical fiber to the signal processing circuit in the box, which generates pulse impulses.A fiber media converter transforms the link between the ethernet network in the control box and the TLS control network into a fiber optic network to offer remote control ability.
Raspberry Pi [3] is a single-board computer (SBC) with 40 Pin general-purpose input/output (GPIO) and built-in ethernet.It can run programs developed using the EPICS framework and support expansion modules such as controllers and sensors.The new design replaces the VMEbus-base ILC control computer with an SBC and combines the signal processing circuit and the SBC into a single box.As a result, the control cabinet can be removed, and fewer control lines will need to be connected from outside the HV-Deck.High-Precision AD/DA Board [4] offers low-noise AD/DA converters with 2 voltage output channels and 8 analog data input channels.
In the current design, a PLC I/O controller is used to read the grid-bias voltage, b-plus voltage, and the filament voltage of the heater box that was used to heat the filament.The expansion board in the new design integrates and takes the position of the existing F/V converter and PLC I/O controller.It also has the ability to read b-plus, bias, filament voltage, heater current, and perform DI/DO functions.
The self-designed signal processing circuit can integrate the SBC control signal and the external trigger signal to produce the corresponding b-plus and bias voltages, as well as output the pulse voltage to the electron gun's cathode grid.

Circuit design concepts of control box
The control box contains a voltage regulator, transformer, induction coil, O/E converter, power supply, and other components.The circuit design concepts are shown in Fig. 2. A SBC with the EPICS framework integrated uses an AD/DA expansion board as the I/O controller.The expansion board can read the measured b-plus and bias voltages as well as the heater current and filament voltage coming from the heater box.An interlock signal is monitored through the extension board's DI interface to protect the electron gun from damage.When abnormal voltage operation is detected, this will immediately stop the high-voltage power output using both hardware and software methods.The trigger signals are sent over fiber optics to the fiber optic sensor.The RF MOSFET consists of a high-power gate driver and a power MOSFET, which transform the trigger signal into a pulse voltage signal to driver the electrons to overcome the DC-bias and generate electron beams.
The constructed circuit, along with the power supply, SBC, AD/DA Board, and other modules, is put on both sides of the partition in the control box.The photograph of control box is shown in Fig. 3.  , where D is the register value, indicating that VREF is a crucial parameter.In the original design, the VREF is powered by the GPIO Pin of the SBC.Nevertheless, after connecting various peripheral devices, the VREF might not be accurate, resulting in an error in the output voltage and the read voltage value.As a result, we use an adjustable voltage power supply to power VREF directly instead of the SBC, and set VREF to the proper voltage after connecting various loads.

The software architecture of the electron gun pulser
The new electron gun pulser control system was developed using EPICS since the TLS control system is upgrading to the EPICS framework.The software architecture is shown as Fig. 4. The Raspberry Pi is a small single-board computer with the linux-based operating system so that we can run EPICS-related software on it.SPI, a synchronous serial communication interface specification primarily utilized in embedded systems, is used for communication between the expansion board and the SBC.The bcm2835 [6] is a C-based library that offers functions to access the SBC's GPIO and other IO.With the help of this library, we could read digital inputs, set digital outputs, and transmit SPI commands.Through the Device Support interface, the C-based SPI control code is applied to EPICS and manages the GPIO to transmit SPI commands to the DAC8552 and ADS1256 modules on the AD/DA expansion board.

Perform SPI operations
SPI is a master-slave architecture communication interface that usually includes one master and numerous slave devices.The communications use shared buses and need out-of-band chip select (CS) signals to identify the destination slave.Every write and read action on the DAC/ADC must use the correct serial command and execute it sequentially.
The EPICS IOC may execute an operation before the previous operation is completed, which will damage data in transit.The software implements a buffer to cache the interactive operations of the EPICS IOC and executes commands through a single thread to prevent interference between actions.

Improve the stability of the voltage output
During the integration test stage, we had the problem with the high voltage output of the signal processing circuit is occasionally aberrant when the DAC setting voltage varies greatly.However, there is no such issue when using a commercially available DC power supply source.Following some investigation, we discovered that the settling time of the DC power source is more than 150 ms, whereas the DAC8552 module's settling time is only 10 µs, which will result in the transistor failing to react and causing high volt-age output errors.The measurement results are shown in Fig. 5.As a result, the setting voltage is correct-ed by software, and the voltage change is restricted to no more than 0.5V every 50ms in a gradual manner to resolve this issue.Figure 6 shows the result of volt-age output after software adjustment.

Graphical user interface
The GUI of the TLS electron gun pulse power control system was developed using EDM to make it convenient to control the electron gun remotely and monitor the machine's operational state.The bplus and bias voltages can be remotely set by the operator via the GUI, and the measured b-plus and Bias voltages are shown on the right side of the screen.The screen will also show values for the heater current, filament voltage, and interlock status.The GUI is shown as Fig. 7.

Conclusion
The new electron gun pulser has been implemented.The control software was developed utilizing the EPICS framework and it may be incorporated into the TLS control interface that is being converted to EPICS.The SBC with the advantages of small size and low power consumption is used to replace the existing VME interface and can be integrated with the circuit module into one chassis, which can reduce the occupied space and improve the convenience of maintenance.After several months of testing in the lab, the new electron gun pulser was installed at TLS in early 2023.The new system is now used to control electron gun during routine accelerator operating.This system will continue to make minor adjustments and make spare parts to improve stability and reduce the difficulty of maintenance.

Figure 1 .
Figure 1.The architecture for TLS electron gun pulser control system.

Figure 2 .
Figure 2. The circuit design concepts of control box.

Figure 3 .
Figure 3.The photograph of control box.

Figure 4 .
Figure 4.The software architecture of the electron gun pulser.

Figure 6 .
Figure 6.The voltage output after software adjustment.

Figure 7 .
Figure 7. EDM GUI for the electron gun control.