PEP-II LLRF Tuner Inputs &Constants Panel


This panel contains the various constants necessary to define the operation of the tuner loop, including phase offsets, gains, tuner polynomial coefficients, deadband and forgetting factor.

This panel is accessed using the "Inp&Consts" button about half down the Tuners panel in the column associated with the cavity of interest.

Loading Angle Error Calculation

On the upper right of the panel, the equation for calculating the loading angle error is listed:

Load Angle Error = Probe Phase - Forward Phase + Loading Angle Offset

Since the phase length of the RF cables from the forward coupler and the cavity probe are unknowns, an offset must be determined for each to null both phases when the cavity is tuned to 476 MHz.  Both offsets are determined during tuner configuration which is part of station configuration.

A loading angle offset is added to the phase difference to allow the "Loading Angle Offset" loop (enabled on the Feedback panel or Tuners panel) or a fixed constant offset to be added to the loading angle error calculation.  Note that if the station phase were changed, both the forward phase and the probe phase would change but the difference would remain constant and the tuner loop still operates properly.

Park Frequency Error Calculation

Below the loading angle error calculation is the park frequency error calculation:

PARK Freq Error = (90/(4*476e3)) * Ql * (Park Freq - Freq Offset)

This calculation is a linear approximation of the phase slope through a resonator's 3 dB points.  The difference between the "Desired Park Frequency (kHz)" and the current "Freq Offset (kHz)" along with the loaded Q allows the calculation of the "Freq Error (Deg)" which is used to replace the normal loading angle error in the tuner movement calculation (described below).  Note that even if the Ql is not correct the tuner will continue to move until the tuner polynomial reaches the "Desired Park Frequency".

Loading Angle Offset Calculation

Below the Park frequency error calculation is the loading angle offset calculation:

Load Angle Offset = Fx_Offs+(F*(Prev_Offs-(K*(Strength-Setpoint))))

This loop creates a loading angle offset based on the measured cavity strength (in percent) compared to the setpoint (also in percent).  Cavity strength is simply the fraction of the station total gap voltage (in percent) produced by the one cavity.  This is an integrating loop which uses the previous value of the offset to calculate the new value.  When the beam current goes below the limit on the Tuners panel, the RF IOC is unable to connect to the BIC IOC for beam current status, or the calculation is turned off on the Tuners panel, the stored offset value is cleared and must regenerate as beam is injected.

A forgetting factor prevents runaway by pulling the offsets for all the cavities toward zero.  This loop allows running one or more cavities at different voltages and has proven very useful.

Delta Position Calculation

Near the bottom right of the panel is the tuner motor delta position calculation:

Delta Position = Loop Gain * Conv * Error

Based on the error term (which can be either the "Load Angle Error" or the "PARK Freq Error"), the tuner position movement in mm is calculated.

Frequency Offset (Tuner Polynomial) Calculation

On the left of the panel is the frequency offset calculation:

Freq Offset (kHz) = polynomial(Tuner Posn - ON Home Posn) + (t1*(Cav Volt**2))  where

polynomial(x) = p0 + p1*(x) + p2*(x**2) + p3*(x**3)

The polynomial coefficients are generated using the "make_polynomials.m" Matlab script which is called by the "Make Polys" button in the invasive list on the MoreMATLAB EPICS panel. Remember to turn off the direct and comb RF feedback loops before generating the polynomial coefficients. A properly generated polynomial should be accurate to 10 kHz.

The philosophy that the polynomial is based on the TUNE/ON home position allows reusing the old polynomial coefficients even after changing a tuner assembly or position potentiometer, as long as tuner configuration is done to relocate the "TUNE/ON Home" position.  Since the invention of the "Fast Turnon" option, we have realized that the "TUNE/ON Home" position is set when the cavities are at a medium range gap voltage and is not optimum for banging the station on to full gap voltage.  If one adjusts the "TUNE/ON Home" position, then the polynomial is no longer valid.  The proper solution would be to either change tuner configuration to set the "TUNE/ON Home" position at a very low gap voltage or rewrite the polynomial related EPICS and Matlab code to base the polynomial on actual position (not relative to "TUNE/ON Home").  I prefer the first option. 

The t1*(Cav Volt**2) term is a simple attempt to correct for cavity heating effects since thermal power is proportional to the voltage squared.