Active Suppression of Microphonics Detuning in high $Q_L$ Cavities

Operation of Superconducting Radio Frequency (SRF) cavities with high loaded quality factors is becoming increasingly preferred for applications which involve low beam loading including Energy Recovery Linacs (ERL). Vibration induced microphonics detuning poses a major operational bottleneck in these low bandwidth systems, adversely affecting field stability. Besides passive measures of mitigating the vibration sources, modern SRF cavities are also attached to fast tuners incorporating piezo-electric actuators. We demonstrate the narrow band active noise control algorithm for realizing active resonance control and propose a modification based on the Least Mean Square approach to adaptively tune the control parameters and study it's stability and performance. We discuss our experience of using passive mitigation techniques while commissioning the Main Linac Cryomodule of the Cornell-BNL ERL Test Accelerator (CBETA) and report a net reduction in peak detuning by more than a factor of 2 in its unstiffened cavities. Finally, we demonstrate stable performance of our resonance control system with consistent reduction of peak microphonics detuning by almost a factor of 2 on multiple cavities.


I. INTRODUCTION
Modern particle accelerators are reaching the pinnacle of efficiency using Superconducting Radio Frequency (SRF) cavities which are characterized by low thermal loses arising from high intrinsic quality factors (Q 0 10 10 ) [1]. The microwave power requirements of such SRF cavities depend on the effective beam loading and the loaded quality factor Q L used in operation. In situations of high beam loading, they are operated with a comparatively low Q L in order to couple the required power into the beam, such as in the LHC [2], CESR [3], NSLS-II [4] and many others. However, in new applications such as light source Linacs (eg. LCLS-II [5], XFEL [6]) and in Energy Recovery Linacs (eg. CBETA [7], bERLin-Pro [8]), high Q L are becoming common due to the low or negligible beam loading involved. Low beam loading implies the reduction of the RF power requirements and allows the use of efficient solid state amplifiers.
However, the limited bandwidth arising from large Q L make RF systems more sensitive to detuning when operating at a fixed frequency, as during linac operation. Transient changes in the resonant frequency of the cavity resulting from mechanical deformations change its response to the microwaves coming through the fundamental power coupler. Due to enhanced reflection of the incoming waves from a detuned cavity, more power is needed to maintain a stable field. The interaction of the field with the wall currents is one mechanism leading to mechanical deformation and is known as Lorentz Force Detuning (LFD). This leads to transient detuning as a function of the field inside the cavity and is important for pulsed RF systems. Vibrations inside cryomodules couple into the cavity walls causing transient deformations in its shape resulting in microphonics detuning. The RF * nb522@cornell.edu power P consumed by a detuned cavity to maintain a voltage V with zero beam loading is given by [9], Where Q L is the loaded quality factor, β is the coupling factor, R/Q is the shunt impedance in circuit definition and ∆ω is the detuning of the SRF cavity. Hence, the maximum voltage which can be stably sustained in a cavity depends on the peak microphonics detuning and is constrained by the peak forward power available from the amplifiers. Suppression of peak detuning is important in machines operating with high Q L and designing cavities mechanically less sensitive to vibrations is one way of achieving this goal. Cavities fabricated with metal rings welded on to them as shown in Fig. 1 can be designed to be less sensitive to vibrations. Depending on whether the machine will be pulsed or CW, the shape and location of the stiffening rings may be optimized to reduce the effect of LFD or increase its stiffness towards external forces respectively. [10] In this paper, we discuss suppression of the vibration sources and describe active compensation of microphonics detuning to reduce peak power consumption. In the next section, we describe the design and operation of fast tuners while modelling them as a linear time invariant system and further explore their non-linear behavior. Using the linear model, we develop a Least Mean Square (LMS) control system based on narrow band Active Noise Control to command the piezo-electric actuators and analyze its performance and stability. Next, we catalog the microphonics sources we found during the commissioning of the Main Linac Cryomodule (MLC) used in CBETA and the measures we took to mitigate them. We then report on the results of using the active control algorithm during RF operations. Finally, we present a summary of our work and propose some improvements to the resonance control system.

II. FAST TUNER
Mitigation of vibration sources is the preferred method of suppressing microphonics, however an active resonance control mechanism is equally important. By further reducing peak detuning, it improves the margin of power consumption with respect to the maximum capability of the microwave amplifier. It also provides an emergency mitigation mechanism against new sources of microphonics until they are found and suppressed. Active control of microphonics requires the use of fast tuners with acoustic response time scales such as the one shown in Fig. 2. [11] While a stepper motor drives the slow movement of the tuner over a large range, the piezo-electric actuators drive fast movement with a range of 2 kHz [12] which is almost 100 times the operating bandwidth of the cavity. The response of the cavity resonance frequency to voltages applied to the actuator greatly influences the design of the active resonance control system.

A. Linear Response
A Linear Time Invariant (LTI) response is a simple model which can predict the output of a linear system to a given excitation. In the case of the fast tuner, the forces generated by the piezo-electric crystals are approximately a linear function of the voltage applied to it. As long as the materials are in the elastic regime, the strain of different locations of the cavity driven by these forces is governed by a linear partial differential equation. This implies that the detuning of the cavity may be written as a linear ordinary differential equation with the piezo voltage as its source term. This motivates the use of linear response theory which models the output of the system in time domain as a convolution of the input with an impulse response function as follows, where δf tuner is the change in resonant frequency of the cavity generated by the tuner, u pz is the voltage applied and τ (t) is the impulse response function which encodes the mechanics of the tuner. The output linearly depends on the input since if we scale and add inputs together, the output can be similarly obtained by scaling and adding the original outputs. The response is also time invariant, i.e. if we shift the input in time, the output also suffers the same shift. We can use this LTI model to design the active control system. We can measure the linear response of the tuner based on the LTI model in two ways. We can directly determine the impulse response by measuring the detuning as a function of time right after applying a short (delta function) voltage pulse to the piezo-electric actuator. However measuring the response function in the time domain is complicated by the presence of strong microphonics and a frequency domain description lends well to the measurement. Applying the Fourier transform on both sides of Eq. (2) we obtain, where δf tuner (ω) andũ pz (ω) are the Fourier transforms of detuning and voltage respectively. τ (ω) is the frequency domain tuner transfer function which encodes both the amplitude of the response and the phase shift generated by the tuner. We determine the frequency response by exciting a sine wave on the actuator with different amplitudes and varying frequency while measuring the amplitude and phase of the resultant sine wave of detuning. The transfer functions measured on three cavities of the main linac in CBETA are shown in Fig. 3. All the transfer functions show a region of flat amplitude and linear phase response in the range of low frequencies up to 30 Hz; this makes the use of simple algorithms like proportional integral control feasible for attenuating low frequency microphonics. The large peaks in amplitude correspond to resonances and they are accompanied by large swings in the phase response of the tuner; this limits feedback control at these frequencies. The measurements also verify one of the design goals of stiffening cavities, shifting the lowest mechanical eigenmode to a higher frequency. The transfer function data can be used to construct an LTI model of the tuner and is used to analyze the stability of the control algorithm used for resonance control.

B. Non-linear response
The assumption of linearity is dependent on the linearity of the piezo-electric effect, the stress strain curves and damping mechanisms in the materials involved. Although the stress strain curve and the piezo-electric effect are reasonably linear in the regime of use, slight hysteresis is generally observed in resonant frequency as the applied voltage is cycled from 0 V to high voltage back to 0 V. [12][13][14] This implies that some non-linearity is present in the system and we should verify its magnitude. A nonlinear response would excite multiple frequencies even if we excite just one [15] and this provides a simple way of diagnosing the non-linear dynamics of the system by exciting it with sine waves. We measure the power spectrum of detuning for different frequencies of excitation of the tuner and subtract the contribution from the ambient microphonics present in the system to yield an approximate spectral response function. Figure 4 illustrate some examples of spectral responses. The linear response shows up as a line with slope of 1, i.e. the frequency of excitation equals the major frequency component of detuning. However, the plot also shows evidence of higher order responses in the form of additional frequencies in the detuning spectrum.
We can use the straight lines observed in the plots to estimate the order of non-linearity present in the system and gain some insight into its source. In general, the frequencies present in non-linear responses of a dynamical system to a sinusoidal excitation can be written as, where f detuning and f vib,i are the frequencies present in the tuner response and ambient microphonics, while f pz is the frequency of excitation. m and n i are integers, with |m| representing the order of the non-linear term and the addition of vibration frequencies represent parametric behaviour of the tuner dependent on external microphonics. Both the cavities show lines parallel to the linear response line indicating the presence of modulation from ambient microphonics. The unstiffened cavity further shows the second harmonic with evidence of the m = 2 line near f pz = 300 Hz. The strength of the nonlinear responses appear to be a function of frequency with excitation frequencies of above 250 Hz showing the most activity. These observations suggest that we can ignore the non-linearity as long as we excite the tuner below 250 Hz which limits the bandwidth of the compensation system.

III. ACTIVE NOISE CONTROL
Microphonics compensation of SRF cavity detuning using fast tuners has been demonstrated using a variety of techniques. Resonance control of CW RF cavities typically rely on feedback of microphonics detuning. In this control topology, the detuning acts as an input to the controller which generates a signal for the piezoelectric actuator which in turn affects the net microphonics detuning thus closing the loop. The transfer function of the tuner system as discussed in the previous section plays an important role in designing the controller. The traditional method of Proportional-Integral feedback has been demonstrated in various machines [16][17][18] and is very effective when the phase response of the tuner is a monotonous function of frequency which is typical at lower frequencies (≤ 10Hz). At higher frequencies, the tuner cavity system typically has mechanical eigen-modes which introduce steps in the phase response which may possibly lead to positive feedback and instability at even modest gains. Consequently, low pass filters are used to ensure stability of the PI loop but at the cost of reducing the bandwidth. Additional band pass filters may be used in parallel to attenuate certain frequency bands, however manually adjusting them while ensuring stability is inconvenient. In order to get past this limitation, arbitrary digital control filters can be optimized specifically to compensate for a given microphonics spectrum while taking into account the exact phase response of the tuner. This has been demonstrated on the new LCLS-II cryomodules being tested at FermiLab. [19] In the methods described above, the tuner transfer function and the microphonics spectrum are first measured and the data is processed external to the RF control system and the optimal filter coefficients are then uploaded into the control system. In contrast, adaptive tuning of digital control filters inside the RF system during operations using Least Mean Squares algorithms have also been demonstrated. In traditional LMS, an external reference signal which correlates to microphonics detuning is used as an input to a Finite Impulse Response (FIR) filter whose coefficients are updated continuously to reduce the mean square of detuning [18]. In a different technique [20] based on Active Noise Control (ANC) methods, amplitude and phase of sinewaves at different frequencies are adjusted to cancel out microphonics. However, both these methods require prior measurement of the tuner transfer function which may be a function of tuner position [10] and may not stay constant over long periods of time and over multiple pressure or temperature cycles. In this paper, we derive the narrow band ANC technique and propose a modification so that it adapts to the tuner response phase in-situ.
Microphonics detuning due to narrow band vibration sources can be well approximated by a finite series of sinusoids at different frequencies with slowly changing amplitudes and phases. This motivates the use of an algorithm which works by adjusting the amplitudes of a series of sine and cosine functions in order to reduce the mean square detuning. At a particular frequency ω m , the ideal phase of the actuator signal θ pz m is determined by not only the relative phase of external detuning with respect to the internal clock θ micro m of the control system but also the phase response φ m of the actuator. The ideal actuator signal phase given by θ pz m = θ micro m + φ m − π in principle perfectly cancels the sine wave produced by external vibrations. The phase lag φ m introduced by the tuner can be assumed to be a constant when the frequency of vibrations is far from a mechanical resonance, and used as a compensation parameter in the algorithm. Using the technique of stochastic gradient descent, we derive a set of equations which updates the amplitude and phase of individual sinusoids along with online optimization of the phase parameter φ m at the frequencies of vibration.

A. Derivation
Microphonics from narrow band vibration sources may be represented by a finite series of sinusoids at different frequencies with slowly changing amplitudes and phases. Hence, in the time domain, the actuator voltage (u pz (t)) can also be written as a sum of sinusoids with frequencies ω m and whose amplitude and phase are determined by I m (t) and Q m (t), The piezo-electric actuator tunes the cavity in response to this signal, the effect of the tuner being represented as a linear transfer function τ (ω). Using a phasor notation for the actuator voltage u pz (t) ≡ m Re{Ã m (t)e iωmt }, we can write detuning near a particular frequency as a linear response integral.
Since the spectral content of microphonics detuning is assumed to be concentrated around certain frequencies, only parts of the transfer function are relevant in modelling the tuner movements. Far from resonance, we approximate the tuner transfer function around the frequency ω m as, where we assumed a constant amplitude response τ m and a phase response up to first order. Using this ansatz in Eq. (6) and changing the order of integration, we get, Where the integral over ω becomes a delta function which represents the approximate time domain impulse response valid when the frequency of actuation is ω m . Using the delta function to evaluate the convolution integral, we get, Where we have introduced the group delay D m ≡ dφ dω ωm . The effective detuning δf comp (t) of the cavity in response to the perturbation given in Eq. (5) is thus given by, where we have combined the tuner response at different frequencies and δf ext (t) is the microphonics detuning coming from external vibrations. This multifrequency model approximates the dynamics of the tuner in the limit of narrow band oscillations where, << ω m . Now we can use this model to construct a suitable cost function which can be minimized by the algorithm.
The objective of microphonics compensation is to reduce the mean square detuning of the cavity.
C(t n ) is the cost function at time t n which is taken to be the expected value of square of detuning, approximated by a running average. The method of gradient descent relies on the gradient vector being the direction of steepest descent on the cost surface as shown in Fig. 5. In parameter space, the gradient represents the normal to the constant cost surface and can be estimated using the model developed in Eq. (10). Following standard LMS techniques [21], we take N = 1 and calculate the partial derivatives of the cost function with respect to the optimization parameters I m and Q m which determine the actuator voltage.
Where we have used Eq. (10) under the assumption that group delay D m is negligible with respect to the time scales with which I m (t) and Q m (t) change. The typical group delay introduced by the modified Saclay -I tuners used in the CBETA project is less than a millisecond far from resonant frequencies while the bandwidth of the vibration sources are typically less than 1 Hz. This implies that I m (t) and Q m (t) change with time scales of more than 1 second while the delay in the feedback loop is less than a millisecond thus ensuring the validity of the above assumption. Each iteration of the stochastic gradient descent algorithm changes the control parameters a little in the direction opposite to the gradient.
Where we have absorbed 2τ m into µ m , which is the adaptation rate for I m and Q m in the algorithm. Equation 13 together with 5 form the Active Noise Control(ANC) algorithm which is illustrated in Fig. 6.

B. Control Filter
The microphonics compensation system works to attenuate multiple frequencies by effectively using an array of linear filters in parallel. Each of these control filters works on a small frequency range around ω m and generate individual actuator signals u m . I m and Q m form a complex phasor which changes slowly compared to the frequency ω m and Eq. (5) modulates a sinusoid at this frequency with this phasor. Using this insight and combining the equations 5, 13a and 13b to eliminate I m and Q m , assuming the phase φ m does not change in time, we get where we have assumed zero initial conditions I m (0) = Q m (0) = 0. Equation 14 represents a discrete convolution of the input signal with a sinusoid and is an impulse response filter. The Z-transform of the filter can be written as, where we have dropped the minus sign for the sake of convention and ∆t is the sample duration. The frequency response of the filter is shown in Fig. 7.
The control filter shows a very narrow band pass response rising to ∞ and a phase swing of 180 o around the frequency ω m . In the limit of ω → ω m , the filter response can be approximated by (16) µ m serves as an overall scaling factor governing the span of frequencies within which the controller-tuner system has more than unity gain and µ m can hence be used to adjust the bandwidth of the feedback loop around the microphonics frequency. In the neighborhood of ω m , the phase swings from π/2+φ m +ω m ∆t to −π/2+φ m +ω m ∆t from left to right in a discrete jump. This span of phase can be adjusted to stabilize the controller and optimize compensation.
The compensated detuning δf comp (ω) is the net effect of the tuner δf m (ω) ≡ τ (ω)u(ω) and the external contribution δf ext (ω). The tuner excitation u(ω) ≡ −H(ω)δf comp (ω) is obtained as an output of the linear controller whose frequency response is given by H(ω), where the minus sign accounts for the one we dropped while deriving Eq. (15). From these definitions we obtain the closed loop transfer function (CLTF) of the system which provides a linear relation between the external detuning δf ext (ω) and the compensated detuning δf comp (ω) in frequency space.
Where the sum of all the filters H(ω) ≡ m H m (ω) acts as a comb with it's frequency response amplitude remaining small except for the neighborhood of ω m . In a theoretical situation, when all the microphonics detuning is generated by pure sine waves whose frequencies are exactly ω m , the controller works perfectly to compensate for all microphonics as shown in Fig. 8 since lim ω→ωm H m (ω) = ∞. However real microphonics signals have finite bandwidth spectral modes and the performance of feedback control is determined by the combined response of the controller and the tuner over all of frequency space. In the limit of the response of each filter being much greater near its pass-band than its nearest neighbours i.e. |τ (ω m )H m−1 (ω m )| << 1, we can approximate the net transfer function to be a product of individual response functions at each compensation frequency.
Where we have used φ m and D m as the transfer function phase and group delay at frequency ω m . φ m is the compensation parameter used in the control algorithm. The band of frequencies for which |U m (ω)| ≥ 1 is given by, The control loop is stable when we avoid positive feedback inside the above domain i.e. φ OL (ω m − 0.5µ m τ m /∆t) < π and φ OL (ω m + 0.5µ m τ m /∆t) > −π. This gives us a range of possible values for φ m .
The center of the above range, φ center m = φ m −ω m ∆t compensates for the phase lag from the tuner at frequency ω m and gives us the maximum margin on stability. The span of acceptable values of φ m depends on not only the tuner behavior but also the adaptation rate µ m . To ensure that the range given by Eq. ( 21) is not a null set, we put an upper bound on µ m .
These calculations assume that neighbouring frequencies of the comb are far away so that their response amplitudes are much lesser than unity at the next frequency i.e. |τ (ω m )H m−1 (ω m )| << 1. This gives us a crude limit on the distance between nearest neighbours as, hence constraining the spacing of the different frequencies we can compensate. Detailed calculations involving the complete tuner transfer function and the array of band pass filters are required to fully analyze the stability of the control system. The complete stability analysis of the ANC system involves assessing the open loop transfer function over all frequencies using a bode plot. Figure 9 shows an example of using the compensation system on an unstiffened cavity used in the main linac of the CBETA project. We apply the algorithm on two frequencies 8  Fig. 9. However, the gain seems to be close to 0 dB near the tuner resonances at frequencies around 250 Hz, when φ OL crosses the −180 o mark with a gain margin 2 dB. This prompts the use of a low pass filter with frequency response F (ω) to attenuate the transfer function at these frequencies as shown by the dotted lines of Fig. 9. The analysis illustrates the effect of tuner resonances far from the compensation frequencies ω m signalling the need for additional filtering to ensure stability of the system.
The performance of the controller in suppressing microphonics detuning depends on the vibrating compo- nents. Assuming that the microphonics is generated by resonant processes either through instabilities or white noise excitations, the ensemble averaged power spectrum |δf ext (ω)| 2 E is given by, where ω v , Q v and Γ v are the frequencies, quality factors and strengths of microphonics detuning. Figure 10 shows the effect of adjusting compensation parameters from simulations of the controller assuming a perfect tuner with τ (ω) = 1, group delay D = 2∆t and random microphonics detuning with frequency 40 Hz and quality factor 50 as illustrated by the first panel. To account for the randomness, we perform the ensemble average of attenuation over 100 simulations each lasting for a duration of 10 seconds. We calculate the expected performance of the algorithm using the closed loop transfer function [Eq. (18)] along with the filter response in Eq. (15). The results show that the controller performs its best on average when ω m = ω v , with attenuation progressively getting worse as we go farther away from ω v . The attenuation shows an asymmetric dependence on φ m about 0 o reaching a minimum at some non-zero value. This leads to a closed loop transfer function asymmetric about ω v which exactly corrects for the asymmetry of the vibration power spectrum. Finally, µ m represents the gain in the system and compensation is expected to get better with larger gain up to the limit given by Eq. (22) beyond which the system becomes unstable. The expected attenuation clearly diverges at µ m π/2, however the results from the numerical simulations don't agree. In practice the maximum gain of the system will depend on the exact response of the tuner, especially the group delay. These simulations guide us on how to choose parameters of the ANC during operations.

C. Phase Adaptation
The compensation performance of a controller with fixed parameters is dependent on variations in the re-sponse of the tuner and fluctuations of the microphonics spectrum. The tuner response may vary from day to day due to pressure variation in the Helium bath while the vibration mechanism may also change frequency as a function of time. The controller as described in the previous section will not be able to adapt to such changes, which might limit performance in a dynamic environment. The simulation results in Fig. 10 suggests that attenuation is a monotonously decreasing function of gain µ m , with the system becoming unstable beyond a threshold. An adaptive algorithm to optimize for the value of µ m might tend to drive the system towards instability. However, the controller frequency ω m and phase φ m have positions where attenuation is minimum within the range of values which satisfy the stability conditions. Consequently, adapting ω m and φ m to a changing excitation could potentially make the algorithm more robust, while making it easier to operate in practice since it would optimize itself.
The optimization of the ANC system translates to finding the minimum of the mean square of detuning δf 2 comp with respect to the phases φ m and the frequencies ω m . For finding the optimum values, we can use the Parseval's theorem to write the mean square in frequency space and then use Eq. (17) to establish a relation with H m (ω).
We can use this expression with any numerical optimizer to calculate the best values for the ANC parameters. The dashed lines in Fig. 11 show the optimum values of phase φ opt m and the attenuation calculated using a simplex algorithm assuming microphonics at 40 Hz. Further, the calculations also use a tuner transfer function fitted to data from MLC un-stiffened cavity 3. Consequently any LMS scheme based on this approach will adapt to changing characteristics of microphonics detuning but not to changes in tuner response. We can derive an alternative algorithm which works in the time domain and does not need prior measurements of the tuner transfer function. The cost function may be minimized with respect to controller phase φ m using stochastic gradient descent. The partial derivative of the cost function given in Eq. (11) with respect to φ m is given by, This gives us the update rule, where η m is the adaptation rate for φ m . Figure 11 shows the results from simulations of this algorithm with microphonics at frequency 40 Hz, with a tuner response modelled on MLC cavity 3. The thin blue lines representing the ensemble average over 80 simulations clearly show the LMS adapted phase deviates from the optimization outlined previously. This deviation arises from the approximate model [Eq. (10)] of compensated detuning which we used to construct the partial derivative. However, the attenuation obtained from gradient descent closely matches the ideal result, thus demonstrating the efficacy of this method.

IV. RESULTS
The Cornell-BNL ERL Test Accelerator (CBETA) [7,22,23] project will be the first high-current multi-turn ERL employing SRF Linacs. It uses two SRF cryomodules, one for the injection system and the other used to execute energy recovery. The injector cryomodule [24,25] consists of five 2-cell SRF cavities [26] and is configured to provide 6 MeV of energy gain to the electron beam for injection into the CBETA loop and is operated with a low external quality factor due to high beam loading. The main linac [11,27] on the other hand incorporates six 7cell SRF cavities [28] with a design energy gain of 36 MeV and will be used to execute energy recovery. Operated at Q L ≈ 6 × 10 7 with solid state amplifiers, the peak detuning which can be tolerated by the main linac cavities is limited to 54 Hz with a 5 kW RF source, consequently microphonics detuning presents a significant operational bottleneck and needs to be mitigated.

A. Passive Suppression
The initial microphonics measurements of the main linac cavities showed strong vibrations at frequencies 8 Hz, 41 Hz and 82 Hz as illustrated in the plots of RMS detuning in Fig. 12. Apart from steady vibrations at these frequencies, sudden events resulting in large peak detuning of over 100 Hz were seen in the un-stiffened cavities 3 and 5 as evident from the histograms. Vibrations can mechanically couple into the cavities from sources both inside and outside the cryomodule. In an attempt to find them, we cross-correlated the microphonics detuning signal with vibration signatures from various machinery. We started with the rotary and turbomolecular pumps maintaining the insulation vacuum in the cryomodule, looking at the effect of power cycling them for brief periods and eventually calculating the cross-correlation functions. Though the rotary pump didn't have any effect, the turbomolecular pump does induce weak vibrations around 820 Hz, consistent with a rotation speed of 50000 rpm. There are large variable frequency induction motor water pumps on the experimental floor in the vicinity of the cryomodule, these were also shown to be of no effect to the microphonics detuning. Further we also measured vibrations from the large room temperature vacuum pumps controlling the vapor pressure of Helium inside the cryomodule, showing that these too don't contribute to peak detuning of the cavities directly. Besides direct mechanical coupling of vibrations through the cavity supports, pressure fluctuations in the liquid helium surrounding the cavity also give rise to microphonics detuning. These pressure variations accounted for most of the microphonics in the main linac cavities.
The cryogenic system of the main linac cryomodule is a modified version of the TESLA design. [29] Separate vessels house the six cavities and are supplied with liq- uid Helium through chimneys by the 2K -2 phase pipe and through the precool line connected to the bottom of the vessels. The pressure exerted by liquid Helium on the cavity walls influences the resonant frequency of the cavities and needs to be regulated. Slow trends in this pressure give rise to very low frequency microphonics detuning ( 1Hz) and tight pressure regulation requires the interplay of two control mechanisms. A Joule-Thomson (JT) valve maintains the liquid level in the 2K -2 phase pipe and an external pump maintains the vapor pressure near 12.5 Torr corresponding to 1.8 K. Two separate proportional integral feedback loops actuate the JT valve and control the pump to maintain the liquid level and vapor pressure at their set points respectively. The system also opens the precool valve when the liquid level goes below a threshold. Consequently, transients or instabilities in any of these components may give rise to vibrations in the cryomodule.
Measurements of microphonics detuning and various cryogenic control parameters showed that movement of the JT and movement of the precool valve both coincided with the large peak detuning events. The occasional actuation of the precool valve in response to the Helium liquid level going below a threshold correlated with spikes in a signal from a piezo-electric sensor. However the occurrence of peak detuning is more frequent, consequently we made both the precool and the JT valves static and the results of this test are shown in Fig. 13. In the default configuration, the microphonics histogram shows large peak events which are 200Hz 1 , while the peak microphonics detuning becomes ∼ 50Hz with both valves static verifying the proposed mechanism. However, this configuration doesn't allow us to have active control on the liquid Helium level and if the boil off generated due to the thermal load from the cavities doesn't equal the rate of in-flow from the supply line, then the liquid level in the 2K -2 phase pipe would steadily run away. To avoid this, a heater attached to the 2K -2 phase pipe is put on a control loop to provide a minimum dynamic thermal load to substitute for when the cavities are not generating enough heat and thus boiling off suitable amounts of Helium while stabilizing the liquid level. This results in stable operation while limiting the peak detuning to ∼ 100 Hz a definite improvement from the original configuration. Despite the additional detuning introduced due to the operation of the heater, this is still better than controlling the Helium level using the valves.
Peak detuning was greatly improved when the valves were made static, however we observed a strong enhancement of the steady state oscillations at 41 Hz which don't contribute much to the peak detuning but increase the RMS by a factor of 2. The liquid Helium level control using the heater enhances the narrow band 8 Hz vibration line. This points to gas flow in the Helium Gas return Pipe (HGRP) as a possible source for the generation of the 8 Hz vibrations. Previous operations data further corroborated this fact by showing that the vibration amplitude at 8 Hz is an increasing function of the vapor flow through the Helium Gas Return Pipe possibly exciting a mechanical eigen-mode of the structure. Pending further investigation into the source, the active compensation system has been successful in attenuating these vibrations.
Accelerometer measurements of vibration on the 5 K adjust cryogenic valve stalk yielded significant crosscorrelation with the microphonics detuning measurement at 41 Hz and 82 Hz. Figure 14 is a schematic of the valve showing the cold region near the valve orifice which comes in contact with cold Helium and the warm region which extends outside the cold mass of the cryomodule and is at room temperature. Delayed heat transfer between the hot and the cold regions trough convection of the Helium gas and conduction through the valve stalk leads to thermo-acoustic oscillations [30] and the resulting pressure waves resonate inside the closed space between the valve stem and the valve stalk. This mechanism of vibrations was first observed in the LCLS-II cryomodules while testing at Fermilab. [31] Following discussions with the Fermilab team, we inserted sleeves made of a cryogenic compatible PEEK plastic material on the stem to restrict the gas flow and suppress vibrations. [32] Table I shows a summary of the microphonics measurements on all cavities in different configurations of the cryogenic system. The peak detuning on all unstiffened cavities (Fig. 12) showed a significant reduction after the 5 K adjust valve was modified. However, we measured a new vibration line at 59 Hz which wasn't seen during our previous tests. The results from cross-correlation measurements of the microphonics detuning and accelerometer signals indicate that 59 Hz vibrations from an external source are being mechanically coupled into the cryomodule through the newly installed waveguides. The new source affected cavity 3 the most generating the highest peak detuning (∼ 50 Hz) among all others and this was an excellent candidate for testing the active compensation system.
Stiffened cavities did not show a significant reduction in peak microphonics detuning, with an increase being shown by cavities 2 and 4 even when the RMS diminished for cavity 4. Figure 12 shows results from microphonics measurements on these cavities. The histogram of detuning for cavity 2 and cavity 4 shows a flat top, indicating deviations from Gaussian white noise. The spectrum plot shows substantial vibration energy localized around 41 Hz and the 82 Hz corroborating this observation and the thermo-acoustic oscillations are indeed the reason as discussed earlier. The spectrum plots further indicate a reduction of the energy after valve modification in the same frequency bands, along with a net decrease in RMS detuning up to a vibration frequency of 200 Hz which is the limit of the data set. However, the width of the histograms also related to the RMS seems unchanged for cavity 4 and shows an increase in cavity 2 after valve modification seemingly contradicting the frequency domain observations. This apparent disagreement of the RMS detuning obtained from the histogram and the spectrum plots are listed in Tab. I. While the estimates agree for un-stiffened cavities, there is a significant difference for the stiffened cavities. The missing vibration energy could be accounted for by the excitation of high frequencies ( 200 Hz), possibly the mechanical eigenmodes of the cavity along with measurement noise. Unfortunately the raw signals were not recorded during this experiment rendering us unable to analyze this in more detail.

B. Active Compensation
Passive measures of mitigating the vibration sources is the preferred method of reducing microphonics detuning. However active control is also necessary to temporarily restore operating gradient until the source is mitigated and to improve the margin of RF power consumption in the presence of existing microphonics detuning. We implemented the narrow band ANC algorithm in the Cornell Digital Low Level RF control system [33,34] for this purpose. As described in Sec. III, the algorithm works separately for each frequency ω m and requires two additional parameters, the gain µ m and phase adaptation rate η m as described in Eq. (13) and Eq. (27) respectively. To determine an optimum setting, we start with small numbers for µ m and η m until we start observing some effects on microphonics detuning, increasing µ m until the feedback loop becomes unstable. We set µ m to half of this maximum value to give us a suitable gain margin, and observe the controller phase φ m as a function of time. We set η m so that the phase settles to the optimum value on average within a few minutes at the same time showing a noise level within ±10 • . Additionally, we nudged the frequency of compensation to find an optimum value within 0.1 Hz. This process is repeated for each frequency we want to compensate. The overall performance of resonance control depends on the quality factors of vibrations as explained in the previous section.
We have used the ANC algorithm during various stages of RF commissioning to attenuate microphonics and the results from un-stiffened cavities of the main linac are shown in Fig. 15. Before we modified the 5 K adjust valve, compensation was applied to 41 Hz and 8 Hz on un-stiffened cavities 1 and 3. The algorithm was successful in attenuating 41 Hz in both cavities 1 and 3 but was not effective on 8 Hz vibrations in cavity 3 as illustrated by the spectrum plots probably because the compensation frequency was not set correctly. These narrow band vibrations were a major contribution to microphonics detuning and their decrease also reduced the peak detuning. After we modified the 5 K adjust valve, we found the major source of microphonics detuning to be at 59 Hz. The ANC algorithm was successful in suppressing these vibrations in cavity 3. The attenuation of spectral lines are further validated by the RMS detuning as listed in Tab. II. The success of the algorithm indicates that those vibration lines were not in the vicinity of mechanical eigen modes of the tuner-cavity system which would have limited the effectiveness of the system as explained in Sec. III.
The results of using the system on stiffened cavities is shown in Fig. 16. The algorithm was applied to cavities 4 and 6 for the frequencies 8 Hz and 41 Hz with additional attenuation of 82 Hz on cavity 6. While the ANC successfully reduced peak detuning from 30 Hz to 15 Hz in cavity 6, the measurements on cavity 4 indicate no reduction of peak detuning even though the RMS detuning is attenuated as seen from both the histogram and the spectrum plot. To understand which frequencies actually contribute to peak detuning, we Fourier transform the raw signal and zero all components beyond a certain vibration frequency and then find the peak detuning of the inverse transformed signal. Figure 17 shows the cumulative peak detuning as a function of the vibration frequency threshold. When the ANC is off, 41 Hz and 82 Hz contribute most to the peak detuning as indicated by the large steps when we include these frequencies in the peak calculation. When we turn on compensation, the contribution from both these frequencies are reduced but a new mode at 102 Hz appears which accounts for almost half of the peak detuning but appears as a shallow step in the spectrum plot, illustrating it's transient nature. The ANC algorithm is thus well suited for compensating narrow band vibrations in both stiffened and un-stiffened cavities.
The stability and robustness of the algorithm is demonstrated by comparatively long periods of stable operation with the same settings on different days. the observations shown in Tab. II are taken from data sets of at least 800 seconds measured for cavities inside a cryomodule connected to a production level cryogenic system unlike previous work primarily focused on test facilities. We achieved stable operations of over a few hours without spontaneous trips on all cavities with the ANC system active. We also successfully used it on cavity 3 during beam operations for the CBETA Fractional Arc Test which helped us achieve an energy gain of 8 MeV using a forward power below 5 kW which would not be possible   without it. Once the settings were determined using the procedure explained earlier, resonance control was turn key with no tweaking required on subsequent days of operation which highlights the robustness of the system. Lorentz Force Detuning (LFD) and mechanical coupling between different cavities in the cryomodule can be further sources of detuning which affect the operation of a resonance control system. The field dependence of LFD leads to decrease in the resonant frequency when the cavity field is ramped up. Large microphonics events generating a sudden increase in the resonance frequency of the cavity can lead to reduction in fields, LFD can in turn detune the cavity further in the positive direction amplifying the effect of the microphonics. Such an instability will lead to a catastrophic fall in cavity field and subsequent beam loss in an accelerator. However, in high Q machines the filling time of narrow bandwidth cavities can be sufficiently large, of the order of tens of milliseconds, slowing down the field decrease. This along with the presence of a high gain feedback loop on the field can be enough to avoid such an instability from developing. In all our operations till now, we have not used any feed-forward control of detuning and simple integral con-trol of detuning has been enough to compensate for LFD when the field is ramped slowly. Further, the resonance control system of neighbouring cavities did not interact with each other during the course of normal operation since we have bellows mechanically isolating the cavities. This eliminates the need to account for such effects. The resonance control system described in this paper is thus a stable way of reducing peak detuning when mitigation of vibration sources is not an option.

V. CONCLUSION
The operation of SRF cavities with high Q L using solid state amplifiers of limited power present a significant constraint on the peak microphonics detuning which we can tolerate in order to maintain stable field. As a result, mitigation of vibration sources have become important for operations for a growing number of particle accelerators. Apart from passive measures, most cryomodules also incorporate fast tuners based on piezo-electric actuators which can be used for active resonance control such as in LCLS-II and XFEL. Assuming that the mechanics is adequately described by linear partial differential equations, we can model the tuner's response as a Linear Time Invariant system. This lets us encode the dynamics of the tuner in a transfer function τ (ω), which expresses the amplitude and phase response of the cavity resonance frequency to sinusoidal excitations applied to the actuator at different frequencies. Measurements from 7-cell SRF cavities used in the main linac of the CBETA project indicate that the bandwidth of an active control system must be limited to below microphonics frequencies of 200 Hz beyond which mechanical eigen modes dominate the dynamics. The transfer function data is used in the design of the active microphonics control system.
We derived the narrow band Active Noise Control(ANC) algorithm starting from the assumption that microphonics detuning can be decomposed into a finite sum of sine waves. A sine wave of the same frequency applied to the actuator at the correct amplitude and phase should perfectly compensate for the vibrations. Using stochastic gradient descent, we derived an update relation which slowly changes phasors with components I m and Q m depending on the net microphonics detuning. These in turn modulate career signals at the microphonics frequencies ω m applied to the actuator thus complet-ing the ANC feedback controller. We further derived the frequency response of the ANC algorithm and established constraints on the adaptation rates µ m and the controller phases φ m to operate in the stable region, giving one concrete example from CBETA. Finally we propose a modification which automatically minimizes the mean square of compensated detuning by adapting the value of controller phase in response to changing tuner responses or vibration excitations. Using numerical simulations, we demonstrate the effectiveness of the modified ANC algorithm before implementing it on the main linac used in CBETA.
We applied various mitigation techniques on the main linac cryomodule of the CBETA project to reduce microphonics detuning. Passive measures included several modifications to the cryogenic system to damp thermoacoustic oscillations and transients related to Helium flow and we achieved a reduction of peak detuning by at least a factor of 2. We further demonstrate the use of the active control system to achieve a stable reduction of microphonics typically by a factor of 2 without the need of detailed measurement of the transfer function. Future work will involve finding the remaining sources of vibrations and eliminating them, incorporating automatic frequency tracking in the ANC algorithm in order to make it more robust, and devising an algorithm to automatically configure the ANC on multiple frequencies during operation.