Beam Control: Timing, Protection, Database and Application Software C.M. Chu, J. Tang 储中明 / 唐渊卿 Spallation Neutron Source Oak Ridge National Laboratory
Outline Control software overview Timing system Protection system Application software Database Live demo and pre-exercise Computer control system lab 2
Control Software Overview Accelerator = Acc. Physics + Controls + Diagnostics + Operations + higher order terms Controls = F(hardware, software(physics, ), ) The relationship (integration) among control components is even more important than components themselves! Control system components 3
Control Software Overview (cont.) Timing controlling event flow Protection prevent injury and machine damage Application software machine tuning and many others Database repository for static information 4
Timing I know it is unpopular. I know the timing is unpopular. I know the whole thing is unpopular. But I believe it is the right thing. Bill Clinton (American 42nd US President (1993-2001) 5
Timing Overview (SNS) RTDL Event Link 10 MHz Crystal Osc. Timing Master IOC SNS Real Time Data Link Master Experimental Halls Timing Clients (V124S) SNS Time Stamps Beam data RF Gates Extraction Kickers Triggers, etc. X32 PLL (33 MHz) SNS Event Link Master Machine Protection System High resolution timestamps Machine Modes Ring RF AC Line Timing Reference Generator ICS IOC's SNS Utility Module SNS Timestamps Remote Reset Synchronous ISR s Neutron Choppers LEBT Chopper X4 PLL (64 MHz) Beam Delay Beam Phase Micro pulse width Macro pulse width Timing System Hardware Timing System Users Subsytem Hardware Experimental Systems Diagnostics SNS Time stamps Delays Gates Triggers 6
Timing Example (SNS) Real-Time Data Link (RTDL) Time Critical Events, (soft events disabled) Informational Events, non critical timing RTDL parameter transmission (for next cycle) Cycle Start End Injection Extract RTDL Transmit RTDL Valid (Alternate) Cycle Start Event Link Beam On beam accumulation Machine Line-Synch Reference Clock +60 Hz Zero Crossing -60 Hz Zero Crossing 0 1 ms 2 ms 3 ms 4 ms 5 ms 6 ms 7 ms 8 ms Simplified SNS timing scheme 7
Protection Overview Personal Protection Simple but extremely high reliability Redundant Machine Protection Hardware fault/trip Human error Interlock: must clear fault(s) before allowing beam. E.g. cooling water can interlock magnet. Input from many devices (you name it), controls critical devices. Typically, trip off RF power or shift timing to prevent beam. 8
Software infrastructure 9
Application Software Overview Machine tuning Orbit/trajectory correction Transverse optics/beam parameter matching RF cavity phase/amplitude setting Magnet/RF scaling for beam energy Beam measurement Tune, dispersion, chromaticity Device diagnostics Orbit difference General purpose display (array, scalar, X-Y, X-time) 10
Application Software Overview (cont.) Beam experiment data acquisition Customized data collection for offline use Simulation Virtual accelerator for software test Offline analysis Anything cannot be done online 11
Software Framework/Toolkit Providing tools to share among apps Uniform user interface (common look-and-feel) Making non-programmers lives easier Examples: XAL, CDEV, SDDS, SAD Save/open app setup Error logging Html help Common default menu bar 12
Object-oriented Accelerator Hierarchy Re-useable Well-structured Easy to maintain and clearer Should be easily initialized from database Simplified accelerator hierarchy 13
Online Model Can provide quick physics modeling Not multi-particle tracking but envelope or singleparticle tracking Many physics apps rely on online model Model-based simulator (virtual accelerator) for SW testing Beta functions through the SNS SCL and Linac dump line for a machine snapshot during Sep. 05 commissioning. The app can server as orbit difference tool with live BPM and profile monitor data. 14
Machine Tuning Methods (General purpose) Orbit Difference Compare the measured (BPM) change in a beam trajectory from a magnet setting change with the model predicted change. Eliminates uncertainties of beam initial conditions Easily identifies sign issues, and B(I) problems. 15
Machine Tuning Methods (General purpose) Orbit correction: beam based alignment, e.g. orbit response matrix automated trajectory flattening local orbit bump Orbit flattening in SNS ring 16
Machine Tuning Methods (General purpose) Manual tuning based on beam loss display (for high intensity beam). SNS beam loss pattern during machine tuning 17
Machine Tuning Methods (AP) Linac specific Drifting beam for superconducting cavities Send a beam through a cavity with field = 0 and measure the excited field by the beam to determine the cavity phase set point Acceptance scan Insert an energy degrader / faraday cup into beam Compare with model FC Signal DTL Phase Different DTL amplitud es 18
Machine Tuning Methods (AP) (cont.) More Linac specific Signature comparison (with model). Measurement: scan cavity phase and monitor beam arrival time at two downstream detectors Analysis: vary incoming beam energy, cavity amplitude and cavity phase offset in model to match measurement BPM Measured Phase Diff Cavity phase BPM Measured Phase Cavity phase 19
Machine Tuning Methods (AP) (cont.) More Linac specific Transverse matching (in transition regions). Ring specific Optics tuning: betatron tune adjustment Others E.g. Energy Manager scaling lattice based on beam energy 20
Application Software Consideration Meet requirement: Produce correct results!!! Flexibility and scalability: Same app can apply to different beam lines Portability: Can run on most popular platforms or even via Internet User interface: Easy and clear to use Good graphics support Maintenance and upgrade: industrial standard Object-oriented programming language 21
Application Software Consideration (cont.) Cost and schedule: Within budget and delivered on time Hidden cost such as licensing fees, learning curve Performance: Suitable for existing computer hardware Heavy numerical calculation/display optimization Interface to the controls system Test plan Need offline test before apply to the machine Good simulated environment for testing, e.g. virtual accelerator Good team work 22
Database Including (but not limited to): General purpose: such as information for running model, magnet measurement Control system initialization CVS: can be used for configuration files, software Live data archive, logger 23
Database (cont.) Avoid data duplication Information saved in the DB should be accurate Create customized views for info across multiple tables easy to query 24
Naming Convention Required for database and other automated tasks Hierarchical System_Part:Device_Part:Signal_Part (A:B:C) Systems have many devices Devices have zero to many signals Device names represent function, not equipment 25
Naming Convention (cont.) System Name ( A ) is: (System)(_Subsystem) E.g. DTL_Vac; Ring_Mag Device Name ( A:B ) is: (DeviceType)(_DeviceInstance) E.g. DTL_Vac:GV62; CCL_Mag:PS_QH01; Ring_Mag:QV_A02 Signal Name ( A:B:C ) is: (SignalName) E.g. SCL_Diag:BPM08:xAvg 26
Naming Convention (cont.) Consider the database requirements in developing your naming scheme Do it early (so you do not have to change existing names) Document and advertise Monitor closely Something is better than nothing 27
Database Tools Web interface everybody can use the database, not only DB experts Automatically generated reports error checking, etc. Easier for data uploading, querying 28
Database Example (SNS) Cable 43GB data as of 06/2006 Devices Configuration MPS Operation Signals Equipment Electronic logbook User instruments 29