ARTIFACT, CNRS, AISSAI, IRIS, Region Normandie, EPS Accelerator Group, GANIL

Steering CLARA end to end

Getting the beam a user asked for, in shots instead of hours

🦊

Overfit & Proud

Foxy Gradient — always finds the way down

Amelia Pollard
Eiad Hamwi
Francesco Velotti
Ivan Morozov
Manuel Vazquez Muniz

A user asks for a spot. It costs a morning.

30–90minutes to set up, good day to bad
64.4 mS02 to the FEH screen, 282 apertures
0.1–20 mmspot sizes a user can ask for
CLARA floor plan, lattice and apertures with the nominal beam envelope

And every day is a different machine

50 µmsurvey error on the quadrupoles and sextupoles
new beamdealt at the start of every episode
175–270 µmwhat a 200 µm spot reads, settings untouched
Beam position and size along the lattice, ten consecutive episodes

Ten episodes of the benchmark, same lattice, same axes: lattice.plot_overview(beam) for each day as it was dealt.

0.8 TB of screen images, and only some of them mean anything

Raw and cleaned beam image
Keep. Threshold at a tenth of the peak, then centroid and rms from the row and column sums.
A weak beam before and after cleaning
Discard. Clean a weak frame and nothing is left — but it still returns four confident numbers.
28cameras, calibrated µm per pixel
0.1–30%reading variation we trust
5,732capture sets through the filter

Six ways to tune a machine

Optics lookup144 matched tunes, no shots at all
SVD + response matrixinvert the model, correct in one shot
RCDSconjugate-direction search on the machine
Bayesian optimisationa GP over the knobs that matter
Multi-fidelity BOtwin as low fidelity, machine as high
Model-based RLfit a twin, plan against it, re-read
Transmission at each of the 144 matched nodes Orbit at the 31 BPMs before correction, after one shot and after three Response matrix, BO, RCDS and hybrids compared on one section Final score per episode for the BO and RCDS branches Benchmark score per episode over 100 days of multi-fidelity BO The last shot of one model-based RL episode, measured spot on the request

All of them on the same benchmark — which is what made the losers cheap.

What we ended up with

Optics lookup — 46 quadrupoles for the requested size
model only
↓
Steer — SVD of the correctors against the BPMs
0–4 shots
↓
Focus — five quadrupole modes, size only
~4 shots
↓ ↑
until it matches
Read the screen — the same measure as the real captures
every shot
↓
Place the spot — two correctors, one linear solve
1 shot

Everything the model can do, the model does. The machine is only asked what the model cannot answer.

One episode, eight shots

One episode: the measured spot converging onto the requested one over eight shots

The numbers

MethodScoreShots Screen moves
Calibration + MF-BO 0.408.7 0
SVD subspace, BO 0.435.6 0
SVD subspace, RCDS 0.506.2 0
Model-based RL 0.776.5 0
Optics + placement (two linear solves) 1.002.0 0
Do nothing 9.650 0

A morning’s work, in six shots.

100 episodes each, lower score is better. Different draws of days, so read the column, not the decimal place.

Credits

Most valuable player

🏆

Claude

Wrote the twin, the planner, the response tables, the capture filter, most of the READMEs and every slide you have just sat through — and found more of our bugs than we would like recorded in a public talk.

🥈 Honourable mention: ChatGPT

The models had the benchmark in front of them throughout. Every number in this deck comes from a run a human set off, read and checked.