REALISTIC RF SYSTEM AND BEAM SIMULATIONIN REAL TIME FOR A SYNCHROTRON
Joachim Tückmantel, CERN, Geneva, Switzerland

Due to heavy beam loading with gaps in the LHC
beams, RF and beam are intimately linked to a complex
system with fast transients where the RF loops and theirlimitations play a decisive role. Such a system is difficult
to assess with analytical methods. To learn about overallsystem stability and for the definition of RF components
to be built it is essential to understand the complete
system long before the machine really exists. Therefore
the author has written a general purpose real time
simulation program and applied it to model the LHC
machine with its beam pattern and complete double RFsystem. The latter is equipped with fast RF vector
feedback loops having loop delay, transmitter power
limitation and limited amplifier bandwidth as well as
including one-turn-delay feedback and longitudinal batch
injection damping. The development of all RF and beamquantities can be displayed graphically turn by turn. Theseframes can be assembled to a realistic multi-trace scopemovie.

depending on the RF frequency in the corresponding
subsystem. Each bunch may have any error in arrival
time (phase) or energy as well as a distinct charge.
♦ Each bucket may or may not be occupied to simulate
any beam pattern in the machine.
♦ Subsystem(s) can additionally be driven by asuperimposed signal obtained from processed beamdata to make it simulate a longitudinal damper.
♦ All cavity, transmitter, loop parameters and thebunch length can be varied according to envisaged
manipulations.
♦ The program calculates the evolution of the various
RF and beam parameters: RF voltages and powers,
beam arrival time and energy errors etc.
Since the program is made to study the non-trivial
cases with heavy beam loading, the corresponding loaded
cavity bandwidth is always large and therefore effects suchas cavity vibrations (microphonics) and Lorentz detuning
are neglected. Each cavity has its own transmitter withvector feedback loop. RF system errors (scatter in Q ext andvector feedback calibration errors) are considered
unimportant.

1 BASIC FEATURES OF THE PROGRAM

2 DETAILS OF THE REALIZATION

Abstract

The program is designed to simulate non-ideal cases ina synchrotron, such as non-infinite gain of the RF
feedback loops, an intense beam with gaps, cavities
working as longitudinal damper etc. It also allows slow
changes of most quantities and thus offers the possibilityof running simulated ‘machine development studies’ to
examine many parameters and to find the best settings andthe limits of the system.
The essential features of the simulation are:
♦ The RF system is treated as several independentsubsystems. Each subsystem represents a number ofidentical units with a cavity, its transmitter and theirloops. Each cavity is equipped with a classical RF
vector feedback, which takes into account cable delay,
amplifier bandwidth and saturation of the RF
amplifiers.
♦ A one-turn-delay RF feedback [1] with comb-filter
can be active on all cavities.
♦ Up to three ideal RF subsystems (much faster inCPU time) can be added e.g. for tests♦ Setting up tripping cavity(s) as a separate subsystem
can simulate a transmitter trip. One subsystem cantrip while the others continue to work normally.
♦ Bunches are considered as point charges1. The bunchlength is taken into account as a form factor
1The author is working on an improvement where bunches i nfull longitudinal phase space representation can also besimulated

2.1 Fast RF Loops
The whole RF system is considered to be concentrated
at one point in the ring. RF subsystems are independent
from each other but all cavities of every subsystem areconsidered identical, thus explicit calculation is done only
for one of them. Numerically all primary RF data (cavityvoltage, transmitter current, feedback data) are updated inuser defined regular time steps, an integer fraction of themachine revolution time. Secondary data (such as reflectedcurrent, power levels) are only determined if required foroutput. Bunch data are updated once per turn when it
passes the RF system.
The longest possible and most natural time step is thenominal inter-bunch time; for LHC (about 25 ns) thischoice works very well. This time step must be shortcompared to all system time constants except the RF
period, thus for a beam with long inter-bunch time, anadapted integer fraction has to be used. During such a time
step the cavity/transmitter system is treated as a driven
oscillator with constant drive. The transmitter current
amplitude is assumed stable while the cavity voltage
moves exponentially in the direction of the asymptotic
equilibrium value. The complex time constant of the
exponential function is determined by the total system Qvalue (real part) and the cavity’s detuning (imaginarypart). Cavity R/Q, Q 0, detuning and coupler Q ext definethe asymptotic equilibrium together with the transmittercurrent amplitude which is updated stepwise at the end ofeach time step.
The cavity voltage is adjusted instantly whenever abunch passes, the bunch energy is updated
correspondingly together with the bunch arrival time(‘phase’) lag with respect to the nominal bunch. The
revolution time of each bunch is a function of the bunchenergy deviation, taking into account the transition energyof the machine.
Cable delay in the vector feedback is modelled byfeeding the ‘measured’ complex cavity voltage through apipeline (in fact a circular buffer) with a number of steps
equivalent to the delay. The delayed voltage is comparedto the set-value, yielding the delayed error signal ∆V del.
This is multiplied by the (complex) loop gain to obtainthe nominal transmitter current amplitude; it is clipped (inconserving the phase) if the maximum transmitter power
would be exceeded. The really applied transmitter current
used for the next time step – closing the classical feedback
loop – follows the nominal current with a delay
determined by an exponential function with a time
constant defined by the transmitter bandwidth.
The one-turn-delay feedback reserves for each time step
k in one machine turn a complex (circular) buffer locationS k , filled with zero at start. At each time step a fixed
fraction 2-n (<<1) of the immediate error signal ∆V k isadded to (1-2-n)*Sk, defining the new S k . This algorithm(as in numerical filters) emulates a comb filter with fulltransmission at all multiples of the revolution frequency
but with attenuation in between. The quantity Sk from theprevious turn2 is added to ∆Vdel with a user defined weightfactor relative to the classical feedback gain, thus feedingback a comb filtered signal with one machine turn delay.
Finally, for each bunch the turn to turn change inarrival time (‘differentiation’) multiplied by the userdefined damper gain can be used to modulate the otherwise
static cavity voltage set-value, letting the cavity work as
longitudinal damper.

2.2 Beam Definition
Internally all bunches are treated independently, thus
each one may have its distinct energy, time lag andcharge. For practical reasons the set-up is done in theactual program version with uniform bunch charge and abunch pattern made up of a number of (‘SPS’) batches
that may themselves be built by a number of (‘PS’) subbatches3. It is assumed that a certain number of batches
are already stable in the machine at the time a new batchwith (uniform) energy error and (non-uniform) time lag
error is injected.

2.3 Ramping of RF and Beam Quantities
The program is also capable of ramping all conceivable
quantities as cavity voltage, resonance frequency, Qext
(variable coupler), Q0 (cavity damping loop), all gain
factors as well as the bunch length (during a voltageramp). The new target value and the number of turns
define the linear change, values are updated stepwise after
each turn. This ramping can be pre-programmed – theoperation is triggered at a certain turn – as part of the setup data for standard operations or it may be specified
online during program execution. Furthermore damper
mode, feedback loops and transmitter power can beswitched on or off instantly, and the beam may bedumped.

2.4 Graphics Display
The program displays graphically all desired quantities
as cavity voltages (real and imaginary part), transmitterand reflected power, corresponding complex RF currents,
as well as the energy and time lag of each bunch. Figure 1
shows a typical example. Nominal, zero and limit values
are displayed as dashed lines in the corresponding colour.

Fig. 1: Example of graphic program output for the200 MHz capture cavities in LHC.
Red vertical lines (appearing as thick red horizontal
band due to graphic overlap of adjacent bunches): bunchenergy error, black vertical lines: (appearing as thickblack horizontal band): bunch time error; zero forboth at the centre of the plot. Green/blue line: imaginary
and real part of cavity voltage, zero for both at black
dashed line in lower part.
Red line: transmitter power. Pink line: reflected power,
300 kW limit red dashed line. Nominal, zero and limit
values are shown as dashed lines in the corresponding
colour. This example demonstrates that in the planned
LHC RF system longitudinal damping does not succeed
without active one-turn-delay feedback

2.5 Movies
2

in fact S k-m, shifted by a user defined amount m of buffer
locations to allow compensation for the transmitter delay
3such that the (initial) LHC bunch pattern can be realized

A long series of sequential pictures similar to the one
in figure 1 can be produced and assembled to produce amovie, e.g. using QuickTime®4. These movies show the(simulated) beam and RF system data as will be seen in
future in the control room on a multi-trace colour scope

2.6 Numerical Output
To get numerical data at any turn and for any time step,an ‘info-window’ can be opened during program
execution, holding the simulation; it ‘floats’ over thegraphics display. Placing the mouse cursor at the wanted
time step location, all data are displayed digitally onmouse click, an example is shown in figure 2

coupler Q ext, voltage set-values, loop gain and delay andothers to be defined.
Once the simulation has started, the specified data are
saved automatically (in the application resource file) sothat at the next start of the program the last executed data
are loaded automatically.

Fig 2: Numerical data in the ‘info window’. Colours are‘coded’ as the traces in the underlying display, see fig. 1.
The lower part shows one-turn power averages as well as
cavity stored energy at start and end of the turn and energybalance over the last turn3 PROGRAM CHECKS
Several program checks have been done. Different caseswith a regular bunch pattern all around the machine –corresponding to a smooth beam – have been comparedwith the theoretical calculations possible under these
conditions. Energy balance over one turn between
transmitter, reflected and beam power and including thechange of cavity stored energy, is written in any ‘info
window’ (see Fig. 2); it has been verified for many
arbitrary irregular cases at different turns and with stable,
charging or discharging cavities.
Finally, without beam, the vector feedback gain has
been turned up gradually and instability with the expected
modulation frequency starts at the theoretically predicted
loop gain.

4 PRACTICAL DETAILSThe program runs on any (PowerPC) Macintosh. Alluser defined data for machine, beam and RF system(s) arespecified using different user-friendly panels. Except forthe main panel, these only open on request to allow
parameters to be modified, otherwise the existing
parameters are used. An example for a “RF (sub) systempanel” is shown in figure 3. It allows the subsystem RFfrequency (forced to be the nearest multiple of the bunch
repetition frequency), cavity R/Q, Q0 and detuning,4

the player to show assembled movies (Macintosh or IBMcompatible version) can be downloaded without charges at
http://www.apple.com/quicktime/download/; to unlock the‘movie assembly option’ a small fee is charged

Fig. 3: Example of an input panel: Specification for the
200 MHz capture cavity system in LHC
Also, each saved picture – in a format used byprofessional graphic programs allowing further processingor the production of QuickTime® movies – carries therun data ‘in the background’ so that clicking on thepicture icon loads the program with the corresponding
data. This feature makes book-keeping of run
specifications very easy. Furthermore, data sets can bearchived in ‘spec’-files for later re-use

5 CONCLUSIONSThe program has already shown its usefulness insimulating the LHC beam with its many gaps and theplanned RF system having four 200 MHz copper (capture)cavities and eight 400 MHz superconducting cavities perbeam. Peak powers and average powers for component
specification could be determined. Also, the necessity ofthe one-turn-delay feedback loop (see figure 1) at nominal
beam intensity was demonstrated

REFERENCES[1]
D. Boussard., “Possible ways of improving thelongitudinal behaviour of the high intensity beam at
injection in the SPS”, CERN-SPS/ARF/Technical
Report/DB/gs/81-2