A versatile framework for attitude tuning of beamlines at light source facilities

  • 1National Synchrotron Radiation Laboratory, University of Science and Technology of China, Hefei, Anhui 230029, People's Republic of China.
  • 2Institute of High Energy Physics, Chinese Academy of Sciences, Beijing 100049, People's Republic of China.

Abstract

Aside from regular beamline experiments at light sources, the preparation steps before these experiments are also worthy of systematic consideration in terms of automation; a representative category in these steps is attitude tuning, which typically appears in contexts like beam focusing, sample alignment etc. With the goal of saving time and human effort in both writing and using such code, a Mamba-based attitude-tuning framework is created. It supports flexible input/output ports, easy integration of diverse evaluation functions and free selection of optimization algorithms. With the help of Mamba's infrastructure, machine learning (ML) and artificial intelligence (AI) technologies can also be readily integrated. The tuning of a polycapillary lens and of an X-ray emission spectrometer are given as examples for the general use of this framework, featuring powerful command-line interfaces (CLIs) and friendly graphical user interfaces (GUIs) that allow comfortable human-in-the-loop control. The tuning of a Raman spectrometer demonstrates more specialized use of the framework with customized optimization algorithms. With similar applications in mind, this framework is estimated to be capable of fulfilling most attitude-tuning needs. Also reported is a virtual-beamline mechanism based on easily customisable simulated detectors and motors, which facilitates both testing for developers and training for users, as well as the encapsulation of digital twins.