LUND UNIVERSITY

MASTER THESIS MAXM30

Effect of Insertion Devices Tapering Mode of Operation on the MAX IV Storage Rings

Author: Georgia PARASKAKI Supervisors: Sverker Werin Hamed Tarawneh

June 4, 2018

Abstract

Tapering is a mode of operation of insertion devices that allows the users to perform scanning in a range of photon energies. NanoMAX, BioMAX and BALDER are all of the 3 GeV MAX IV storage ring and will provide this special mode of operation for their users. In this thesis, the spectra of NanoMAX and BioMAX while operating with tapering were studied and feed forward tables that cancel out the closed orbit distortion caused by the insertion devices were generated. Moreover, a study of the nature of the closed orbit distortion was performed, aiming at simplifying the feed forward table measurements that can currently be quite time consuming. In addition, the effect of BALDER, which is a and currently the strongest insertion device in the storage ring, on the beam was studied. Apart from the feed forward table that corrects for the closed orbit distortion, BALDER induces a beta beat and tune shift which has to be eliminated in order to make the insertion device transparent to the electron beam. This correction is needed in order to keep the beam life time unaffected and ensure a stable operation. For this reason, a two-stage correction scheme was proposed. First, a local correction with the quadrupoles adjacent to BALDER was performed in order to eliminate the beta beat induced by the wiggler. As a second step a global correction was applied. The aim of the global correction is to bring the tune back to the design values. Contents

1 Introduction 3

2 Background 5 2.1 Beam Dynamics ...... 5 2.1.1 Coordinate system ...... 5 2.1.2 Optics of charged particle beams ...... 7 2.2 Response Matrix ...... 9 2.3 Insertion Devices ...... 10 2.3.1 Physics of Insertion Devices ...... 10 2.3.2 Tapering mode ...... 12 2.3.3 Effects of Insertion Devices on the electron beam ...... 14 2.4 The MAX IV Laboratory ...... 16 2.5 The MAX IV beamlines ...... 16 2.5.1 NanoMAX ...... 16 2.5.2 BioMAX ...... 16 2.5.3 BALDER ...... 17 2.5.4 BLOCH ...... 17

3 Methods 18 3.1 SPECTRA ...... 18 3.2 Accelerator Toolbox ...... 18 3.3 Matlab Middle Layer ...... 18 3.4 LOCO ...... 19

4 Modelling and correction strategy 20 4.1 Spectrum study ...... 20 4.2 Neutralizing the effect of IDs on the electron beam ...... 20 4.2.1 Feed Forward table generation ...... 20 4.2.2 Field integral study ...... 21 4.2.3 Modelling BALDER’s effect on the storage ring ...... 22 4.2.4 Optics correction for BALDER ...... 23

5 Results 25 5.1 Spectrum study ...... 25 5.2 Neutralizing the effect of IDs on the electron beam ...... 29

1 5.2.1 Feed Forward table generation ...... 29 5.2.2 Field integral study ...... 29 5.2.3 Simulation of BALDER’s effect on the storage ring ...... 30 5.2.4 Optics correction for BALDER ...... 31

6 Discussion 33 6.1 Spectrum study ...... 33 6.2 Neutralizing the effect of IDs on the electron beam ...... 34 6.2.1 Feed Forward Table generation ...... 34 6.2.2 Field integral study ...... 34 6.2.3 Simulation of BALDER’s effect on the storage ring ...... 34 6.2.4 Optics correction for BALDER ...... 35

7 Outlook 36

2 Chapter 1

Introduction

Light sources are accelerators dedicated to the production of light. (SR), the light emitted when charged particles are accelerated, was first discovered in 1947 at the General Electric Research Laboratory in a 70 MeV synchrotron [1]. Until the 1970’s, synchrotrons were mostly dedicated to nuclear and high energy physics experiments for which SR was only a limiting factor in achieving higher energies. That was the first generation of light sources. Early in 1980s synchrotrons started being dedicated to the production of X-rays using bending magnets. This was the second generation of light sources. In the middle of 1990s the first light sources using insertion devices (IDs), a special type of magnets, to produce light were built in Europe, the so called third generation of light sources [1]. The full capabilities of this generation has not yet reached its limit. However, at the same time, we are moving towards the fourth generation of light sources; the free electron lasers (FELs) and low emittance storage rings. FELs are linac-based light sources the aim of which is to produce fully coherent light of higher brightness with very short pulse duration [1]. MAX IV is a Swedish national accelerator laboratory that was inaugurated on the 21st of June 2016 and is expected to provide users with the most brilliant X-rays in the world with its light sources. In order to produce light for the experiments, electron beams are circulated in accelerators, called storage rings. In these storage rings the light is produced with IDs. Even though the insertion devices are essential for the light production, they introduce changes to beam parameters or orbit that need to be corrected. The two problems to be corrected are the closed orbit distortion (COD) and the optics distortion.

3 Figure 1.1: The MAX IV facility.

The aims of this thesis are to:

• Study a special mode of operation of the insertion devices, called tapering mode.

• Generate feed forward tables to correct the COD for tapered and nontapered insertion de- vices.

• Investigate the nature of COD in order to simplify the measurement method.

• Correct the optics distortion caused by BALDER, the strongest insertion device of the MAX IV storage rings.

In this thesis, first there is an introduction to the accelerator physics theory and a description of the tools used. Later, the tapering mode of operation is studied. Following, the effect of the insertion devices on the electron beam is studied and the proposed corrections are presented. Finally, there is a discussion of the results and possible future steps.

4 Chapter 2

Background

2.1 Beam Dynamics

2.1.1 Coordinate system In order to describe the state of a particle, a 6D coordinate system can be used (x, x0, y, y0, z, δ). The coordinates x and y are the transverse displacements from the reference particle that follows the design orbit, x0, y0 the transverse angles, z the longitudinal displacement from the reference particle and δ is the relative momentum offset from the reference particle [3]. As expected, the coordinates of the reference particle in this system are (0, 0, 0, 0, 0, 0). The motion of particles in the transverse plane can be described by Hill’s equation [4]:

00 x (s) + Kx(s)x(s) = 0, 00 (2.1) y (s) + Ky(s)y(s) = 0, where Kx and Ky are functions of the magnets’ properties that are periodic with the circumference of the ring and s is the coordinate along the beam direction [2]. Since the equations for the hori- zontal and the vertical plane are similar, we can limit us to the study in the horizontal plane. The general solution to the equation of motion is:

√ p x(s) =  β(s)cos(Ψ(s) + Ψ0). (2.2)

The solution indicates that the particles perform harmonic oscillations which are called betatron oscillations. In Eq. 2.2 β(s) is the beta function, also known as the amplitude function, which describes the amplitude of betatron oscillations and is a measure of the transverse size of the beam. When performing betatron oscillations, the amplitude of the oscillations is position dependent [2]: √ E(s) = pβ(s). (2.3)

5 Figure 2.1: Coordinate system in the vicinity of the reference particle [2].

Therefore, the trajectories of the particles are included in the envelope E(s) which defines the range of their oscillation. We can also define α(s) and γ(s) [2] as:

β0(s) α(s) = − , 2 (2.4) 1 + α2(s) γ(s) = . β(s)

The beta function β(s) along with α(s) and γ(s) are called twiss parameters and they will be interpreted later in this section. Ψ, which appears in Eq. 2.2, is the phase advance [2]:

I ds Ψ(s) = , (2.5) β(s) and  is a constant of motion called the Courant-Synder invariant also known as emittance [2]:

 = γ(s)x2(s) + 2α(s)x(s)x0(s) + β(s)x02(s). (2.6) This is the equation of an ellipse in the x−x0 plane which is also called phase space. The emittance  is the area of this ellipse divided by π, and based on Liouville’s theorem it is an invariant of motion [2]. The twiss parameters introduced previously describe the orientation of this ellipse in phase space. At this point, the tune of the machine can be defined as shown in Eq. 2.7 [2]. The tune expresses the number of oscillations an electron performs in one revolution along a circular accelerator. 1 I 1 Qx/y = ds. (2.7) 2π βx/y(s)

6 2.1.2 Optics of charged particle beams Optics in accelerator physics concerns the use of magnetic fields in order to force the electron beam, in our case, to follow the design orbit while being focused [5]. The force acting on a particle of charge e with velocity u in an electromagnetic field (E, B) is the Lorentz force shown in Eq. 2.8 [2]:

F = eu × B. (2.8) Since the transverse displacement of the beam is quite small, it is possible to expand the magnetic field in the vicinity of the nominal orbit [2]:

∂B ∂2B ∂3B B (x) = B + y x + y x2 + y x2 + ... (2.9) y y0 ∂x ∂x2 ∂x3 p Dividing all the terms in Eq. 2.9 with the magnetic rigidity Bρ = q [3] gives:

2 2 3 3 By(x) By0 ∂By x ∂ By x ∂ By x = + + 2 + 3 + ... = p/q By0ρ ∂x ρ ∂x p/q ∂x p/q 1 (2.10) + gx + mx2 + nx3 +... ρ |{z} |{z} |{z} |{z} quadrupole field sextupole field octupole field dipole field

As can be seen in Eq. 2.10, in the linear approximation it is only the dipole and quadrupole field that we are interested in. In order to guide the along a curved path, dipole magnets are used. The deflection of the particles can be determined from the equilibrium between the Lorentz force (see Eq. 2.8) and mu2 the centrifugal force [4] F = ρ , where ρ is the bending radius. In equilibrium, using practical units, we get:

GeV Bρ[T m] = 3.33p[ ], (2.11) c where p is the momentum of the particle and Bρ is called the magnetic rigidity and describes how rigid a particle is in a magnetic field based on its momentum. As can be seen from Eq. 2.11, dipoles can also be used to introduce a correlation between the transverse position and the momentum of a particle [5], but this use is outside the scope of this thesis. Using Eq. 2.11 and the fact that the arc of the trajectory can be written as L = ρθ we can calculate the kick angle θ introduced by a dipole:

Bl θ = , (2.12) 3.3E and in convenient units: B[Gauss]l[cm] θ[µrad] = . (2.13) 3.3E[GeV ]

7 Figure 2.2: Calculation of the magnetic field of a dipole magnet [2].

In the simplest case, the dipoles are sector magnets and the trajectory of the particle is perpendicular both to the entrance and exit pole face of the magnet. Rectangular dipole magnets exist as well. These magnets cause the so called edge focusing effect, which results in a vertical focusing and horizontal defocusing effect. It should be noted that except for the dipoles that are used to bend the beam along the curved path, there are also dipole corrector magnets. Corrector magnets are thin magnetic dipoles which are used in order to correct the trajectory of a particle that deviates from the nominal orbit. This deviation might be caused from misalignments along the machine for instance. Using Ampere’s law H H · d` = nI we can convert the current used in dipole magnets into a kick angle. In this case, n is the number of coil turns and I the induced current. Integrating along a dipole corrector magnet for instance (see Fig. 2.2), we get: HF e · lF e + H0 · h = nI. However, the field in the iron is H = H0 . Since the magnetic permeability of iron, µ , is a large number, F e µr r the field in the iron can be neglected. [2]. This leaves us with a magnetic field in the vacuum µ0nI B0 = h . Now, using Eq. 2.13 we can translate the current of the coils to kick angles. Except for changing the direction of the beam, it is also important to keep it focused on the transverse plane. This can be achieved by using quadrupole magnets. A quadrupole consists of four magnetic poles. A particle that passes through the center of the magnet will not be affected. However, particles that pass off-center feel the Lorentz force (Eq. 2.8) in both x and y axis due to the By and Bx field respectively. In this case, the dependence of the magnetic field on the transverse displacement is linear, as shown in Eq. 2.10. The magnetic field and the Lorentz force in this case are:

8 Bx = gy → Fy = eugy, (2.14) By = gx → Fx = −eugx,

∂By where g = ∂x is the gradient of the magnetic field [3]. As seen in Eq. 2.14, when the quadrupole has a focusing effect on the x axis, it has a defocusing effect on the y axis and vice versa. Therefore, in order to achieve focusing in both planes it is required to use focusing and defocusing quadrupole magnets in an alternating sequence. This type of lattice consists of a focusing magnet, drift and a defocusing magnet, indicated by ’F’. ’O’ and ’D’ respectively, therefore it is called a FODO lattice. The normalised strength of a quadrupole magnet for electrons is [3]:

g[T/m] k[m−2] = 0.3 . (2.15) p[GeV/c] Then, the focal length of the quadrupole magnet is: 1 f = , (2.16) kLq where Lq is the length of the quadrupole magnet. Sextupole and octupole magnets are also used in accelerators in order to deal with non-linear ef- fects. However, they will not be discussed further as they are outside the scope of this thesis. Additional information can be found in textbooks such as [5] and [4].

2.2 Response Matrix

In accelerator physics, it is quite common to refer to the longitudinal sequence of the electromag- netic elements of the machine as a lattice. In order to measure the transverse position of the beam along the lattice, beam position monitors (BPMs) are used. In most cases, the principle with which they work is through the electric field of the beam. This field can induce charges on metal plates. The signal measured is correlated to the distance between the plate and the beam, therefore two such plates are needed to determine the position of the center of mass horizontally and another two plates for the vertical position [6]. The response matrix of such a lattice describes how the measured beam position at the i-th ~  T BPM is affected by the individual kick of the j-th corrector magnet. Let b = b1 b2 . . . bN be the beam position vector where bi is of the measured beam position at the i-th BPM in the ring, where i = 0...N when there is a total of N BPMs. In addition, the corrector vector is ~  T θ = θ1 θ2 . . . θM , where θj is the kick strength of the jth corrector and j = 0...M when ∂bi the total of correctors is M. Now we can define the response matrix R with elements Rij = ∂θj describing the orbit shift at the the i-th BPM due the individual kick of the j-th corrector [7]. Naturally, R is an M × N matrix. This matrix exists both for the horizontal and vertical plane. In addition, coupled terms can be included. The response matrix is a very useful tool for correction schemes. In this case, a set of dipole kicks to correct the orbit distortion can be calculated by ~ ~ ~ ~ ~ solving the equation (bref − bdist) = Rθ for θ, where bref are the BPM measurements of the ~ reference orbit and bdist the measurements after the orbit distortion. The target is to minimize the difference between the reference measurements and the measurements after the orbit distortion.

9 Figure 2.3: Emission of synchrotron radiation in an insertion device [8].

2.3 Insertion Devices

2.3.1 Physics of Insertion Devices Synchrotron radiation is the electromagnetic radiation which occurs when a charged particle is be- ing accelerated. In the case of relativistic particles, it is emitted in the forward direction, tangential to the particle motion. This effect is more significant when the charged particles move along cir- cular orbits. As it was explained in the introduction, initially dipole magnets were used to produce light. However, in order to produce intense and highly collimated light dipole magnets were re- placed by insertion devices. IDs consist of periodic series of short bending magnets [2] and are called wigglers and . These two types of IDs are working with the same principle, how- ever wigglers produce a stronger magnetic field. Some characteristic parameters of the IDs are the period length λu, the gap between the poles g and the parameter K which is dimension- less and expresses the strength of the magnetic field for a device of certain period length as shown in Eq. 2.17 [9].

eBoλu K = = 0.934B0[T ]λu[cm], (2.17) 2πm0c where e is the electron charge, B0 the magnetic field, m0 the electron rest mass and c the speed of light. A quality factor, which is of great importance for a variety of experiments, is called brilliance [10]: Φ B = 2 , (2.18) 4π ΣxΣx0 ΣyΣy0 where Φ is the flux (number of photons per second in 0.1 % bandwidth), Σx, Σx0 , Σy, Σy0 are the transverse rms size and divergence of the convoluted beam. The convoluted beam is the quadratic sum of the electron beam σx,y, σx0,y0 and the diffraction limits σr, σr0 as shown in Eq. 2.19:

10 q 2 2 Σx,y = σx,y + σr , q 2 02 Σx0,y0 = σx0,y0 + σr , √ λ L (2.19) σ = n r 2π λn σ 0 = r 2L In the simplest case, the ID is a planar device and the magnetic field is sinusoidal and vertical [2]:

B(z) = B0cos(kuz), (2.20) where k = 2π . While the electron is passing through the ID, the Lorentz force (see Eq.2.8) acts u λu on it. Therefore, a vertical magnetic field will lead to a motion on the x-z plane. The equation of motion of an electron are:

e x¨ = −z˙ B(z) m0γ e (2.21) z¨ =x ˙ B(z). m0γ To obtain the solution of those equations we can use the fact that electrons are relativistic, uz ≈ c = const and ux  uz, which means that we only need to consider the first equation of Eq. 2.21. The initial conditions are x(0) = 0 and x˙ = eB(z) [10] and solving the differential Eq. 2.21 γm0ku gives the solution:

e x = 2 B0cos(kuz). (2.22) m0γβcku Therefore, the electron follows a sinusoidal trajectory in the x-z plane. The maximum angle of this trajectory with respect to the ideal orbit is [2]:

λueB0 K θw = = . (2.23) γ2πmec γ At this point the undulators and wigglers can be defined. Undulators are the IDs that have K ≤ 1 1 1 and therefore θw ≤ γ . Wigglers have K > 1 and therefore θw > γ . However, this is just a matter of convention and one can find undulators of up to K = 4 for example. In any case, undulators provide weaker magnetic field and the radiation is produced within a smaller opening angle. The light emitted by the electrons in the ID is produced in discrete energies which are called harmonics. In the case of undulators, the synchrotron radiation produced has high brilliance and the spectral range is very narrow. The wavelength of the n-th harmonic is [2]:

λ K2 λ = u (1 + + γ2θ2), (2.24) n 2nγ2 2

11 where θ is the observation angle. In the case of wigglers though, the strong magnetic field results in radiation emitted in a large cone (Eq. 2.23) which does not allow the coherence superposition of the radiation produced in each period [2], unlike undulators. This leads to a broader spectrum of lower brilliance compared to the spectrum produced with undulators. It should be noted that in addition to the planar IDs that produce linearly polarized light, there are also IDs that produce light of different polarization. For example, shifting the relevant longitu- dinal position of the upper and lower magnetic arrays of the ID will have the result of elliptically polarized light. This kind of device is called an Elliptically Polarized Undulator (EPU).

2.3.2 Tapering mode Tapering is a mode of operation of IDs in which the gap at the entrance of the undulator is different from the gap at the exit by ∆g. This means that the amplitude of the magnetic field of the ID varies along its length and as a result it provides radiation of broadened spectrum. This happens because it affects the interference feature that naturally happens in normal mode. In this case the broaden spectrum of radiation comes with the cost of a lower brilliance. One can express mathematically the peak field of the ID on axis as a first approximation as shown in Eq. 2.25 [11].

−πg/λu B(z) = B0e . (2.25) In order to estimate the energy spread caused by this field variation, we can rewrite Eq. 2.24 in terms of photon energy for the on-axis (θ = 0) harmonics [11]:

2nγ2hc E = , n K2 (2.26) λu(1 + 2 ) where h is the Planck constant. Knowing that K is proportional to the magnetic field (see Eq. 2.17), the change in the harmonic energy due to a gap variation ∆g can be approximated as [11]:

∆E K2π∆g = 2 . (2.27) E (1 + K /2)λu In a nontapered undulator the fundamental and the higher harmonics produced have a certain width due to factors such as magnetic field errors, energy spread of the particles within the beam and finite emittance resulting in a full width half maximum (FWHM) energy width of ∆E0. On top of that, when the device is tapered the final FWHM energy width is approximately [11]:

p 2 2 ∆Etot = (∆E) + (∆E0) . (2.28)

This feature is basically transforming the undulator spectrum into a wiggler-like spectrum. This means that the peaks of the harmonics in the undulator spectrum are lower but also include a broader range of energies. This gives the opportunity for the experiments to have a broader energy range for each harmonic which can be used for scanning in the case where the optimum energy for an experiment is not known. As an example, the simulated spectrum of NanoMAX, one of the MAX IV beamlines that will be introduced later in this section, can be seen in Fig. 2.4. After tapering the device, the energy range of the harmonic is broadened while its peak flux is reduced.

12 1012 BioMAX: simulated 7th harmonic 3 Nontapered 2.5 Tapered

2

1.5

1 Flux [Arb. Units]

0.5

0 12 12.5 13 13.5 Photon Energy [keV] Figure 2.4: Comparison of the 7th harmonic of BioMAX (see Sec. 2.5) with and without tapering. Simulated with SPECTRA [12] using magnetic field measurements of the ID. The flux of the harmonic after tapering is magnified by a factor 6.

In addition, there are experimental techniques, such as XAFS, that might require a broader spectral width for each harmonic [13]. If the tapering mode is applied in a wiggler, the target is to smooth out the lower photon energy part of the spectrum which is an undulator spectrum with clear peaks. As an example, Fig. 2.5 shows the simulated spectrum of BALDER [14] with and without tapering. As can be seen, after tapering the device, the spectrum in low energies is smoother with less discrete peaks and lower flux.

13 BALDER: simulated spectrum BALDER: simulated spectrum 1016 Nontapered Nontapered Tapered Tapered

1014

1014

1012 Flux [Arb. Units] Flux [Arb. Units] 1010

1013

108 101 102 103 104 345 350 355 360 365 370 375 380 385 390 Photon energy [eV] Photon energy [eV] (a) (b)

Figure 2.5: Comparison of the spectrum of BALDER (see Sec. 2.5) with and without tapering. Simulated with SPECTRA [12] using magnetic field measurements of the ID. In (b) there is a zoom in the lower-energy part of the spectrum showing the effect of tapering in a single harmonic.

2.3.3 Effects of Insertion Devices on the electron beam An effect that naturally arises in IDs is the damping effect. While the electron beam oscillates transversely it radiates synchrotron radiation and loses energy. Since synchrotron radiation is emit- ted in a cone, the electron beam loses energy in all 3 dimensions (x, y, s) and this leads to a beam of lower transverse emittance but reduced energy at the same time. However, the energy lost will be recovered with the radiofrequency cavities which compensate only longitudinal losses. As a result, the energy of the beam is restored and its emittance is reduced. This is a very useful feature for the MAX IV storage ring, since the brilliance is increased when the emittance is reduced (see Eq. 2.18). For this reason, IDs are also used in special rings, called damping rings, the aim of which is to reduce the emittance of the beam and increase the luminosity [2]. Damping rings are used for linear colliders, in which the interaction probability increases when the transverse cross section of the beam is reduced [2]. However, there are additional unwanted effects related to IDs. The closed orbit distortion introduced by residual field integrals and a focusing effect that disturbs the optics in the accelerator are some of them. Ideally, IDs have a perfectly symmetrical field which forces the electrons to follow an ideal sinusoidal trajectory and exit the ID with zero angle and displacement. However, due to magnetic field imperfections the IDs induce a transverse displacement and a transverse angle offset. Those two effects can be described by the field integrals. The first field integral describes the angle offset of the electron caused by the ID. We can express the equations of motion of the electrons inside the ID as [15]:

e x00(z) = − B (z) m γc y 0 (2.29) 00 e y (z) = Bx(z). m0γc Integrating these equations along z will give the slope of the trajectory at the exit of the ID of length

14 L :

e Z z0+L e ∆θ = x0(z) = − B (z )dz = − I , x γmc y 1 1 γmc 1y z0 (2.30) Z z0+L 0 e e ∆θy = y (z) = Bx(z1)dz1 = I1x, γmc z0 γmc By integrating Eq. 2.30 once more one gets the transverse position of the electron at the exit of the ID [15]:

e Z z0+L Z z2 e ∆x(z) = − B (z )dz dz = − I , γmc y 1 1 2 γmc 2y z0 z0 (2.31) e Z z0+L Z z2 e ∆y(z) = Bx(z1)dz1dz2 = I2x. γmc z0 z0 γmc Therefore, the second field integral describes the transverse displacement of the electron caused by the ID. Ideally, in an ID the first and second integrals (I1x,I1y and I2x,I2y respectively) should be zero. However, due to errors such as misalignments they deviate from zero. This deviation should be limited within certain tolerances since the integrals are connected to the beam displacement and angle offset introduced by the ID as it is shown in Eq. 2.30 and 2.31, which must be as small as possible. It should be noted that the field integrals are gap and phase dependent, since they depend on the magnetic field of the ID. In addition to the orbit distortion by residual field integrals of the IDs, insertion devices can also affect the optics in the ring. Planar IDs give rise to dynamic multipoles which lead to a vertically focusing effect [16] and a horizontally defocusing effect which is negligible in a first approach. This is the result of the edge focusing effect of the large number of dipoles that the IDs consist of. This focusing effect leads to a tune shift and a variation of beta functions. This is called beta- ∆β beating and is the relative change of beta function, β . The strength of the focusing effect of an ID, Kz, can be approximated by [8]: 1 K = , (2.32) z 2ρ2 therefore the effect is more severe for low energy rings (see Eq. 2.11). This strength corresponds to a focal length FZ and a tune shift ∆Qy of [8]: 1 L = LK = , F z 2ρ2 z (2.33) β L ∆Q = y . y 8πρ2 The estimated beta beat is [8]: ∆β βyL = 2 . (2.34) β 4ρ sin(2πQy) A variation of the vertical beta function and tune can lead to a reduction of the dynamic aperture [16], which is the effective aperture that is available to the electrons [2]. This can happen because

15 the operating point, the shifted tunes of the machine, can excite non systematic resonances that can cause beam losses. Overall, the IDs can affect the beam lifetime and injection stability through the dynamic aperture [16]. In addition they can affect the stability of the position and size of the beam which would cause problems to the beamlines [16]. Finally, they contribute to a reduction of the emittance through the damping effect.

2.4 The MAX IV Laboratory

MAX IV Laboratory is a Swedish national accelerator laboratory with the goal of producing the most brilliant X-rays in the world [17]. The electrons can be produced by two electron guns in a linac. The linac serves as an injector for the two storage rings, one of 1.5 GeV and a bigger one of 3 GeV . At the same time it can produce a compressed beam for short-pulse facilities and possibly for a FEL in the future which has been under discussion the past years [18]. The 1.5 GeV storage ring has a circumference of 96 m and is dedicated to the production of light in the soft x-ray and ultraviolet (UV) regime [17]. The 3 GeV storage ring has a circumference of 528 m and can produce higher energy light, providing the users with light in the soft and hard X-ray regime [17].

2.5 The MAX IV beamlines

All IDs of the beamlines are placed in the straight sections of the storage rings and are either undulators or wigglers. In total there are 10 straight sections available for IDs in the 1.5 GeV MAX IV storage ring and 19 for the 3 GeV storage ring. NanoMAX, BioMAX and BALDER are all beamlines that belong to the 3 GeV MAX IV storage ring. BLOCH belongs to the 1.5 GeV MAX IV storage ring.

2.5.1 NanoMAX Nanomax is a hard X-ray of the 3 GeV MAX IV ring which provides down to 10 nm direct spatial resolution [19]. It has two experimental stations, one with a Frensel zone plate and one with KB mirror optics. The undulator providing light to this beamline is a 2-meter-long in- vacuum undulator with permanent magnets. It has a period length of 18 mm and a minimum gap of 4 mm that provides a maximum undulator parameter Kmax = 1.92 [19]. This undulator has two motors that provide two more degrees of freedom, thus providing the tapering mode.

2.5.2 BioMAX BioMAX is an X-ray macromolecular crystallography beamline of the 3 GeV MAX IV ring. It offers a number of techniques and specializes in X-ray protein crystallography. The undulator used in this beamline is the same model as the one used in NanoMAX, hence it can offer the tapering mode to the users as well.

16 2.5.3 BALDER BALDER is a hard X-ray beamline of the 3 GeV MAX IV ring that is dedicated to X-ray absorption spectroscopy (XAS) and X-ray emission spectroscopy (XES) within an energy range of 2.4-40 keV . The light for this beamline is produced by an in-vacuum wiggler which is 2 m long and it is placed off-center in the straight section of the 8th achromat. The minimum gap with which it can be used is 4.2 mm which corresponds to a magnetic field of 2.421 T [14].

2.5.4 BLOCH BLOCH is a beamline that provides elliptically polarized light in an energy range of 10 -1000 eV (UV and soft X-ray). The source of the light is an EPU which is 2.436 m long and it is placed in the straight section of the 10th achromat. It is dedicated to techniques such as high resolution photoelectron spectroscopy, encompassing angle-resolved (ARPES), spin resolved (spin-ARPES) and core-level spectroscopy [20]. The study of this beamline is related to the study of the effect of the undulator on the electron beam. No tapering mode is provided to this beamline.

17 Chapter 3

Methods

In order to achieve the goals discussed in the introduction, a number of tools were used. In this section, SPECTRA, Accelerator Toolbox, Matlab Middle Layer and LOCO will be introduced.

3.1 SPECTRA

SPECTRA is a software application developed at the SPRING-8 synchrotron facility in Japan. In this software, the synchrotron radiation produced by bending magnets, undulators and wigglers can be simulated and their energy spectrum can be calculated and studied. The user can introduce the electron beam properties and the bending magnet or the ID’s characteristics in graphical user interface (GUI). In addition it is possible to introduce the tapering mode to insertion devices and input magnetic field measurements from an arbitrary synchrotron radiation device [12].

3.2 Accelerator Toolbox

Accelerator Toolbox (AT) [21] is a toolbox of MATLAB that was developed at the Stanford Linear Accelerator Center (SLAC). With AT it is possible to simulate storage rings and beam transport lines. In addition, the elements of the lattice can be manipulated separately, particles can be tracked and there are tools to analyze the accelerator parameters and beam properties. The MAX IV storage rings are both simulated in detail in AT.

3.3 Matlab Middle Layer

Matlab Middle Layer (MML) [22] is used within MATLAB and offers a number of tools for both online control and machine simulations, as it is linked to AT. This can be done by switching be- tween online/simulate modes and hardware/physics units respectively. It was originally used at SSRL (Stanford Synchrotron Radiation Light source) and ALS (Advanced Light Source) and it is currently used in a number of accelerator laboratories worldwide, including MAX IV.

18 3.4 LOCO

Linear Optics from Closed Orbits (LOCO) is a debugging code for the linear optics of storage rings, it is written in MATLAB and it is linked to AT [23]. With LOCO it is possible to optimize the optics of a storage ring. It uses a model response matrix, then it measures the orbit response matrix and is trying to fit the measured one to the model one by adjusting certain parameters that can be chosen by the users. For example, it can be used to calibrate the gradients of quadrupoles, the gains and coupling of BPMs and correctors as well. In addition, it can fit the gradient of quadrupoles in order to restore the optics in the storage ring based on the model chosen by the user. From a mathematical point of view, in order to calibrate gradient errors a model of the machine, Rmodel, can be found by changing the quadrupole gradients and trying to match the model to the orbit response matrix of the machine measured, Rmeas. One can write this mathematically as the effort to minimize a target function [23]: 2 X (Rmodel − Rmeas) χ2 = , (3.1) σ2 i,j i where σi is the noise of the i-th BPM. The result of this optimization, is a model that best reproduces the measured response matrix. LOCO can also be used to restore the optics. For example, it is possible to determine the necessary quadrupole gradients that cancel out the focusing effect of IDs, as it will be explained in Section 4.2.4.

19 Chapter 4

Modelling and correction strategy

4.1 Spectrum study

The spectra of NanoMAX and BioMAX were measured at a 5mm gap with and without tapering and the two modes of operation were compared. In both cases, the spectrum of the seventh har- monic was studied. The measurements were done with cold beam, which is a beam of low current (3 mA), in order to avoid instabilities and to be able to study the effect of tapering. At the same time, measurements of the magnetic field for both undulators were used as input in SPECTRA and the spectrum produced was simulated and compared to the measured spectrum.

4.2 Neutralizing the effect of IDs on the electron beam

In order to correct the effect of the insertion devices on the electron beam there are two different problems to be solved. The first one is the orbit distortion. As mentioned in Section 2.3.3, it is introduced by residual field integrals. The second one is the distortion of the optics along the ring. The two problems are treated and solved separately.

4.2.1 Feed Forward table generation Before commissioning the IDs, the static field integrals of the IDs are measured. The field integrals depend on the gap of the ID and deviate from the ideal zero value. In order to compensate for this deviation, there are four air coil corrector magnets that are used and are adjacent to the ID in the storage ring. There is one horizontal and one vertical corrector before and after the ID. There are two correctors of each type since both the displacement and the angle offset need to be corrected. Therefore, after the installation of the IDs in the ring a series of automated measurements is performed in order to create a feed forward table (FFT) that contains the optimum current applied to the four adjacent correctors of the ID for each gap that restores the close orbit distortion. This table establishes that the beam will exit the ID with no transverse displacement or angle offset. The scripts for the feed forward table generation had already been developed and used for the commissioning of the first insertion devices on the MAX IV storage rings. In order to do this, the response matrix of the lattice is computed while the ID is open at maximum gap (bare lattice). Afterwards, the gap is changed and the orbit is measured again. A set of dipole kicks that will

20 bring the orbit back to the one measured for the bare lattice is computed, as described in Section 2.2. This procedure is repeated for a number of gaps and a feed forward table can be generated. In this thesis, the feed forward tables were generated for BioMAX, NanoMAX and BALDER while operating with and without tapering and were compared with each other. The FFT for BLOCH was also generated, however tapering mode is not available for this device. More information on the algorithm implementation of feed forward table generation can be found in [24] and [25].

4.2.2 Field integral study The objective of this work is to make use of the feed forward table generated for BLOCH and study the field integrals of the ID. A deeper understanding of them, would possibly simplify the current measurement method. The correction applied by the correctors, and therefore the coils, is partly compensating for errors of the ID itself (can be measured before installing the ID) and partly from residual errors such as misalignment errors and contribution of the earth magnetic field (that are determined after the installation). In order to model the correction applied with the coil correctors, we assume that the electron beam arrives at the upstream corrector (Cu) (see Fig. 4.1) without displacement or divergence:

( ( x = 0 y = 0 0 0

θx0 = 0 θy0 = 0.

We also assume that the first field integral error ∆θerr(x,y) induced by the undulator occurs at the position of the upstream corrector. The undulator induces a second field integral error ∆x and ∆y in the transverse plane as well. Finally, the kick angles induced by the upstream and downstream correctors are ∆θcu and ∆θcd respectively. The combination of these correctors’ angles must compensate for the ID’s errors. The correction strategy is the following [26]:

1. Bring the beam back to 0 position at the downstream corrector (Cd) (see Fig. 4.1). 2. Correct the residual angle at Cd.

This can be expressed mathematically for the horizontal plane as:

(∆θcu + ∆θerr,x)(b + Lu + c) + ∆x = 0 ⇒ ∆x = −A(∆θcu + ∆θerr,x) = A∆θcu | {z } A

(∆θcu + ∆θerr,x + ∆θcd)d = 0 ⇒ ∆θerr,x = −(∆θcu + ∆θcd) And in matrix formulation for both the horizontal and vertical plane:       ∆x/A 0 1 0 0 ∆θcu,x ∆θerr,x −1 −1 0 0  ∆θcd,x   =   ·    ∆y/A   0 0 0 1  ∆θcu,y ∆θerr,y 0 0 −1 −1 ∆θcd,y At this point, the current at the coils of the correctors applied based on the FFT needs to be con- verted into kick angles. The procedure to do this is described in Section 2.1.2 and since BLOCH is

21 BPMu Cu BLOCH Cd BPMd

a b Lu c d Figure 4.1: Simplified model. From left to right: upstream BPM (BPMu), upstream corrector (Cu), Bloch, downstream corrector (Cd), downstream BPM (BPMd). in the small MAX IV storage ring, E = 1.5 GeV . With this information, the tranverse displacement and angle offset caused by the ID after its commission in the storage ring can be deduced. At the same time, the field integral measurements of the ID at the lab before its installation in the ring can be translated into tranverse displacement and angle offset with Eq. 2.30 and 2.31. The two results, one coming from the corrector coils and the other one coming from the field integral measurements before installation, are compared.

4.2.3 Modelling BALDER’s effect on the storage ring In order to study the effect of BALDER on the storage ring, BALDER was simulated using the simulated lattice of MAX IV 3 GeV ring at AT. In order to simulate the effect of both field inte- grals and the focusing effect, quadrupoles and correctors were placed in the straight section that BALDER exists. BALDER, is placed in the eighth straight section and is approximately 82 cm off center. The length of the undulator is 2 m. In the simulation, 4 dipole correctors were placed at the end points of the device, two of them upstream and two downstream. Each pair of correctors consists of one horizontal and one vertical one. The range of kick angles used was estimated based on field integral measurements on BALDER [14]. In addition, one defocusing quadrupole of 0.01 m length was placed in the center of the ID to simulate the focusing effect induced by the wiggler [14].

22 Figure 4.2: BALDER wiggler in the 3 GeV MAX IV storage ring. Photograph taken by Georgi Georgiev.

4.2.4 Optics correction for BALDER As mentioned in Section 2.3.3, in addition to the field integrals, IDs introduce a beta beat and a tune shift that need to be restored. BALDER is the strongest wiggler in MAX IV 3 GeV storage ring and is therefore expected to have the strongest effect on the optics. Currently, the MAX IV storage ring is running with the so called Production Optics which result in a different operating point that improves the injection rate. However, all the measurements for the correction were performed with the design optics since the machine is expected to run with those in the future. In addition, all measurements were performed with cold beam (around 3 mA) in order to avoid instabilities due to high current and be able to study the effect of BALDER alone on the optics. The optics correction was done with LOCO in two stages. First, a local compensation was performed in which the quadrupoles that are adjacent to BALDER and have independent current circuits were used as fitting parameters. The aim of this local correction is to correct the beta beat induced by the ID. However, after correcting the beta beat, the tune of the machine was still shifted. Therefore, as a second step a global correction of the tune shift was needed. In this case, QFE (focusing quadrupoles) and QDE (defocusing quadrupoles) families of quadrupoles were used as fitting parameters. The correction was performed with the following order:

1. LOCO measurement and fitting to determine bare lattice.

2. LOCO measurement and fitting with BALDER closed at 5 mm to determine perturbed lat- tice.

3. LOCO fitting of perturbed lattice using fitted bare lattice and 4 knobs (QFE and QDE quadrupole magnets adjacent to BALDER).

23 4. Compute current adjustment on QFE and QDE and deploy (local correction).

5. Evaluation of beta beat for the locally corrected lattice.

6. LOCO fitting of locally corrected lattice to the bare lattice with 42 knobs (QFE and QDE quadrupole magnets along the whole lattice).

7. Compute current adjustment on QFE and QDE and deploy (global correction).

8. Evaluation of beta beat and tune shift for the globally corrected lattice.

24 Chapter 5

Results

5.1 Spectrum study

Spectrum measurements and simulations were performed for both NanoMAX and BioMAX. In Fig. 5.1 and 5.3, the simulated and measured spectra of NanoMAX and BioMAX respectively are shown. In all cases the gap was set to 5 mm and the tapering was 0.4 mm. For the simulation, the magnetic field measurements were used as the input. In Fig. 5.2, the measured spectrum of NanoMAX is shown with 0.4 mm tapering and without. In Fig. 5.4, the measured spectra of BioMAX without tapering, with 0.4 mm tapering and with 0.2 mm tapering are shown. Finally, in Tables 5.1 and 5.2 there is a comparison between the FWHM and peak flux with and without tapering for NanoMAX and BioMAX respectively. In Fig. 5.2, the measured spectrum of NanoMAX with and without tapering is compared.

25 7th harmonic without tapering 7th harmonic with tapering 1 1 Simulated spectrum Simulated spectrum 0.9 0.9 Measured spectrum Measured spectrum 0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4 Normalised Flux Normalised Flux 0.3 0.3

0.2 0.2

0.1 0.1

0 0 1.25 1.3 1.35 1.4 1.2 1.25 1.3 1.35 1.4 Photon Energy [eV] 104 Photon Energy [eV] 104 Figure 5.1: NanoMAX: measured and simulated with magnetic measurements spectrum of seventh harmonic with and without tapering. The gap was set to 5 mm and the tapering was 0.4 mm.

10 4 NanoMAX: measured 7th harmonic@5mm gap 3 Nontapered 2.5 Tapering 0.4mm

2

1.5

1 Flux [Arb. Units]

0.5

0 12 12.5 13 13.5 14 Photon Energy [keV] Figure 5.2: NanoMAX: measured spectrum of seventh harmonic with and without tapering. The flux of the tapered one is magnified by a factor 9.

26 Measurements FWHM [eV] Peak [arb. units] Tapered 900 2211 Nontapered 204 27494

Table 5.1: NanoMAX: Comparison of FWHM and peak flux of the 7th harmonic of tapered (0.4 mm) and nontapered undulator of NanoMAX at 5 mm gap. Results obtained with measurements at MAX IV laboratory. See Fig. 5.1.

The measurement of the seventh harmonic was repeated for BioMAX. In this case the spectrum was measured at 5 mm gap without tapering, with 0.2 mm and 0.4 mm tapering.

Measurements FWHM [eV] Peak [arb. units] Tapered (0.4 mm) 2721 4.36·10−11 Tapered (0.2 mm) 1307 7.15·10−11 Nontapered 65 80.78·10−11

Table 5.2: BioMAX: Comparison of FWHM and peak flux of the 7th harmonic of tapered (0.4 mm and 0.2 mm) and nontapered undulator at 5 mm gap. Results obtained with measurements at MAX IV laboratory. See Fig. 5.4.

27 7th harmonic without tapering 7th harmonic with tapering 1 1 Simulated spectrum Simulated spectrum 0.9 0.9 Measured spectrum Measured spectrum 0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4 Normalised Flux Normalised Flux 0.3 0.3

0.2 0.2

0.1 0.1

0 0 1.24 1.25 1.26 1.27 1.28 1.29 1.2 1.25 1.3 1.35 1.4 Photon Energy [eV] 104 Photon Energy [eV] 104 Figure 5.3: BioMAX: measured and simulated with magnetic measurements spectrum of seventh harmonic with and without tapering. The gap was set to 5 mm and the tapering was 0.4 mm.

(a) (b)

(c)

Figure 5.4: Biomax: Measured spectrum of 7th harmonic at 5 mm gap (a) with 0.2 mm tapering, (b) with 0.4 mm tapering and (c) without tapering.

28 5.2 Neutralizing the effect of IDs on the electron beam

5.2.1 Feed Forward table generation The feed forward tables were generated and are plotted in this section. The current applied at the correctors of each ID is converted to kick angles (see Eq. 2.13) using field measurements of the correctors [27] and plotted in Fig. 5.5.

Residual field kick from NanoMAX Residual field kick from BioMAX 2 7 y y 1 x 6 x y tap. y tap. x tap. 5 x tap. 0

4 -1 rad] rad] 3 -2 2 -3 Kick angle [ Kick angle [ 1

-4 0

-5 -1

-6 -2 5 10 15 20 25 30 35 5 10 15 20 25 30 Gap [mm] Gap [mm] (a) (b)

Residual field kick from BALDER 10 y 8 x 6 y tap. x tap. 4

2 rad] 0

-2

-4 Kick angle [

-6

-8

-10

-12 5 10 15 20 25 30 35 Gap [mm] (c)

Figure 5.5: Residual field kick applied from correctors horizontally and vertically for (a) NanoMAX nontapered and tapered (0.4 mm), (b) BioMAX nontapered and tapered (0.4 mm) (c) BALDER nontapered and tapered (1.2 mm). Notice that the scaling in plots is different.

5.2.2 Field integral study In Fig. 5.6, the field integrals measured before installing the ID at BLOCH beamline and the field integrals calculated by the coil correction after the installation of the ID in the ring are compared.

29 x error 10-3 y error 0.015 8 Integral measured from coil corrector [mm] Integral measured from coil corrector [mm] Integral measured in lab [mm] 6 Integral measured in lab [mm] Difference in Integrals [mm] Difference in Integrals [mm] 0.01 Zero reference 4 Zero reference

2 0.005 0

-2 0 -4

-6 -0.005

-8

-0.01 -10 10 15 20 25 30 35 40 45 50 10 15 20 25 30 35 40 45 50 Gap [mm] Gap [mm] (a) (b)

10-3 theta x error 10-3 theta y error 10 5 Integral measured from coil corrector [mrad] Integral measured from coil corrector [mrad] Integral measured in lab [mrad] Integral measured in lab [mrad] 4 8 Difference in Integrals [mrad] Difference in Integrals [mrad] Zero reference Zero reference 3 6

2 4 1

2 0

0 -1

-2 -2 10 15 20 25 30 35 40 45 50 10 15 20 25 30 35 40 45 50 Gap [mm] Gap [mm] (c) (d)

Figure 5.6: BLOCH: Comparison of field integrals measured at the laboratory before the installa- tion of the ID and field integrals deduced from corrector coils after the installation in the 1.5 GeV MAX IV storage ring. Notice that the scaling in different in each plot.

5.2.3 Simulation of BALDER’s effect on the storage ring In Fig. 5.7, the results of the simulation of BALDER’s effect on the storage ring are shown. In par- ticular, the tune shift induced by the wiggler is studied. In addition, the tune shift due to BALDER measured in the storage ring is highlighted.

30 0.01 Horizontal Vertical 0.005

0

-0.005 Q

-0.01

-0.015

-0.02

-0.025 -3 -2.5 -2 -1.5 -1 -0.5 0 Quadrupole strength [1/m 2] Figure 5.7: Simulating the focusing effect and the residual field kick from BALDER in the 3 GeV MAX IV storage ring. The vertical and horizontal tune shift due to the strength of the quadrupole is plotted. The measured tune shift is highlighted with a star.

5.2.4 Optics correction for BALDER The tune of the 3 GeV MAX IV storage ring was measured with BALDER open (gap at 50 mm) and closed (gap at 5 mm) and a tune shift was measured for both horizontal and vertical plane, ∆Qx = 0.0009 and ∆Qy = 0.0054 respectively. The adjustment of quadrupole gradients for local correction is shown in Fig. 5.8a. After correcting locally, the vertical tune shift was ∆Qy = 0.002. The adjustments proposed by LOCO for a global correction can be seen in Fig. 5.8a. After the global correction the vertical tune shift was further reduced to ∆Qy = −0.0008. Finally, the beta beat in the vicinity of BALDER before correction, after correcting locally and after correcting globally can be seen in Fig. 5.9b.

31 Local correction Global correction 0.1 0.6 BALDER Focusing quad. Defocusing quad. 0 0.4 BALDER

-0.1 0.2

-0.2 0

-0.3 -0.2 Gradient adjustment [%] Gradient adjustment [%] -0.4 Defocusing quad. -0.4 Focusing quad. -0.5 0 1 2 3 4 -0.6 0 5 10 15 20 25 30 35 40 45 Quadrupole index Quadrupole index (a) Local correction (b) Global correction.

Figure 5.8: Gradient adjustment for (a) local and (b) global correction. BALDER’s position shown with an arrow.

BALDER beta distortion (rel.) BALDER beta distortion (rel.) Uncorrected 0.04 0.04 Uncorrected BALDER Locally corrected Globally corrected Locally corrected 0.03 0.03 BALDER Globally corrected

0.02 0.02

0.01 0.01

0 0

-0.01 -0.01 Vert. beta beat Vert. beta beat

-0.02 -0.02

-0.03 -0.03

-0.04 -0.04

0 50 100 150 200 250 300 350 400 450 500 150 160 170 180 190 200 210 220 s [m] s [m] (a) (b)

Figure 5.9: Measured beta beat (a) along the machine (b) in the vicinity of BALDER when closed at 5 mm without correction, after local correction with flanking quadrupoles and after global cor- rection.

32 Chapter 6

Discussion

6.1 Spectrum study

The spectra of BioMAX and NanoMAX were studied when the devices were both tapered and nontapered. In both cases the seventh harmonic was studied because in higher harmonics the quality of the spectrum is increased and therefore the effect of tapering is easier studied. In addition, both devices were operated with a 5 mm gap and the tapering applied for NanoMAX was 0.4 mm while for BioMAX both 0.4 mm and 0.2 mm tapering were applied. The measured spectrum for NanoMAX is shown in Fig. 5.2. As expected, the FWHM of the harmonic is increased with the tapering from 204 eV to 900 eV and the peak flux is decreased, see Tab. 5.1. In order to simulate the spectra, magnetic field measurements of NanoMAX were used. A number of parameters need to be adjusted in order to achieve similar results to the measured spectrum, such as the observation angle is (Eq. 2.24). A comparison between the simulated and measured spectrum can be seen in Fig. 5.1. Similarly, the measured spectrum for BioMAX is shown in Fig. 5.4. The seventh harmonic was measured with the device nontapered and after applying a tapering of 0.2 mm and 0.4 mm. As expected, the flux is reduced and the FWHM of the harmonic is increased from 65 eV to 1307 eV and 2721 eV for 0.2 mm and 0.4 mm tapering respectively (Tab. 5.2). In addition, the spectrum was simulated in SPECTRA by using magnetic field measurements of BioMAX. A comparison between the simulated and measured spectrum can be seen in Fig. 5.3. Even though NanoMAX and BioMAX are undulators of the same design, the spectrum mea- sured in each case was slightly different. This happens because of the parameters applied during the measurements. For the measurements after tapering the device, the FWHM of the harmonic at NanoMAX is lower than the one of BioMAX. This can be due to noise in the spectrum mea- surement of the tapered device for BioMAX, which made the calculation of the FWHM hard. Additionally, the differences noticed in the photon energy, FWHM and shape of the harmonic are the result of different conditions for the two IDs. The difference in magnetic field at the same gap for the two undulators, the difference in aperture and the different opening angle could have been factors that determined the spectra measured. Additionally, the measurements were taken on dif- ferent days so differing conditions of the electron beam, such as its size, could have influenced the result as well.

33 6.2 Neutralizing the effect of IDs on the electron beam

6.2.1 Feed Forward Table generation The feed forward tables of BALDER, NanoMAX and BioMAX were generated for both nonta- pered and tapered devices. The current that needs to be applied at the adjacent correctors are gap dependent. The current values applied to the correctors correspond to kick angles applied to the beam and are plotted in Fig. 5.5. The maximum current that can be applied to the correctors is 5 A and in all cases, the current needed for the correction is around 20 % of this value at most. As expected, the total of current that needs to be applied to correct the orbit distortion due to field integrals is higher for lower gaps. Similarly, for maximum gap the kick angles of the correctors tend to zero, as the residual field integrals tend to zero as well (see Fig. 5.5). It should be noted that the current needed for the correction for BALDER is higher than in the case of BioMAX and NanoMAX. This is expected since BALDER is a wiggler with higher maximum magnetic field compared to NanoMAX and BioMAX which are undulators of lower field. NanoMAX and BioMAX are IDs of the same design and the amplitude of currents to be applied are in the same range for both devices. However, the current of each corrector for the two devices scales up with the gap in a different way. This is normal since the deviation of the field integrals from the ideal zero is a result of imperfections of the device. Therefore, the two devices of the same design are expected to have different imperfections of similar range.

6.2.2 Field integral study The field integrals of BLOCH were deduced from the coil measurements for the FFT scheme. In addition, the field integrals of BLOCH before its installation were measured. A comparison between those two can be seen in Fig. 5.6. As can be seen in the figure, there seems to be a correlation between the two different mea- surements. The integrals measured from the coil correctors are partly coming from the ID itself (this part is measured before installation) and also from residual errors that are determined after installation. Some of those could be the earth magnetic field or additional misalignments after the installation process. If the contribution of those factors can be determined for a certain ID after installation, then we would know the correlation between the factors contributing to the final field integrals that need to be corrected. This knowledge would save a lot of time for the measurements for the FFT generation which is currently time-consuming (approximately 8 hours) for an EPU such as BLOCH. However, a further investigation is needed in order to draw conclusions. A mea- surement at full gap would probably be a good method of determining the contribution of the earth field for instance.

6.2.3 Simulation of BALDER’s effect on the storage ring The effect of BALDER on the electron beam was simulated with AT. The measured vertical tune 1 shift corresponds to the focusing effect of a quadrupole with strength k = −2.9 m2 while for the defocusing effect on the horizontal plane, the measured tune shift corresponds to a defocusing quadrupole of strength. The disadvantage of this model is that vertical and horizontal focusing

34 effect cannot be introduced independently and since there is coupling for both planes incuded in the model the results are not representative.

6.2.4 Optics correction for BALDER Closing the wiggler BALDER to 5 mm gap caused a distortion in the optics of the 3 GeV MAX IV storage ring. The vertical tune shift was ∆Qy = 0.0054 and the horizontal one ∆Qx = 0.0009. As it was expected, the effect on the vertical tune was more severe than the horizontal one. A vertical focusing leads to an increase of the shift. The horizontal defocusing was expected to reduce the horizontal tune. However, the horizontal tune was increased. This could possibly mean that we are not able to see the effect on the horizontal plane since it is negligible within the accuracy of the tune measurement. The correction scheme applied was done in two steps. First, the beta beat induced by BALDER was restored by adjusting the gradients of the adjacent quadrupoles. In [28] and [16] is stated that a direct local compensation should not be done since it affects a lot the beta functions in the straight section and therefore the beam size. However, it was decided to proceed with a local compensation as a first approach anyway. In Fig. 5.8a, the quadrupole gradient change is shown and it is less than 0.5 % for all of them. This result is consistent with previous studies for the effect of insertion devices on the optics, in which less than 1.3 % gradient adjustment was expected for the strongest ID [16]. Moreover, the change in the gradient of the quadrupoles that are located after BALDER is bigger, which can be explained by the off-center position of BALDER to the end of the straight section. In addition, in Fig. 5.9b, it can be seen that the beta beat in the vicinity of BALDER is reduced from a maximum beta beat of 4% to a beta beat of 2.7 %. However, after applying the local correction the tune of the machine was still shifted. To restore the tune, a global correction was needed. Two families of quadrupoles, one focusing (QFE) and one defocusing (QDE), were used as fitting parameters. In Fig. 5.8b, the percentage of gradient change for each quadrupole is shown. As expected the quadrupoles that are located in the vicinity of BALDER are contributing more to the correction. The changes are up to 0.52 %, even though previous studies of reference [16] predicted a maximum 0.07 % gradient adjustment. This dis- crepancy arises from the fact that a smaller number of knobs was used in this case as a first step for global correction. Using more families of quadrupoles would lead to less gradient change for each quadrupole. After the global correction, the maximum beta beat in the vicinity of BALDER is reduced to 2 %. There is no significant improvement in the beta beat which is expected since the global correction is not aiming to reduce the beta beat, but to restore the tune. After the global correction the vertical tune shift was reduced from ∆Qy = 0.0054 to ∆Qy = −0.0008 which is a considerable improvement.

35 Chapter 7

Outlook

In this thesis, the spectrum produced with NanoMAX and BioMAX with and without tapering was studied. The resulted spectra showed that the tapering is working as expected and is available to the users. At the same time, the feed forward tables for NanoMAX, BioMAX and BALDER were generated for both tapered and nontapered device. This means that the users can use those device with and without tapering for any gap without disturbing the closed orbit. The same procedure is expected to be followed for a beamline called FlexPES after its comissioning since it will also be available for tapering. In addition, the field integrals of BLOCH were studied. There seems to be a correlation between the field integrals measured at the laboratory before installation and the field integrals deduced from the coil correctors. A deeper study on the effects that cause this difference can give the possibility to reduce the time of measurements for the feed forward table generation. This is because, if we manage to isolate the contribution of the residual errors as a constant we will not need to take measurements for all gaps. Instead, we will only need to measure a few gaps and interpolate accordingly. The optics distortion due to BALDER was also simulated. The simulation on AT is only a first approximation, since the quadrupole used introduced a large defocusing effect on the horizontal plane at the same time, which is not in good agreement with the edge focusing effect of the insertion devices. For this reason, a series of rectangular dipoles can be used instead. Alternatively, there exist other lattice design codes such as OPA [29], in which only the vertical focusing effect of an ID can be simulated and a correction using selected knobs can be found [30] and compared to the applied correction in the machine. Finally, the optics distortion due to BALDER on the real machine was attempted to be cor- rected. Even though the combination of a local and global correction seemed to have results in compensating for the optics distortion caused by BALDER, it is essential to investigate in more depth the correction scheme and apply more solutions which was not possible due to limited beam time. First of all, the magnets of the 3 GeV MAX IV ring suffer from the phenomenon of hysteresis which is currently not included in the simulation model of the ring. This means, that the magnetic field produced by the magnet is affected by the history of its magnetisation. When reducing the current, it usually follows the applied change, however, when the current is increased it might not produce the wanted magnetic field. For this reason, for the quadrupoles that the correction scheme proposes a gradient increase, a bigger increase in gradient than the proposed one can be tested.

36 As an alternative solution for correction, as proposed in [28] and [16], a local compensation can be applied with the goal to increase the focusing effect at this stage. Afterwards, the global correction would correct both the beta beat and the tune shift. This correction scheme takes into account preserving the beam size by keeping the beta functions’ change in the straight sections as small as possible. Finally, after choosing the best correction scheme a feed forward table for different gaps of BALDER can be generated in order to correct the optics distortion. As a second step, a similar study can be done for NanoMAX and BioMAX which are also relatively strong undulators.

37 Acknowledgement

First of all, I would like to thank my supervisor Hamed. I would also like to thank all the people at MAX IV that helped me make this thesis project reality. More specifically, I would like to thank Magnus for always giving his precious insight, Sverker for always being available for assistance, Patrick for sharing his ideas and teaching me, Ake˚ for sharing his work with me, the operators for their support during measurements, David for always being available for assistance with LOCO, Mohammed and Andreas for their help, Johan for his feedback and support, Mihai, Georgi and Ermis for the fruitful conversations. I would also like to thank my family and friends that live either close or far away for their vitally important support. Finally, going a bit back in time, I would like to thank my previous supervisors Kostas Kordas and Andrea Latina for being my mentors, my friends Petros, Katerini and Lilian for keeping me sane with their support and last but not least Lefteris for being a patient and supportive programming teacher and my precious anchor during my entire student life.

38 Bibliography

[1] Jun’ichiro Mizuki. Introduction: From a first-generation synchrotron radiation to an x-ray free electron laser. Journal of the Physical Society of Japan, 82(2):021001, 2013.

[2] K. Wille. The Physics of Particle Accelerators: An Introduction. The Physics of Particle Accelerators: An Introduction. Oxford University Press, 1996.

[3] Andrea Latina. Introduction to Transverse Beam Dynamics. JUAS, 2017.

[4] Beam dynamics. In Handbook of Accelerator Physics and Engineering, pages 65–203.

[5] D.C. Carey. The Optics of Charged Particle Beams. Accelerators and storage rings. Harwood Academic Publishers, 1992.

[6] P Forck, P Kowina, and D Liakin. Beam position monitors. 2009.

[7] Riyasat Husain, A D Ghodke, Surendra Yadav, A C Holikatti, R P Yadav, P Fatnani, T A Puntambekar, and P R Hannurkar. Measurement, analysis and correction of the closed orbit distortion in Indus-2 synchrotron radiation source. Pramana, 80(2):263–275, 2013.

[8] Insertion devices. In DETAILED DESIGN REPORT ON THE MAX IV FACILITY, chapter 5.

[9] Francesca Curbis. Lecture notes for Synchrotron radiation and Free electron lasers. MAX IV, 2016.

[10] Peter Schmuser,¨ Martin Dohlus, Jorg¨ Rossbach, and Christopher Behrens. Undulator Radia- tion, pages 11–23. Springer International Publishing, Cham, 2014.

[11] B. Lai, P. J. Viccaro, R. J. Dejus, E. Gluskin, W. B. Yun, and I. Mcnulty. Spectral properties of a tapered gap hard x-ray undulator. Review of Scientific Instruments, 64(4):858–863, 1993.

[12] SPECTRA. SPRING 8. http://spectrax.org/spectra/.

[13] Nark-Eon Sung, Ik-Jae Lee, Sung-hoon Jeong, and Seen-Woong Kang. Characteristics of a tapered undulator for the X-ray absorption fine-structure technique at PLS-II. Journal of Synchrotron Radiation, 21(6):1282–1287, Nov 2014.

[14] REPORT OF MAGNETIC MEASUREMENTS OF THE BALDER WIGGLER OF MAX IV. Annalen der Physik, 322(10):891–921, 1905.

[15] Zachary Wolf. Undulator Field Integral Measurements. SLAC, 2006.

39 [16] S. C. Leemann and E. J. Wallen.´ Strategy for Neutralizing the Impact of Insertion Devices on the MAX IV 3 GeV Ring. Conf. Proc., C110328:1262–1264, 2011.

[17] MAX IV. https://www.maxiv.lu.se/. Accessed: 2018-02-20.

[18] M. Eriksson F. Lindau L-J. Lindgren M. Sjostr¨ om¨ S. Thorin M. Brandin, N. Cutic, E. Wallen,´ and S Werin. The synchrotron radiation and free electron laser project MAX IV at MAX-lab. Journal of Physics: Conference Series, 100(2):022001, 2008.

[19] Anders Mikkelsen Ulf Johansson, Ulrich Vogt. NanoMAX: a hard x-ray nanoprobe beamline at MAX IV. Proc.SPIE, 8851:8851 – 8851 – 10, 2013.

[20] BLOCH. https://www.maxiv.lu.se/accelerators-beamlines/beamlines/bloch/. Accessed: 2018-04-20.

[21] Accelerator Toolbox. SLAC. http://atcollab.sourceforge.net/.

[22] G. Portmann, J. Corbett, and A. Terebilo. An Accelerator Control Middle Layer Using Matlab. In Proceedings of the 2005 Particle Accelerator Conference, pages 4009–4011, May 2005.

[23] J Safranek, G Portmann, A Terebilo, and Christoph Steier. Matlab-based LOCO. 04 2018.

[24] Hampus Manefjord˚ and David Hill. Commissioning of the First Insertion Devices on the 1.5 GeV Storage Ring in MAX IV, 2018. Student Paper.

[25] Sara Mikaelsson. Commissioning and Characterization of Two Undulators at the MAX IV 3 GeV Storage Ring, 2016. Student Paper.

[26] Patrick Ngotta. Private communication, 2018.

[27] Mohammed Ebbeni. Private communication, 2018.

[28] J. Feikes and G. Wustefeld. Lifetime reduction due to insertion devices at BESSY II. 2:845– 847 Vol.2, May 2003.

[29] OPA. https://ados.web.psi.ch/opa/.

[30] Ake˚ Andersson. Private communication, 2018.

40