DTT_AUTO ======== W. Hartung, with guidance from R. E. Meller Updated 30 Nov 2011 Updated 02 Dec 2011 DTT_AUTO is a program for automatic control of the digital tune trackers. It can be used for "timed" or "on demand" measurements of the betatron frequencies and/or synchrotron frequency. In timed mode, by default, the program iterates repeatedly through two "cycles", an "H cycle" in which it measures fh and fv and an "L cycle" in which it measures fs and fv. Each cycle includes three stages: 1. Acquire lock and obtain frequencies 2. Hold lock 3. Release lock and wait for next cycle In demand mode, the program queries the user as to which planes should be measured, locks the tune tracker(s), and holds the tune trackers in locked mode until directed to release them. After releasing the tune trackers, it queries the user for another measurement. The use can also adjust the drive levels while remaining locked. The input parameters may be used to set the initial frequencies and drive levels for each plane. In timed mode, the input parameters may be used to also set which planes are measured and set the hold times and wait times. It is possible to disable one of the timed cycles with an appropriate choice of input parameters. Running the Program ------------------- Log on to the CESRcontrol VMS cluster. Type RUN [CESR.WHH]DTT_AUTO The program will try to read an input file (see below). Then it will prompt the user as to whether the drive should be turned on and as to which run mode should be used. Then it will begin timed or on demand measurements. Stopping the Program -------------------- To stop the program in timed mode, press "S" and the return key when the program is in "hold lock" or "wait" parts of a cycle. The program will release the tune trackers if needed, reload saved parameters into the MPM, and exit. In demand mode, press "M" and the return key to release the tune trackers and return to the demand mode menu. After returning to the menu, you can enter E to exit from the program. You can also exit from the program using control-C or control-Y, but this may leave the tune trackers in an undesired state. Demand Mode Commands -------------------- When holding lock in demand mode, press "G" and the return key to input new values for the drive levels for the active planes. The program indicates the level for each plane (set point and actual), prompts for a new value, and then returns to the "hold lock" state. As indicated above, when holding lock in demand mode, press "M" to release the tune trackers and return to the demand mode menu. From the demand mode menu, you can select a new combination of planes and turn the tune trackers back on, or you can exit from the program. Input file ---------- The program reads the input file DTT_AUTO.INIT. Example contents: $PARA FH_ON=.TRUE. FV_ON=.TRUE. FS_ON=.TRUE. FV_BOTH=.TRUE. TLOCK_H=3.0, TLOCK_L=3.0, TWAIT_H=15.0, TWAIT_L=15.0 FREQSTART=164.0, 143.0, 19.0 LEV_SWEEP=2000,500,200 LEV_DRIVE=1000,250,100 IBUNCH=1 LCHATTY=.TRUE. $ A sample input file can be found in the directory [CESR.WHH] on the CESRcontrol cluster. Input Parameters ---------------- Parameters used in all modes: FREQSTART: array of 3 real numbers; may be used to set the initial values of fh, fv, and fs in kHz. Default values are 160.0, 140.0, and 18.0. To use the values most recently loaded into the MPM, set the frequency to 0.0 (if you want to measure both fh and fs, setting one or more frequencies to zero may produce unexpected results). LEV_SWEEP: array of 3 integers; may be used to set the level for the frequency sweep for fh, fv, and fs. To use the values most recently loaded into the MPM, set the level to a negative value. Default values are -1 for all three planes. (If you want to measure both fh and fs, mixing positive and negative values may produce unexpected results.) LEV_DRIVE: array of 3 integers; may be used to set the level for the locking fh, fv, and fs. To use the values most recently loaded into the MPM, set the level to a negative value. Default values are -1 for all three planes. (If you want to measure both fh and fs, mixing positive and negative values may produce unexpected results.) IBUNCH: integer; may be used to set the bunch number. The bunch numbering convention should be appropriate to the machine configuration. The default value is 1. LCHATTY: logical; if LCHATTY=.TRUE., the program will display the most recent frequency value(s) when in "hold lock" mode. If LCHATTY=.FALSE., the program will display a warning message if it detects a loss of lock, but it will not display the frequency repeatedly while in hold lock mode. Default is LCHATTY=.TRUE. Parameters used in timed mode but ignored in demand mode: FH_ON, FV_ON, FS_ON: logical; flags to indicate which planes (horizontal, vertical, longitudinal) are to be measured. Set the value to .TRUE. to enable the measurement. Default values are .TRUE. for all three planes. FV_BOTH: logical; flag to indicate that fv should be measured in both cycles. Default value is .TRUE. TLOCK_H, TLOCK_L: real; time in seconds to hold the tune trackers in locked mode after acquiring the frequencies during the H cycle and L cycle, respectively. Default value is 3.0 for each. TWAIT_H, TWAIT_L: real; time in seconds to wait after releasing the tune trackers from the H cycle and the L cycle, respectively. Default value is 27.0 for each. Output ------ The digital tune trackers write values to the MPM. Nodes include DIG TTRACK H (20 elements) DIG TTRACK V (20 elements) Elements in the above nodes include element 13 = status; bit 12 = 1 if phase locked, 0 otherwise element 18 = averaged frequency in Hz if locked or center frequency if open loop element 15 = frequency RMS deviation If LCHATTY=.TRUE., the program also displays the frequency and RMS deviation values at the terminal when in "hold lock" mode. Compiling the Program --------------------- At present, the program resides on the CESRcontrol VMS cluster in directory [CESR.WHH]. The source file are DTT_AUTO.F77 (the main program) TT_ACQ_SUB.F77 (digital tune tracker subprograms) The TT_ACQ_SUB.F77 file is a copy of the original file in [CESR.REMTUN]. To compile the program, go to the subdirectory [CESR.WHH] and type DO VLGL DTT_AUTO,TT_ACQ_SUB Note: make sure that there is a comma and no spaces between entries in the list of source files, as this will produce an error. Notes ----- The digital tune trackers measure frequency values which are "aliased" to be below frev/2. (Typically fh,actual = frev-fh, fv,actual = frev-fv, and fs,actual = fs.) Hence, the input values should be below frev/2. The program will report the values returned by the Digital Tune Trackers and calculate frev-fh and frev-fv, but the values stored by the Tune Trackers into the MPM will be the aliased values rather than the actual values. The program turns off the transverse feedback when measuring fh and/or fv, but does not turn off the transverse feedback if measuring only fs. When in the "hold lock" state, the program checks periodically to see whether the tune trackers are locked. If one of the tune trackers is not locked, it prints a warning message to the terminal. If alternating between fh and fs measurements in timed mode, the program saves and restores selected MPM values (phase and delay) for the H/L plane when switching between the planes. If measuring fh or fs in demand mode, the program also saves and restores these MPM values. The program first tries to lock without sweeping the frequency. If successful, it searches for the optimum phase. Initial testing indicates that the time required to acquire lock should be 5 to 6 seconds if a frequency sweep is not needed. If a frequency sweep is needed, initial testing suggests that the acquisition time should be 10 to 12 seconds. The "lock without frequency sweep" was recently implemented and the features may not be fully understood. Other Parameters ---------------- At present, some features cannot be adjusted except by modifying the source code and recompiling it. These include 1. The number of frequency measurements to be averaged by the tune trackers. The program always uses 2^3. 2. When in the "hold lock" state, the program waits for a fixed time (1 second) before checking whether the trackers are still locked. 3. Which MPM parameters are saved and restored. The program saves and restores the first 14 elements of the tune tracker nodes when switching between planes (this includes the center frequency, drive level for sweeping, drive level for locking, and phase). Other parameters are not changed. If there are user-specified values for the drive levels, these override saved values. Areas with Room for Improvement ------------------------------- Further investigation of ways to reduce the time required to acquire lock may be needed. At present, the program check whether the tune trackers are locked, and warns the user if one of the trackers is not locked, but does not do anything special in response to the loss of lock. Additional Notes ---------------- At present, the program runs only on VMS CESRcontrol nodes. Operation on the Linux needs to be implemented before the elimination of the VMS computing platforms. The same is true of the Digital Tune Tracker programs.