Vector-based feedback of continuous wave radiofrequency compression cavity for ultrafast electron diffraction

The temporal resolution of ultrafast electron diffraction at weakly relativistic beam energies ( ≲100 keV) suffers from space-charge induced electron pulse broadening. We describe the implementation of a radio frequency (RF) cavity operating in the continuous wave regime to compress high repetition rate electron bunches from a 40.4 kV DC photoinjector for ultrafast electron diffraction applications. Active stabilization of the RF amplitude and phase through a feedback loop based on the demodulated in-phase and quadrature components of the RF signal is demonstrated. This scheme yields 144 ± 19 fs RMS temporal resolution in pump–probe studies.


I. INTRODUCTION
Ultrafast electron diffraction (UED) probes the timedependent spatial charge distribution of a many-particle system in response to an impulsive excitation [1][2][3].Typically, a laser pulse is used to excite a sample away from equilibrium and a subsequent pulse of electrons diffracts from the perturbed system.In solids, this experimental scheme provides snapshots of the non-equilibrium crystal structure.Varying the relative arrival time between the pump and probe pulses allows for a full mapping of the structural dynamics in response to photo-excitation.In a UED experiment, a crucial parameter is the temporal resolution; this is affected by the temporal widths of the pump laser and electron pulses in addition to the jitter in their relative arrival time.
Compact ultrafast electron diffraction instruments have greatly improved in their temporal resolution and beam quality in the last decade due to the adoption of methods from the field of accelerator and beam physics [4].Some of the important recent developments include the widespread use of radio frequency (RF) [5,6] and magnetic compression schemes [7,8], the use of high brightness photo-cathodes [9], and the development of time-stamping diagnostics [10,11].Each have contributed to improving the UED instruments by enhancing spatial resolution as well as temporal resolution to below the 100 fs regime.While beamlines at highly relativistic energies based on RF injectors still require significant infrastructure investment and are mainly restricted to national laboratory settings [12][13][14], lower energy 25-100 keV scale beamlines based on DC photoinjectors are well-suited to a university-sized laboratory [9,15,16].Lower beam energy instruments can take full advantage of the development of high repetition rate ultrafast laser systems.These lasers are now available with sufficient energy per pulse to perform pump-probe experiments at repetition rates of 10 kHz and above, up to the limit of sample recovery times.
At weakly relativistic beam energies, space-charge effects (i.e.Coulomb repulsion) significantly broadens the electron bunch longitudinal width resulting in a severe degradation of the temporal resolution in UED experiments.Electron bunch compression (e.g. using RF cavities) is essential to obtaining short pulse lengths.In order to achieve maximum compression, the electron pulse is typically injected into the RF cavity at the zero-crossing of the field (i.e. at the point where the electron pulse experiences zero net change in momentum).This strategy ensures that a nearly linear energy chirp is imparted onto the beam longitudinal phase space, which leads to a strong compression of the electron pulse as it drifts towards the sample [5,6].
Unfortunately, such a configuration also implies that any small timing error at the entrance of the cavity translates into a variation in the electron beam energy, ultimately degrading temporal resolution.Synchronization between the laser pulse that generates the electron bunch and the field in the RF cavity is therefore crucially important.The phase of the RF field is a key parameter in this setup, yet it is difficult to fully control.For example, due to the narrow frequency resonance of typical RF compression cavities, small changes in temperature cause significant phase shifts.Similarly, stability in the amplitude of the RF field is also important for optimal beam compression and arrival time stability.Earlier efforts in stabilizing the time-of-arrival jitter have concentrated on phase feedback [17].However, a combined phase and amplitude vectorial feedback could further improve the control of the RF parameters and lead to new applications in electron pulse manipulation with RF cavities.
In RF circuits, IQ (in-phase/quadrature) double balanced mixers enable simultaneous acquisition of the amplitude and phase of an RF signal with respect to a local oscillator reference.Notably, the mixers also work in reverse; by providing two separate voltage inputs at the I and Q ports, one can modulate the phase and amplitude of an input RF signal.Thus, adding IQ mixers upstream and downstream of the RF cavity allows for control and measurement of the RF field's phase and amplitude.Using these mixers in combination, we can perform feedback control with a bandwidth mainly limited by the process-ing time of the PID feedback loop which minimizes the effects of long term drifts in the system.
In this paper, we discuss the design and implementation of the GARUDA (Garuda Ultrafast Diffraction Apparatus) beamline: a novel low energy (40.4 keV) UED beamline at UCLA based on the use of an RF cavity operating in continuous wave (CW) mode.We utilize a system of double-balanced IQ mixers to provide simultaneous phase and amplitude feedback that enables reaching an instrument response function of less than 150 fs RMS, as measured in a pump-probe study of ultrafast melting of a charge density wave superlattice.It is important to note that such a temporal resolution measurement is achieved over several hours, during which the drift in time-zero is minimized by the implementation of the feedback loop.The main residual contribution to the temporal resolution of the instrument is due to the electron bunch length.

II. RF-BASED BUNCH COMPRESSION FOR UED BEAMLINE
Near the zero-crossing of the RF field, the momentum change imparted onto electrons propagating through a cavity depends almost linearly on the electron's position within the bunch.Such RF cavities can therefore be described as temporal lenses [18].Propagation in a drift space will transform the momentum-position correlation and flatten the longitudinal phase space at the temporal focus.
The effective focal length for a cavity is the distance over which an energy collimated beam injected into the cavity will reach its minimum longitudinal length [19] and can be written as: where m 0 and e 0 are the rest mass and charge of the electron respectively, k = 2π/λ is the RF wavenumber, γ and β the standard relativistic factors, respectively, and ψ is the RF phase deviation from the zero-crossing condition (which is defined as the phase where the average momentum of the beam does not change when passing through the cavity).For electrons of kinetic energy E k = 40.4keV (β = 0.376), RF frequency c/λ = 2.856 GHz and a cavity with accelerating voltage V c = 3.04 kV, the focal length of the temporal compression lens can be calculated to be 0.187 m.Note that a longitudinally diverging beam will come to a temporal focus some distance after this cavity focal length.
For small fluctuations of the RF amplitude and phase, the focal length changes and the electron pulses are not optimally compressed at the sample plane.These fluctuations also alter the beam energy which changes the time-of-arrival of the electrons.This latter effect is a significantly more important contribution to the deterioration of the temporal resolution in a UED measurement.
The change in electron arrival time compared to the reference case is given by, where D is the propagation distance from the cavity to the sample and depends on the cavity voltage and the injection phase.
If the cavity is tuned exactly to the zero-crossing phase (ψ = 0), fluctuations in RF amplitude have no effect on the electron arrival time.However, if there is a small error in phase, the time of arrival will also change due to fluctuations in the RF amplitude.Thus, combined phase and amplitude jitter introduces an additional 2nd order jitter in the electron arrival time.In our numerical example, for a distance D = 0.279 m at the zero-crossing condition, we expect which yields dta dψ = 1.47 ps/degree.If we are 1 • off from the zero-crossing condition, a 2.5% amplitude change will lead to 40 fs time-of-arrival difference.
A. Beamline design Fig. 1(b) shows a schematic of the GARUDA electron beamline.It should be noted that four magnetic beam steerers are present on the beamline, but they are not depicted because their exact locations are not critical.Roughly, these steerers are placed (i) directly after the electron gun, (ii) directly after the first solenoid, (iii) before the RF cavity, and (iv) directly after the second solenoid.In our setup, the pump and probe pulses originate from a 1030 nm, 180 fs FWHM Yb-based Pharos TM laser system with 10 W of average power and repetition rate up to 20 kHz.A pulse picker allows for tuning the repetition rate from the regenerative amplifier; for this study, we operate at 500 Hz.The output is routed to a beam-splitter that separates the pulses into pump and probe paths.The pump is directed into an optical parametric amplifier (OPA) to obtain a wavelength-tunable output in the optical-to-infrared range of the electromagnetic spectrum.This laser pulse is then free-space coupled into a vacuum chamber housing the sample to provide an impulsive excitation that drives the sample away from equilibrium.On the probe path, 1030 nm light is frequency-doubled twice via nonlinear crystals to provide 257.5 nm (4.8 eV) laser pulses.These pulses are then focused to a 60 µm FWHM spot on a poly-crystalline copper cathode housed in vacuum.An electron bunch is thus produced via the photoelectric effect.Increasing the bunch charge provides an improved diffraction signal-to-noise at the cost of greater transverse and longitudinal broadening.The compromise between these effects must be weighed carefully in selecting an operating bunch charge.For the GARUDA beamline, the operating bunch charge may be easily varied depending on the requirements of a specific study (here we present data taken at 1 fC and 3.3 fC).The electron bunch is then accelerated by a DC field to 40.4 keV kinetic energy over the cathode-to-anode distance of ∼11 mm.This brings their velocity (normalized to the speed of light) to β = 0.376.Initially, the transverse and longitudinal size of the electron pulse grows rapidly due to the non-zero thermal emittance and the mutual Coulomb repulsion (space-charge).A solenoid magnetic lens directly after the gun is used to control the transverse profile of the beam and focus it into the entrance of the RF compression cavity.At the appropriate RF cavity phase, the electron pulse is given a negative chirp with no net bunch acceleration.Consequently, the mean velocity of the beam remains constant, but electrons at the back (front) of the pulse are accelerated (decelerated).Thus, the pulse will come to a longitudinal focus at some distance after the RF compression cavity.At the ideal RF power and phase, this focus will be at the sample plane.In our setup, this distance is 27.9 cm downstream of the RF cavity.
When the cavity is set at the longitudinally focusing phase, the RF field has a defocusing effect on the trans-verse beam profile.A second solenoid refocuses the beam to a transverse size (σ x ) of approximately 200 µm RMS at the sample plane.This is illustrated in Fig. 1(d).Here there is a trade-off between spot-size on the sample and q-space resolution on the detector.In order to achieve a smaller spot-size at the sample plane, a retractable 100 µm diameter pinhole is placed directly before the sample.Control over the spot size in this way comes at the cost of decreased intensity (typical transmission through the pinhole is 20%).

B. Beamline Simulation
We utilize the General Particle Tracer (GPT) software package to simulate the propagation of electron bunches along the beamline.GPT is a three-dimensional particle tracking software that numerically simulates charged particle dynamics in external electromagnetic fields while accounting for space-charge effects [20].All of the GPT results presented here are from simulations with a 40.4 keV beam energy, 1.0 fC bunch charge, and 0.25 eV thermal emittance.Note that the 100 µm diameter pinhole is not included in the simulation.longitudinally focus at the sample plane while imparting no net momentum to the electron bunch; we will refer to these optimized values as the ideal RF phase and RF amplitude.If we were to vary the RF phase away from this ideal value, σ t would grow until it reaches a maximum expansion phase at 90 • away from the compression phase.In contrast, if we were to vary the RF power while keeping phase fixed at the zero-crossing point, the electron bunch would come to a longitudinal focus either before or after the sample plane.Fig. 2 shows a simulated mapping of σ t at the sample plane as a function of RF amplitude and phase.For fixed RF powers below the ideal level, the minimizing phase always corresponds to the zero-field crossing, where the field slope is maximal.However, for RF power levels higher than ideal, the minimizing phase along cuts of constant RF power bifurcates into two branches.In these branches, either a net acceleration or deceleration is applied to the electron bunch along with the longitudinal compression; the shift away from the zero-field crossing exposes the electron bunch to a weaker field slope which compensates for the excess power thus holding the focus at the sample plane.
These two bifurcated branches achieve similar simulated σ t compared to the ideal condition; however, arrival time jitter due to amplitude fluctuations is significantly worse along the branches.At the ideal condition, the zero field crossing completely eliminates first order arrival time jitter effects due to fluctuations in the RF power; however, in the high power branches, this arrival time jitter increases more than tenfold to a level of 40 fs per 0.1 % power variation in the cavity.Additionally, the dependence of σ t on RF phase is more severe in the high power branches compared to the ideal condition.Hence, operating in these branches is undesirable unless amplitude is highly stabilized.

C. RF cavity and cooling
A single-cell S-band 2.856 GHz buncher cavity is used to impart the required chirp on the electron bunch.The cavity was constructed by Radiabeam technologies (Fig. 3) and is based on a re-entrant nose cone geometry.The conversion of RF cavity power (P ) to the peak accelerating voltage (V c ) is quantified by the shunt impedance (R s ) through the relation: The re-entrant geometry is designed to obtain a cavity shunt impedance of 3.3 MΩ so that <3 W of RF power is sufficient to reach the nominal cavity voltage of ∼3 kV.
The distance between the nose cones is carefully chosen so that 40.4 keV electrons will enter and exit the cavity in half a cycle of the RF fields in order to maximize the transit time factor.The cavity is equipped with two n-type ports, one of which is used to feed the input coupler into the cavity and the other is used for a probe antenna.This antenna is calibrated to a -12 dB coupling in order to monitor the amplitude and phase of the RF fields.
When operating in CW mode, the maximum power into the cavity is limited by heat transfer considerations.Two separate water cooling circuits can be used to control the temperature of the copper structure, but due to a leaky connection, we have operated using only the upstream water channels (Fig. 3(a)).Although not ideal, heat load simulations indicate this mode of operation is acceptable as it yields a relatively modest peak temperature increase of less than 5 • C under 50 W of input power.In our implementation, the operating input power is less than 5 W, so this temperature gradient is much smaller.During operation, the temperature of the water in the cooling line is actively stabilized such that fluctuations do not exceed 0. (±0.05 MHz).Mismatches between the cavity resonant frequency and the frequency from the oscillator lead to reflections and losses.The input coupler that converts the RF power from the coaxial cable to the cavity mode has a coupling factor of 0.98 so that the return loss is very small (-40 dB of the input power), as confirmed by the measurement shown in Fig. 3(b).After tuning and adjustments, a sharp cavity resonance with an unloaded quality factor of 12000 was measured with a vector network analyzer at 2.856 GHz prior to installation on the beamline (Fig. 3(b)).
The design shunt impedance is verified by measuring the change in the beam velocity as a function of the RF phase, as shown in Fig. 4. The deviation in beam momentum is obtained by monitoring the shift in the Bragg peaks from a gold reference sample as a function of the input phase while maintaining an input power of 2.3 W. Acceleration (deceleration) of the electron bunch contracts (expands) the scale of the diffraction pattern on the detector.A sinusoidal fit of this diffraction scale variation with RF phase yields a shunt impedance of 3.2 MΩ, in good agreement with the predictions.Note that this measurement also allows one to easily determine the phase for which no net impulse is imparted to the bunch as described later.

III. SYNCHRONIZATION AND FEEDBACK
RF compression requires precise synchronization between the electron arrival time at the RF cavity and the phase of the RF field inside the cavity.This synchronization problem is central to state-of-the-art RF technologies at large-scale particle accelerators; thus, there is a large body of knowledge in this domain [21][22][23][24][25].In the case of UED experiments at the GARUDA beamline, this problem is addressed by synchronizing the laser oscillator (seed for pump and probe pulses) and the RF cavity wave to a master clock.
Fig. 5 shows a simple schematic of this system.In order to stabilize the RF compression process, the laser oscillator is locked via PID feedback to a master dielectric resonator oscillator (DRO) providing a low noise electronic signal at 2.856 GHz frequency.The frequency of the laser oscillator is 79.333 MHz; pulses from this oscillator are fed into a mixer detector unit [MenloSystems, MDU-2856MHz-FS].This converts the laser pulses into an electronic signal via a fast photodiode with a bandwidth large enough to resolve the harmonics of the 79.333 MHz pulse train up to the 36th order (2.856 GHz).The DRO signal is mixed with this photodiode signal to produce an error voltage that measures the phase mismatch.Two piezo mirrors are controlled inside the laser oscillator to adjust the length of the cavity and synchronize the phase.The integrated timing jitters of the master DRO and the laser oscillator are shown in Fig. 6; both stay below 40 fs RMS.
The RF cavity is driven by an amplified and phaseshifted signal from this same master DRO.The RF amplifier is a fixed gain Empower model 2193 which is run below saturation to allow for amplitude feedback adjustments.The variable attenuation and phase shift is PID feedback controlled by two IQ mixers [Marki Microwave, EVAL-MMIQ-0205H].These are four port devices (two RF ports and two low frequency ports) which enable simultaneous in-phase and quadrature mixing.
If the following two signals are applied to the RF ports, then the IQ mixer will produce two DC voltages, I and Q, such that: Here, we take V 1 as a signal from the master DRO and V 2 as a signal from a antenna probe in the RF cavity.
The mixer acts to demodulate the signal to the I and Q voltages which yield the relative amplitude and phase of the RF cavity wave.Letting A = a/b, the relevant relations are: Likewise, we can use a separate IQ mixer to set the amplitude and phase for an RF wave applied to port V 2 .In this case, the V 1 signal is modulated according to the DC voltages externally applied at the I and Q ports of the mixer.With simultaneous operation of two IQ mixers,  one acting as a modulator and one acting as a demodulator, we can measure and control the phase and amplitude of the RF field inside the cavity.Prior to deployment in the feedback system, the IQ mixers must be calibrated.This is accomplished using a 2-port vector network analyzer (VNA) and an analog phase shifter.Ideally, the relationship between the true phase (as measured by the VNA) and the IQ mixers setphases would be a line with unity slope.In practice, there can be a deviation from this linearity due to a variety of possible causes including the response of the antenna inside the cavity and the actual response of the mixers themselves.
Let (I 1 , Q 1 ) and (I 2 , Q 2 ) denote the voltages on the modulation and demodulation mixers respectively.We can convert these voltages to amplitudes and phases through equations 10 and 11 to obtain modulation parameters (A 1 , ϕ 1 ), and the actual demodulated amplitude and phase in the cavity (A 2 , ϕ 2 ).For feedback on the RF phase and amplitude, we require a mapping from (I 1 , Q 1 ) to (A 2 , ϕ 2 ) which will have a similar form to the analytic mapping with some non negligible deviations due to the non-linear response and thresholds of the Empower amplifier.To correct for these, we use a lookup table approach.The demodulated values of amplitude and phase are measured for a dense grid of input modulation parameters; this discrete mapping is then interpolated to create a continuous function L : (I 1 , Q 1 ) → (A 2 , ϕ 2 ).An example of this mapping is shown in Fig. 7 and clearly shows an approximate correspondence to the expected conical and arc-tangent behavior.
A LabJack U3-HV with a LJTick-DAC is used to digitally read and write the IQ mixers' DC voltages; this device provides a -10 to 10 V range.The read and write DC voltages for the IQ mixers are typically low (around 0.5 V).Voltage dividers and low noise amplifiers [Analog Devices, OP27] are used to boost the signal to fill the dynamic range of the LabJack.For each measurement in the feedback system, 100 individual digital measurements are performed and averaged to increase accuracy.
UED experiments at the GARUDA beamline frequently require 12 hours of data acquisition to achieve a high quality signal-to-noise ratio.During this time, the same UED trace is scanned over many times and the results are averaged.Fig. 8 displays RF amplitude and phase data over two separate 12 hour periods to demonstrate the difference in RF stability with and without active feedback.It is apparent that activation of the vectorial feedback results in a significant improvement of 4 2 0 2 4 Map between the voltages applied to the modulation IQ mixer and the voltages measured on the demodulation IQ mixer.The demodulation IQ mixer voltages are expressed in terms of an amplitude and phase.In the ideal case, A2 and ϕ2 would relate to I1 and Q1 through Eq. 10 and Eq.11 respectively.This empirical mapping corrects for deviations from the ideal.
phase stability on timescales as short as one hour while the improvement in amplitude stability (more than a factor of two) takes longer to appreciate.We can also compare the amplitude stability of the full vectorial feedback to a system where only phase feedback is applied.In this scenario, the phase feedback introduces significant additional amplitude jitter due to phase-amplitude correlations in RF phase shifter circuit elements [17].For the IQ mixer based design presented here, a phase only feedback system adds noise into the amplitude channel due to the cross-talk in the lookup table L. This can increase the amplitude drift by a factor of 100.Thus, simultaneous feedback for both quantities is essential for best performance when using these mixers.Given the measured performances of the feedback loop shown in Fig. 8, we can estimate for this data set that the time-zero jitter due to fluctuations in RF cavity phase and power is lower than 20 fs RMS at the zero-field crossing.The total time-zero jitter in a UED experiment is a combination of this RF cavity jitter along with the timing jitter in the DRO and laser oscillator.This quantity is σ jitter ≈ 50 fs RMS.

IV. SYSTEM CHARACTERIZATION
We characterize the GARUDA beamline performance through diffraction measurements on a mono-crystalline sample of 1T -TaS 2 .This material is a widely studied quasi-two-dimensional compound belonging to the transition metal dichalcogenide family of materials.It is metallic at high temperatures (>550K), but below this temperature, it hosts a series of charge-density-wave (CDW) states possessing different characteristic wavevectors [26,27].The sample studied here was sectioned to approximately 60 nm thickness via ultramicrotomy and mounted freestanding on a copper TEM grid.
The momentum resolution of a diffraction instrument can be directly determined by analyzing Bragg peak widths collected from a known sample (1T -TaS 2 ).From the data in Fig. 9, we measure an RMS momentum resolution of σ q = 0.104 Å−1 .This corresponds to a transverse coherence length of 9.62 Å.This quantity is related to the RMS beam angular divergence at the sample (σ θ ) according to, σ q = mγβc h σ θ Thus, we have a divergence at the sample plane of 0.988 mrad.Additionally, the measured RMS beam transverse size at the sample is 37 µm (with the 100 µm pinhole inserted).Hence, the normalized beam emittance is approximately 11.6 nm•rad.However, this measurement is not obtained exactly at the transverse focal point of the beam; therefore, the quoted value serves as an upper bound on the normalized emittance.
The temporal resolution of the system is characterized through measurements of CDW peak dynamics in 1T -TaS 2 .Specifically, we present UED measurements on the photo-induced transition from the room temperature nearly-commensurate charge-density-wave (NC-CDW) to the incommensurate charge-density wave (IC-CDW) phase.All measurements are performed at 500 Hz repetition rate with a laser pump of 835 nm wavelenth and 750 µm RMS transverse width.Time-resolved X-ray diffraction studies on this transition have shown a complete suppression of the NCCDW peaks within ∼250 fs of pump excitation followed by a slight recovery [28].These data provide a measure of the intrinsic response time of the photo-induced NCCDW-to-ICCDW transition.We utilize a phenomenological function as an effective Green's function, χ(t), that describes the intensity of the NCCDW diffraction peak as a function of time in the limit of zero instrument broadening.
Here I D defines the magnitude of the initial intensity drop, and I ∞ is the intensity in the limit of t → ∞.The intrinsic response time was previously measured using time-resolved X-ray diffraction by Laulhé et al. whose results fit to τ 1 = 140 fs, a timescale that characterizes the initial peak intensity drop.In order to quantify our instrument response function, we hold τ 1 fixed at this value.The peak intensity recovers on a timescale that is characterized by the variable τ 2 .
Our data is fit to a convolution of this Green's function with a Gaussian of variance τ 2 i to represent the instru-ment broadening.Thus, the fit curve is given by, Fig. 9 shows a fit of F (t) to the UED data on the photoinduced NCCDW to ICCDW transition.The data was collected at optimized RF power and RF phase; thus, the value of τ i extracted from this curve is the minimum achieved RMS instrument response time: 144 ± 19 fs.The quantity τ i contains all sources of instrument broadening; however, the width of the IR pump (σ pump = 85 fs RMS), the width of the electron probe pulse (σ t ), and the arrival time jitter (σ jitter ≈ 50 fs RMS) are the dominant factors.By subtracting in quadrature the length of the laser pump pulse and the contribution of the timing jitter, we obtain an estimate for the electron bunch RMS temporal width σ t = 105 fs.Limitations on this temporal width at focus are primarily due to space-charge effects and phase-space nonlinearity [29].Phase-space non-linearity refers to a deviation from perfect correlation between particle position and velocity along the beam axis; this will cause the negative, linear chirp applied by the RF cavity to imperfectly focus the bunch.Improvements here can be obtained by either increasing the electron beam energy or decreasing the distance between the RF lens and the sample plane.
To empirically determine the zero-crossing compression phase of the RF cavity, one can measure a set of Bragg peak positions as a function of RF phase at fixed The data is fit to F (t) (defined in Eq. 13) which is plotted as the solid green curve.The dashed blue curve is the intrinsic sample response given by χ(t) (defined in Eq. 12).The dotted blue curve is the instrument response function which fits to an RMS width of 144 ± 19 fs.This data was collected with a pump fluence of 2.7 mJ/cm 2 , 180 fs FWHM laser pulse width, 500 Hz repetition rate, and a bunch charge of 3.3 fC.RF power jitter was below 3 mW RMS.
RF power -shown in Fig. 4.This curve shows the magnification factor of the initial diffraction pattern due to RF acceleration from the cavity.If there is no magnification (factor is equal to 1), then zero net momentum was imparted to the electron beam; this can occur for either a compression phase or an expansion phase that are separated by 90 • .To differentiate the two, it is necessary to know whether increasing phase leads or lags the RF wave.In our case, phase leads the wave which means that the zero-crossing where dt a /dψ| ψ=0 < 0 is the compression phase.The precision of this method is limited by the position resolution of the Bragg peaks in the diffraction pattern.Using Gaussian fits for the peak profiles The green lines are from the GPT model.Each data point in these plots is extracted from a UED time-trace with pump fluence of 4 mJ/cm 2 , 180 fs FWHM laser pulse width, 500 Hz repetition rate, and bunch charge of 1 fC.Note that this data was collected before optimized RF amplitude stability was achieved; here the power jitter was at the level of 200 mW RMS.
allows sub-pixel accuracy in the determination of peak centroids; nevertheless, the measurement of the compression phase is still uncertain to within a few degrees with this method.Significantly better precision on the compression phase determination is obtained from time-zero measurements in a UED experiment.A reference case time-zero is measured from a time-trace in which no power is supplied to the RF cavity.This defines the zero of the electron arrival time (t a = 0).Once power is supplied to the RF cavity, deviation from the zero-crossing phase will result in a non-zero t a .A UED time-trace measures this quantity to within 100 fs error (1σ confidence) which allows the RF phase to be tuned to the zero-crossing with 1.1 mrad precision.Fig. 10(a) shows results from UED data collected at a fixed RF power for a number of different RF phases.The phase where t a = 0 is a point at which zero net momentum is imparted to the electron beam.The slope of t a (ψ) at the zero-crossing is measured to be -1.54ps/ • in good agreement with Eq. 4.
The dependence of the system response time (τ i ) on phase at the ideal RF power is shown in Fig. 10(b).The range of compressing phases at the ideal power is quite large; however, the onset of time-zero jitter due to RF power fluctuations can quickly increase the system response time as phase is moved away from the zero-field crossing.For the data presented in Fig. 10, the total RF power jitter was ∼200 mW RMS; however, the phase jitter was held below 0.5 mrad.Even with this comparatively high jitter in RF power, the system response time at the zero-field crossing is still below 200 fs.As shown in Figure 8, the RF power jitter has since been improved to the 2.6 mW level.Fig. 10(c) displays measurements of the system response time at various RF powers while the phase is set at the zero-crossing.This corresponds to varying the focal length of the RF longitudinal lens.Clearly, a power that is too high (low) yields a focus before (after) the sample plane.This data is found to be in agreement with the expected curve from particle tracking simulations and shows a relatively large, approximately 300 mW range, for an acceptable temporal focus below 200 fs RMS.

V. CONCLUSIONS
In conclusion, a novel UED beamline operating at 40.4 keV electron energy has been commissioned at UCLA based on RF compression to obtain an RMS temporal resolution of 144±19 fs.The cavity is operated in CW mode which allows for fast feedback control.A vector-based feedback loop using IQ mixers to read and control the amplitude and phase of the cavity RF field is implemented.This active stabilization of both amplitude and phase allows for new operating conditions for RF compression.For instance, compression away from the zero-field crossing for tuning of the electron energy or RF focusing can be employed using the vector-based feedback scheme.Additionally, implementation of two amplitude stable RF cavities could be used for precise energy collimation of the electron bunch, which would enable high precision momentum resolved electron energy loss spectroscopy (EELS) [30].Further improvements in temporal resolution can be obtained by increasing the energy from the electron gun (currently limited by arcing at the cathode) and optimizing the compression for different bunch charges.Compression of the pump laser pulse and reduction of the RF cavity-to-sample distance would also improve the instrument response time.Further advances are possible in which timing jitter is handled through post processing.Since the UED scans are performed stroboscopically, good resolution electronic measurements could enable a scheme in which each probe shot is assigned its own arrival time and machine learning/artificial intelligence is used to compensate for the residual timing jitter [29].

FIG. 1 .
FIG. 1.(a) Map of the electric field of the 40.4 kV DC electron gun (From DrX Works TM ) along the central axis.(b) CAD model of the GARUDA beamline.Beam steering optics are omitted from this drawing.(c) Map of the peak electric field along the central axis of the RF cavity.The final figures (d) and (e) show the simulated electron bunch transverse and longitudinal RMS size respectively against the average bunch position.Note that the 100 µm pinhole is not present in this simulation.

Fig. 1 (FIG. 2 .
FIG. 2. Simulated temporal RMS width (σt) of the electron pulse at the sample plane as a function of RF phase and RF power.The compression reaches σt ≈ 140 fs.The simulations were performed with 40.4 keV beam energy, 1.0 fC bunch charge, and 0.25 eV thermal emittance.

FIG. 3 .
FIG. 3. (a) Cavity temperature simulation under 50W continuous-wave RF power operating with one cooling channel.The maximum and minimum temperature differ by about 5 • C (image courtesy of Radiabeam Technologies).(b) S21 measurements for the cavity conducted in vacuum.The resonance occurs at 2.856 GHz frequency with a bandwidth of 1.4 MHz FWHM.
FIG. 7. Map between the voltages applied to the modulation IQ mixer and the voltages measured on the demodulation IQ mixer.The demodulation IQ mixer voltages are expressed in terms of an amplitude and phase.In the ideal case, A2 and ϕ2 would relate to I1 and Q1 through Eq. 10 and Eq.11 respectively.This empirical mapping corrects for deviations from the ideal.

FIG. 8 .
FIG.8.RF phase (left) and amplitude (right) stability with PID feedback on (green) and off (red).The top panels show the raw readings over a 12 hour period.The middle panels give histograms of these readings demonstrating the superior stability attained with feedback.The bottom panels give the averages of standard deviations of the raw data binned over different time scales.

FIG. 9 .
FIG. 9. Electron diffraction patterns from 1T -TaS2 in the (a) nearly commensurate charge density wave (NCCDW) state and (b) incommensurate charge density wave (ICCDW) state.(c) and (d) Intensity cuts along the dashed lines drawn in (a) and (b).The average Bragg peak width (RMS) is measured to be σq = 0.104 Å−1 .(e) A UED time trace of the NC-CDW peak intensity during a photo-induced transition to the ICCDW state.The data is fit to F (t) (defined in Eq. 13) which is plotted as the solid green curve.The dashed blue curve is the intrinsic sample response given by χ(t) (defined in Eq. 12).The dotted blue curve is the instrument response function which fits to an RMS width of 144 ± 19 fs.This data was collected with a pump fluence of 2.7 mJ/cm 2 , 180 fs FWHM laser pulse width, 500 Hz repetition rate, and a bunch charge of 3.3 fC.RF power jitter was below 3 mW RMS.

FIG. 10 .
FIG. 10.(a) Electron bunch relative arrival time (ta) as a function of RF phase.The slope of ta vs. phase at the zerocrossing is 1.54 ps/ • .(b) Instrument response time (τi) as a function of RF phase.The data in both (a) and (b) were collected for an RF power of 34.5 dBm.(c) Instrument response time as a function of RF cavity power at zero phase.The green lines are from the GPT model.Each data point in these plots is extracted from a UED time-trace with pump fluence of 4 mJ/cm 2 , 180 fs FWHM laser pulse width, 500 Hz repetition rate, and bunch charge of 1 fC.Note that this data was collected before optimized RF amplitude stability was achieved; here the power jitter was at the level of 200 mW RMS.
1 • C. The cavity dimensions are designed such that the resonant frequency is 2.856 GHz to very high accuracy FIG.4.Relative size of an electron diffraction pattern from a thin-film gold crystal as a function of the RF phase in the cavity at 2.3 W input power.This is given by the circular data points and red fit curve, and was directly measured from the distances between several Bragg peaks on the detector.The triangular data points and blue fit curve give the electron bunch velocity inferred from the variation in diffraction pattern scale.