High precision superconducting cavity diagnostics with higher order mode measurements

Experiments at the FLASH facility at DESY have demonstrated that the higher order modes induced in superconducting cavities can be used to provide a variety of beam and cavity diagnostics. The axes of the modes can be determined from the beam orbit that produces minimum power in the dipole HOM modes. The phase and amplitude of the dipole modes can be used to obtain high resolution beam position information, and the phase of the monopole modes to measure the beam phase relative to the accelerator rf. For most superconducting accelerators, the existing higher order mode couplers provide the necessary signals, and the downmix and digitizing electronics are straightforward, similar to those for a conventional beam position monitor.


I. INTRODUCTION
Higher order modes (HOMs) excited by charged particle beams in accelerating structures are often the main cause of emittance growth in rf accelerators [1]. In order to minimize their effect the beam has to be well centered in these structures, particularly at low energy.
A beam is usually steered through a machine based on conventional diagnostics such as beam position monitors (BPMs) and optical screens. These, however, do not give direct information about the beam position in the accelerating cavities. This information can be obtained from the HOM couplers, whose purpose is to extract energy from the HOM fields, therefore minimizing emittance growth.
Superconducting technology is increasingly used for accelerators, in applications such as free electron lasers, energy recovery linacs, and colliders. Among these are the international linear collider (ILC) [2] project study, the xray free electron laser (XFEL) [3] to be built in Hamburg, and the free electron laser in Hamburg (FLASH) [4,5]. These projects all share the basic design of the accelerating cavity, based on the TESLA technology [6]. FLASH is also used as a test facility for the ILC and the XFEL under the name TESLA Test Facility-Phase 2 (TTF2).
Two HOM couplers are installed on each TESLA cavity. We have equipped each of the 80 couplers at FLASH with downmix digitizing electronics to monitor one dipole mode in each cavity. In this way we can monitor the beam position in each structure and align the beam by minimizing the dipole mode power. This paper presents a brief overview of the FLASH facility, including the superconducting cavities used to accelerate the beam, and coupling ports used to extract the power from the HOM fields. It then describes how the coupler outputs were instrumented in order to analyze their signals. A detailed description of the electronics designed to observe the sensitivity of a dipole mode to beam position is given. A technique based on singular value decomposition to extract beam position from the HOM coupler output is described. The possibility of using the HOM signal as a measure of the beam phase is also demonstrated. Figure 1 shows the FLASH [7] facility schematically. The photoelectric gun generates up to 800 electron bunches per train, with an energy of 4.5 MeV [8]. Presently there are five accelerating modules, each containing eight superconducting accelerating cavities, which accelerate the beam to a total energy between 450 and 700 MeV. Two bunch compressors reduce the length of part of each bunch to 50 fs. The uncompressed bunch length is 5:7 ps. During its subsequent passage through six undulators, this compressed spike generates an intense VUV light with a wavelength between 32 and 13 nm, based on self-amplified spontaneous emission (SASE). This light is transported further to the user beam lines while the electrons are sent to a dump. The bypass line is used during commissioning and accelerator studies in order to protect the undulators.

III. TESLA CAVITIES
The 1 m long superconducting accelerating cavities are made of nine cells, as can be seen in Fig. 2. A standing wave of 1.3 GHz is generated for acceleration.
Two HOM couplers (see Fig. 3) are mounted on the 78 mm diameter beam pipe at either side of the cavity [9]. They are built such that they couple electrically and magnetically to the fields in the cavity. A notch filter reduces the coupling to the accelerating mode. Azimuthally, the couplers are separated by an angle of 115 in order to maximize the total coupling to all the dipole modes, as well as to ensure good coupling to quadrupole modes.
Long cables bring the HOM power out of the accelerator tunnel for damping, and it is here that the measuring electronics have been installed, as explained later in this paper.

IV. HIGHER ORDER MODES
A relativistic bunch of electrons passing through a cavity excites wake fields, which can be expanded as a multipole series [10], each term being a so-called mode. The TESLA cavities are cylindrically symmetric, therefore one can classify the modes according to their azimuthal symmetry into monopole, dipole, quadrupole, etc. modes [11].
According to their field geometry, there are TM-like and TE-like modes. Since there are nine cells in a cavity, there are nine modes with similar field geometry, but different longitudinal distribution along the cavity, forming a passband. The first passband contains TM-like monopole modes and includes the accelerating mode at 1.3 GHz. Two dipole bands, one TE-like and one TM-like, follow, with frequencies between 1.6 and 1.8 GHz, and 1.8 and 1.9 GHz, respectively. A quadrupole band is found around 2.3 GHz, followed by the first higher order monopole band between about 2.38 and 2.46 GHz.
The coupling of the modes to the beam, i.e., how much energy is transferred from the beam into a mode, is characterized by the loss factor, or the equivalent R=Q parameter. Synchronous modes, i.e., modes whose phase velocity is the same as the beam velocity (c in this case), couple more strongly to the beam. The amplitude of the excited monopole modes depends only on the bunch charge, while that of the dipole modes depends also on the transverse beam offset. This is illustrated in Fig. 4 [11], where the frequency of each of the lowest four monopole bands is plotted against the phase change per cell. Each of the nine predicted modes per passband is marked as a diamond. The speed of light line is shown for reference. Modes lying closer to this line will have the strongest coupling to the beam (e.g. the ninth mode in the lowest passband in this figure has an R=Q of 511 , and is the accelerating mode).
Each of the dipole modes exist in two polarizations corresponding to two transverse orthogonal directions. Note that these are not necessarily coincident with the horizontal and vertical planes, as imperfections in the construction of the cavities, and the perturbing effect of the couplers, can lead to a rotation of these polarizations. These imperfections also cause the different polarizations to have different frequencies. This frequency splitting has been observed to be <1 MHz [12,13].
In addition to an offset beam, a tilted beam trajectory, as shown in Fig. 5, or a tilted bunch may also excite dipole modes [14]. In the case of a mode whose phase velocity is synchronous with the beam, the contribution from a bunch that leaves the cavity with a certain offset will be exactly equal in amplitude, but opposite in phase to the signal induced by it entering with the opposite offset. Thus the signals will exactly cancel. There will, however, be a contribution due to the finite length of each of the cells that make up the cavity, since a bunch traversing the cavity at an angle will enter and leave each of the cells with a different offset.
Since the length of each of the cells and the phase change per cell of the mode are known, it is possible to calculate an approximate value for the amplitude scaling between (for example) the mode induced by a 1 mm offset, and the mode induced by a 1 mrad angle.

V. DIPOLE MODE MEASUREMENT
The linear relationship between the dipole mode voltage induced and the offset of the beam with respect to the axis of that mode implies that the voltage waveform can be examined to find the position of the beam as it traverses each cavity. Promising preliminary measurements [15] made on the first FLASH accelerating module showed that a beam position resolution of 50 m could be easily achieved by measuring the time-domain intensity of the dipolar modes excitation with a variable bandwidth spectrum analyzer. The following will explain how the TESLA cavities at the FLASH facility were instrumented in order to examine a particular dipole line, and to explore the possibility of determining the beam position from an analysis of its properties.

A. Electronics
Simulations of the TESLA cavities [11] show that the sixth mode in the first dipole passband, TE111-6, has a strong coupling to the beam, with an R=Q of 5:5 =cm 2 .
Its frequency is 1:7 GHz, with small variations from cavity to cavity. A circuit was developed to filter the HOM output around this frequency, and downmix to a lower frequency for digitization. Its block diagram is shown in Fig. 6. After filtering (20 MHz bandwidth), the signal is mixed with a 1.679 GHz (186 times the 9.0275 MHz accelerator reference frequency) local oscillator (LO). The resulting 20 MHz signal is then digitized at 108 MHz (12 times 9.0275 MHz), with 14 bit resolution. The purpose of locking the LO and the digitizer clock with the accelerator reference frequency is to allow meaningful phase measurements of the signal. Figure 7 shows a more detailed schematic of the electronics [16]. An input coupler sends a small part of the input signal to a test port. A second coupler introduces a 1.697 GHz (188 times 9.0275 MHz) calibration signal to measure the signal amplitude and phase. A two section ceramic filter is used to attenuate signals outside of a 20 MHz bandwidth of 1.7 GHz mode frequency to prevent amplifier saturation. A rf limiter, rated at 100 W peak power, is used to protect the downstream active electronics from possible high output power from the HOM coupler. Note that leakage of the cavity fundamental power at 1.3 GHz is blocked by the passive band pass filter.
A low noise (1.1 dB noise factor), high linearity (27 dBm OIP3) preamplifier is used, followed by a four section, 20 MHz bandwidth ceramic filter. This second filter blocks all frequencies which might alias into the signal band. A high linearity mixer (30 dBm IIP3) is used to mix the signal down to the approximately 20 MHz IF.
The mixer is followed by two stages of IF amplifier to drive the required 1 V, 50 input of the digitizer. A low pass filter at 36 MHz is used to eliminate amplifier noise.
The digitizer is a Struck Innovative Systems SIS3301, eight channel, 14 bit, VME digitizer, operating at 108 Ms=s. Data is collected from the digitizer with the DESY DOOCS [17] control system, and processed offline using MATLAB [18].
Because of the risk of damage to the electronics from high power HOM signals produced by large beam offsets during the experiment, 10 dB attenuators were added to the input of the electronics. This provides increased measurement range, but is expected to degrade the system resolution by a factor of 3, assuming the electronic noise is the limiting factor.
An example of the output of these electronics from one HOM coupler and a single electron bunch is shown in Fig. 8. The beating of the signal indicates the nondegenerate nature of the polarizations of the TE111-6 mode in this cavity. The calibration tone, which has been downconverted to 18 MHz, can be observed as the finite width of the line before the arrival of the beam.
These electronics were installed on each of the couplers on all eight cavities, in each of the five accelerating modules present in the FLASH facility.
Using a model developed for the beam optics in the machine [19], the beam was steered to a range of values in the horizontal and vertical phase spaces, x; x 0 and y; y 0 . The response of the TE111-6 mode was measured at each steerer setting. This is illustrated in Fig. 9.

B. Singular value decomposition
A straightforward method of extracting beam position information is to determine the amplitude of the signal at the peak frequency of each of the two polarizations, and to correlate this with the position interpolated from BPM readouts [20]. This method is problematic, however, due to the varying degrees of degeneracy that exist in each of the 40 cavities. Figure 10 shows four different spectra recorded from different cavities. It can be seen that the exact frequencies of the polarizations are only trivial to determine if they are identical, or if the split is of the same magnitude or larger than the linewidth. Also, this technique does not make use of the phase information in the regression to find the beam position.
An alternative analysis scheme is to perform a singular value decomposition (SVD) [21] of the data. This method does not require knowledge of the mode frequency or the machine optics [22].
SVD decomposes a matrix, X, into the product of three matrices, where U and V are unitary, and S is diagonal. V T indicates the transpose of V.
In the case where each row of X is the waveform for a different beam pulse, the rows of V will form a basis set for X. The diagonal elements of S-known as the ''singular values''-are proportional to the average amplitude of each of these basis vectors. U is a matrix of vectors containing the amplitude of each of the basis vectors in V for each beam pulse.
If r is the rank of the matrix X, then Eq. (1) can be written as an expansion,  An approximation, X k , to X with a rank of k can be produced by replacing r with k < r in Eq. (2), and it can be shown [21] that X k is the nearest, in a least-squares sense, rank k matrix to X. That is, the 2-norm distance 1 between X and X k is minimized. It can also be shown that this 2-norm distance is where the double vertical lines indicate the 2-norm. Therefore, the 2-norm difference between the rank k approximation and the input matrix is equivalent to the k 1 singular value. This is important in that it implies that, in an SVD analysis where only the first k basis modes are found, it proves that the sum of these modes will provide the closest approximation to the data in a least-squares sense.
The intuitive cavity modes are expected to be linear combinations of these basis vectors.

C. Data preparation and analysis
In principle, the measurements of both polarizations (in the case of nondegeneracy) from one HOM coupler are sufficient for a given cavity. However, since the polarizations may be degenerate, or the polarization directions of the modes may be rotated so that only one of them couples to one of the couplers, it is important to include the output of both couplers in the SVD analysis. To this end, the outputs of the two couplers were concatenated to create the rows of X. This is shown in Fig. 11 (a constant term has been subtracted to give a zero mean in the absence of the beam).
A time window was used in order to cut off the saturated part early in the waveform (see Fig. 8, the data was cut at sample number 300). This increases the dynamic range of the system at the expense of the resolution. Beam pulses with excessively low or high charge, large offsets, or BPM/ toroid problems were cut from the analysis.
Since the transverse beam motion has 4 degrees of freedom-x, x 0 , y, and y 0 -it is only the top four SVD modes that need to be analyzed, as the rest can be assumed to be spurious correlations with noise. There could, however, be extra SVD modes relating to the calibration tone, or the beam field coupling directly to the HOM couplers, so it was decided to find at least six modes. That is, k 6 in Eqs. (2) and (3). The MATLAB svds function was used for this.
For each machine pulse in the calibration data set, the amplitudes of each of the SVD modes were found. This was done by calculating the dot product of each of the modes with the calibration data, as follows: where A is a matrix containing the amplitude of each of the SVD modes in each pulse of the data set, V is the matrix of SVD modes found in Eq. (1), and X is the original data matrix. Note that A is identical to the U matrix found in Eq. (1). It is useful to calculate it the way shown in Eq. (4) since U will be unknown for data sets to which the calibration will be applied. The matrix of mode amplitude vectors was then regressed against the position of the beam in the cavity as interpolated from BPM measurements. In other words, a least-squares fit was performed to find matrix M in the following system of linear equations: where Y is the matrix of beam positions in x and y for each beam pulse. This calculation was initially applied only to the x and y offsets as interpolated from the BPMs, and not x 0 or y 0 . M was then used to measure the offsets directly from the HOMs, and then x 0 and y 0 were calculated from these. A second regression was then performed against x 0 and y 0 in order to have the HOMs calibrated to measure angle as well as position.
Thus, the calibration consisted of finding the SVD modes with the largest singular values, and the calibration matrix that converts from the amplitude of each of these to a 4D beam position.

D. Beam position measurement
An example of the output of the electronics was shown in Fig. 8. Figure 12 shows an example of the top eight SVD modes, along with their associated singular values. It can be seen that the magnitude of the singular values falls by almost 3 orders of magnitude between the first and eighth modes, giving confidence that between six and eight modes provides an accurate representation of the data. In other words, these data and Eq. (3) imply that eight modes is a very good representation of the data. Figure 13 shows the contribution of each of the eight SVD modes to the x and y modes, as calculated from the regression matrix. The values in this plot have been scaled, for the purposes of readability, to make the maximum values equal one. This also confirms the fact that the majority of the information is contained in the first few modes. Figure 14 shows the reconstructed x mode. As expected, the calibration tone (clearly visible in Fig. 8) can no longer be seen. Also apparent is that the mode polarizations are not coincident with the x and y axes, as a small amount of beating between these two modes can be seen in the reconstructed x mode.
Using a calibration against the first six SVD modes, the position of the beam was measured in cavities #4 and #6 of module #5, and this was used to make a prediction about the position of the beam in cavity #5. This prediction was compared with the measured position in that cavity, and Figs. 15 and 16 show the spread in the difference between predicted and measured for 65 beam pulses. The rms of these residuals is 11 m for x and 5 m for y. After multiplying by a factor of 2=3 p to account for the contribution of the resolution of cavities #4 and #6 to this number, the resolutions are 9 m for x and 4 m for y.
These calibrations were then used to determine the angle of the beam by fitting the offset in each of the eight cavities to a straight line. These measured angles were then used to generate an angle calibration matrix, and the residuals of the measured angles to the predicted angles are shown in Fig. 17 and 18 for x 0 and y 0 , respectively. The angular resolutions were measured to be 175 rad for x 0 and 140 rad for y 0 .

E. Theoretical resolution
The energy, U, deposited into a particular mode in a cavity is [23] U R where R=Q is given in units of V=pC cm 2 , ! is the angular frequency of the mode, and q is the charge of the beam. A fraction, , of this energy will couple to the HOM coupler, where 0:5 [24]. The measurement resolution is limited by the thermal noise, and the minimum detectable thermal energy, Uth, is where k b is Boltzmann's constant, and T is assumed to be 300 K. For a 1 nC beam, this corresponds to a resolution of 6 nm.
Given the cable losses of 10 dB, the electronics noise figure of 6.5 dB, and the 10 dB protection attenuator on the electronics, this leads to a theoretical minimum resolution of 130 nm, as compared to the observed resolution of 4 m.
In order to calculate the predicted angle resolution, the phase change per cell of the mode and the effective length of each cell must be used. Since it is the TE111-6 mode that is being examined, the phase change per cell is 120 degrees. For this calculation it will be assumed that the effective cell length is 115.4 mm (see Fig. 2).
A beam that enters the cavity with an offset will induce an oscillation that, in the case of a synchronous mode, will follow it through the cell, and will therefore have changed phase by 120 degrees by the time it reaches the end of the cell. If its trajectory causes it to pass through the electrical   center of the cell, and, therefore, exit with the opposite offset to which it entered, it will induce a second oscillation of the same amplitude, but opposite phase to the first. These two oscillations will then have a phase difference of 60 degrees, and will superimpose to create an oscillation with 1:7 times the original amplitude.
A bunch passing through the cavity with an angle of 1 mrad will enter and leave with an offset of 57:7 m and ÿ57:7 m, respectively. The scaling factor of 1.73 implies that a 1 mrad signal will, therefore, have the same amplitude as a 100 m position signal.
This scaling implies that a theoretical position resolution of 130 nm leads to a theoretical angular resolution of 1:3 rad, as compared to the observed resolution of 150 rad.
There are believed to be two main causes of the discrepancy between the theoretical and observed resolutions.
1. The coupler output must be normalized by the bunch charge before the position calculation is made. Therefore, in order to achieve 1 m resolution at 1 mm offset, an accuracy of 0.1% is required of the charge measurement. The FLASH toroids have a measured resolution of 0:6%, therefore contributing 6 m to the position resolution, and 60 rad to the angular resolution.
2. The LO used to shift the frequency of the HOM output has a measured phase noise of 1 degree rms. This will cause a mixing of the phase and angle measurement, and is sufficient to degrade the resolution to the observed value. This would add 1 m to the position resolution, and 200 rad to the angular resolution. Therefore, it can be seen that measured position noise is dominated by noise in the charge normalization, and that the angular noise is dominated by the LO phase jitter.
For future measurements, the amplitude of a monopole mode could be used as an accurate measure of the beam charge for normalization purposes. The stability of the calibration tone, whose generation is based on the same circuit design as the LO generation, has been measured to be a factor of 5 times more stable in phase, than the LO. This indicates a problem with the electronics, not a design flaw, and it is expected that a major improvement in stability could be gained with a relatively modest effort.

F. Cavity alignment
In each cavity, there is a well-defined orbit that will result in minimum power being coupled into a particular dipole mode. The relative positions of the locations of these mode axes can be found for all the cavities in each module in order to give a measure of the alignment of that particular module.
The amplitudes of the SVD modes were regressed against the measured beam position as before, and the position associated with the minimum of the sum of the squares of the mode amplitudes was found. Since the angle measurement has been shown to have a poor resolution, it was decided to perform the calculation in the x; y plane only.
The calculated mode axes are shown in Fig. 19 and 20 for ACC4 and ACC5, respectively. The rms alignment of the cavities with respect to each other for ACC4 was 105 and 215 m (for x and y, respectively), with a measurement reproducibility in x and y of 37 and 24 m. In ACC5, the rms alignment in x and y was 241 and 203 m, with a measurement reproducibility of 9 and 5 m. Note that the difference between the various measurements is partially due to the measurement precision, and partially due to the movements of the cavities inside the modules with time.
Also, it is important to note that this measurement shows the center of the TE111-6 mode only, and that measurements using other modes are expected to yield different results.

VI. MONOPOLE MODE MEASUREMENTS
Superconducting linac based FELs, and the international linear collider, require control of the main rf phase relative to beam arrival time at the 0.1 degree level. Measurement of this phase is complicated by drifts in the cables and measurement electronics. At this time the phase measurement is a critical point in the synchronization system at FLASH [7].
The HOM couplers in the FLASH linac have superconducting filters to reject the 1.3 GHz accelerating mode; however, the leakage of that mode through the coupler is comparable in power to the HOM monopole mode signals. This allows a simultaneous measurement of the 1.3 GHz accelerator mode and of the beam induced monopole HOM modes using the same cables and electronics.

A. Monopole signal analysis
The HOM coupler signal, including the 1.3 GHz fundamental leakage signal, is digitized. Since the monopole lines are singlets, identification of the mode frequencies from the spectrum is straightforward. A typical spectrum for the first higher order monopole band for one cavity is shown in Fig. 21. The phase of the monopole lines can be measured and used to define a precise beam arrival time. The phase of the 1.3 GHz fundamental can then be measured with respect to this time. Figure 22 shows a measurement of the 1.3 GHz phase during a 5 degree phase change commanded by the rf control system.

B. Phase measurement results
The measurement noise is estimated by comparing the measured beam relative to rf phase from the two couplers on a single cavity. The difference, after subtracting a phase offset, corresponds to a 0.08 degree rms (at 1.3 GHz) measurement noise.
Interestingly, when the beam phase is compared to the rf phases of two cavities on the same klystron, an approximately 0.3 degree variation is measured. This could be due to microphonics or helium pressure differences between the cavities.

VII. FUTURE WORK
Up to this point, all of the effort has been in developing the HOM system to work as a BPM for single bunch beam; however, in order to be applicable to the ILC, a successful demonstration of the multibunch performance is necessary. This is thought to be possible due to the linearity of the system, and the fact that the FLASH/HOM data acquisition system is synchronous with the bunch repetition rate. Therefore, despite the high Q of the dipole modes causing signals from different bunches to overlap one another, we expect to be able to deconvolve each bunch, without a serious degradation in resolution. This is due to the fact that the SVD modes evolve in a predictable way, therefore the contribution of the SVD modes from previous bunches can be subtracted in order to find the position of each bunch.
Also of interest is the possibility of using the broadband HOM monitoring system to study the response of several HOM passbands to beam position and angle. This work could be coordinated with the groups performing simulations of the cavities, in order to allow improvements to be made to their simulations and to perform studies of modes predicted to be detrimental to the ILC beam.