Controlling the RF cavities

Table of Contents
A lattice may contain multiple RF cavities, grouped according to different RF systems:
main cavities, harmonic cavities… AT provides simple tools to tune them.

Lattice properties

Lattice properties are used to describe global properties of the lattice. They are stored as attributes of a RingParam element, ideally located in the 1st position in the lattice.
The lattice properties can be accessed with the atSetRingProperties / atGetRingProperties functions.
Several lattice properties are used for cavity control. They act on the "main" cavities, defined as follows:
'Periodicity': read/write - The number of times the lattice cell is repeated to build the ring,
'rf_frequency': read/write - The frequency of the main cavities
'rf_timelag': read/write - The time lag of the main cavities expressed in values of path lengthening “cτ”, the 6th particle coordinate [m].
'rf_voltage': read/write - The sum of the voltages of all main cavities over the full ring
'cell_rf_voltage': read/write - Sum of the voltages of all main cavities over one cell
'cavpts': read/write - select the cavities used by default, as explained below.

Cavity access function

More control of the cavity parameters can be acheived with the atsetcavity function.
newring=atsetcavity(ring,'Name',Value,...) specifies cavity properties using one or more Name,Value pair arguments. The values handled by the function concern the full ring (`periodicity` x cell).

Selection of the target cavities

The `cavpts` argument is used to select the cavities driven by the command.
newring=atsetcavity(ring,___,'cavpts',cavpts)
It is used as follows:
So the easier way to use it is:

Cavity attributes

newring=atsetcavity(ring,___,'Frequency',frf)
newring=atsetcavity(ring,___,'Frequency','nominal')
If the frequency is 'nominal', the function will set the frequency to the nominal value, according to the revolution frequency and harmonic number. An optional off-momentum may be applied using the 'dp' or 'dct' arguments. The frequency shift is then computed using the linear slip factor , so that the resulting dp may slighly differ from the specified value.
newring=atsetcavity(ring,___,'Voltage',Vrf)
Set the total voltage (all cells) [V]. The voltage is equally distributed over all selected cavities in all cells. So the voltage of each cavity is Vrf / n_cavities / Periodicity.
newring=atsetcavity(ring,___,'cell_voltage',Vrf)
Set the voltage of one cell [V]. The voltage is equally distributed over all selected cavities in the cell. So the voltage of each cavity is Vrf / n_cavities.
newring=atsetcavity(ring,___,'Timelag',time_lag)
The time lag is expressed in values of path lengthening “cτ”, the 6th particle coordinate [m].
newring=atsetcavity(ring,___,'dp',dp)
newring=atsetcavity(ring,___,'dct',dct)
Set the off-momentum used to compute the nominal RF frequency.