Fast Bunch Integrator
A System for Measuring Bunch Intensities in the Fermilab Main Ring
Jeff Utterback, Greg VogelFermi National Accelerator Laboratory*POB 500, MS 307, Batavia, IL 60510 USA
Paper Prepared for ICALEPCS 95
ABSTRACT
In order to support the proposed luminosity increases in the Fermilab Tevatron Collider, a new Fast Bunch
Integrator (FBI) system has been developed. FBI is used to precisely measure the intensity of each bunch inthe Main Ring before injection into the Tevatron. These intensity measurements are particularly useful formonitoring the coalescing process as it takes place. This newly designed FBI system will also be used in theMain Injector when complete. The FBI system is comprised of a VME Front End which communicates withFermilab's ACNET via an Ethernet connection. The boards in the VME crate are a Motorola 162 CPU, aFermilab designed Pulse Pattern Generator (PPG), 2 Fermilab designed Integrator boards (one for protons andone for antiprotons), and 2 "Comet Analog Digitizer" boards by Omnibyte corporation. The embeddedsoftware makes use of the VxWorks operating system by Wind River Systems.
Precise timing pulses are produced by the PPG to trigger the integrators and the digitizers just as the bunches
are passing the detection equipment in the beam pipe. The embedded software is required to program the PPG
so that the pulses occur at the correct times. The embedded software also has real-time requirements because
the intensity readings must be retrieved from the hardware quickly to make the data available to ACNET for
console displays and for continuous plots.
Software has been created to produce a local terminal display which mimics the remote console access. This
local display is useful for system access in the field and for debugging purposes.

INTRODUCTION
The Fast Bunch Integrator (FBI) is a system which monitors the bunch intensity of the protons andantiprotons in the Main Ring (or the future Main Injector) and supplies this data to ACNET. The data will be
particularly useful during the coalescing procedure. The data is supplied in a suitable form for continuous Fast
Time Plotting (FTP) and Snap Shot Plotting (SNP). The data is also supplied in a suitable form for all normalslow ACNET accesses such as Parameter Pages, and Data Loggers.

THEORYIn order to increase the luminosity of colliding beam physics in the Tevatron, a process of coalescing musttake place in the Main Ring before injection. This process packs the Main Ring batches into high intensity
bunches. The end result of the coalescing process is 12 high-intensity proton bunches and 4 high-intensity
antiproton bunches. In order to get 36 on 36 in the Tevatron, 3 injections of 12 proton bunches and 9injections of 4 antiproton bunches will be required.
The goal of FBI is to get an intensity reading for each coalesced bunch in the Main Ring. We are not trying
to create a "scope picture" of the bunches, we are simply trying to get an intensity value for each bunch. Toachieve this goal, the intensity signal is used as an input to an integrator circuit. The output of the integrator
depends upon the magnitude of its input and upon the amount of time it is allowed to integrate. The integrator
takes two readings on each bunch; a wide gate reading and a narrow gate reading. The wide gate reading isused to determine the intensity of the batches before coalescing. The narrow gate reading is used to determine
the intensity of the bunch after coalescing. The narrow gate reading should go higher and higher as thecoalescing process takes place. The wide gate reading should not change much during the coalescing process
but may decrease slightly due to losses incurred by the coalescing process.

*Operated by the Universities Research Association under contract with the U.S. Department of Energy.

page 1

11 small bunches
before coalescing

132

4567

8910

11

one big bunchafter coalescing

narrow gate
19ns=1/53MHz=one RF bucket width19nswide gate

HARDWARE
The FBI project consists of a VME crate connected to ACNET via Ethernet. The boards in the crate are aMotorola 162 CPU, a Fermilab-designed VUCD Tevatron clock decoder board, a Fermilab-designed VRFT
pulse pattern generator board, 2 Fermilab-designed integrator boards, and 2 Comet digitizer boards fromOmnibyte Corporation.
VME Backplane

VRFT

PROTON
Integrator

PBAR
Integrator

PPG
Outputs

PROTON
COMET
ADC

PBAR
COMET
ADC

Naro Gate
Wide Gate
Naro Gate
Wide Gate
Digitize
Digitize
Input

Naro Out
Wide Out
53MHZ InA Marker In

PatternClockPatternStart

Input

Input
Naro Out

Input

Wide Out

Input

Input

From Beam Pipe "Resistive Wall Monitor"

THE VRFT PULSE PATTERN GENERATORThe VRFT pulse pattern generator (PPG) is used for all of the critical timing. It has 8 outputs which are
driven by the pattern generator. The pattern can be programmed so that pulses of various widths occurring at
various delays from the "Pattern Start" can occur on any output. The pattern memory is 64K bytes long so amaximum pattern length of 64K buckets can be used. Each bit in a pattern byte corresponds to one of the 8outputs. The pattern proceeds from one byte to the next as the 53MHz clock ticks occur.

page 2

The PPG outputs are used for the integrator gate pulses as well as the trigger pulses for the digitizer boards.
The PPG is triggered to start a pattern on the Main Ring A Marker. This signal occurs once per turn. The
PPG clock runs at 53MHz so the minimum output pulse width is 1/53MHz=19ns=1RF Bucket. This makes itvery convenient for the experts to set the pulse delays in terms of "Buckets off the A Marker."

THE INTEGRATOR BOARDSThe Integrator boards were designed at Fermilab. These boards take their input from the "Resistive WallMonitor" in the Main Ring beam pipe. The purpose of these boards is to integrate the input signal uponcommand from the gate pulses that are provided by the PPG. The narrow gate is programmed to occur just as
the coalesced bunch comes by. The wide gate is centered upon the narrow gate and is used to integrate several
pre-coalesced bunches. The output of the integrator boards provides intensity signals to the Comet digitizerboards.
In order to get accurate intensity readings, it is necessary to periodically take a reading when no bunches are
passing by in the beam pipe. This is called a "background sample". The background sample must be
subtracted from all of the bunch intensity readings. It was originally thought that the background subtraction
would be done in the Integrator boards, but the design has proven to be too difficult and now the backgroundsubtraction is done in software.

THE COMET DIGITIZERSThe Comet digitizer boards contain a large amount of memory. Each time a digitize trigger occurs it puts
the new data in the next consecutive memory location. When the PPG pattern takes place, the data items stackup in the Comet memory until the pattern ends and then the microprocessor can retrieve the data.
The time between bunches after coalescing is 378ns. We sample every other bunch at 756ns. In order to getreadings on all bunches, we take readings over 2 turns. The first turn yields the odd numbered bunches andthe 2nd turn yields the even numbered bunches. The PPG gets its "start pattern" signal from the Main Ring AMarker. The A Marker occurs once per turn and is always present when the Main Ring is running.
P1 P2 P3 P4 P5 P6 P7 P8 P9 10 11 12P1 P2 P3 P4 P5 P6 P7 P8 P9 10 11 12
batchesbackgroundsamplecoalescedbunchesnarrow
gate
wide
gate
integrator
outputdigitize
trigger
A Marker Turn 1

A Marker Turn 2

RFT begins Pattern Generation

RFT ignores this one and continues pattern

The PPG is programmed so that its pattern runs for 2 turns. The PPG will ignore the 2nd A Marker because
it is designed to ignore triggers until the pattern is complete. After 2 turns have elapsed, one reading for all 12Proton bunches and 4 Pbar bunches will be sitting in the respective Comet boards memories. The readings
will be in interleaved order such as P1 P3 P5 P7 P9 P11 P2 P4 P6 P8 P10 P12 in the Proton Comet and A1 A3
A2 A4 in the Pbar Comet.

page 3

SOFTWARE
The embedded software makes use of the VxWorks operating system by Wind River. This is a multitasking
operating system that has very good network capabilities. The software makes its data available to ACNET
using an Ethernet connection. The embedded software has 3 main jobs to do. It must load the PPG to create
the correct pulse pattern for system operation, it must retrieve the intensities from the Comets in a timely
fashion and it must make the data available to ACNET for plots and parameter pages.

LOADING THE PULSE PATTERN
From ACNET the experts have SETTING capability for the various pulse delays and pulse widths. Here isan example of the settings.
P1 gate delay 0 buckets
A1 gate delay 30 buckets
P2 gate delay 20 buckets
A2 gate delay 50 buckets
P3 gate delay 40 buckets
A3 gate delay 70 buckets
P4 gate delay 60 buckets
A4 gate delay 90 buckets
P5 gate delay 80 buckets
Pbar background 300 buckets
P6 gate delay 100 buckets
P7 gate delay 120 buckets
Proton Naro Gate Width 1 buckets
P8 gate delay 140 buckets
Proton Wide Gate Width 11 buckets
P9 gate delay 160 buckets
Pbar Naro Gate Width 1 buckets
P10 gate delay 180 bucket
Pbar Wide Gate Width 11 buckets
P11 gate delay 200 buckets
Background Sample Width 5 buckets
P12 gate delay 220 bucketsDigitize Pulse Delay Off Wide Gate 0 buckets
Proton background 300 buckets
Digitize Pulse Width 1 buckets
These settings are kept in battery backed RAM on the CPU board, so that reasonable settings will always beavailable after a reboot. Any time a setting is changed from ACNET, the embedded software saves the newsetting in BBRAM and then loads the new pulse pattern into the PPG. That way the pattern is all set to go
when ACNET asks for intensity data. The pattern settings are not expected to be changed very often.

RETRIEVING THE INTENSITY DATA
When ACNET asks for intensity data a routine is called which performs the following:
1. Enable the PPG external trigger so that the next A marker triggers the pattern.
2. Wait for the pattern to end by watching the Comet data counter.
3. Disable the PPG.
4. Retrieve the data.
5. Sort out the data.
6. Subtract off the background.
7. Return one pattern's worth of intensity readings to the caller.
This routine takes about 250 uS to execute which is fast enough even if it is called at 720Hz for Fast TimePlots. It returns intensity readings for all 12 proton bunches and all 4 antiproton bunches even if ACNET isonly asking for one reading. It would be inefficient to attempt to change the PPG pattern to get just theparticular bunch that ACNET is asking for. The software just takes the intensity reading that it needs andreturns that single reading.
When this project was first conceived, we thought that we would let the PPG board continually play its
pattern and let the data stack up in the Comet boards memory to be periodically retrieved by themicroprocessor. In that way, data for every turn would be taken and would be available for ACNET. It turns
out that it takes 1 uS per word to retrieve data from the Comet which is typical for off board VME access, soretrieving large blocks of data requires a lot of dead time when the PPG must be disabled and several turn'sworth of data must be allowed to pass by. Experience has shown that it is better to wait until ACNET asks fordata and then enable the PPG for one pattern each time data is asked for. For Snap Shot Plots, the PPG will beenabled for several patterns so that several consecutive turns' worth of data is taken.

page 4

USER INTERFACEThe FBI system can be accessed via a normal Fermilab ACNET console parameter page. Bunch intensities
are displayed in text form and updated at a 1Hz rate. Bunch intensities can also be display graphically using
the standard Fast Time Plot and Snap Shot Plot facilities. The Fast Time Plot updates at a 720Hz rate and theSnap Shot Plot gathers its plot data every other turn. The gate delays and gate widths can be set by a user at
the parameter page.
A local terminal display has also been created for the FBI project. The local terminal is simply a standard
VT220 terminal attached to the CPU board in the VME crate. Software has been created to display all of thepertinent readings and settings. The local terminal display has proven to be quite useful during the setup anddebugging phase.

CONCLUSION
The FBI project is a blend of commercial hardware with custom hardware and a commercial operating systemwith custom software. The information from the FBI system is made available to the Fermilab ACNET system
so that it can be displayed and analyzed using a typical ACNET Console. The end result is a successfully
functioning system which meets the real-time needs for information about the bunch intensities in theFermilab Main Ring.

page 5