OffSet measurements at Rapid Cycling Synchrotron in China Spallation Neutron Source

The Rapid Cycling Synchrotron(RCS) is the key part of the China Spallation Neutron Source(CSNS) with a repetition rate of 25 Hz. The lattice of the RCS is based on triplet cells with a superperiod of four. Due to the utilization of the trim quadrupoles in June 2021, the Beam Position Monitor(BPM) offsets have been carefully measured, and the beam operation is more stable. In this paper, we will review the preparation of BPM offsets measurements with the virtual accelerator and the experimental results in beam commissioning.


Introduction
The China Spallation Neutron Source is a multidisciplinary research facility with a repetition rate of 25Hz [1,2], which passed its national acceptance in 2018.The accelerator consists of two main parts, a hydrogen linac and a proton RCS.The hydrogen beam is accelerated to 80MeV by an RFQ and four DTL tanks, and stripped to protons by a carbon foil in the injection region.The proton beam is accelerated to 1.6GeV by the RCS and extracted to strike the tungsten target.During the beam commissioning of the RCS, the closed orbit distortion correction is carefully performed, and the beam displacements at the BPMs are reduced from ±15mm to ±7mm.Because the BPM offsets were not carefully measured, there are still some unknown options in the orbit correction for high beam power commissioning.To meet the high beam power commissioning, the orbit of the beam is optimized by minimizing the beam loss at the Beam Loss Monitors (BLMs) using the local orbit correction methods [3].
As a large-scale and high-intensity accelerator facility, a virtual accelerator based on OPEN-XAL framework is developed.The virtual accelerator is more secure because the operators can identify and control the hardware by the record name in the input/output controller (IOC).During the summer maintenance, the trim quadrupoles were installed in the RCS tunnel, and during the next machine study period, the BPM offsets were carefully measured using the trim quadrupoles.In the following sections, the measurements based on the virtual accelerator are presented in section 2, the experimental results in section 3, the discussions in section 4, and a summary in section 5. Table 1 shows the RCS design parameters.In a circular accelerator, when one quadrupole strength is changed, and the beam does not pass through the center of that quadrupole, a dipole kick θ will be generated.In lowest order, we have [4] θ ≈ ∆Kx q − K∆x, where x q is the original closed orbit in that quadrupole, ∆x the change in closed-orbit position, K the integrated quadrupole gradient, ∆K the integrated quadrupole gradient change, and we have neglected a second order term (∆K∆x).We can apply the formula for the closed orbit distortion at the location of the dipole kick, and we find ∆x = (∆Kx which we can solve for ∆x, where β is the beta function at that quadrupole, ν the working point of the disturbed lattice.Inserting this back into Eq.1 gives the closed-orbit kick induced by a gradient change ∆K: ).
The closed orbit in other place can be written as where φ(s) and φ are the phase advance at BPM and quadrupole, β(s) and β are beta functions at BPM and quadrupole.The merit function can be defined as where N BP M is the total BPMs along the ring.By using a least-squares parabolic fit, the BPM offset can be determined by minimizing χ 2 as a function of the BPM offset ∆x q .For BPM offset measurement, it is necessary to bump different orbits by the steering magnet in the ring, and then count the merit function, and finally do the least square fitting.

Introduction of the virtual accelerator
CSNS accelerator employs XAL [5] as the physical control software, which is a high level programming infrastrcture developed to provide application programs for beam commissioning.
As shown in Fig. 1, it consists of several components which include a hierarchal class representation of the accelerator, a model of the accelerator, a high level wrapper to the control system, a framework for writing GUI applications and a sets of tools.The virtual accelerator is an application software developed on the basis of OPENXAL.By importing the server implementation of Java Channel Access (JCA), as shown in Fig. 2, the virtual accelerator can provide the same PV as the real accelerator.MATLAB Channel Access (MCA) which is an interface to EPICS Channel Access (CA) client library is a integration toolbox of the MATLAB-based accelerator modeling software-Accelerator Toolbox [6].Since it has the ability to calculate and display parameters that use EPICS process variables as inputs, we adopted MCA to develop the GUI and the data analysis of the BPM Offset measurements.

BPM Offset Measurements based on virtual accelerator
For large accelerators, a common and reliable method is to test the reliability of the program on the test platform.For CSNS-RCS, to generate different ∆x q , it is necessary to carefully choose the proper steering magnets, otherwise the measurement data will be asymmetric, which will affect the accuracy of the least squares fitting.The visualization of the experimental process is also very important.In 2021, the sparking of the Penning ion source (From 2022, CSNS project replace Penning ion source to RF-driven negative hydrogen ion source, and the ion source commissioning is more stable) and the RFQ will cause beam loss and interruption of the beam.In the process of developing the GUI application, we have considered these details, and we can easily remove bad data in the data procession.Fig. 3 is the BPM offset measurement application GUI developed with Accelerator Toolbox.The BPM offset can be dialed into virtual accelerator, and can be measured by this application.The simulation of the BPM offset dialed into the virtual accelerator in the XAL framework is very close to the BPM offset measured result from application developed in the Accelerator Toolbox Framework.

Experimental results of the BPM offset measurements 3.1. The experimental results of the BPM offset measurement
The basic structure of the CSNS-RCS lattice is triplet, 16 trim quadrupoles (QT) were installed near the defocusing quadrupoles Q272 in the June 2021.In September 2021, the beam-based BPM offset measurement experiment was carried out.During the experiment, RCS runs in the storage mode (DC mode).Fig. 4 is one of the measurement result, and the horizontal BPM offset measurement of R3BPM05 is about 4.2 mm.After the BPM offset dialed into the machine, we remeasured this BPM offset, and the BPM offset is less than 1mm as shown in 5. Table 2 is the BPM Offset measurement results in CSNS-RCS.

The orbit comparison before and after the BPM OffSet dialed into the machine
In storage mode, the orbit correction with and without BPM offset is shown in Fig 6 .We can see the vertical Closed Orbit Distortion(COD) is smaller after the BPM offset dialed , but in the horizontal direction, the COD is the same order after the BPM offset dialed.The horizontal BPM offset seems to have little effect in closed orbit distortion, that maybe it is due to two reasons.Firstly, not all of the BPM offsets were measured, and the closed orbit distortion was corrected globally.Secondly, in storage mode, we matched the cavity frequency to the bending magnet strength by minimization the mean value of the BPM values in arc region, that may

Discussion
There are 32 BPMs along the ring.Unfortunately, only very little BPMs near the QT which can be powered individually.The distance (center to center) between BPM05/BPM08 and QT is less than 0.3m, and the beam slope may also be small.In our measurement, more than half of the BPM offsets were measured.Because the location of the BPM is far from the QT, and the results may be not very accurate, so we just dialed those eight BPM offsets in Table 2. BPM offset measurement has a strong relationship with the lattice (the arrangement of the magnets and BPMs), and we are now developing new method taking account of the lattice and the ramping mode.

CONCLUSION
Trim quadrupoles were installed in the summer maintenance in 2021.Thanks to its individual power supplies, the BPM offset measurement can be done in a more reliable way.By adopting Matlab Channel Access, the model based on AT can be connected to virtual accelerator in the framework of XAL.The offset measurements show the maximum offset is about 4mm.After the BPM offset dialed into the machine, the BPM offset remeasured less than 1mm, and the COD is smaller and the beam is more stable.

Figure 2 .
Figure 2. The virtual accelerator of the CSNS-RCS.

Figure 3 .
Figure 3.The GUI of the BPM Offset Measurements.

Figure 5 .
Figure 5. Horizontal BPM offset remeasurement of R3BPM05 after the offset dialed into machine.

14thFigure 6 .
Figure 6.Closed orbit comparison before and after BPM offset dialed in.