Machine Learning-based Beam Size
Stabiliza9on at ALS
Simon C. Leemann

ALS Accelerator Physics, ATAP & ALS Divisions, Lawrence Berkeley Na;onal Laboratory
Aug 7, 2020
SLAC AI Seminar

The Advanced Light Source at Berkeley Lab

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 2/39.

The Advanced Light Source at Berkeley Lab

184" cyclotron yoke (construc9on 1940)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 3/39.

The Advanced Light Source at Berkeley Lab

1.9 GeV Storage Ring, 196.8 m, 1993

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 4/39.

The Advanced Light Source at Berkeley Lab

Triple-bend achromat laUce (12 sectors)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 5/39.

The Advanced Light Source at Berkeley Lab≈40 beamlines, ≈5000 hrs/y, ≈2000 users/ySimon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 6/39.

Many Successful Eﬀorts to Stabilize Electron Beams• Top-oﬀ keeps ALS stored current varia;on <0.2%

Courtesy: C. Steier, PAC'09

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 7/39.

Many Successful Eﬀorts to Stabilize Electron Beams• Top-oﬀ keeps ALS stored current varia;on <0.2%• At low energy, ALS strongly aﬀected by inser;ondevice (ID) imperfec;ons & con;nuously
changing EPU gaps/phases
Courtesy: C. Steier, PAC'09

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 8/39.

Many Successful Eﬀorts to Stabilize Electron Beams• Top-oﬀ keeps ALS stored current varia;on <0.2%• At low energy, ALS strongly aﬀected by inser;ondevice (ID) imperfec;ons & con;nuously
changing EPU gaps/phases– Orbit feedback and ID feed-forwards
stabilize source posi;ons/angles to
sub-micron level at many tens of Hz

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 9/39.

Courtesy: C. Steier, PAC'09

Many Successful Eﬀorts to Stabilize Electron Beams• Top-oﬀ keeps ALS stored current varia;on <0.2%• At low energy, ALS strongly aﬀected by inser;ondevice (ID) imperfec;ons & con;nuously
changing EPU gaps/phases– Orbit feedback and ID feed-forwards
stabilize source posi;ons/angles to
sub-micron level at many tens of Hz– ID feed-forwards & tune feedback stabilize
op;cs at source points– ID skew feed-forwards stabilize source size
• require recording lookup tables (;me consuming)• tables are imperfect and machine dri]s over ;meThermal, Ground, Water Table, etc.
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 10/39.

Courtesy: C. Steier, PAC'09

The Problem: Beam Size vs. ID Mo9on• Nevertheless, during rou;ne user ops observe ver;cal source size
varia;ons when ID conﬁgura;ons change≈4% source size varia9on

ALS Diagnos9c Beamline 3.1

SR from 1st arc dipole ("round beam") ➔KB mirrors ➔ C ﬁlter ➔ 1-3 keV x-rays ➔LYSO scin;llator crystal ➔ visible ➔ CCD
PRL 123, 194801 (2019)Rev. Sci. Instrum. 67, 3368 (1996)• Tradi;onally 3rd-gen. sources considered <10% acceptable, but...
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 11/39.

How this Problem Aﬀects Sensi9ve Experiments• Ver;cal source size ﬂuctua;ons show up as intensity
varia;ons at highly sensi;ve beamlines, such as the
STXM at ALS beamline 5.3.2.2– STXM zone plate focal length ≈1 mm ➔ no independent &reliable I0 measurement– Very small spot size in focus (>20 nm ➔ scan >10×10 μm2)
– Fast raster scanning for diﬀeren;al measurements ➔ noaveraging (≈1 ms/pixel, 1 s/line, 6 min/scan)

3.2% varia9on

during user ops

0.5% varia9on– Monochromator plane is H ➔ V source size ﬂuctua;ons
directly aﬀect experimental noise ﬂoor

• 4th-gen. rings such as ALS-U will be equippedwith many more such highly sensi;ve beamlines:
STXM, XPCS, ptychography, etc.
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 12/39.

no ID mo9on
PRL 123, 194801 (2019)

Need to Solve This Problem at the Source• Why use Machine Learning (ML) to aoack this issue?
– ML can model highly nonlinear processes and is extremely ﬂexible– ML does not require a priori understanding underlying physics (e.g. machinedriq) ➔ but allows extrac;ng valuable system informa;on a posteriori– ML can substan;ally outperform conven;onal ﬁrng (polynomial regression)• ML requires reproducible events ➔ conﬁrmed in experiments• ML ideally requires large data sets for training ➔ ALS digital control
system can provide that

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 13/39.

Need
SolveFitting
ThisResult
Problem at the Source
LasttoUpdate:There are 6000000 data points in the training dataset and 1000000 in evaluation.
fitting
result using
model with(ML)three tofullyaoack
connected[128, 64, 32]
MachineLearning
thislayers
issue?
• WhyTheuse
gives decent YAVERMS prediction:– ML can model highly nonlinear processes and is extremely ﬂexible– ML does not require a priori understanding underlying physics (e.g. machinedriq) ➔ but allows extrac;ng valuable system informa;on a posteriori– ML can substan;ally outperform conven;onal ﬁrng (polynomial regression)• ML requires reproducible events ➔ conﬁrmed in experiments• ML ideally requires large data sets for training ➔ ALS digital control
system can provide that Predic9on within 0.3%
MSE: 0.0230

of measured beam size

MSE: 0.0232

Courtesy: S. Liu• First example: oﬄine analysis of user ops data
– 26 ID parameters ("input") ➔ predict V beam size @ BL3.1 ("output")– Recorded 8 Msamples @ 10 Hz ➔ 6 Msamples used for training, 2 Msamples forvalida;on ➔ training took 30 min on powerful GPU
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 14/39.

Need to Solve This Problem at the Source• Why use Machine Learning (ML) to aoack this issue?
– ML can model highly nonlinear processes and is extremely ﬂexible– ML does not require a priori understanding underlying physics (e.g. machinedriq) ➔ but allows extrac;ng valuable system informa;on a posteriori– ML can substan;ally outperform conven;onal ﬁrng (polynomial regression)• ML requires reproducible events ➔ conﬁrmed in experiments• ML ideally requires large data sets for training ➔ ALS digital control
ML predic9on clearly outperforms
system can provide thatpolynomial regression• First example: oﬄine analysis of user ops data

PRL 123, 194801 (2019)– 26 ID parameters ("input") ➔ predict V beam size @ BL3.1 ("output")– Recorded 8 Msamples @ 10 Hz ➔ 6 Msamples used for training, 2 Msamples forvalida;on ➔ training took 30 min on powerful GPU
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 15/39.

From Predic9on to Correc9on• Introduced "dispersion wave parameter" (DWP) to modify standard
ALS dispersion wave (skew quadrupole excita;on paoern) ➔ allows
adjus;ng ver;cal emioance (global conserved quan;ty)
SQSF SQSD~ =K~0 + ( 0 + ) K,
~
K

DWP

Dispersion Wave
EPAC 2000, TUP3A17, p.1098"Dispersion" Function (122 BPMs)
0.08
0.06
0.04

"Dispersion" [mm]

LOCO & Setup~ 2 R16+16
K

0.02
0
-0.02
-0.04
-0.06

Current ALS Op;cs

-0.08
20

40

60

80

Vertical BPM Number

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 16/39
.

100

120

From Predic9on to Correc9on (cont.)• Introduced "dispersion wave parameter" (DWP) to modify standard
ALS dispersion wave (skew quadrupole excita;on paoern) ➔ allows
adjus;ng ver;cal emioance (global conserved quan;ty)
SQSF SQSD~ =K~0 + ( 0 + ) K,
~
K

DWP

Dispersion Wave

Dispersion Wave
EPAC 2000, TUP3A17, p.1098

Local Skew Correc9on"Dispersion" Function (122 BPMs)
0.08
0.06
0.04

"Dispersion" [mm]

LOCO & Setup~ 2 R16+16
K

0.02
0
-0.02
-0.04
-0.06

Current ALS Op;cs-0.08

EPAC 2004, MOPKF071, p.479
20

40

60

80

Vertical BPM Number

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 17/39
.

100

120

From Predic9on to Correc9on (cont.)• Introduced "dispersion wave parameter" (DWP) to modify standard
ALS dispersion wave (skew quadrupole excita;on paoern) ➔ allows
adjus;ng ver;cal emioance (global conserved quan;ty)
SQSF SQSD~ =K~0 + ( 0 + ) K,
~
K

DWP

Dispersion Wave
EPAC 2000, TUP3A17, p.1098• Observed varying ID conﬁgura;ons aﬀectprimarily ver;cal dispersion ➔ εy• Can therefore stabilize beam size globally byadjus;ng DWP"Dispersion" Function (122 BPMs)
0.08
0.06
0.04

"Dispersion" [mm]

LOCO & Setup~ 2 R16+16
K

0.02
0
-0.02
-0.04
-0.06

Current ALS Op;cs

-0.08
20

40

60

80

Vertical BPM Number

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 18/39
.

100

120

Building a NN-based ID Feed-Forward• Training: measure beam sizes while scanning DWP & various ID
conﬁgura;ons ➔ acquire data at 10 Hz ➔ input for training of NN (DL)IDs
Deep Learning
Skews

Training

σy

NN

Input

Output• Requires only large amounts ofdata & reproducibility

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 19/39.

Building a NN-based ID Feed-Forward• Training: measure beam sizes while scanning DWP & various ID
conﬁgura;ons ➔ acquire data at 10 Hz ➔ input for training of NN (DL)• Result of DL is predic=on for DWP required to keep beam size
constant for arbitrary ID conﬁgura;ons ➔ run as NN-based ID FF
IDs
Deep Learning
Skews

Training

σy

NN

Input

Output• Requires only large amounts ofdata & reproducibility

FF

NN
IDs

Skews

σy

Applica9on during ops

Set Target σyPredic=on

Skews
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 20/39.

How a Neural Network (NN) Works

Courtesy: S. Liue.g.

𝒙𝒋𝒍+𝟏 = 𝒇(∑𝒋𝒘𝒊𝒋𝒙𝒊𝒍)Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 21/39.

Deep Learning: How we Trained the NN
Insertion Device (ID)Settings

Measured
Beam Size

Dispersion Wave
Parameter (DWP)

Input Layer: ID settings (22-35 Dimension)and DWP (1 Dimension)
Three Hidden Fully Connected Layers:
128, 64, 32 neurons in each layer
Output Layer: Vertical Beam Size (1Dimension)

IDs
Skews

Regularization: L2 regularizer with λ = 10-4
Optimization: Adam
Optimizer
with learning
Different
Architectures
rate α = 10-3
Raw Data

Training

σy

NN

Input

OutputWith Square Features

Architecture

Training MSE

Evaluation MSE

Training MSE

Evaluation MSE

128-640.02650.02680.02570.0260256-640.02430.02450.02590.0262512-1280.02430.02470.02430.0247

128-64-32

0.02380.02420.02430.0245256-128-64

0.02360.02400.02400.0246256-128-64-32

0.02450.02490.02450.0248The fitting becomes much better when have two layers and three layers. However, wecannot get better results if we have more nodes each layer and/or add more layers.
Simon
C. Leemann• Machine
Learning-based
BeamSize Stabiliza9on at ALS
Some errors are
not reducible.
In this case,adding squarefeature does nothelp forprediction. The deep neural network canlearnAI
theSeminar
useful information
similaras •squareSLAC• Aug 7,
2020
22/39
.
features.
15

PRL 123, 194801 (2019)

Resul9ng NN Enables ID Feed-Forward at ≈3 Hz
Insertion Device (ID)Settings

Predicted
Beam Size

Proposed DWP

Proposed DWPs

Predicted Beam Sizes

-0.06

50.3

….
0
…
0.06

Measured ID
Settings
Neural Network

….
52.1
…

Compare with Target
Beam Size

Choose proper DWP

54.0

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 23/39.

Physics Shi]: Data Collec9on for NN Training
Example from 11 h training @ 500 mA top-oﬀ• Training: measure beam sizes & scan DWP while also scanning ID
conﬁgura;ons ➔ acquire data at 10 Hz ➔ input for training of NN (DL)• Result of DL is predic;on for DWP required to keep beam size
constant for arbitrary ID conﬁgura;ons ➔ run as NN-based
ID FF
σy
48 μm

DWP
±0.06 units±4.75 μm
Scanning ID gaps (and shi]s)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 24/39.

Physics Shi]: Running NN-based ID Feed-Forward
Evalua9on @ 500 mA top-oﬀ

Training required ≈15 min on single core

• Training: measure beam sizes & scan DWP while also scanning ID
conﬁgura;ons ➔ acquire data at 10 Hz ➔ input for training of NN (DL)7.5 μm p-p (15%)
1.9 μm(4%) required to keep beam sizeof DL is predic;onforp-pDWP• Result
1.5 μm rms (3%)
rms (0.4%)
constant for arbitrary0.2
IDμm
conﬁgura;ons➔ run as NN-based ID FF
σy

DWP

48 μm

FF oﬀ

FF on
Scanning ID gaps (and shi]s)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 25/39.

Physics Shi]: Running NN-based ID Feed-Forward
STXM images BL 5.3.2.2 (D. Shapiro & M. Marcus)

Evalua9on @ 500 mA top-oﬀ• Training: measure beam sizes & scan DWP while also scanning ID
varia9on
0.5%
conﬁgura;ons ➔ acquire data at 10 Hz ➔ 3.2%
input
for training ofNNvaria9on(DL)
7.5 μm p-p (15%)
1.9 μm(4%) required to keep beam sizeof DL is predic;onforp-pDWP• Result
1.5 μm rms (3%)
rms (0.4%)
constant for arbitrary0.2
IDμm
conﬁgura;ons➔ run as NN-based ID FF
σy
FF oﬀ

no ID mo9on

DWP

48 μm

0.8% varia9on
FF oﬀ

FF on

FF on
Scanning ID gaps (and shi]s)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 26/39.

Physics Shi]: Running NN-based ID Feed-Forward
STXM images BL 5.3.2.2 (D. Shapiro & M. Marcus)

Evalua9on @ 500 mA top-oﬀ• Training: measure beam sizes & scan DWP while also scanning ID
varia9on
0.5%
conﬁgura;ons ➔ acquire data at 10 Hz ➔ 3.2%
input
for training ofNNvaria9on
(DL)
noμm
ID mo9on
7.5
1.9 μm(4%) required to keep beam size
DL(15%)
is predic;onforp-pDWP• Result ofp-p
1.5 μm rms (3%)
0.2 μm rms (0.4%)

constant for arbitrary ID conﬁgura;ons ➔ run as NN-based ID FF
σy
FF oﬀ

DWP

FF oﬀ

no ID mo9on

FF on

48 μm

0.8% varia9on
FF oﬀ

FF on

FF on
Scanning ID gaps (and shi]s)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 27/39.

Physics Shi]: Running NN-based ID Feed-Forward
STXM images BL 5.3.2.2 (D. Shapiro & M. Marcus)

Evalua9on @ 500 mA top-oﬀ• Training: measure beam sizes & scan DWP while also scanning ID
varia9on
0.5%
conﬁgura;ons ➔ acquire data at 10 Hz ➔ 3.2%
input
for training ofNNvaria9on
(DL)
noμm
ID mo9on
7.5
1.9 μm(4%) required to keep beam size
DL(15%)
is predic;onforp-pDWP• Result ofp-p
1.5 μm rms (3%)
0.2 μm rms (0.4%)

constant for arbitrary ID conﬁgura;ons ➔ run as NN-based ID FF
σy
FF oﬀ

FF oﬀ

FF oﬀ

no ID mo9on–12 dB
FF on

DWP

48 μm

0.8% varia9on

FF on
FF oﬀ

FF on

no ID mo9on

FF on
Scanning ID gaps (and shi]s)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 28/39.

Towards First Experiments During User Ops• Use machine shiq to acquire training data by scanning opera;onal
IDs in a quasi-randomized fashion (favoring opera;onal gap range) ➔ train NN• Put this NN into FF opera;on during user ops and evaluate

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 29/39.

Stabiliza9on Conﬁrmed During First User Ops Trial
User Ops @ 500 mA top-oﬀ• With the NN-based ID FF working well during machine shiqs (using
subset of IDs believed to have most eﬀect) ➔ move to next phase
DWP = FF ac9on on dispersion wave

• Use machine shiq to acquire training data ➔ train NN ➔ put into FF
opera;on during user ops• Presents opportunity for "Online Retraining" exploi;ng huge amountof data acquired during user ops (and based on ID conﬁgura;on space actuallyoccupied by ALS users)

σy

σx0.42 μm rms (0.8%)
0.18 μm rms (0.3%)
ID gaps & shi]s moving during user ops(only subset shown here)

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 30/39.

Stabiliza9on Conﬁrmed During First User Ops Trial
User Ops @ 500 mA top-oﬀ• With the NN-based ID FF working well during machine shiqs (using
subset of IDs believed to have most eﬀect) ➔ move to next phase
DWP = FF ac9on on dispersion wave

• Use machine shiq to acquire training data ➔ train NN ➔ put into FF
opera;on during user ops
to EPU not"Onlinerelated
Retraining"
exploi;ng huge amount• Presents opportunity for Stepping
includedoriginal
trainingof data acquired during user
opsin(andbasedon ID conﬁgura;on space actuallyoccupied by ALS users)

σy

σx0.42 μm rms (0.8%)
3.5 μm (7%)

0.18 μm rms (0.3%)
ID gaps & shi]s moving during user ops(only subset shown here)

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 31/39.

Stabiliza9on Conﬁrmed During First User Ops Trial
User Ops @ 500 mA top-oﬀ• With the NN-based ID FF working well during machine shiqs (using
subset of IDs believed to have most eﬀect) ➔ move to next phase
DWP = FF ac9on on dispersion wave

• Use machine shiq to acquire training data ➔ train NN ➔ put into FF
opera;on during user ops

n
i
a
r
t
e
R
e

?
g
in

to EPU not"Onlinerelated
Retraining"
exploi;ng huge amount• Presents opportunity for Stepping
includedoriginal
trainingof data acquired during user
opsin(andbasedon ID conﬁgura;on space actuallyoccupied by ALS users)

σy

σx

O

3.5 μm (7%)

n
i
l
n

0.42 μm rms (0.8%)

0.18 μm rms (0.3%)
ID gaps & shi]s moving during user ops(only subset shown here)

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 32/39.

Online Retraining: Improve NN with User Ops Data
So far: "Conven9onal" Machine Learning

Training

Scanning during
Acc Phys Shi]

Feed-Forward

Neural Network(Predic9ve Model)
User Ops

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 33/39.

Online Retraining: Improve NN with User Ops Data
Online Retraining: apply user ops data to improve NN ➔ swap NN used for ID FF on the ﬂyTraining

Scanning during
Acc Phys Shi]

Feed-Forward

Neural Network(Predic9ve Model)
User Ops

Online Retraining
NN can be con9nuously online retrained during user ops to improve FF performance(exploi9ng huge amounts of data acquired during user ops)
PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 34/39.

Substan9al Improvement A]er Online Retraining
User Ops @ 500 mA top-oﬀ

Online Retrained NN in FF Ops
NN-based FF oﬀ
DWP

σy0.16 μm rms (0.3%)

σy0.20 μm rms (0.4%)

ID gaps & shi]s moving during user ops(only subset shown here)

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 35/39.

Substan9al Improvement A]er Online Retraining
User Ops @ 500 mA top-oﬀ

0.6% varia9on

Online Retrained NN in FF Ops

NN-based FF oﬀ
DWP

σy0.16 μm rms (0.3%)

σy0.20 μm rms (0.4%)

NN-based FF onID gaps & shi]s moving during user ops(only subset shown here)

PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 36/39.

Results: NN-based FF Oﬀ vs. On During User Ops
User Ops @ 500 mA top-oﬀ

NN-based FF oﬀ

σxσy

0.93 μm rms (1.8%)
ID phase switching

NN-based FF on

FF ac9on

User Ops @ 500 mA top-oﬀ

σyσx0.20 μm rms (0.4%)
PRL 123, 194801 (2019)
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 37/39.

Stabiliza9on Conﬁrmed at Experiment

ALS Beamline 5.3.2.2

Mean Line Intensity

300
200

Line No.

400

200

100

100

ID Mo9on

3.2% rms intensity

100

No ID mo9on (STXM noise ﬂoor)

With ID mo9on
0

0

0

0

500
1400

200

100

1300

200

400

1200

300

300

100

1100

400

300

0.5% rms intensity0

Row No.
200
300

1000

500
1400

1300

400

400

1200

400

100

1100

Line No.

Mean Line Intensity

500

0
500

1000

Row No.
200
300

NN-based FF on
Mean Line Intensity

Mean Line Intensity

300
200

Line No.

400

Line No.

500
1400

100

200

100

100

With ID mo9on

With ID mo9on, online-retrained NN
0Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 38/39.

PRL 123, 194801 (2019)0000.8% rms intensity

1300

200

100

Online Retraining

400

1200

300

200

100

1100

400

300

0

Row No.
200
300

1000

500
1400

1300

300

0.6% rms intensity

1200

400

400

1100

400

100

1000

500

0
500

Noise
reducedto almostﬂoor level

Row No.
200
300

Thank You!

Acknowledgments:
Shuai Liu, Hiroshi Nishimura, Mauhew A. Marcus, David Shapiro, Changchun Sun, Nathan Melton,
Alex Hexemer, Dani Ushizima, Mike Ehrlichman, Gregg Penn, Thorsten Hellert, Yuping Lu, Erik Wallen,
Warren Byrne, Fernando Sannibale, Marco Venturini, Andreas Scholl, Xiaobiao Huang (SSRL)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • /39.

Backup Slides

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 40/39.

Errors Caused by IDs & Required Correc9ons• Orbit distor;ons– caused by on-axis varia;on of ﬁeld integrals (with gap or EPU phase)• corrected by shims (magic ﬁngers) & local orbit correctors (FF, 200 Hz)• corrected by ring corrector magnets (FB, ≈1 Hz SOFB & 1.1 kHz FOFB)EPAC 2004, MOPKF071, p.479

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 41/39.

Errors Caused by IDs & Required Correc9ons• Orbit distor;ons– caused by on-axis varia;on of ﬁeld integrals (with gap or EPU phase)• corrected by shims (magic ﬁngers) & local orbit correctors (FF, 200 Hz)• corrected by ring corrector magnets (FB, ≈1 Hz SOFB & 1.1 kHz FOFB)• Beam size (primarily ver;cal)

EPAC 2004, MOPKF071, p.479– caused by varia;on of ID focusing terms (with gap or EPU phase)• corrected by local quad trims and global quad adjustment (FF & FB)

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 42/39.

Errors Caused by IDs & Required Correc9ons• Orbit distor;ons– caused by on-axis varia;on of ﬁeld integrals (with gap or EPU phase)• corrected by shims (magic ﬁngers) & local orbit correctors (FF, 200 Hz)• corrected by ring corrector magnets (FB, ≈1 Hz SOFB & 1.1 kHz FOFB)• Beam size (primarily ver;cal)– caused by varia;on of ID focusing terms (with gap or EPU phase)• corrected by local quad trims and global quad adjustment (FF & FB)

EPAC 2004, MOPKF071, p.479– caused by varia;on of ID-induced coupling (usually with EPU phase)• corrected by local skew quad coils (FF)Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 43/39.

Errors Caused by IDs & Required Correc9ons• Orbit distor;ons– caused by on-axis varia;on of ﬁeld integrals (with gap or EPU phase)• corrected by shims (magic ﬁngers) & local orbit correctors (FF, 200 Hz)• corrected by ring corrector magnets (FB, ≈1 Hz SOFB & 1.1 kHz FOFB)• Beam size (primarily ver;cal)– caused by varia;on of ID focusing terms (with gap or EPU phase)• corrected by local quad trims and global quad adjustment (FF & FB)– caused by varia;on of ID-induced coupling (usually with EPU phase)• corrected by local skew quad coils (FF)• Reduced injec;on eﬃciency & life;me (nonlinear beam dynamics)– caused by higher-order ID eﬀects (eg. ﬁeld roll-oﬀ) ➔ setsrequirements for ID design and machine op;cs
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 44/39.

ID Focusing Correc9ons Implemented in ALS ID FF• Global Correc;ons– tunes (using larce quads: 24 QF & 24 QD)– in addi;on: tune FB using same quads• Local Correc;ons for all IDsy [m]– βy beat (using 2 QF &2.02 QD locally)➔ slightly increases Δνy ➔ can beremoved by global tune correc;on

QD QF• Local Correc;ons for EPUs only
– βx beat (using 2 QF & 2 QD locally)➔ locally also corrects Δνx since βx ≈ 21 m
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 45/39
.

QF QD
ID
x [m]

Who is sensi9ve to beam size ﬂuctua9ons?
• H beam size is highly stable due to beam physics in 3GLSs (ﬂatmachines, well corrected, low coupling ➔ ﬂat beam)• V beam size can ﬂuctuate signiﬁcantly ➔ BLs suﬀer from this if they– have entrance slits (apertures transform shape/size changes into intensity changes)– disperse in the H plane (monochromator)– rely on intensity measurement (I0 diﬃcult to measure properly)– use short acquisi;on ;me (➔ no averaging), eg.
• diﬀeren;al measurements (do not want to discard too many scans ➔ acquisi;on;me needs to be short compared to ﬂuctua;ons)• raster scanning (STXM) & dynamics (XPCS) ➔ lots of this @ ALS & ALS-U• want to operate at shot noise limit (3GLSs oqen heavily oversubscribed)• When feature observed, want certainty it's sample and not source
Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 46/39.

Ver9cal Dispersion Wave Determines Eﬀec9ve εy• Ver;cal source size is determined by– op;cs and coupling (local)– ver;cal emioance (global)
consis;ng of• natural contribu;on (emissionof SR is quantum process)Dispersion Wave
Local Skew Correc9on• imperfec;ons (unavoidable inreal machines)• systema;c ηy contribu;ons(Dispersion Wave)
EPAC 2004, MOPKF071, p.479

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 47/39.

PID FB Loop Adjus9ng DWP as Func9on of σy
Ver9cal Gap ID 8.1

σy
49 μm

DWP
FB oﬀ

FB oﬀ

FB on

FB on

FB oﬀ

FB oﬀ

FB on

FB on

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 48/39.

PID FB Loop Adjus9ng DWP as Func9on of σy (cont.)
Ver9cal Gap ID 8.1

σy

49 μm

DWP

FB oﬀ
FB on
FB PID tuning

Simon C. Leemann • Machine Learning-based Beam Size Stabiliza9on at ALSSLAC AI Seminar • Aug 7, 2020 • 49/39.