Automatic Configuration of Motors at theEuropean XFEL
Florian Sohn, Wajid Ehsan, Gabriele Giovanetti, Dennis Goeries, Ivars Karpics, Konstantin Sukharnikov
European XFEL GmbH, Schenefeld, Germany

The Motor Configurator

Introduction
Research at the European XFEL scientific facility relies heavily on the use ofmore than 3000 motors to move components within the various scientific setups.
To facilitate flexible experimental setups and to save resources, motors arerelocated within the European XFEL and reused at various locations as part ofthe operation of scientific instruments. Typically, each motor has more than 150
configurable parameters and needs to be configured at each new location. In thiscontribution, a software tool for the automatic configuration of motors ispresented, which aims to achieve the following main goals:■ Minimize time spent by staff to configure motors,■ Minimize mistakes due to manual configuration of motors,■ Protect against hardware damage due to accidental misconfigurations ofThe motor configurator software tool has been implemented to eliminate
the necessity for manual reconfigurations and allows■ to apply stored configuration presets to motors■ monitoring of the configuration of active, i.e. online, motors, including
highlighting and displaying deviations from the assigned preset
main scene

advanced preset
configuration scene

motors.
The software tool is based on the SCADA system Karabo [1,2], which isdeveloped at European XFEL. Karabo provides a high-performance, reliable, anduser-friendly environment to configure and control a plethora of hardware
devices. One outstanding feature of Karabo are so-called scenes, easily
configurable, multi-purpose graphical user interfaces that can be shipped with
Karabo-based software tools. The motor configurator software includes a scene
to provide a user-friendly graphical user interface.

Technical backgroundFeatures

For the integration of a hardware device in Karabo a software device class iswritten, which provides access to hardware features. Within Karabo, eachindividual hardware device is represented in terms of an instance of therespective device class. For each device instance, a configuration, i.e. a set ofoperational parameters for the hardware device, is held by the control system.
Most motors at European XFEL are connected to programmable logic
controllers (PLCs), one motor to one PLC terminal. Within Karabo each PLC
terminal receives a unique identifier, the terminal ID. An instance of the correct
device class for the connected hardware is automatically created after
information about the detected hardware has been forwarded from the PLC toKarabo. Importantly, a configuration is assigned to a terminal ID, but cannot beassigned to the connected hardware directly.
hardware motors

Control PC

PLCTerminals
12345KaraboSCADAsystem

Device Server
Terminal_1_ID
Terminal_2_ID
Terminal_3_ID

Terminal_2_ID Configuration
Position
5.83 mm
Target Velocity
1.0 mm/s
Target Acceleration 0.7mm/s2-10 mm
Limit Low
10 mm
Limit HighTerminal_42_ID

42Operational requirements for exp. setups
As motors are relocated between and within experimental setups, the assignment of motors to PLC terminals is subject to changes due to motors being■ reassigned to different PLC terminals,■ added to or removed from the setup.
Even if a motor driver of the same type as the previous setup is connected to a
PLC terminal, the previous configuration for the PLC terminal in Karabo might not
be suitable due to a motion stage with different mechanical and electricalrequirements being connected to that driver. Hence, a reconfiguration of theparameters of a terminal ID is necessary upon each exchange of the connected
hardware device. Due to the number of motors in a scientific component and thenumber of parameters in a motor configuration, manual reconfigurations aretime-consuming and error-prone.

configurationcomparison dialog■ user-friendly GUI interface■ a preset configuration is created from the current configuration of a motor■ motor parameters table: select subset of parameters to be saved inpreset, restrict configuration comparison to a subset of parameters■ 1-to-1 mapping table to assign stored configurations to terminal IDs■ comparison table: indicate mismatch between current configuration of motorand stored configuration■ monitoring mode: compare online and stored configurations periodically■ display differences between stored and online configurations■ allow to easily apply a stored configuration to a motor■ central database for configurations allows to synchronize storedconfigurations over multiple installations of the software■ version control allows to restore previous configurations■ currently uses git/gitlab as a backend■ preset organization: store multiple different presets for a terminal and selectone preset to be used for comparisons with online configurations■ Device 'locking': In case of mismatch between preset and online
configuration disable control of motor to prevent motor movements andprotect against hardware damage

Conclusion and future work
The motor configurator software tool is heavily used for setting and monitoringconfigurations of motors at European XFEL. Major benefits of the tool are■ a significant reduction in time needed to configure motor setups,■ a reduced likelihood of motor misconfigurations,■ a reduced likelihood of damage to hardware components.
For convenient modification of existing configuration presets, a configuration
editor can be added in future work.

References[1] Hauf, Steffen, et al. "The Karabo distributed control system." Journal ofsynchrotron radiation 26.5 (2019): 1448-1461.
[2] https://github.com/European-XFEL/Karabo

European XFEL GmbH, Florian Sohn, Holzkoppel 4, 22869 Schenefeld, Germany, Phone +49 40 8998 6572, florian.sohn@xfel.eu
www.xfel.eu