Tuning method for phase shifters with very low first field integral errors for the European X-ray Free Electron Laser

For the long gap tunable undulator systems of the European XFEL, 91 phase shifters are needed. They need to fulfil stringent and demanding field integral tolerances if their strengths, i.e., their magnetic gaps, are changed. In order to avoid additional correctors, their first field integral errors must not exceed 0.004 Tmm for self-amplified spontaneous emission operation at 1 Å. For longer wavelengths there are slightly relaxed requirements. In addition, a good field range of 0.5 mm is required. Phase shifters are manufactured by using state of the art techniques such as measurement and sorting of magnets, measurement and sorting of subassemblies, etc. In spite of these efforts, inhomogeneities of the permanent magnet material as well as mechanic manufacturing errors, which cannot be avoided and lead to violations of the demanding first field integral specifications. Therefore, a fast and robust shimming technique was developed for the serial production of these devices. It is based on measured signatures of shims with different geometries and uses symmetry properties of shims placed on different positions and poles with different polarity. In this paper, the specifications for the phase shifters in the European XFEL are derived first. Then the method is described in detail and results are presented, which demonstrate that all requirements can be fulfilled.


I. INTRODUCTION
The European X-ray Free Electron Laser (XFEL) will provide three undulator systems for user operation called SASE1, SASE2, and SASE3 [1].Their wavelength ranges cover 0.05-5.2nm by changing the electron beam energy and/or the undulator gaps.High power radiation will be generated by using the process of self-amplified spontaneous emission (SASE).In order to reach saturation, the lengths of these systems are to 215 m.The beam energy in the European XFEL can be varied between 8.5 and 17.5 GeV.Two undulator systems, SASE1 and SASE2, are optimized to cover the hard x-ray range from 0.05 up to 0.4 nm at 17.5 GeV.They need 35 undulator segments each 5 m long with a period length of 40 mm.SASE3 is a soft x-ray FEL.It uses 21 5 m long segments with a period length of 68 mm.Its radiation wavelength range starts at 0.4 nm at 17.5 GeV at a gap of 21 mm and ends at 5.2 nm at 8.5 GeV with a fully closed gap of 10 mm.
Long undulator systems need to be segmented for simple reasons: (i) For economic manufacturing, the length of an undulator segment is limited by machine tools.A good compromise is a length of 5 m.For longer devices, the technical effort gets too high.(ii) For the electron beam passing through the undulator system, auxiliary components such as quadrupoles, correctors, beam position monitors, vacuum pumps, etc., are needed.They are placed between undulator segments in so-called intersections.At XFEL they are 1.1 m long.The resulting periodicity of 6.1 m is a good compromise with machine operation as well.
The longitudinal velocity in an undulator with a closed gap is lower than in the intersection leading to a mismatch between the photon field and the microbunched electron beam.For fixed gap undulator systems such as FLASH and LCLS [2,3], this is a static problem which can be compensated with a suitable design of the undulator end fields.For systems with variable gaps, phase shifters are needed to provide an adjustable delay to the electrons for proper matching to the phase advance.For this reason, phase shifters are needed.They are placed in the intersection as well.
A phase shifter can be realized by using a chicane consisting of three electromagnets (EMs) [4,5].Generally, for a given strength an EM phase shifter needs more space than a permanent magnet (PM) one.In addition, EMs need correction coils to exactly trim the field integrals to the required accuracy [4].In addition, there are fringe fields outside an EM phase shifter, which might interfere with other magnetic components such as quadrupoles, corrector coils, or the end fields of undulators.All these components are closely stacked in an intersection.Also, heat dissipation by electromagnetic devices is an unwanted side effect in undulator systems, which are operated in a precision temperature-stabilized environment.For the European XFEL, a permanent magnet phase shifter was developed and is described in detail in Ref. [6].Its magnetic principle is shown in Fig. 1 and briefly described.It is a modified Halbach-type hybrid structure using four identical magnet modules.Each module is surrounded by a massive zero potential iron yoke, which is static.Its yoke gap cannot be moved.This iron yoke very effectively terminates all fringe fields.For changing the strength, the magnetic gap of the magnet packages is changed inside this static yoke.Its magnetic field on axis can be described by two sinusoids with a period length of 55 mm separated by the iron yoke in the center.For demonstration, Fig. 2 shows the field and the first and the second field integrals of one of the 91 phase shifters made for the European XFEL at the minimum gap of 10.7 mm.At this gap the peak field is about 1.4 T. The shapes of the first and second field integrals outside and in the center part demonstrate that the contribution of fringe fields is very low.The total device length is only 230 mm.There is perfect magnetic symmetry: Positive and negative magnets and poles in all modules have the same dimensions and identical magnetic counterparts and surroundings.So, ideally, there should be no gap-dependent first field integral errors.However, direct fields caused by angular magnetization errors as well as inhomogeneous PM material and manufacturing errors of poles and support structures may lead to small residual gap-dependent errors.These errors may be above tolerance limits and cannot be avoided completely by the manufacturing and assembly process and therefore require compensation.
For the precision measurements of the first field integral as described in this paper, the moving wire method was used but slightly modified.The wire length is only 500 mm.A 50 strand multifilament wire was used.It is not spanned but is cast in a thin fiberglass support plate.It is found that in this way the reproducibility of measurements is enhanced, which is typically 0.0003 Tmm (0.3 Gcm).In this paper, measurements and tuning are focused on the gap dependence of first field integrals of the phase shifters.There are, of course, small static components as well, which depend on the ambient magnetic field and the geographical orientation of a device.However, they are not changing with time and therefore are no problem for operation.There are dedicated correctors in each intersection.During operation, they will be used to establish a reference orbit using beam-based alignment techniques.Therefore, in all measurements the static contribution is subtracted.It is small anyway, typically ≤AE0.02Tmm only.
In this paper, tolerance requirements for the XFEL undulator segments are derived first.Then a tuning procedure is described, which minimizes the gap dependence of first field integral errors as well as the maximum gradients in the transverse beam directions so that the specs on first field integrals in the good field region are met.It is robust and fast to apply and is used in the serial production of phase shifters for the European XFEL.Measured results are presented.

II. SPECIFICATIONS OF THE PHASE SHIFTERS FOR THE EUROPEAN XFEL
There are longitudinal and transverse errors which deteriorate FEL gain: phase jitter and beam wander.Imperfect phase shifters may contribute to both.If not adjusted well, there might be phase jitter in a long undulator system.The phase integral, which determines the phase shift at a given radiation wavelength, is controlled via the magnet gap.In Ref. [6], an adjustment accuracy of 5°was found acceptable, requiring a moderate accuracy of the phase shifter gap control of about 25 μm.Nonzero first field integrals of phase shifters steer the electron beam off the axis and decrease the overlap between the electron beam and laser field.They originate in inhomogeneities of the magnet material and geometrical imperfections.The impact of these errors on XFEL performance was studied theoretically following the method described in Ref. [7] using the FEL simulation code GENESIS 1.3 [8].
The simulations are done in the following way: 100 different rectangular distributions of random kicks of strength AE0.001, 0.005, 0.010, and 0.018 Tmm are generated at the locations of the phase shifters.For each distribution, the resulting rms beam wander and the FEL power are calculated by using GENESIS 1.3.The FEL power is normalized to the perfect, error-free configuration.Each configuration results in one data point and is plotted.It should be emphasized that this is a statistical investigation.FEL power depends on specific details of the randomly generated configuration and might differ considerably from distribution to distribution.
Figure 3(a) shows the results for the SASE1 or 2 operated at 17.5 GeV, 1 Å.It is seen that for 0.001 Tmm kicks (black squares) there is a marginal loss of FEL power.For 0.005 Tmm errors (red dots) losses up to about 10% are observed.For 0.01 Tmm (green triangles) up to 30% losses are observed, and, finally, for 0.018 Tmm errors (blue triangles) losses are up to about 70%.In order to reliably limit FEL power losses to about 10%, field integral tolerances were limited to AE0.004 Tmm to be on the safe side.Figure 3(b) shows the same analysis for SASE3 operated at 4 Å, which is the short wavelength limit of SASE3.The results suggest that in this case errors of 0.010 Tmm are just above threshold, but slightly smaller errors are permissible.A comparison with Fig. 3(a) shows that a 0.010 Tmm error at 1 Å in the worst case leads to 30% power degradation but only to 15% at 4 Å. Figure 3(c) shows the results for SASE3 operated at 16 Å.It is seen that at this wavelength higher field integral errors up to 0.018 Tmm can be tolerated without compromising on power loss.
In order to cover the whole tuning range of SASE1 or 2 with some safety margin, the phase shifter (PS) in SASE1 or 2 will not be operated at gaps below 16 mm [6].Therefore, field integral tolerances ≤0.004 Tmm are needed only for PS gaps larger than 16 mm.For SASE3, field integral tolerances can be relaxed as a function of the gap, but the PS strength is higher.For the longest wavelengths at SASE3 requiring minimum PS gaps [6], the tolerance requirement is AE0.018Tmm.For intermediate wavelengths, there are no simulations.Here tolerance requirements are obtained by linear interpolation.In order to have one standard PS at the European XFEL, these specifications are combined.
Field integral tolerance requirements must be fulfilled in a good field region of 1 mm in the horizontal plane AE0.5 mm around the device axis.This value with some safety margin is determined by alignment tolerances of AE150 μm and limits the allowed integrated gradient to below AE0.004 T. A summary of the combined specifications is given in Table I.
These are tight tolerances and are a challenge for the shimming and tuning technique.However, their benefit is that the PS strengths and gaps can be changed freely and independently from the undulator segments in the system and no PS-specific corrections are needed.This simplifies operation and facilitates special operational modes, which require retuning of phase shifters over a wide range.Two examples are just mentioned: (i) The K parameters of two adjacent undulator segments can be exactly tuned by systematically tuning the phase shifter over a large range [9].(ii) Lasing at higher harmonics can be suppressed or stimulated by retuning the phase shifters [10].Such operations will be possible without any retuning and are therefore compatible with fast changes.

III. MAGNETIC MOMENT IN SHIMS
The method of error compensation proposed in this paper relies on applying shims.Shimming is widely used for tuning insertion devices [11][12][13][14][15].A qualitative understanding of their working principle is essential.Shims are made of highly permeable material such as low carbon iron foil with a low coercive field.The typical thickness is 0.05-0.5 mm.Lateral dimensions are several to several tens of millimeters.They might be placed either directly on a pole or beside a pole on the magnet.Because of its low coercive field, the external magnetic field drives the shim in saturation and induces a magnetic moment.The resulting field of the saturated shim is similar but not identical to that of a permanent magnet with the dimensions of the shim.
Figure 4(a) shows a sketch of a hybrid-type magnet structure as used for the phase shifters.While the magnetization of the magnets is parallel or antiparallel to the beam axis, the flux created by them is redirected by the poles perpendicular to the axis.If a shim is placed on a magnet next to a pole, a magnetic moment is induced by a small fraction of the flux.Its magnetic moment vector is predominantly parallel to the beam axis, but field lines emerging from this shim are perpendicular.In contrast, in a shim on a pole the direction of the magnetic moment vector in the shim is the same as in the pole, and the effect is similar to a pole shift.
The magnetic field B ⇀ of a magnetic moment m ⇀ at position r ⇀ is given by The total first field integral of this moment is given by It is seen that only the perpendicular component m ⊥ contributes to the first field integral and in this simple model m ∥ has no effect.The induced magnetic moment in shims on poles result in m ⊥ .In contrast, shims on magnets result in m ∥ .Therefore, for the first field integral, shims on poles are more efficient.
Unfortunately, shims on poles reduce the effective phase shifter gap, are not self-adhesive by magnetic forces, and therefore need to be restrained (glued).In contrast, shims on magnets do not narrow the gap if a small overhang of poles with respect to magnets of typically 0.5 mm is provided.Fortunately, it is observed that shims on magnets still give a small strength, which is sufficient for corrections [16,17].They stay on magnets firmly and are a convenient choice for phase shifter shimming.
As sketched in Fig. 4(b), the field induced by the shim on the beam axis depends on the lateral distance d.Therefore, by changing the transverse dimensions and positions of a shim, its gap-dependent contribution to the field integral is changed, and different gap dependencies may be created with different shim geometries.

IV. SYSTEMATIC TUNING STRATEGY A. Basic assumptions
Shims have a direct effect on transverse field integrals and field integral gradients.A systematic tuning technique must determine shim geometry and placement.Two basic assumptions are made: (1) Linearity principle.-Thecontribution of any shim is proportional to its thickness.
(2) Superposition principle.-Thecontribution of a combination of several shims is equal to the sum of the contributions of the individual shims.
Full saturation of the shims is assumed.For the XFEL phase shifters, this was explicitly verified by simulations and measurements [16][17].030703-4 the same size, but placed on different positions have an according effect.Half and full magnets need to be treated separately.Accordingly, for the 32 different positions, shims on half magnets and shims on full magnets need to be distinguished.In each group the function of the shim follows the specific symmetry properties.Without loss of generality, position 1 in Fig. 5 is defined to represent the "original" O position for half magnets and position 3 as the O position for full magnets.

B. Geometry
Positions opposite to the original positions with respect to the x axis such as 2, 4 are named "mirror" positions M. Positions on poles with opposite sign are named as "reversed" positions R.There are positions which are both opposite to the original position and on the reversed poles.They are named MR for "mirror reversed."The field integral induced by a shim on an O position as a function of the transverse position x is described by a function fðxÞ, where the beam is at x ¼ 0.Here fðxÞ can stand for the horizontal or vertical field integral but in both cases are, of course, different functions.The contributions by shims on the other symmetry positions can be described by using fðxÞ and applying the according symmetry operation: For M shims it goes like fð−xÞ, for R shims like −fðxÞ, and for MR shims like −fð−xÞ.These relationships determine important geometric properties for the combination of shims on different positions in terms of both gap-dependent field integrals and transverse gradients.Table II summarizes the resulting combined functions of two shims at different symmetry positions."Integral" stands for the first field integral along phase shifter axis z, and "gradient" means the transverse gradient along the axis x.Two things need to be emphasized: (i) The symmetry operations apply only to shims which have identical size.(ii) Since only total field integrals are needed, the z position of a shim plays no role, and shims may be distributed over different locations, i.e., on different sides of a pole and/or on poles with different polarity.
There are four different cases, which need to be distinguished: shims on half and full magnets and their effects on a vertical or horizontal field.For each of these four cases, there are O, M, R, and MR positions.Note that these positions as shown in Fig. 5 differ for these four cases.Table III gives an overview.030703-5 The symmetry relations described in Tables II and III are the basis for the shimming technique.As shown in Table II, combinations of shims may be found, which independently correct field integral or gradient errors in one direction without changing the other.
In order to demonstrate the strategy by using symmetry groups of O, M, R, and MR in Table III, the impact of a shim of dimension 36 × 8 × 0.4 mm placed on a full magnet was measured experimentally with the moving wire technique.
Following Table III, eight different positions 3, 4, 5, 6, 11, 12, 13, and 14 out of the 16 allowed for the vertical field integrals of full magnet were selected for demonstration.Figure 6(a) shows the original data for these eight measurements.The sign and symmetry depend on the symmetry group.Two measurements were made on each symmetry position O at 3 and 11, M at 4 and 12, R at 5 and 13, and MR at 6 and 14.In Fig. 6 Tables II and III.The overlap of these curves is quite good, demonstrating that the assumptions on symmetry hold fairly well.The slight differences are attributed to errors in the lateral dimensions and positioning of the shims.

V. FIELD INTEGRAL TUNING
For the large scale production of the phase shifters, a fast tuning method was developed.It is based on (a) measured signatures of a selection of five types of shims with different geometries on half and full magnets, (b) the consequent use of the symmetry properties described in Tables II and III, (c) the application of the linearity and superposition principle, and, finally, (d) the numerical optimization using the superposition of combinations of shims and their signatures by a systematic trial and error method with a subsequent evaluation of field integrals and gradients.Discrete steps for the thickness of the shims of 50, 100, 200, 300, 400, and 500 μm were selected.

A. Signatures of shims
For a numerical optimization, the dependence of the onaxis horizontal and vertical field integrals and gradients on the phase shifter gap needs to be known for different shim geometries and for full and half magnets.These dependencies are called "gap signatures."Many different shim geometries were investigated.Five shims with different dimensions and positions were finally selected for further work.The criterion is that their gap signatures were quite different.Figure 7(a) illustrates the gap signature of the vertical field integral for these five shims.Figure 7(b) shows the dependency of the vertical field integrals on x at a phase shifter gap of 10.5 mm.This is the worst case, since at this minimum gap field integrals and gradients are highest.The gradient for the optimization is evaluated by the slope at x ¼ 0. Figures 7(c a large reduction, especially at small gaps, is obtained.The final status fits into the specs window given by Table I.Similarly, the tuned gradient is low enough that there is a good field area of AE0.5 mm around the axis.This is explicitly shown in Fig. 8(b) by the dependence on x at the minimum gap before and after tuning.Figures 8(c) and 8(d) show the results for the horizontal field integrals.
The results are quite similar to the vertical case.

VI. SUMMARY AND OUTLOOK
The subject of this paper is a compensation method for residual gap-dependent first field integral errors of the phase shifters for the European XFEL.It can be applied right after mechanical assembly.Unavoidable production errors due to magnet material imperfections and limited mechanical accuracy, etc., can be corrected.A systematic method is described and demonstrated which reduces the gap dependence of these errors below the specifications required for the European XFEL.It is based on measured signatures of a set of reference shims using the linearity and superposition principle.A shim configuration, which minimizes field integral errors and the transverse gradient, is found by numerical simulations of a large number of different shims by using a trial and error method.Shim configurations which bring the first field integrals and gradients in full compliance with European XFEL specifications or even below are quickly found.
The shimming method described in this paper was developed for the serial production of these devices for the European XFEL.It combines both fine-tuning to very low gap-dependent field integral errors and fast fabrication speed resulting in completely "passive" phase shifters.This means that the phase shifter gaps can be freely changed without the need for additional corrections.The operation of large undulator systems like those for the European XFEL is significantly simplified where up to 35 phase shifters need to be operated synchronously together with the undulator segments.A change of wavelength can thus be made faster.As an ultimate objective, the wavelength of an undulator system might be changed "on the fly," allowing for scanning the wavelength while the system continues lasing.
Furthermore, "passive" phase shifters facilitate special XFEL operation modes, which require substantial detuning of the phase shifters [9,10] since there are no steering errors, which may falsify results.
Shimming is commonly used to improve field quality of insertion devices [11][12][13][14][15].The method described in this paper enhances the application spectrum of shims.Three examples are just mentioned: (i) Similar to phase shifters, gap-dependent steering errors of an undulator can be compensated completely with high accuracy so that it is passive and no further corrections are needed.(ii) In long undulators, sometimes gap-dependent steering errors well inside the structure are observed, which deteriorate the trajectory out of

FIG. 2 .
FIG.2.Field and first and second field integrals of one of the 91 phase shifters of the European XFEL.

FIG. 3 .
FIG. 3. GENESIS 1.3 simulations at different wavelengths with a 17.5 GeV beam.The normalized power is plotted against rms beam wander caused by different first field integral kicks on the phase shifter positions.(a) SASE1 or 2 at 0.1 nm; (b) SASE3 at 0.4 nm; (c) SASE3 at 1.6 nm.

Figure 5
Figure 5 illustrates the magnet configuration of a phase shifter in a perspective view.Only the magnet modules without the iron yoke shown in Fig. 1 are sketched: A phase shifter is comprised of four magnet modules.Each contains one full magnet, two poles, and two half magnets.In Fig. 5, 32 different positions are defined where shims might be placed.Symmetry requires that identical shims, i.e., with

FIG. 5 .
FIG. 5. Illustration of the four modules of a phase shifter and the definition of the 32 different shim positions.
FIG. 6. Measurements of the total first vertical field integral as a function of x with a shim of 36 × 8 × 0.4 mm placed on O, M, R, and MR positions as indicated.(a) Measured data.(b) Data transformed back by using the symmetry properties of TableIII.
FIG.8.Demonstration of the tuning of the vertical field integrals.Left: Open symbols, status as found; full symbols, field integral after tuning.Red: On-axis measurement; blue, black measurement at x ¼ AE0.5 mm.All curves fit inside the specs window as given by TableI, which is indicated for comparison.Right: Gradient optimization is demonstrated by the slope of the x dependence at the 10.5 mm gap before and after tuning.

TABLE I .
Combined specifications of the phase shifters for SASE1-3.

TABLE II .
Combination of shims and resulting effects.

TABLE III .
Magnet positions with O, M, R, and MR symmetry for horizontal and vertical field integrals and half and full magnets.