# Optics Measurement and Correction (OMC) – LS3 Planning
Optics Measurement and Correction represents a critical activity, and key bottleneck, during LHC commissioning.
To ensure machine protection and optimal performance, each operational configuration requires that a large array of optical parameters should be corrected to a high degree of precision, including:
- beta*
- beta-waist
- beta-beat
- horizontal dispersion
- vertical dispersion
- key phase advances
- local linear coupling
- global linear coupling
- detuning
- IR feed-down
- nonlinear resonances
The objective of this project is to support development of improved optics commissioning tools, to facilitate more efficient optics commissioning in preparation for the HL-LHC.
## Key objectives
### OMC model and response matrix generation
- With the decision to end support for the MAD-X simulation code in Run4, OMC model generation for linear optics and response matrices should be migrated to Xsuite
- Python functionality of new simulation codes should be utilized to support simpler on-the-fly adaptation of response matrix calculations
### Nonlinear optics measurement, correction, and automation
- Develop tools to automate nonlinear optics scans, in particular:
- RF scans
- crossing-angle / orbit-bump scans
- Develop improved response matrix generation tools for the nonlinear optics
- At present NL-optics knob definition cannot be performed online
- Utilize novel functionality provided by the MAD-NG simulation code to efficiently generate high-order response matrices
- Develop improved analysis tools / GUI to support efficient post-processing of NL-optics measurements and calculate corrections, to supplant existing scripts and manual procedures
### Bad BPM identification
- Develop improved tools to support automatic identification of problematic BPMs from:
- raw data
- spectra
- outlier analysis
online during optics measurements, which represents a necessary prerequisite to any future automation of measurement and correction
- Develop improved tools for the long-term monitoring of problematic BPMs across the ensemble of optics measurements performed during a given commissioning / year / run, with a view to providing regular input to BI
### Automated excitation
- Develop tools to improve efficiency of AC-dipole excitation (to be able to exploit any future AC-dipole upgrade increasing allowed kick frequency)
- A first update to the LHC multiturn GUI to support a pre-programmed automatic kick program has already been developed; during the 2025/26 period these new tools should be tested and refined as required
- The present tools utilize basic figures of merit to define kick amplitudes; this should be updated with online action calculations to help ensure consistent measurement quality
- Introduce automation of on/off momentum kicks into the program to facilitate dispersion measurement
### Towards automatic beta measurement
- Complementary to improvements in automated excitation, develop tools to help facilitate non-expert linear optics measurement in the LHC
- Online models should be automatically generated based on extracted optics present in the machine at the time of automated kicks performed via the multiturn GUI
- A similar process is utilized already for basic models during ADT-based coupling measurement
- For beta- and dispersion measurements models must be extended to include extracted knob settings (for example crossing-angles, spurious dispersion knobs)
- Extend the multiturn application to automatically process coupling and optics measurements generated following completion of the automatic kick program
- Develop improved software to support K-modulation measurements, including:
- updates of the K-modulation tools and procedures to be compatible with HL-LHC circuits
- developments of the OMC GUI to improve the pipeline between K-modulation measurements and optics corrections
These developments are underway and should be tested during Run3 and refined as necessary
### Towards automation of global corrections
- Study the possibility to shift basic global corrections of the linear optics to a non-expert task
- At present the response matrix and global correction approach do not automatically account for circuit current limits
- Integrate circuit limitations into determination of the global corrections
- The global correction is in principle straightforward to define; in practice however, correction usually involves:
- testing multiple predicted corrections in simulation
- varying a selection of response matrix and measurement cuts
- tailoring weighting between different optics parameters and measurement sources
Study the viability of automating this process
### Local IR error corrections
- Development of segment-by-segment tools for local error correction in the LHC IRs is underway within the framework of the OMC3 GUI
- These tools should be tested and exploited during the remainder of Run3
- Action-Phase-Jump correction methods should be fully implemented in OMC tools to provide a complementary correction method to SbS
- ML-based tools for IR error identification have been developed during Run2/3
- These should continue to be tested with a view to further integration in the OMC toolset
- Provide a complementary correction method to SbS and APJ
### Local arc error corrections
- Develop OMC segment-by-segment correction tools / GUI, together with support for automatic matching of:
- orbit bumps
- sextupole strengths
to identify local arc corrections in a time-efficient manner
### Energy error identification / corrections
- Analytical tools to support efficient optics correction due to energy offsets during the commissioning process are in development
- These approaches should be tested and validated during Run3
### Single pass dispersion
- Develop OMC tools and GUI to support non-expert checks of single-pass dispersion in the LHC
### ADT-based measurements with nominals
- Test OMC tools and methods with the transverse damper, to explore the viability of routine linear optics measurements with lumi-production beams
### Extension of OMC tools in the injectors
#### SPS
- Develop model creation tools for SPS (in line with those already existing for PSB, PS, LHC, and external machines)
- At present coupling and RDT calculations in OMC tools are incompatible with SPS turn-by-turn data
- Update OMC codes to facilitate coupling measurements with single-plane BPMs
- Ultimately target development of routine coupling measurements in SPS using the ADT
- Update existing LHC analysis tools for nonlinear optics to work in SPS
- Notably amplitude detuning calculation via the OMC GUI in SPS requires implementation of corrections for un-kicked tune drifts (as already implemented in LHC)
#### PS, PSB
- Long-term turn-by-turn data acquisition in PSB and PS has so far been performed by logging of raw sum / difference signals from the BPMs via dedicated scripts provided by BI
- These are then calibrated and converted to work with the OMC tools
- Improve the pipeline between turn-by-turn acquisition and OMC analysis tools in the injectors to facilitate non-expert use of OMC measurements throughout the injector chain
## Short / Mid term LHC OP-facing activities
### K-mod application
- Fix ability to load / re-analyse historical measurements in the GUI
- Change information output by K-mod GUI:
- clearly display beta*
- beta-waist
- waist values of the two beams
- In results panel estimate separation of the two K-mod solutions (to help spot online issues with VdM analysis when L* approaches beta*)
- In the GUI input explicitly display expected units for initial guesses of the beta* and waist
- Develop tool in K-mod or OMC GUIs to publish summary of K-mod results to the OMC elog
- Review / change coordinate system for waist and beta* calculations to simplify online understanding of waists
### Multiturn application
#### Automatic estimation of the coupling correction from multiturn
- Run OMC3 coupling calculation automatically for every kick from the multiturn application (as done today for the ADT-ACD type measurements)
- Publish effective global coupling knob correction to the elog alongside automatic kick entries
#### Online action estimation
- Run OMC3 action calculation automatically for every kick from the multiturn application
- Publish to elog alongside applied kick percentages
- Switch kick scheduling targets from [mm] to action
#### Feed-back states in multiturn
- Investigate whether it is possible to speed up automatic restoration of initial feed-back states
- Separate sending of state configurations between the two beams
#### On / off-momentum kick scheduling
- Extend automatic kick scheduling in the multiturn application to include off-momentum kicks
- Automatically vary RF-trims and feed-back states
- Coordination of kick scheduling between the two beams
#### Kick scheduling in the ramp
- Extend multiturn kick scheduling to allow automatic measurement in the ramp
- Select series of matched points:
- sanity checks of expected time between kicks
- retrieve automatically energy and optics associated with the matched points
- scale kick strength according to expected rigidity
- schedule kicks of both beams at appropriate times in the ramp
- Enable online adjustment of kick targets during the process in case losses do not scale as expected
#### ADT-ACD optics mode
- Define requirements for MPP and interlocks to allow dedicated optics mode of the ADT to be utilized from the multiturn application
- Implement option in multiturn to switch ADT between coupling and optics mode
### Automation of RF and Xing scans
- Develop GUI / tools for automatic large range RF-frequency and Xing-angle scans to simplify NL-optics commissioning
## Short / Mid term PS OP-facing activities
- Pre-LS3: continue benchmarking of OPERA / MAD models of PS-MU auxiliary circuits
- assess cross-talk
- normalization
- MRP dependence of the circuit responses
- Investigate surrogate / best-knowledge models of the PS circuits to improve tune / chroma control in PS
- Support tests of emittance measurement via numerical deconvolution with zero dispersion optics in PS
- if successful develop non-expert tools to support PS operation
- Improve tools for inloading of PSB / PS turn-by-turn data
- expand segment-by-segment tools to support calculation of measured optics functions at injector instrumentation
- Implementation of Xsuite models into OMC3 for the injectors