Introduction
Ideally, the beam in a storage ring should circulate on the orbit passing through the axes of all magnet centers, which is called the golden orbit. The beam orbit may deviate from the ideal path due to errors such as misalignment, magnet imperfection, and power regulation errors. When the beam traverses magnets with orbital offsets, undesired magnetic fields are observed, called feed-downs [1]. The feed-down of a quadrupole with an orbital offset causes an additional dipole field. To minimize this effect, a beam-based alignment can be adopted to determine the golden orbit for machine operation. It is widely used in the commissioning phase of storage rings [2, 3]. For storage rings with long circumferences, such as most diffraction-limited storage rings (DLSRs), the number of quadrupoles is large, and the conventional BBA method is time-consuming [4]. Recently, a fast BBA method was developed at ALBA light source using the AC excitation of orbit correctors and fast beam position data acquisition [5-7]. At HLS-II, with no need to upgrade the hardware, a machine learning (ML)-based method was developed to determine the golden orbit for storage rings[8].
Neural networks (NNs) have been widely applied in artificial intelligence and have achieved great success in various fields. Their application has also been introduced in the field of particle accelerators [9-12]. In the Advanced Light Source (ALS), an NN model is used to maintain the vertical beam size when the gap of insertion devices varies [13]. The NN model can also be used to significantly reduce the simulation time for beam dynamics optimization [14]. At the Shanghai Synchrotron Radiation Facility (SSRF), an image processing technique using convolutional neural networks (CNNs) was adopted to extract bunch longitudinal phase information [15]. These applications demonstrate the substantial potential of NNs for improving accelerator performance.
In this study, we present a new BBA method that uses an NN model to predict the golden orbit of a storage ring. To initiate the experiment, different closed orbits were generated by randomly changing the strengths of all the orbit correctors. Beams with various orbital deviations in the quadrupoles are subject to various degrees of influence from their magnetic field feed-down. This effect can be evaluated by measuring the change in the orbit caused by the quadrupole strength variation. Because the beam on the ideal golden orbit should not be disturbed by changing the quadrupole strength, an NN model can be trained to search for the orbit that is least affected by varying the quadrupole strength. To train this model, the orbit differences owing to quadrupole changes were used as input data, and the corresponding orbits before quadrupole adjustment were used as output data. The golden orbit was predicted by setting the input value to zero in the NN model.
To demonstrate its validity, the new BBA method was tested in the HLS-II storage ring through simulations and online experiments. The results indicated that the golden orbit obtained from the NN model was consistent with that obtained after several iterations using the conventional method. The golden orbit obtained using this method can be directly used for operation or as a starting point to speed up the conventional BBA, which requires several iterations. In general, this new method is less time-consuming than the conventional BBA, particularly during initial commissioning [16].
In the following sections, the methods of the conventional BBA and the new BBA using an NN model are shown in Sect. 2. The simulation results obtained using these two BBA methods for the HLS-II storage ring are described in Sect. 3. The online experiments using both BBA methods are introduced in Sect. 4. Finally, the work is summarized in Sect. 5.
Beam-based alignment
Conventional BBA method
The purpose of BBA is to find a reference orbit in which the beam passes the centers of all quadrupoles in a storage ring using beam position monitors (BPMs) and orbit corrector magnets (OCMs). The dipole fields seen by an off-axis particle in a quadrupole is given by
The quadrupole center is measured using the nearest BPM. Suppose that when the beam passes through the quadrupole center, the related reading of this BPM is 𝒗0. According to Eq. (5), by changing the quadrupole strength Δ K, the beam orbit change is given by
BBA using a neural network
BBA is based on the principle that the off-axis beam is affected by a quadrupole strength change. The golden orbit can then be evaluated using the relationship between the orbit changes and the initial beam orbits before varying the quadrupole strength. This relationship can be explored by training a neural network using orbital changes as the input data and initial orbits as the output data. By setting the orbital change to zero, the corresponding initial beam orbit becomes the predicted golden orbit. The main concept behind this proposed BBA method is illustrated in Fig. 1. To obtain data for training the NN model, a simulation or online experiment was performed as follows:
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F001.jpg)
• Randomly exciting all corrector magnets to form an initial closed orbit;
• recording all BPM readings;
• changing all quadrupoles by the same amount to form a new closed orbit.
• recording the changes in all BPM readings;
• resuming the quadrupole and corrector strengths to the original values;
• repeating the above procedures.
A typical dense neural network has one input layer, several hidden layers (also called middle layers), and one output layer, as illustrated in Fig. 2 [21]. The nodes where the data are transferred are called neurons. The nodes between adjacent layers are connected to each other by an arrow, which shows the flow of data. Each arrow represents a linear transformation combined with an activation function used to introduce nonlinearity if necessary [11]. A loss function is used to describe the performance of the neural network. An NN also requires an optimizer function to optimize the parameters used for data transmission. The optimization is performed by minimizing the loss value.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F002.jpg)
Simulation study for the HLS-II storage ring
Before conducting the online experiments, a simulation was performed to evaluate the validity of the new BBA method based on an NN model. The accelerator toolbox (AT) is used for the simulation in this study [22]. TensorFlow, which is adopted in this study, provides a flexible platform that makes it easy for users to build and train an NN model [23, 24].
The HLS-II storage ring has two super periods with a circumference of 66.1 m. The layout of a single super period is shown in Fig. 3. The orbit system of the storage ring consists of 32 BPMs and 32 correctors combined with sextupoles. 32 quadrupoles were installed to measure their real centers using the BBA procedure [25].
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F003.jpg)
Random rotation and shift errors were applied to simulate the misalignment of the elements and girders. The errors were generated in a normal distribution with truncation at three standard deviations. Based on the design report, the error settings for all magnets, girders, and BPMs are listed in Table 1. A set of misalignment errors for the whole ring is shown in Table 4. Strength errors of all magnets were also applied. The BPM random measurement error was set to 0.5 μm [26].
Type | Shift error (μm) | Rotation error (μrad) | ||||
---|---|---|---|---|---|---|
X | Y | S | X | Y | S | |
Girder | 50 | 50 | 200 | 500 | 500 | 500 |
Dipole | 200 | 200 | 150 | 500 | 500 | 500 |
Quadrupole | 200 | 200 | 150 | 500 | 500 | 500 |
Sextupole | 200 | 200 | 150 | 500 | 500 | 500 |
BPM | 200 | 200 | 150 | 500 | 500 | 500 |
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F004.jpg)
Conventional BBA method
In the conventional BBA measurement for one quadrupole, the beam is moved to three different positions with the help of the corrector magnets [27]. At each position, the change in the beam orbit from all BPM readings was recorded after varying the strength of the target quadrupole by a certain Δ K. The orbital changes can be fitted linearly as a function of the beam position in the target quadrupole. An immobile point can be found by setting the position at which the BPM changes vanish. The quadrupole center was then obtained by adding all the immobile points from each BPM. The entire BBA routine repeats this process for all quadrupoles in both the horizontal and vertical planes in the storage ring. To increase the BBA accuracy, the measurement was repeated after moving the beam to the orbit obtained from the previous BBA experiment. This scheme is typically required in the machine commissioning stage. Figure 5 shows the simulated measurements of the horizontal and vertical centers of the quadrupole magnet in the HLS-II storage ring. At least three conventional BBA iterations are required to decrease the standard deviation of the fitted Gaussian function of the quadrupole center to several micrometers, which is of the same order as BPM measurement resolution [28].
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F005.jpg)
BBA using an NN model
In the simulation, the correctors were set randomly within a certain range of kicks to move the beam orbit. The kick angle variations were generated using a normal distribution with a standard deviation of 0.05 mrad, and a truncation at three standard deviations was applied. For each random orbit, all quadrupoles were simultaneously changed by the same amount of Δ K (-0.02 m-2). The corresponding initial beam orbit and orbit changes were recorded for all BPMs.
The entire simulation generates 10,000 samples. In each sample, there were 64 initial orbits and 64 orbit change data points, with 32 in the horizontal plane and 32 in the vertical plane. These samples were adopted to train the neural network. Figure 6 shows the random initial beam orbits within the range (-5,5) mm. Figure 7 shows the orbit change after quadrupole adjustment. The range of the orbit change was within (-1.5,1.3) mm and (-0.8,0.8) mm in the horizontal and vertical planes, respectively.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F006.jpg)
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F007.jpg)
An NN model is trained using these data to obtain the golden orbit. The 64 sets of orbit change data were used as the input to the model, and the 64 sets of the corresponding initial orbit data were used as the output. Eighty percent of the data were used to train the model, and the rest were used to test the performance of the model. There were 128, 256, and 128 neurons in the three hidden layers, respectively. The tanh is considered the activation function that provides nonlinearity. The NN model was trained using the Adam optimizer [29]. The loss function is the mean squared error (MSE) between the measured data and model-predicted results, which is
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F008.jpg)
Online experiment in the HLS-II storage ring
A conventional BBA was applied to the HLS-II storage ring [30]. Figure 9 shows the BBA results for a single quadrupole. The fitting errors for most of the quadrupoles were within 20 μm.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F009.jpg)
Training data acquisition
Similar to the simulation, training data can be obtained from a real storage ring. Before the experiment, the magnet strengths were set according to the results of the early commissioning of the storage ring. In this case, the beam is not on the golden orbit that connects the centers of the quadrupoles. An online experiment to obtain the training data is presented in this subsection.
During the online experiment, the orbit feedback system was turned off, and the correctors were randomly set to generate different orbits. As a compromise between beam stability and data diversity, the adjustment range of all correctors was set to ±0.8 A relative to the starting point. This corrector adjustment range ensured no beam loss during the experiment by controlling the orbit change within a distinguishable range, as shown in Fig. 10. The horizontal tune in the HLS-II storage ring was approximately 4.44, whereas the vertical tune was 2.36, which is further from the half-integer. When the quadrupole strength is simultaneously increased, the horizontal tune increases accordingly which may reach the half-integer resonance and thus cause beam loss. Therefore, all quadrupole strengths were adjusted in the decreasing direction by -0.02 m-2 (normalized focusing strength). After the orbital change was recorded, all quadrupole strengths were restored to their original values. For the HLS-II storage ring, the time constant for the orbit corrector power supply is approximately 15 ms [30]. The time constant for the quadrupole power supply is approximately 30 ms. This implies that one complete loop of this measurement could be performed within 1 second. To ensure the data acquisition accuracy, the measurement time for each loop was set to 2 s.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F010.jpg)
An online experiment was conducted during the machine study time [31]. The entire measurement process generated 21,000 samples. These samples were used to train the neural network. Figure 10 shows the randomly generated initial beam orbits before the quadrupole strength is varied. The distribution shows that orbits were generated within a range of approximately (-10,10) mm, and the densest distribution was approximately 0. The orbit change after the quadrupole adjustment was also analyzed, and the distribution of the orbit differences is plotted in Fig. 11. The range of the orbit change was within (-3,2) mm in the horizontal plane and within (-1.5,1.5) mm in the vertical plane.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F011.jpg)
NN model training using online data
In this subsection, the relationship between the initial orbit and the orbit change after quadrupole adjustment is explored using a dense neural network. Similar to the simulation, 64 sets of orbit change data were set as the input to the model, and 64 sets of the corresponding initial orbit data were set as the output. To determine the data-size requirements, the two models were trained using different numbers of samples. In Model I, all 21000 samples were adopted, 5/6 of the samples were used for training, and 1/6 were the validation data set. For comparison, Model II was trained with only 3000 samples in the training set and 600 samples in the validation set; 3600 samples were adopted in total. The Adam optimizer and MSE loss function were used to train the models.
The trained NN models were evaluated by calculating the mean absolute error (MAE) between the measured and model-predicted values of the validation samples for each BPM:
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F012.jpg)
Golden orbit from the NN model
In the NN training, the orbit changes caused by varying quadrupoles were used as the input data. The corresponding initial orbits were used as the output data. The beam on the golden orbit should have the least orbital distortion (ideally zero) owing to the change in quadrupole strength. Therefore, the input can be set to zero for the NN model, and the corresponding output is the golden orbit.
To estimate its accuracy, this golden orbit was compared with that obtained using the conventional BBA method, and the results are shown in Fig. 13. The sub-figures in Fig. 13 illustrate the differences between the novel and conventional BBA. The results show that this golden orbit is consistent with that obtained from the conventional BBA. In the horizontal plane, the average difference between the conventional BBA and the model prediction was approximately 46 μm for Model I and 53 μm for Model II. In the vertical plane, the average difference between the conventional BBA and the model prediction is approximately 42 μm for Model I and 39 μm for Model II.
-202404-小份文件/1001-8042-35-04-009/alternativeImage/1001-8042-35-04-009-F013.jpg)
Although the training error of Model I was smaller than that of Model II, the difference in the predicted golden orbits from these two models did not exhibit a large deviation [32]. In the HLS-II storage ring, the typical experimental period for the conventional BBA process is approximately 5 h. In the machine commissioning phase, this BBA process is needed to be repeated several times to obtain precise results. Model II used only 3600 samples, which resulted in a shorter online measurement time (approximately 2 h). As discussed previously, the online measurement time for this new method is irrelevant to the total quadrupole number. This differs from the conventional BBA, where the larger storage ring requires more time. In contrast, the NN-trained golden orbit can be set as the starting point for the conventional BBA. This helps reduce the iterative process of the BBA starting from the initial commissioning orbit and, hence, the experimental time.
Summary
A novel method is developed to search for the golden orbit of a storage ring. This method trains a neural network model using simulated or online data of different closed orbits and the corresponding orbit change caused by simultaneously varying all quadrupole strengths. The online experiments can be conducted in less time, particularly for large storage rings. This golden orbit is compared with that obtained using the conventional BBA, and the result shows good consistency.
The NN-based BBA is a good choice for the commissioning stage of a storage ring, where the beam optics are significantly different from the ideal model and the closed orbit deviates from the magnet centers. In this case, the linear process of conventional BBA is no longer accurate. Moreover, the conventional BBA treats the horizontal and vertical orbits separately. However, the coupling of a real machine is non-negligible, particularly when the coupling is not sufficiently corrected. The NN-based method deals with transverse planes simultaneously, which naturally solves the coupling issue. In addition, the new BBA method can be applied better to storage rings with strong nonlinear effects, which is often the case with DLSRs. With strong nonlinearity, the conventional BBA method might work within a limited region because the linearity of the orbit response is assumed. Because NNs can be used to solve nonlinear problems, as is well known, the NN-based BBA method is expected to be more effective for DLSRs. From another perspective, this new technique can better deal with cases in which the quadrupoles are powered in series, as there is no need to vary the strengths of all quadrupoles individually. Some small light sources or boosters are expected to benefit from the new BBA method.
Simultaneous beam-based alignment measurement for multiple magnets by correcting induced orbit shift
. Phys. Rev. Accel. Beams 25, 052802 (2022). https://doi.org/10.1103/PhysRevAccelBeams.25.052802Study of beam based alignment and orbit feedback for SwissFEL
.Beam based alignment for the storage ring multipoles of synchrotron SOLEIL
.Design study of APS-U-type hybrid-MBA lattice for mid-energy DLSR
. Nucl. Sci. Tech. 32, 71 (2021). https://doi.org/10.1007/s41365-021-00902-1Fast orbit response matrix measurements at ALBA
.Fast quadrupole beam based alignment using AC corrector excitations
.Fast beam-based alignment using AC excitations
. Phys. Rev. Accel. Beams 23, 012802 (2020). https://doi.org/10.1103/PhysRevAccelBeams.23.012802Machine learning for orders of magnitude speedup in multiobjective optimization of particle accelerator systems
. Phys. Rev. Accel. Beams 23, 044601 (2020). https://doi.org/10.1103/PhysRevAccelBeams.23.044601Improvement of machine learning enhanced genetic algorithm for nonlinear beam dynamics optimization
. Nucl. Instrum. Meth. A 946, 162683 (2019). https://doi.org/10.1016/j.nima.2019.162683Neural network-based multiobjective optimization algorithm for nonlinear beam dynamics
. Phys. Rev. Accel. Beams 23, 081601 (2020). https://doi.org/10.1103/PhysRevAccelBeams.23.081601Research on tune feedback of the Hefei Light Source II based on machine learning
. Nucl. Sci. Tech. 33, 28 (2022). https://doi.org/10.1007/s41365-022-01018-wDemonstration of machine learning-based model-independent stabilization of source properties in synchrotron light sources
. Phys. Rev. Lett. 123, 194801 (2019). https://doi.org/10.1103/PhysRevLett.123.194801Genetic algorithm enhanced by machine learning in dynamic aperture optimization
. Phys. Rev. Accel. Beams 21, 054601 (2018). https://doi.org/10.1103/PhysRevAccelBeams.21.054601Machine learning based image processing technology application in bunch longitudinal phase information extraction
. Phys. Rev. Accel. Beams 23, 032805 (2020). https://doi.org/10.1103/PhysRevAccelBeams.23.032805Commissioning of the hybrid multibend achromat lattice at the European Synchrotron Radiation Facility
. Phys. Rev. Accel. Beams 24, 110701 (2021). https://doi.org/10.1103/PhysRevAccelBeams.24.110701Quadrupole beam-based alignment at RHIC
.Nonlinear neural networks: Principles, mechanisms, and architectures
. Neural Networks 1 17-61 (1988). https://doi.org/10.1016/0893-6080(88)90021-4Nonlinear neural networks: Principles, mechanisms, and architectures
. Neural Networks 4, 381-383 (1991). https://doi.org/10.1016/0893-6080(91)90074-FNeural networks and their applications
. Rev. Sci. Instrum. 65, 1803-1832 (1994). https://doi.org/10.1063/1.1144830Deep learning with tensorflow: A review
. J. Educ. Behav. Stat. 45, 227-248 (2020). https://doi.org/10.3102/1076998619872761Lattice study for the HLS-II storage ring
. Chinese Phys. C 37, 047004 (2013). https://doi.org/10.1088/1674-1137/37/4/047004Introduction of beam position monitor system in the HLS II storage ring
.Measurement of local impedance by an orbit bump method
. Nucl. Instrum. Meth. A 525, 433-438 (2004). https://doi.org/10.1016/j.nima.2004.01.077Application of Libera BPM at BEPC II for the early commissioning
. Chinese. Phys. C 32, 102-104 (2008) (in Chinese)Improved Adam optimizer for deep neural networks
.Orbit stabilization for the HLS-II storage ring
.Operation status of HLS-II
.Beam reference orbit compensation for the HLS-II storage ring
. J. Instrum. 18, T06004 (2023). https://doi.org/10.1088/1748-0221/18/06/T06004The authors declare that they have no competing interests.