Development of fast BBA for Diamond Light Source

Beam-based alignment (BBA) is a standard tool at accelerators for aligning particle beams to the centre of quadrupole magnets. Traditional BBA measurements have been slow, potentially taking many hours for a whole machine. We have developed a tool, based on results previously reported at the ALBA synchrotron, that uses fast excitation of magnets to speed up measurements. We show the results of different measurement and analysis techniques in comparison to the currently used slow method.


Introduction
Third generation light sources like Diamond Light Source (DLS) require good control of orbit stability and beam optics.A beam passing off-axis through quadrupole and sextupole magnets will result in orbit, linear optics and coupling errors which can vary over time; this leads to varying photon beam quality at beamlines.BBA is a common system used to align the electron beam to the magnetic centres of the quadrupoles which would generally be done in reference to an ideal orbit; but due to variability between runs and because of environmental changes, this is not practical.Thus, the perfect orbit is defined as one where the electron beam goes through the magnetic centres of all quadrupoles, which is assumed to be more stable over time [1].

Figure 1.
The lattice structure of Cell 22 of the DLS storage ring.Quadrupoles are represented by red and blue, sextupoles by green and pink, dipoles by yellow, correctors by vertical black lines and BPMs by black dots.DLS has a total of 248 quadrupoles and 173 Beam Position Monitors (BPMs) across 24 cells, with a standard cell lattice shown in Fig. 1.We currently measure a subset of BPMs adjacent to beamlines at the beginning of each run, but ideally BBA would be carried out regularly on the whole machine to compensate for short term variations in the ring.However, standard methods of performing the measurements can take many hours making this impractical.Therefore, we have developed a fast BBA method based on previous work at the ALBA synchrotron [1].

Beam Based Alignment
DLS currently uses a BPM-to-quad BBA method based on the standard functions in Matlab Middlelayer [2], which involves applying an electronically induced offset to the BPM in order to align the beam path through the magnetic centre of the closest quadrupole.This process requires scanning the strengths of at least one corrector magnet (CM) for each quadrupole change.This can be time consuming given the number of magnet movements and the limitation of data capture over EPICS at a maximum of 10 Hz.
For each axis where a quadrupole and the closest BPM is selected, the orbit response matrix (ORM) is used to infer the most effective CM for the selected BPM.For BBA, two quadrupole steps and five CM steps are chosen; the quadrupole steps are ±1% of the current quadrupole set point, and the DC CM steps are calculated as ±n, ± n 2 and 0 from the CM set point, where n is the current needed to bend the beam 20 µrad on the chosen corrector.The effect on the orbit, as a result of the change in quadrupole strength at all five CM steps, gives five data points per BPM.This shows a linear relationship when plotted together.By plotting all of the BPM lines, the intersection gives the appropriate change in offset value for the BPM in question.
The time for each set of measurements is around 45 seconds per BPM, which does not consider the time for beam injection to keep a constant current, or for use of orbit [3] and tune [4] correction which are required to keep beam stability due to the length of the measurement.This allows time for machine and power supply drift.Taking these operational considerations into account, a full machine BBA can take over 3.5 hours.Operational BBA returns an average error of 0.68 ± 1.41 µm in the horizontal and 0.70 ± 1.39 µm in the vertical.These values are obtained assuming that the first three data points are required to 'hone' into the optimal value from the intentional 100 µm offset and are therefore removed before performing calculations.

From Excitation to Line Fit
The selected corrector magnet is driven with fixed number of cycles of a sine wave of the selected frequency ω 0 and data x i (t) is captured for each corrector i during this excitation.
The response of each corrector can be modelled as a sine wave with the same phase and frequency, which we can write as Re(α i e iω 0 t ); the component α i is computed by taking the sum over the excitation interval of the product of the data and the excitation: To reduce noise on this result the cycle count ω 0 T /2π should be a whole number and reasonably large.The data in the calculation above can optionally be scaled by a window function, for example 1 − cos(2πt/T ), to further reduce the impact of noise out of band.It is also numerically wise to subtract the mean x i from x i before computing α i .The next step is to align the phases and extract the scaling.We know that the responses of all correctors are in phase, and the target corrector I is known to have a good response, so the phase ∠α I is taken as the overall phase and the final corrector response at each BPM is computed as: Now the response of each BPM to changes in the selected corrector magnet can be modelled as: for s in the range −1..1.This process is repeated for two quadrupole magnet settings (High and Low) to produce two sets of fits 14th  [1] we are interested in the value of y I (s) when y H i (s) = y L i (s).For each line we can compute the corresponding fit coordinate as: and then we have an ensemble of fits at y H I (s i ) and y L I (s i ).Lines where the slope a H i − a L i is too small are excluded from this collection.

Single Axis Fast BBA
From the fast beam-based alignment (FBBA) process detailed by ALBA [1], we have successfully implemented our own version alongside some new measurement and analysis methods.Like ALBA, our version takes advantage of using AC excitations alongside using the fast acquisition archiver system (FAA) [5] to enable orbit measurements at 10 kHz.ALBA presents the difference between the standard deviation of their BBA and FBBA methods as ±15 µm at 7 Hz and ±16 µm at 6 Hz in the horizontal and vertical axes respectively.This considers measurements at all BPMs whereas at DLS, only one BPM was tested, with the difference between BBA and FBBA systems being 0.52 µm and 7.49 µm in each axis.The experiments for FBBA consisted of checking the speed of focusing and stability of the process.This involved applying a constant 100 µm offset before all experiments begin, indicated as run number 0 in the following figures, then repeating and applying measurements 16 times to see how many measurements are needed to find the correct offset.After this, the spread of FBBA results around that value is measured.This system was repeated across a range of frequencies and acquisition times.The range of frequencies was determined by Fig. 2, a discrete Fourier transform of the storage ring BPM orbit over 30 s and selecting sections on the figure that had low beam noise.Due to a drop off in CM response at higher frequencies, the upper frequency limit was set to 200 Hz.To ensure stability throughout the experiment, the fast orbit and tune feedbacks were run for 3 s between measurements.After this, the beam was left for an additional 3 s to allow it to resettle at a stable orbit.The experiments shown were carried out at 10 mA.

Frequency, Acquisition Time and Distribution
Frequencies of 8, 83, 137 and 179 Hz were tested with acquisition times of 0.5, 1 and 2 s.A full matrix of experiments were carried out, with only a selection of the data being shown here.Figure 3 shows the effect of different CM AC excitation frequencies, with a constant acquisition time of 2 s.Our conclusion from this experiment is that the frequency has no meaningful impact in the value reached, and will hone in to an acceptable BPM offset.A key difference between behaviours in each axis is how quickly the process finds the correct value, with the horizontal axis requiring a few steps to converge.However, both FBBA and BBA overshoot in IOP Publishing doi:10.1088/1742-6596/2687/3/0320024 the vertical axis, then come back quickly to the expected offset value.Figure 4 shows the effect of different acquisition times on FBBA at 137 Hz.This data indicates that increasing the time for data acquisition decreases the spread between measurements, but we would need further investigation to confirm this.A full comparison of the stability of FBBA against BBA shows a slight increase of spread in the vertical to ±1.55 µm, but an almost quadruple increase of the original spread in the horizontal to ±5.45 µm.
Across all of the data, a persistent difference is seen between the Matlab BBA and FBBA results in the vertical axis.A potential source of such an error is in the choice of CM that oscillates for a given BPM.All of the experiments were carried out on BPM 5 in Cell 1, but the Matlab BBA and the FBBA systems use different versions of the ORM.Consequently, a different CM in the ring is being oscillated.This difference is equally likely to occur in either axis, and could be confirmed upon running FBBA with a preset CM rather than using the ORM.FBBA measurements affected by this are no less valid than those produced by Matlab BBA.Averaging over multiple CMs to reduce the error in offset of any single CM may produce a more accurate calculation, but result in significantly longer running times.

Simultaneous Dual Axis Fast BBA
Simultaneous multi-frequency dual-axis AC excitations were also tested to speed up the FBBA process, as performed by ALBA.Our method can be applied independently to each axis, with a Fourier analysis showing that the peaks did not superimpose.The vertical peak was visible in the horizontal data, but not vice versa.This could be because of mechanical or electronic misalignment of the CM, which would introduce an unexpected biaxial oscillation.
An acquisition time of 2 s was used across a matrix of frequencies for both axes, with 11, 137 and 179 Hz in the horizontal axis and 13, 139 and 181 Hz in the vertical axis.The dual axis process achieves good values similar to the single axis process, with changes in frequency having no clear impact.A sample of the data is shown in Fig. 5, alongside a comparison of different horizontal frequencies.This also shows the persistent vertical offset between the BBA and FBBA results.Comparing single and dual axis results at 2 s shows lower standard deviations for the dual process of 0.67 µm and 2.30 µm in the horizontal and vertical axes.

Timings
Comparing the time to complete measurements across the data returns the values in Table 1.
The table shows that the FBBA single and dual axis processes with the 2 s acquisition times are just over double and triple the speed, respectively, of Matlab BBA.The simultaneous process could be sped up by an additional 2 s by reducing the acquisition time by 1 s, enabling a full machine simultaneous FBBA to be completed in under 35 min with minimal degradation of results.This could be reduced further, but this must be done with caution as a reduction in the number of oscillations will affect the overall precision, especially for lower frequencies.Given that Matlab BBA has a run time of around 3.5 hours including required topups and orbit corrections, simultaneous FBBA reduces this time by a factor of 6.

Figure 2 .
Figure 2. The discrete Fourier transform of 30 s of horizontal and vertical orbital position at all BPMs.

Figure 3 .
Figure 3.A comparison of repeated FBBAs dependant on CM oscillation frequency.Acquisition time fixed at 2 s.

Figure 4 .
Figure 4.A comparison of repeated FBBAs dependant on acquisition time.CM oscillation frequency fixed at 137 Hz.

14thFigure 5 .
Figure 5.A comparison of repeated Sim.FBBAs dependant on CM oscillation frequency in both axes.Acquisition time fixed at 2 s and vertical axis oscillation fixed at 137 Hz.

Table 1 .
Beam Based Alignment Timings DLS has demonstrated that fast BBA produces acceptable results in comparison to Matlab BBA alongside significant decreases in running time.Additionally, investigations into dual-axis FBBA have been performed which show good results with even larger reductions in running time.The next steps involve optimisation of parameters, development of operational software and further studies into the effects of CM positions on the calculated results.