Tuner Loop Based on FPGA for Petra Cavity at TPS Booster Ring

The low-level radio frequency system of the Taiwan Photon Source, TPS, booster ring was replaced by the digital low-level RF system, DLLRF, in 2018. After that, the phase drift compensation loop for energy-saving operation and the tuner loop were also implemented in the DLLRF system sequentially. We used Altera-DE3 to build the core of DLLRF and handle the high-speed ADC/DAC procedure for RF signal sampling. As we con-sider the response time of the tuner, we choose an-other low-cost board, Altera-DE0-Nano, to develop the tuner loop for 5-Cell-Petra-Cavity. It has an eight-channel 12-bits-ADC, 150 ksps, ADC128S022, to detect the positions of two tuners and two transmitted powers sampled from two cells of the 5-Cell-Petra-Cavity for a power balance function. The phase information of for-ward power and cavity gap voltage will come from the Altera-DE3 to tell the tuner loop in the Altera-DE0-Nano whether the cavity is on resonance or not. The tuner loop controls the cavity to work not only at the resonance frequency but also with a balanced electric field distribution. This study presents the tuner loop’s architecture, including the locking resonance frequency and field balance functions. The performance of the field balance function is observed by the archive data of the two tuners positions and two transmit power signals.


INTRODUCTION
The DLLRF system of TPS BR has functions including the gap voltage control, klystron phase drift compensation loop, and tuner loop.The first two parts were completed in previous reports [1][2][3][4].This study represents the tuner loop realization method and structure for 5-Cell-Petra-Cavity.It contains a frequency-locking function and a power balance function.The resonance frequency is determined from the phase of the transmitted power picked from the electric field inside the cavity instead of the tuner positions.Additionally, two state machines are used for the two tuners.The state machine of tuner1 only controls the resonance frequency of the cavity.The state machine of tuner2 manages the power balance issue.The power distribution in the cavity and the behavior of the tuners at normal user beam time, topup mode with ramping gap voltage, and energy saving on/off, are also shown in this study.

CAVITY RESONANCE PROPERTY
The tuner can adjust the resonance frequency of the cavity.Taking a Doris cavity, for example, a tuner may push or pull the plunger in the cavity chamber.In this way, the geometry of the cavity is changed, and so is the frequency.Fig. 1 is a single-cell Doris cavity resonance property test.The tuner moves from the down to the up position, marked with the blue curve, and then returns from the up to the down position, marked with the orange curve.In Fig. 1(a) and 1(b), the curves of gap voltage, Vc, and the transmit power phase, Pt phase, which is picked up from the cavity electric field, have offsets at the same tuner position respectively, when the tuner moves in different directions.This phenomenon comes from the back-latch effect when the direction of the tuner changes.Thus, the position is a rough index but not a precise reference for tuning the cavity frequency.Since the back latch affects both tuners, the effect can be canceled when we use the Pt phase to adjust the cavity resonance frequency.In Fig. 1(c), the maximum gap voltage always occurs at the same Pt phase under a fixed input RF power and a fixed power path.This also means that the cavity resonates with the RF input power to build the maximum gap voltage.Most facilities adopt this method to lock the cavity resonance frequency.

FREQUENCY-LOCKING LOOP
Monitoring the Pt phase is insufficient to realize the cavity frequency-locking feedback.The phase of the RF system in a synchrotron light source may often change for some operation purposes.The Pt phase changes as the phase of RF input power.Usually, another power phase, the Pf phase, which is the forward power phase of RF input, will join the frequency feedback loop to distinguish the phase change coming from the RF input power.The cavity frequency-locking feedback loop is shown in Fig. 2. The phase difference between Pf and Pt shall be constant when there are no RF path variations and no tuner moving.We can record the constant phase difference when the plunger is at the right position, and the cavity is on resonance.Then, the tuner feedback loop can push or pull the plunger to keep the phase difference in the specific constant.

TUNER LOOP FOR MULTI-CELL CAVITY
The cavity used in the TPS booster ring is a 5-Cell-Petra-Cavity having two tuners and working with 0.9 MV, ~35 kW at 499.65 MHz.According to the bead pull method [5][6], the power distribution of the Petra cavity is controlled by the positions of the two tuners.Holding the cavity resonance frequency and maintaining a balanced electric field distribution are both important requirements for a multi-cell cavity.Therefore, we measure three cells' electric field intensities, also called transmitted power Pt1, Pt2, and Pt3, to complete the entire tuner feedback loop, as shown in Fig. 3.The entire tuner feedback loop is divided into two parts and belong to FPGA-DE3 and FPGA-DE0.The RF signal of Pt2 is sent to DE3, processed by a down converter for the IF band signal, and acquired by a high-speed ADC for IQ sampling.The amplitude and phase of Pt2 are used for the gap voltage control [1].Additionally, the phase difference between Pf and Pt2 is used for the cavity resonance frequency control to control tuner1 and tuner2 with the same actions.To balance the electric field distribution of the Petra cavity, the RF signals of Pt1 and Pt3 are picked up from cell #2 and cell #4 in Fig. 3, transformed as amplitude data by crystal detectors, sent to DE0, and acquired by a low-speed ADC for further processing.When the amplitude difference between Pt1 and Pt3 is larger than a threshold value, the power balance function adjusts the clock of the stepper motor of the tuner2.The direction of the stepper motor depends on whether the amplitude of Pt1 is larger or smaller than Pt3.

STATE MACHINE OF TUNERS
The tuning loop for the Petra cavity has two missions: cavity frequency locking and power balance.In our experience, frequency control shall be the priority over the power balance.If the resonance frequency of the cavity is far from the RF source frequency, the RF power will be reflected back to the circulator and then absorbed by the load.Furthermore, two tuners are assigned with different jobs.Tuner1 majors the frequency control, and tuner2 is responsible for the power balance.Their state machines are shown in Fig. 4.
The behavior of tuner1 is to follow the command from the frequency-locking function in DE3.When the RF system is off, or the interlock is enabled, S0, the tuner parks the plunger at the home position in Fig. 4(a).Tuner1 gets into S1 to sweep frequency when the RF system starts up and outputs a small fixed power toward the cavity.While the tuner position is close to the resonance point, the cavity will build a strong enough electric field for Pt2 coupling.Then the state machine goes into S2 to keep the phase difference of Pt2 and Pf constant by controlling tuner1.
Tuner2 purpose is to keep the power distribution balance inside the Petra cavity, and its behavior is like the state machine in Fig. 4(b).When the power amplitudes picked by Pt1 and Pt3 are lower than the set value, tuner2 is in the S0 state, and its behavior is the same as tuner1.Most of the time in this state, the RF system is off, but for a short period, it is in tune mode; the tuners are in the sweep state.When the amplitude of Pt1 or Pt3 is larger than a certain level, tuner2 goes into S1 and is also controlled by the frequency-locking function with the same clock and direction as tuner1.At the S1 state, only when the cavity is on resonance does the algorithm of distinguishing power balance work and output true/false of the unbalanced signal.Otherwise, the unbalanced signal is always false, and tuners work to maintain the resonance frequency.If the unbalance is true, the state jumps into S2, and tuner2 has its own clock and direction determined by the amplitudes of Pt1 and Pt3.Until Pt1 and Pt3 are close to each other, the unbalance is false and tuner2 goes back to S1 and follows the behavior of tuner1.

POWER DISTRIBUTION TEST RESULTS
The tuner loop is implemented into the DLLRF system in TPS BR, and the performance of the power balance is observed by the tuner positions and amplitudes of Pt1 and Pt3 with a constant gap voltage of 802.9 kV of Pt2, as shown in Fig. 5. First, we enable the frequency-locking function but disable the power balance function and manually unbalance the tuner2, Fig. 5

ONLINE OPERATION WITH ENERGY SAVING MODULE
The RF system of TPS BR is a continuous wave RF source, operated with a ramping gap voltage mode and modulated by an energy-saving module.When the energy-saving module is on, it modulates the klystron cathode current with a high level for the beam injection period and a low level for the standby state.The gap voltage ramps from 100 kV to 900 kV and down to 100 kV with a 3 Hz period in the beam injection period and stays at 100 kV in the standby state.In Fig. 6, before tuner loop optimization, the tuner positions differ when the energy saving is on and off.Pt1 and Pt3 are balanced when the energy saving is off, but Pt1 becomes larger than Pt3 when the energy saving is on.This phenomenon comes from a short injection period to make the unusual state switching between S1 and S2 of tuner2 in Fig. 4(b).After optimizing the switching timing of the two states, the power balance function worked well.The positions of the two tuners are similar but not the same.Pt1 and Pt3 are both close to 0.45 V at the injection period.

Figure 1 .
Figure 1.Single-cell Doris cavity properties.(a) The correlation of cavity gap voltage and tuner position.(b) Pt phase variation with tuner position moving.(c) Gap voltage curve based on Pt phase changing.

Figure 3 .
Figure 3. Tuner loop structure of TPS BR.
(a).The ADC data of tuner1 and tuner2 positions are 2211 and 2075, respectively.The corresponding voltages from the tuner driver modal are 3.280 V and 2.398 V readings from the GUI.The power levels of Pt1 and Pt3 are 745 and 824 from ADC sampling, 595.1 kV and 654.8 kV from the Omron display.Then, we enable the power balance function and turn off the manual mode of the tuner2.The results after the power balance are shown in Fig.5(b).Compared to Fig.5(a), the powers of Pt1 and Pt3 from ADC, 790 and 798, and Omron, 619.3 kV and 625.8 kV, are close to each other.The position data of Pt1 and Pt3 from ADC, 2140 and 2098, and GUI, 2.992 V and 2.636 V, are also close.The Petra cavity is a symmetric structure; thus, two tuners with similar parking position when the power balance is good.The calibration errors from position detectors, the tuner mechanism, and crystal detectors all increase the position difference between tuner1 and tuner2 at the power balance state.

Figure 5 .
Figure 5. Tuner loop test results of (a) unbalance and (b) balance with a constant gap voltage.