CesrV: Calibrating a BPM with Respect to a Quadrupole's Center

Overview

Idea: Change a quadrupole strength and look at the change in orbit and betatron phase. The change in betatron phase gives a precise measurement of the change in quadrupole strength. This, coupled with the change in the orbit, gives a measurement of where the magnetic center of the quadrupole is. This measurement is used as a calibration factor in software so that the orbit displayed by CesrV and other programs is with respect to the quadrupole center.

Inaccuracies in the measurement will throw off the calibration. These inaccuracies are smallest when the beam is going through the center of the quadrupole and there is no change in orbit with quadrupole strength. Therefore, as part of the measurement process, the beam can be steered to align it with the quadrupole center.


Nomenclature

The quadrupole and BPM under consideration are called the "target" quadrupole and "target" BPM. At two settings of the target quadrupole strength, an orbit, phase and coupling measurement is taken. One of the measurements is called the "reference" measurement and the other is called the "data" measurement. Collectively a measurement is called a "phase" measurement since the CesrV phase data file contains all of this data.


Preprocess Setup

  1. Time in the BPM system.
  2. Flatten the orbit. The nearer the initial orbit is to the quad centers the faster the measurement process will be.
  3. Use the "SAVE GOLDEN" command to save the steering strengths for this orbit. These steering values can later be restored using the "LOAD GOLDEN" command.
  4. Take a chromaticity measurement and adjust the chromaticity to maximize beam stability. Generally you want the chromaticity to be positive and of order 1.
  5. Take a phase measurement and veto any bad data points. Bad data points will affect the analysis.
  6. Correct the coupling and the phase. The tunes do not have to be the design tunes. In fact it is better to have the tunes well away from any resonances and to have the tunes separated by at least 10 kHz. Good numbers currently are 230 kHz horizontal and 245 kHz vertical.
  7. Measure and correct the chromaticity (chrom_meas). If the chromaticity is too low or high it could cause instability problems.
  8. Set the global parameters that affect the calibration process:
    logic%auto_measurement
    Set to False to suppress the query of whether you are sure you want to take a measurement.
    logic%dq_max_quad_calib
    Sets the target change in tune ("dq"), measured in radians/twopi, when cesrv is calculating the CU settings for the quadrupole under consideration. A logic%dq_max_quad_calib of 0.02 will give a tune shift of approximately +/- 4 kHz.
    logic%bpm_calib_max_cycles
    Sets the maximum number of calibration cycles. See the next section for details.
    logic%bpm_calib_max_dorbit
    Sets the maximum horizontal and vertical orbit difference between the beam center and the quadrupole center. If the horizontal and vertical orbit differences are less than this, the calibration cycles are terminated. See the next section for details.
    logic%bpm_calib_load_golden
    If True then load the golden steerings after the last calibration cycle See the next section for details.


The Measurement Process

The command to start a calibration is "CALIBRATE BPM <BPM_INDEX_NUMBER>". CesrV will automatically use the nearest quadrupole to the specified BPM. This command has optional arguments to specify the quadrupole CU values for the measurement. See "HELP CALIBRATE" for more details.

Note: If data has already been taken, the "RECALIBRATE" command can be used to analyze the data.

The algorithm used for the calibration consists of a number of "calibration cycles" determined by the setting of logic%bpm_calib_max_cycles.

If logic%auto_measurement = T, and a series of calibrate commands are being read from a command file, after each calibration measurement CesrV will check if any key on the keyboard has been pressed. If yes, CesrV will stop and abort the command file. This check is done so that the user is not forced to press Ctl-C to abort CesrV in the event that early termination of the command file is needed.

A single calibration cycle consists of the following steps:

  1. Take reference and data measurements. If quadrupole CU values are not specified, the value of logic%dq_max_quad_calib is used to determine appropriate values.

  2. Fit the MODEL to the phase and coupling data of the reference measurement using the defined set of quadrupoles and skew quadrupoles as discussed in the setup section. The MODEL quadrupole and skew quadrupole setting are then transfered to the BASE_MODEL.

  3. Using only the target quadrupole strength as a variable, fit the MODEL to the data measurement. Assuming good fits, the difference between the MODEL and BASE_MODEL target quadrupole strengths is equal to the actual change in strength.

  4. With Bmad, a kick value can be assigned to any quadrupole element. In the MODEL, using horizontal and vertical kickers at the quadrupole, fit the change in orbit. The quad strength combined with the kick strength gives the displacement of the quadrupole from the beam. Assuming that the displacement of the beam in the target bpm is the same as the displacement in the target quadrupole, the displacement of the quadrupole with respect to the BPM electrical center can be calculated.

  5. Choosing 4 horizontal and 4 vertical steerings near the target BPM construct (but do not load) a bump to steer the beam to the center of the quadrupole. After constructing the bump, CesrV will check that the steerings have enough range to steer the beam to the quadrupole center. If they do not, CesrV will choose 4 new vertical steering and 4 new horizontal steerings that are near the quadrupole from all the steerings except those that hit the limit on the first try. Note when a new set of steerings is chosen, that steerings that hit a limit will be kept at the limit in computing a new bump so that in the end there will be more than 8 steerings in the bump.

  6. If the difference between the beam center and quadrupole center both horizontally and vertically is less than logic%bpm_calib_max_dorbit then abort the cycling.

  7. If this is not the last cycle, load the calculated steering bump.
After CesrV has stopped cycling, the golden steerings are loaded if logic%bpm_calib_load_golden is set to True.


Output Files and Updating detcal.ok

There are two output files, one has the name "calibrate_bpm.data.yyyy-mm-dd" where "yyyy-mm-dd" is the current date. The other file is "detcal.dat" both files are appended to each time a calibration or recalibration is done. In the case, each calibration cycle is considered a separate calibration.

The "calibrate_bpm.data.yyyy-mm-dd" file looks like

            Phase          Offset          Old          Delta          dOrb 
Ix_bpm     #1     #2       x     y       x     y       x     y       x     y
    33   9925   9926   -1.22  0.64   -1.46  0.47    0.24  0.17    0.28 -0.04
    34   9927   9928   -0.35  0.71    0.30  1.18   -0.65 -0.47   -0.36 -0.17
    35   9931   9932    3.38 -0.04    3.80  0.15   -0.42 -0.19   -0.21 -0.10
    36   9935   9936    2.41 -0.22    2.82 -0.87   -0.41  0.65    0.07  0.00
The columns are:

Note: At the end of a cycle, if logic%auto_measurement = T, and CesrV loads the calculated steering bump due to the beam being too far from the quadrupole center, then CesrV will not write to detcal.dat. The idea is that the next measurement will be better so why add something to detcal.dat that would need to be edited out eventually.

The detcal.dat file can be used to update the official calibration file:

  /nfs/cesr/online/machine_data/mach_meas/orbit/detcal.ok
Edit detcal.dat to remove unwanted calibration numbers before merging with detcal.ok.