Analysis and active compensation of microphonics in continuous wave narrow-bandwidth superconducting cavities

Many proposals for next generation light sources based on single pass free electron lasers or energy recovery linac facilities require a continuous wave (cw) driven superconducting linac. The effective beam loading in such machines is very small and in principle the cavities can be operated at a bandwidth of a few Hz and with less than a few kW of rf power. However, a power reserve is required to ensure ﬁeld stability. A major error source is the mechanical microphonics detuning of the niobium cavities. To understand the inﬂuence of cavity detuning on longitudinal beam stability, a measurement program has been started at the horizontal cavity test facility HoBiCaT at HZB to study TESLA-type cavities. The microphonics detuning spectral content, peak detuning values, and the driving terms for these mechanical oscillations have been analyzed. In combination with the characterization of cw-adapted fast tuning systems based on the piezoelectric effect this information has been used to design a detuning compensation algorithm. It has been shown that a compensation factor between 2–7 is achievable, reducing the typical detuning of 2–3 Hz rms to below 0.5 Hz rms. These results were included in rf-control simulations of the cavities, and it was demonstrated that a phase stability below 0.02 (cid:1) can be achieved.


I. INTRODUCTION
In the past decade many proposals were made for medium energy linear accelerator facilities with beam energies below 5 GeV covering facilities such as free electron lasers (FEL), energy recovery linacs (ERL) foreseen as next generation synchrotron light sources and drivers for nuclear fission to enhance the capabilities of rare isotope experiments [1][2][3]. All have in common the superconducting radio-frequency (SRF) cavities in cw mode to accelerate the electron beam. In contrast to the pulsed operation for high energy machines, such as the XFEL [4], these machines allow potentially a high average beam current and a flexible bunch pattern of the beam. Also, the task of field control may be less complex allowing for high field stability and thus a low energy spread of the beam.
ERLs and FEL linacs operate at a very low beam loading. This allows for optimizing the cavity bandwidth with respect to the external perturbations detuning the cavity eigenfrequency. In principle, loaded quality factors Q L of the order of 10 7 -10 8 are possible. So half-bandwidth of less than 20 Hz at 1.3 GHz operating frequency have to be considered for cavity field control.
The quest for field control requires one to address the following subjects: The main error source for field stability of cw driven cavities is the mechanical detuning by external acoustic vibrations as described in more depth in the following sections. The detuning affects the phase stability È of the rf field as with f the rms detuning and f 1=2 ¼ f 0 =ð2Q L Þ the cavity half-bandwidth. The choice of Q L thus affects the cavity field stability directly, as well as the amount of detuning f . Furthermore, the spectrum of f has to be determined, as part of the detuning may be filtered by the cavities lowpass-like transfer function. The choice of Q L and the level of perturbation by f also determines the amount of power needed to operate at a constant field level: The power P f evolves with the field voltage V cav squared and inversely to Q L . For zero beam loading (I b ¼ 0), the forward power is also proportional to the detuning over the half-bandwidth squared. To reduce the field error, one would need to decrease Q L . But this gain in stability is outweighed by the increase in rf power as given by Eq. (2). Depending on the spectrum of the detuning f , a widening of the bandwidth by lowering Q L may be counterproductive as more detuning components may disturb the field. Thus, one has to judge about the ratio f =f 1=2 ¼ f Q L =f 0 . For a given accelerator it has to be determined what level of field stability would be needed to achieve the desired stability in energy and arrival time jitter of the bunched beam. Thus, it can be calculated in rf field simulations [5] how far the detuning of the linac cavities contributes to the final beam jitter in the longitudinal phase space.
The technology of choice for all following measurements and calculations was the TESLA cavity [ Fig. 1(a)], developed in the past two decades by the TESLA collaboration [6]. Although originally developed for pulsed operation, only minor modifications were required to operate these cw [7]. Nevertheless, the generalizations of the results presented in this paper are valid for all similar high ¼ v=c % 1 multicell elliptical cavities.

A. Beam jitter by cavity detuning
The example calculations shown in Fig. 2(b) were done for the scheme of the BESSY-FEL [1], given by the generic facility layout in Fig. 1(b). To produce an energy chirp on the individual electron bunches for a following bunch compression in a dispersive section, the acceleration is done off-crest on the leading edge of the rf field. However, this intrabunch effect can also be observed considering the bunched beam for a given time period as an ensemble of macroparticles. Figure 2(a) shows the simulated longitudinal phase space of an ensemble of 10 4 electron bunches represented as a macroparticle before and after a bunch compressor dipole-magnet chicane. Before compression the distribution of the beam is determined by two effects. A correlated, linear, energy spread which is determined by the initial time jitter of the beam when leaving the rf photoinjector section is imprinted on the electron bunch. This is due to time jitter of the pulsed laser system extracting the bunched beam from the photocathode, rf field phase errors, and velocity effects by still nonfully relativistic electrons. The widening of this linear distribution is given by the individual phase error of the detuned cavities in the following acceleration sections.
In a bunch compressor this distribution becomes narrower in time as the initial time jitter t 0 is compressed to t 1 as Here R 56 is the linear term of the momentum compaction factor, k the linear correlation between particle energy and longitudinal coordinate, and E E the uncorrelated energy spread by the cavity phase and amplitude errors. The compression is most effective for kR 56 ¼ À1. Any cavity detuning results in deviations of the bunch central energy from this linear correlation. This leads to a less effective  [1] in dependence of the field control gain K P for different cavity rms detuning levels f . The initial jitter from the injector was assumed to be 600 fs, the rf phase noise 0.02 , and the cavity half-bandwidth 20 Hz. Plot (a) shows as an example the bunch distribution before and after a bunch compressor chicane. The lines highlight the linear energy-position correlation. Plot (b) shows the result for correlated detuning. compression of the time jitter and thus a more unstable beam. Figure 2(b) depicts the resulting time jitter for the electron beam in a linac like the BESSY-FEL versus the rf feedback gain of the field control for different rms detuning levels. The initial time jitter of the photoinjector was assumed to be 600 fs corresponding to 0.2 phase error in the injector's rf cavity [8]. Here, the detuning of the cavities is correlated. For seeded FEL schemes the final time jitter has to be well below 60 fs [8] requiring a detuning f 1:0 Hz. In the case of uncorrelated microphonics it is more relaxed, allowing up to 3.5 Hz rms detuning for a jitter below 60 fs.
In general, this means one has to stabilize rf fields down to the 0.01 regime in phase. This requires one to understand the nature of the detuning in cw driven cavities and the minimization of the external error source by detuning compensation in addition to the standard rf field control.

B. Outline of the work
Summing it up, one has to understand and measure the amount of the expected microphonics detuning in the operating range of cavity rf bandwidth optimized for FEL or ERL applications. This will determine the achievable field stability and also the required amount of rf power one will have to install.
Furthermore, using fast tuning systems, a method has to be developed to compensate the mechanical detuning to a minimum. This will improve the operational range of the cavity and allow for rf fields with highest phase and amplitude stabilities down to 0.01 and 1 Â 10 À4 , respectively.
Both issues are addressed in this paper as follows: (i) The sources of the detuning are identified allowing one to design passive means mitigating the detuning. (ii) From time domain detuning measurements the typical rms detuning has been determined and the occurrence and amplitude of peak detuning events have been evaluated. (iii) The spectral content was analyzed and, especially, whether the spectrum is constant with time. (iv) Fast tuning systems were analyzed for their properties in cw application.
(v) Including the properties of the microphonics detuning and the fast tuning systems, a detuning compensation scheme was developed and successfully tested.

II. MICROPHONICS DETUNING
Potentially, many different forces (as shown in Fig. 3) can act on a cavity to detune its resonance. In TESLA cavities, a change of the cavity length by a mere 1 nm results in a frequency shift of 0.3 Hz [9]. External vibrations caused by machinery like vacuum pumps and pressure changes of the helium bath may transfer via beam pipes, rf waveguides, or helium supply lines to the cavity body. Also ground motions, broadband manmade noise, partly filtered by the transferring medium may act on the cavity.
As discussed later, an important noise source is the helium cooling system due to pressure variations or changes of the level in the two-phase line. A detuning to pressure dependency of 55 Hz=mbar had been measured at HoBiCaT [8]. Further, in high field operation with cavity dynamic wall losses of several tens of Watt boiling may occur in the superfluid helium.
Finally, the radiation pressure of the rf field exerts a force on the cavity walls. Thus, a change in the field amplitude by strong microphonics will be further amplified by the so-called dynamic Lorentz-force detuning. In an rf feedback loop this may lead to an instability called ponderomotive oscillation [10].
As will be shown later, all these forces may excite mechanical eigenmodes of the cavity-tuner structure.

A. cw detuning measurements
The mechanical deformation of a cavity results in a shift of its resonance frequency. When driven by a fixed frequency derived from a master oscillator, the cavity responds with a reduction of the field amplitude and a phase shift ÁÈ. The (time dependent) detuning Áf expressed by the phase shift is thereby given by Here ÁfðtÞ is the current detuning and f 0 the frequency of the cavity fundamental mode. Thus, the cavity phase can be used as a mechanical ''sensor.'' With superconducting niobium cavities even nm deformations can be detected. An extreme example of a cavity used as a sensor for gravitational waves is presented in [11].

B. Measurement setup
The scheme given in Fig. 4 gives an overview of the rf measurement setup at HZB's HoBiCaT test facility for the detuning measurements. The cavity is driven open loop by a tunable reference oscillator. The forward wave signal of this source is split to allow a measurement of the current forward frequency by a frequency counter and to supply a signal path for the phase error measurement.
This signal drives the 17 kW inductive output tube based rf amplifier. A three-stub-tuner and the variable penetration depth of the TTF-III input coupler antenna into the beam pipe coupler port allows a variation of the coupling strength to cover loaded quality factors of the cavity from 1 Â 10 10 down to 1 Â 10 7 .
The transmitted power signal and thus the excited rf resonance of the cavity is extracted via a pickup antenna with small coupling strength (Q ext $ 5 Â 10 11 ).
For the phase and thus detuning measurement, the transmitted power signal is amplified by a phase stable limiting amplifier to eliminate amplitude variations. This ensures a pure phase shift measurement between the reference signal and the transmitted signal at a low noise rf mixer. Phase offsets due to the rf cabling can be compensated for by a phase shifter in the reference signal path.
The phase error signal is further processed by a low-pass filtering amplifier for optimum signal-to-noise ratio, removal of higher-frequency components of the mixing process, and to avoid aliasing due to the following sampling process. The sampling frequencies were chosen between 1.0-5.0 kHz to cover the detuning range of several hundred Hertz while still allowing for further filtering by software means.
Furthermore, the limiting amplifier and the reference source guarantee optimum input power levels at the rf mixer for maximum detector sensitivity.
The measurement accuracy is mainly determined by the phase noise of the reference oscillator and the phase stability of the limiting amplifier. For a detuning measurement resolved down to 0.1 Hz at 1.3 GHz with a cavity halfbandwidth of 20 Hz, one would need a phase noise error less than 0.3 . The limiting amplifier was shown to have a phase error of better than 0.02 .
The reference oscillator induced a measurement error due to sideband phase noise modulation of the carrier frequency. The total phase error adds up to as [12] with B the measurement bandwidth, ! 0 the carrier frequency, f m the sideband modulating frequency, and rad the phase noise amplitude in radians at the modulating frequency. Depending on the used signal sources this error varied between 0.05 -0.28 corresponding to 0.02-0.1 Hz detuning at For the open loop measurement, the measurement errors for high cavity detuning above the cavity bandwidth increase to several percent, diverging for phases approaching =2 (Áf ! 1). In that case the measurement was performed in closed loop phase-locked loop operation and the real cavity detuning was reconstructed from the residual error signal of the loop by applying the phase-locked-loops (PLLs) transfer function. In addition to the phase noise, the measurement is hereby further diminished by the uncertainty in determining the loop parameters.

C. Measured detuning
A typical time domain detuning data set is given by Fig. 5(a). It shows slow drifts of the cavity frequency over ten seconds. A zoom into the data reveals a faster oscillation at 30 Hz [ Fig. 5(c)]. A good measure for phase stability of a cavity is given by the rms value of the detuning data and the detuning distribution. Most measurements yield a near Gaussian distribution with rms values ranging between 1.0-5.5 Hz as shown in Fig. 5(b). Sometimes bimodal distributions may occur which are caused by strong sinusoidal driving terms.
Because of the limited bandwidth of the cavity, frequency components of more than double the halfbandwidth have a negligible influence on the total cavity detuning. A good visualization of the influence of each modulating detuning source is to calculate the integrated rms detuning spectrum by Áf rms ðf mod;n Þ is the integrated detuning spectrum up to the modulating frequency of index n of the Fourier components F ½ÁfðtÞ i . The integrated spectrum is given in Fig. 5. A significant fraction of the detuning is caused by low- frequency modulations below 1 Hz and are mainly generated by variations of the pressure in the liquid helium bath surrounding the cavity. In total, the contribution by the helium system is about 30%-60% of the total rms detuning. The determined static dependence of the cavity frequency towards changes in the liquid helium pressure is about 55 Hz=mbar. The usual pressure stability was around 15-30 bar rms. For TESLA cavities, another distinct source for detuning is a line between 30-41 Hz. As will be shown later in Sec. III, this is an excited mechanical eigenmode of the cavity-tuner system. To identify driving terms of these mechanical oscillations, possible contributors were switched off. Surprisingly, vacuum pumps (turbo pumps for the isolation vacuum) and water cooling pumps had a negligible impact. Rather, the mode excitation appears to be due to broadband and random source [8]. This was shown by calculating the autocorrelation of the detuning signal. Beforehand it was filtered by mathematical means to the frequency of the corresponding line in the spectrum. The autocorrelation of the detuning at 41 Hz showed the behavior of a second order system excited by broadband random noise.

Peak events
For a stable cavity and thus linac operation, the rf system needs to deliver enough power to compensate for the largest detuning events. Otherwise the danger of the cavity field trip exists. To measure how often and what kind of peak events occur, the detuning was recorded over a period of 48 hours. Figure 6(a) shows the resultant histogram distribution. It is a Gaussian distribution with a pedestal of events at higher detuning amplitudes. The Gaussian distribution has a sigma of 0.82 Hz [see fit in Fig. 6(a)], increasing to about 1 Hz rms if one includes all measured events. This value is quite low, mainly because the helium pressure had been stabilized down to 17 bar. But occasionally, peak events of up to 16-17 standard deviations occurred. Figure 6(b) shows the time domain structure of the maximum detuning measured. It exhibits a strong excitation of the first mechanical eigenmode of the TESLA structure and typically lasts about 10-40 seconds. Such events occurred about 5-10 times in a 12 h period. If insufficient rf power were available, this would result in a cavity trip rate of 10-20 times per day.
System events correlated to the peak detuning were not found and the process triggering this strong rise of the detuning is still not clear. The in parallel recorded heliumpressure signal did not show a triggering event explaining the peak detuning. Though it may be masked by the 10 Hz bandwidth of the pressure sensor unit. The measurements in [8] showed that the driving source of the first eigenmode is broadband mechanical noise, for which it is hard to locate its origin. In future measurements we will use a cryocapable seismic sensor which would record in parallel to the detuning the external mechanical noise acting on the cavity helium vessel. Even though the peak event recorded at HoBiCaT seems harmful for a stable machine operation, the total detuning is quite low with about 1 Hz rms. Further, the HoBiCaT cryostat was not optimized for damping of mechanical oscillations rather than to serve as a very flexible cavity test facility. Thus, these measurements show the need for a careful cavity module cryostat design to damp possible driving sources for microphonics.

D. Time-frequency analysis by wavelets
The nature of the mechanical detuning determines what type of control system and algorithms must be developed to actively compensate microphonics. In detail one has to understand the following: (i) Are the spectral components of the microphonics detuning invariant with time in amplitude? Do specific error sources change their frequency with time? (ii) If the amplitude of the spectral components is not time invariant, is this amplitude modulation driven by stochastic or deterministic processes? (iii) Are there components appearing in the ''mean'' Fourier spectrum of a longer time sample, that only emerge for a subrange in that time? These are important features to determine, as strong spectral variations with time would inhibit the use of a pure feedforward technique. To address these issues the technique of time-frequency analysis by wavelet transformation was used [13].
The discrete time domain data are transformed into Fourier space and convolved by a Morlet waveletÉ 0 given in the frequency domain by [14] with ! 0 the unscaled center frequency transforming to Þ, ! the frequency, s the scaling parameter, and Â the Heaviside function. In contrast to the standard Fourier based windowed time-frequency method, the characteristic of a chosen wavelet function allows for an improved resolution of steep changes in the spectrum with time. The convolution of the discrete data set Á! n with the wavelet and scaling the frequency in the desired range of interest delivers the wavelet transform plot as in Fig. 7 Here nt is the translation in time and s! i the scaling of the frequency in the microphonics detuning range with the needed resolution and F ðÁ! i Þ the discrete Fourier transform of the time domain data set. The wavelet transform power spectrum in Fig. 7(b) was zoomed to the excited first mechanical eigenmode. The ordinate shows the translation of the spectrum with time while the abscissa depicts the modulating frequency of the detuning contribution (Fourier domain frequency). The color code is the measure for the detuning amplitude at a given time and frequency. Within a resolution bandwidth of 3 Hz, the amplitude of the eigenmode caused microphonics at about 41 Hz varied between 0.2 and 10 Hz detuning on a subsecond time scale.
Not shown is the low-frequency modulation by pressure variation of the liquid helium bath. This spectrum with time showed to be of a more random nature. There are no distinct and constant lines with time. The low-frequency spectrum of the helium bath fluctuates randomly in frequency over time. Rarely sinusoidal oscillations below 1 Hz modulating frequency by thermoacoustic effects occurred with frequencies around 0.8 Hz.

E. Summary of detuning measurements
A summary of all short-term microphonics detuning measurements at HoBiCaT with three different TESLA cavities is shown in Fig. 8. We did not see a significant difference in the detuning level between the different cavities. Only the frequency of the first mechanical eigenmode seemed to depend on the cavity being at 30 or 41 Hz. The rms values of this data provide an overview of the expected detuning in HoBiCaT. The data presented here were all taken for Q L ¼ 3 Â 10 7 , a typical value for a cw linac. Some rms values from 1.2-3.4 Hz were observed corresponding to open loop phase errors from 3.2 -8.9 . To reduce the phase error to values below 0.02 this would necessitate an rf-control system with gains of 160-450. It is questionable if this is achievable with enough stability margin.
Similar measurements have been performed at Jefferson Laboratory and Argonne for the SNS, RIA, and CEBAF projects. The devices under tests were five-to seven-cell elliptical medium and high beta cavities with a similar shape to the TESLA cavities as well as spoke resonators [15][16][17] for low beta applications. The rms level was similar to HoBiCaT with values between 1 and 6 Hz.
Values measured for TESLA cavities in modules are published in [18] and are between 4 and 9 Hz rms. This significant difference may be explained by the lower quality factor of 3 Â 10 6 at the TESLA Test Facility (now FLASH) and remnants of excited eigenmodes due to the pulsed rf operation.
To achieve a low phase error, the lowest mechanical eigenmode is of major concern. This is especially true for low-bandwidth cw linac cavities of ERLs and single pass FELs. The outcome of the detuning measurements in combination with the mechanical analysis of the cavitytuner system in the following section will show that a detuning control system needs to adapt to the continuous changes of the individual detuning amplitudes. The detuning caused by the slow helium-pressure fluctuations can be compensated by means of a classic feedback operated fast tuner system.

III. CHARACTERIZATION OF TUNING SYSTEMS
Every accelerating cavity is equipped with a tuning system to match the resonance frequency to the desired accelerator operating frequency. For elliptical niobium cavities stepper motors change the length of the cavity via a lever system. For TESLA cavities, the tuning systems need to cover a range of about 300-500 kHz minimum to compensate for cavity manufacturing tolerances and changes during cooldown. To compensate the dynamic Lorentz-force detuning by the pulsed rf mode of operation [19], most modern tuning systems work with an integrated piezo tuner to compensate the detuning by the rf pulse [20,21]. For cw-operated cavities, pulsed Lorentz-force detuning no longer is an issue but such fast tuners lend themselves to compensating microphonic detuning. In the case of cw-operated cavities, the perfect fast tuning for compensation of the microphonics should incorporate the following properties: (i) Achieve a displacement of several m in a cryogenic environment between 2 K up to 20 K. This corresponds to a tuning range of several hundred Hertz. (ii) A sub-Hertz resolution should be achieved to compensate individual lines of the detuning spectrum. Thus, nm control of the tuner is required. (iii) There should be only few mechanical resonances in the range of microphonics detuning. (iv) The response time should be in the submillisecond regime for a small phase lag in the control loop to ensure a large gain margin. This is equivalent to a high stiffness of the tuner [22]. Hence, for dynamic applications knowledge of the fast tuning properties is of paramount importance. Figure 9 depicts two of the tuning systems which were tested at HoBiCaT. On the left side the TTF tuner, also referred to as the Saclay I tuner, is shown; the right pictures depict the Saclay II tuning systems [21]. Both were originally developed in the framework of the TESLA project for pulsed cavity operation. In the case of the Saclay I tuner the piezo tuner had been modified at HZB to better fulfill the requirements set by the cw operation [23].

A. Transfer function measurements
The implementation of a detuning compensation system requires the inclusion of the phase and amplitude response of the cavity-tuner system when deformed by the piezo in the controller's algorithm. Thus, the transfer function of the system must be measured. Mechanical eigenmodes will add phase shifts to the total control loop that lead to instability for a standard feedback operation. Figure 10 depicts the setup for the transfer function measurement between the piezo drive signal and the detuning response of the cavity. For an exact measurement by omitting the low-pass behavior of the narrow cavity bandwidth the loop is closed (phase-locked-loop operation). The PLL transfer function, determined by the loop gain, determines how much the cavity low-pass-like transfer function is compensated. This is important to reveal the real mechanical response independent of the cavity bandwidth. The maximum loop gain is limited by the measurement resolution as the detuning amplitude is obtained from the residual PLL error signal.
The measurement itself is performed with a Stanford Research Systems lock-in amplifier model SR 850 for optimum noise suppression and to measure the steady state cavity response at a piezo modulation in frequency domain. Thus, the piezo is driven by the internal reference signal of the lock-in amplifier. The lock-in amplifier determines, by demodulation, the detuning amplitude and the phase lag between driving signal and detuning response signal from the residual PLL phase error signal. As the quality factor of the mechanical modes are an unknown property before the measurement, each frequency step had been measured for at least 4 s to obtain the steady state response for each data point.
In Fig. 11 a characteristic transfer function with the Saclay II tuner is shown. Figure 11(b) depicts the phase lag between the driving signal and the detuning response signal. Thus, by fitting a linear curve to the lower frequency part of the phase response, one obtains the group delay by the slope of that curve. In general values below 1 ms have been measured, mostly below 500 s limiting the theoretical detuning control to frequencies below 1.0 kHz.
The amplitude response shown in Fig. 11(a) shows the mechanical eigenmodes of the cavity-tuner structure. Finite element calculations [24,25] agree with these measurements. Regarding the narrow cavity bandwidth of low beam-loading machines, the contribution of the eigenmodes above 100 Hz will be of limited significance.
A major contribution to the microphonics detuning is given by the permanently present but time-varying excita- tion of the lowest mechanical mode. The frequency of this mode is impacted primarily by the cavity rather than the tuning system, and it generally lies between 30 and 41 Hz.
The tuner primarily impacted the stiffness of the overall system, thus affecting the group delay and also on the coupling strength to the eigenmode structure. This was tested by measuring the transfer function of the Saclay I tuner with different preloads on the piezo. Also, it changed the shape of the mechanical resonances. This kind of behavior is plotted in Fig. 12. It shows the structure of the lowest mode for the two different tuning systems. The mode is in both cases at about 41 Hz, but differs in its substructure. In general, the lowest mode is composed of a pair of resonant and antiresonant response (red curve). The positive (resonant) peak shows a typical Lorentz curve distribution. The neighboring antiresonant response is characterized by a negative Lorentz peak. That means, at this frequency the measured detuning due to the piezo is below the pedestal detuning level. The curve of the Saclay II tuner in Fig. 12 nearly vanishes to zero for the normalized detuning amplitude. Possibly the piezo oscillation at that frequency is transferred to a mechanical eigenmode of the structure which imposes nearly no change for the boundary conditions of the TM 010 mode.
This behavior may be understood by comparing the data with finite element calculations to simulate the vibrational mode spectrum [26]. They predict the first mode given by the bare cavity structure with the boundary conditions of the stiffening rings and the helium vessel at 70.9 Hz. This frequency drops to a value between 31-36 Hz due to the installation of additional weight by the higher order mode and fundamental couplers. The asymmetric coupler positioning leads to two axes of polarization of this transverse mode.
For a more in-depth analysis of these piezo-to-rf detuning transfer functions, one has to take into account that the rf mode may be ''transparent'' to some mechanical modes of the structure, e.g., a transverse mode oscillating the structure in total without a measurable detuning of the rf resonance. This may lead to an unwanted energy modulation of the beam which is not controllable by the rf field control or at least represents a time-varying misalignment of the cavity to the beam [27].
The Saclay II tuner appears to double this structure of the first mode which hints at a breakup of the degeneracy of this transverse mode. To fully address this issue future measurements with seismic sensors installed at both transverse planes of the cavity next to the helium vessel will confirm these assumptions.
In any case, these steep variations of amplitude and phase versus frequency have to be incorporated in any controller counteracting multifrequency microphonics detuning.

B. Fitting the transfer function
To obtain more information about the transfer function, a fitting of the measured response by a model of parallel acting second order systems as derived in [24,25] has been performed. The model incorporates a linear combination of the modes in the fitting range, the low-pass behavior by the tuner's group delay and a further offset by the trailing edges of higher-frequency modes beyond the frequency range of the measurement. The time domain model is given by Á € ! cav;k ðtÞ þ 2 m;k ! m;k Á _ ! cav;k ðtÞ þ ! 2 m;k Á! cav;k ¼ AEk piezo;k 2! 2 m;k V piezo ðtÞ Á! cav ðtÞ ¼ X k Á! cav;k ðtÞ (9) with Á! cav;k the time-varying cavity detuning, m;k the mechanical modes damping constant, ! m;k its frequency, k piezo;k the piezo's coupling constant, and V piezo its voltage. Transforming the time domain equation into frequency Laplace domain gives the steady state solution of the second order system. Including the terms for the group delay and higher-frequency modes, the total transfer function model HðsÞ is given by e ÀT delay s : (10) Here s is the Laplace complex variable s ¼ þ j!, M 0 the DC response including the higher-frequency components above the measurement range, a low-pass time constant representing the passband of the measurement system, N the number of modes, M k the mode's amplitude, and T delay the measured group delay. Because of the possible antiresonant behavior k piezo;k and thereby M k may also be negative. Figure 13 depicts a fit result of the transfer function up to several cavity bandwidths (f 1=2 ¼ 20 Hz). For that result up to 40 second order systems were needed to reconstruct the transfer function with that accuracy. Four modes behaved in an antiresonant way with a negative amplitude M k . Most of the modes had very low amplitudes and are thus not visible in any microphonics spectrum. However, they alter the phase response of the system at their frequency and alter the shape of neighboring modes. Thus, they need to be included. For this subrange of 10-200 Hz the fitting parameter space dimension to be optimized was 123.
An automation of the fitting routine by including a peak search algorithm did not show a reliable and stable behavior. The search algorithm did not always distinguish between real peaks and noise induced changes in the transfer function's slope. Complications also arose due to the fact that M k can be both positive and negative. Furthermore, the vast number of system parameters makes an integration of a model based design, as, e.g., a Kalman filter [28], im-  practical for current digital signal processing systems. Thus, the implementation of the transfer function in the form of look-up tables in the controllers appears to be a more attractive option. However, the model obtained by the fitting routine was later used to simulate the cavity performance with various error sources and different rf control and tuning control systems. This permitted us to make predictions for the linac performance [5]. For future tests, one might also think about representing the complex transfer function by a minimal state space realization if applicable [29].
C. Optimum tuner for cw operation Table I summarizes the tuner characterization measurements done at HoBicaT. Preferable fast tuning attributes are marked by the italic letters.
In principal, all tuning systems show a similar performance and were originally intended for pulsed rf operation where they already demonstrated their capabilities [20,21,30]. With respect to cw operation, the tuner with the least complex transfer function in the frequency range relevant for detuning control showed the best results in detuning control. It also appeared to have the lowest system latency allowing a more robust microphonics control and fewer excitation of mechanical modes visible in the microphonics spectrum. These features were mostly fulfilled by the most simple mechanical design of the Saclay I tuner. Also, one might think of improving this tuning scheme even more by symmetrizing the piezo tuner installing a second tuning set opposite to the first piezo holder. This may decrease the probability to excite transverse modes in an unwanted way.

IV. DETUNING COMPENSATION
The cw detuning measurement results showed, that a controller has to fulfill the following prerequisites: (i) Control microphonics at low frequencies with a stochastic spectrum with time. (ii) Control microphonics in the form of excited mechanical eigenmodes incorporating a complex multimode transfer function. (iii) Adapt to changes in the amplitude and phase of the individual detuning components visible in the spectrum. (iv) Resolve detuning down to 0.1 Hz to reduce the total rms detuning below 1 Hz, especially if several modes are present.

A. The controller
A combination of PI control and adaptive feedforward has been adopted in order to compensate both the lowfrequency stochastic detuning due to helium-pressure fluctuations and the higher-frequency components of the spectrum due to mechanical eigenmodes.
An overview of the controller is given in Fig. 14. Noise is represented by an unknown external mechanical excitation that is transferred via the beam pipe or the cryovessel to the cavity. The cavity detuning is measurable by the phase shift between reference oscillator and cavity transmitted power signal as described in Sec. II. This sampled signal e n is split for the feedback and feedforward path of the controller marked by the blue and grey boxes in the scheme, respectively.

Feedback control
For the PI control path the signal is processed by a lowpass filter of 1st order with a 3 dB cutoff frequency around 1-2 Hz to only compensate for modulations of the cavity below 10 Hz thereby suppressing any unwanted excitation of mechanical eigenmodes.  082001-11 Figure 15 shows the residual detuning at modulation frequencies below 10 Hz for different proportional feedback gains. The open loop detuning was about 1 Hz rms. For gains above 10-20, the achieved detuning reduction appeared to saturate compared to the theoretical values given by the dashed black curve. This may be explained by the resolution limit of the tuner of 0:2 Hz. Investigations by control theory methods also demand for a gain of less than 25 to allow for stable operation reserving enough phase margin for the expected peak detuning events [8]. Any higher gain leads to an increased probability exciting the first mechanical eigenmode by the feedback path.

Least-mean-square based adaptive feedforward
For higher-frequency resonances, an adaptive feedforward scheme is used to take into account the complexity of the transfer function. Here, a reference (feedforward) signal is applied to the fast tuner. However, first it is modified by a finite impulse response filter that takes the piezo-to-rf detuning transfer function into account to create a signal which effectively produces a detuning signal that is phase shifted by 180 with respect to the external detuning that should be compensated.
The feedforward signal should resemble the externally acting forces as well as possible. Unfortunately, this information is not accessible because the measured detuning already includes an unknown transfer function. In principle unknown oscillations z n act via an unknown mechanical transfer function H ext!Áf from the external world on the cavity resulting in a detuning.
To extract an approximate reference signal, the measured microphonicsẽ n are transformed to the tuner side of the system by deconvolving it by the piezo transfer function (H piezo!Áf ) in Fourier space. This 1-2 seconds long signalx n is continuously fed to the FIR filter coefficients of w n to create the feedforward samples which are further processed by bandpass filters to reduce the probability of exciting neighboring eigenmodes. A phase shifter compensates for the loop's phase shift . The complete feedforward signal is given by withê n the Fourier transform of the sampled residual detuningẽ n . Thus, the residual detuning e n at time step n is given by e n ¼ H ext!Áf z n À H piezo!Áf y n sinð shift Þ: If the detuning were perfect white noise, the FIR filter coefficients would form the inverse transfer function of H piezo!Áf . At the beginning the filter coefficients are initialized to zero. A least-mean-square based update algorithm changes the filter coefficient values according to the steepest decent method [31] by using the current residual detuning value e n to determine the amount and direction of change. The update rule is given bỹ w nþ1 ¼w n À e nxn þx T nxn : (13) Here is the update gain and a summand >0 to avoid divergence for very small values of the reference signal x n . In the case of convergence, the filter coefficients are updated until a minimum of the residual detuning is reached by adapting the FIR filters amplitude and phase response to match the external excitation and the transfer function.

B. Compensation with the full controller
After successfully stabilizing the cavity resonance by the PI controller driven piezo tuner (as in Sec. IVA 1), the feedforward signal was added to the PI signal to further reduce the detuning caused by the dominant mechanical resonance at 30 Hz (Saclay I tuner). The algorithm converged quickly after the correct loop phase had been set with the software phase shifter. This is determined by the stability margin of the algorithm. Assuming a perfect reference signal processed by the inverse transfer function, a maximum deviation in phase of 90 is allowed [32]. Otherwise the detuning is amplified rather than damped. Figure 16 shows the time domain detuning data measured at 1.8 K and a loaded quality factor of 6:4 Â 10 7 (10 Hz half-bandwidth). The rms open loop detuning of 2.5 Hz, reaching peak values of 12.5 Hz, was compensated by the PI controller to 0.9 Hz rms by reducing the lowfrequency components by a factor of 15.5. Essentially all remaining detuning is due to higher-frequency ( > 10 Hz) components. This is illustrated by the integrated detuning spectra of Fig. 17. The remaining eigenmode contribution had an envelope amplitude modulation of a factor of 4 on a subsecond time scale (Fig. 16). The residual detuning was reduced further by the adaptive feedforward path by a factor of 3.3 leaving a total detuning of 0.4 Hz rms which is close to the tuner's resolution of about 0.2 Hz. Table II summarizes the most successful compensation measurements done at the test facility. All were performed close to or slightly above the design loaded quality factor of currently planned cw linear accelerators and ERLs. Open loop detuning in the range of 0.7-5.3 Hz rms including cases of large pressure variation and strongly excited mechanical resonances were reduced down to 0.4-1.7 Hz rms (factor of 2-7). Including a low level rf (LLRF) feedback control system with a high gain of 200 residual phase errors below 0.02 are therefore within reach [33].

High pressure variation of helium bath
In the case of high pressure variations with ÁP ¼ 300 bar peak-to-peak, the rms detuning had only been reduced by a factor of 2 (third row in Table II). This demonstrates the need for a very good pressure stability of the helium system. Here, high pressure variations led to a detuning of the order of the cavity bandwidth. Consequently, the large phase errors led to large measurement errors as the measurement was pushed to the nonlinear response regime of the rf mixer. Any measurement error unfortunately limits the feedback gain and update gain for the filter algorithm thus increasing its adaption time. Recent optimization of the cryogenic plant led to a typical stability of 15-20 bar rms limiting the heliumpressure induced detuning to below 1 Hz rms. Also, since then none of these high pressure variation incidences have been observed.

Multiresonance control
We also demonstrated that more than one spectral line can be compensated in parallel [8]. But there is a limit to the system. Mechanical excitations which were close nearby in the spectrum were hard to control as very narrow high order bandpass filters were needed to avoid crosstalk excitation between the two frequencies to be damped. This is shown in Fig. 18, where the overall detuning was damped, but it can be observed that some spectral power is transferred in the frequency range between the two controlled modes.

V. SUMMARY AND OUTLOOK
Based on the measured microphonics and tuner transfer functions, a detuning compensation scheme was developed. A combination of adaptive feedforward FIR filter  algorithm and low-frequency feedback showed a successful compensation under varying conditions. The total detuning was reduced by a factor ranging from 2-7.
Combining the detuning control with a field control system would potentially allow phase stabilities of below 0.02 rms fulfilling the requirements of future FEL or ERL linacs. Table III displays an overview of typical microphonics detuning measurements and the amount of compensation achieved. A major contribution is the detuning driven by the liquid helium-pressure stability as well as the lowest excited mechanical eigenmode. All other contributions are negligible and also below the effective resolution of the tuning system and control scheme. Higher eigenmodes are suppressed by the narrow cavity bandwidth. These values demonstrate a typical behavior. The percentage of each detuning contribution to the total rms detuning may vary for the main sources by 10%-20%.
Future measurements have to demonstrate that a longterm and robust parallel operation of field control and detuning control is possible. Also unwanted crosstalk between the systems has to be avoided. Especially the Lorentz-force detuning acts as an always present negative feedback on the cavity.
Detuning measurements at a fully equipped linac module of several cavities have to prove to what extent the microphonics detuning is correlated. This will have a major impact on the field stability and thus allowable level of detuning.
Measurements of cavity-beam interaction and beam parameters while running the detuning control may show if mechanical oscillations are excited by the piezo which are transparent for the rf field. If so, the detuning control may even harm the beam stability though the measured field appears more stable.