![](media/image1.png){width="5.375in" height="0.5in"}

![](media/image2.png){width="2.5520833333333335in"
height="1.3854166666666667in"}Beam Current Monitor

Stand alone/network diagnostic instrument

# 

# Preface

This interface control document (ICD) represents the current design
concepts and present plans for capabilities.

# 

# Overall Description

The Beam Current Monitor is a PC based instrument, which acquires data
from Beam Current Transformers placed at various locations in the
accelerator. Its purpose is to measure the longitudinal current profile
of the beam. It supports both local and remote operation via a local
console and EPICS (Experimental Physics and Industrial Control System)
channel access.

A beam current transformer sends an analog representation of the current
to the electronics located remotely from the pick-up element. The beam
current signal is digitized, conditioned to reduce droop and restore the
base-line, averaged, integrated, and stored locally in a circular buffer
capable of holding a minimum of 10 macro-pulses. These data are
available for up-loading to the control system. A minimal set of data is
provided on a regular basis for "normal" operating mode, while more
detailed data are available by specific request commands. Current
integration and measurement is internal to the instrument. In addition,
a time stamp is generated to define the macro-pulse data. Each
instrument will provide current monitor electronics for two current
transformers.

The instrument is a stand-alone device with a few exceptions. External
timing is required to synchronize the data acquisition with the
accelerator macro-pulse and mini-pulse structure. A calibration
subsystem provides a known standard current for calibration purposes.

# General Capabilities

The beam current monitor will provide the following capabilities:

## 1- Detailed time history within the macro-pulse

The time history within a macro-pulse will be provided from a digitized
version of the analog signal. The digitizer is planned to operate at
near 65MHz and will yield 13 bit resolution plus sign. To present this
data (2 bytes/sample x 65000 samples/pulse x 60 pulses/sec =
7.8MBytes/s) a great deal of communication bandwidth is required.
Therefore, the detailed data will be stored in a circular buffer for
read-out on demand only. The memory buffer will hold 1 seconds of data,
which gives 7.8 Mbytes per BCM. For two BCM's per instrument requires at
least 15.6Mbytes of data. The operator will be able to read detailed
data for one pulse of all stored pulses. Presently there is a limitation
of the number of values per process variable (PV) that can be read using
channel access. The procedure for reading data is to be determined.

## 2- Droop compensation and base-line restoration

The current transformer is designed to provide a rise time less than 1ns
and a droop of 0.1%/us. With a mini-pulse of 1 ms duration the
transformer will have drooped to near e^-1^ or 0.37. This droop must be
compensated, and the baseline restored to zero to properly average and
integrate the waveform to compute charge. The instrument will provide
this compensation.

## 3- Average current for each mini-pulse and the macro-pulse

The current per macro-pulse will be continuously available. The
mini-pulse information will be available on demand.

**3a) macro-pulse-**

The compensated digitized data will be averaged over a single
macro-pulse to yield a single number for each macro-pulse. One second of
data (60 values for 60 macro pulses) will be stored in the instrument.
This data will be available for up-load to the control system at a one
second refresh data rate. Each BCM will receive a signal to start the
one second acquisition period. This will insure that data from all BCMs
start and stop acquisition at the same time making it easy to correlate
data from different instruments. This mode will provide one value per
macro-pulse or 60 values per second.

**3b) mini-pulse-**

The compensated digitized data will be averaged over a single mini-pulse
to yield a single number for each mini-pulse. This data will be
available for up-load to the control system at a one second refresh data
rate. This mode will provide one value per mini-pulse (1000 values per
macro-pulse) or 60000 values per second on demand. There is a limination
fo 200 values per PV variable which presently limits the number of
consecutive pulses that can be read from the instrument. The procedure
for reading the data is to be determined.

## 4- Total charge for the macro-pulse and each mini-pulse 

**4a) macro-pulse-**

The compensated digitized data will be integrated over a single
macro-pulse to yield a single number for each macro\--pulse. One seconds
worth of data( 60 values for 60 macro pulses) will be stored in the
instrument. This data will be available for up-load to the control
system at a one second refresh data rate. Each BCM will receive a signal
to start the one second acquisition period. This will insure that data
from all BCMs start and stop acquisition at the same time making it easy
to correlate data from different instruments. This mode will provide one
value per macro-pulse or 60 values per second.

**4b) mini-pulse-**

The compensated digitized data will be averaged over a single mini-pulse
to yield a single number for each mini-pulse. This data will be
available for up-load to the control system at a one second refresh data
rate. This mode will provide one value per mini-pulse (1000 values per
macro-pulse) or 60000 values per second on demand. There is a limitation
of 200 values per PV variable which presently limits the number of
consecutive pulses that can be read from the instrument. The procedure
for reading the data is to be determined.

## 5- Time stamping capable of defining a single macro-pulse

The instrument will provide a time stamping capability. The Beam sync
clock will provide timing information to accurately define time to 1/16
of a revolution. This reference (the beam sync clock), together with the
Real-time Data Link (RTDL), will provide the information to place a
unique time stamp with resolution sufficient to define the single
macro-pulse. By counting mini-pulses after the event marker, one can
define the individual mini-pulses.

## 6- Provision for high speed analysis of the beam current

An analog output will be made available for a signal to be externally
processed by a high-speed data acquisition system.

## 7- Manual local/remote gain adjustment

For accurate measurement of the current the amplifier gain must be
adjusted to maximize signal to noise ratio and achieve the dynamic range
required by the particular sensor and location. Due to the large dynamic
range of the input signal in the Ring, the gain must be changed as the
input signal increases. The instrument will store a default table of
gain settings. This table describes the gain required on a turn by turn
basis, and includes information to change gain (at which turn the gain
must change). Gain settings can be changed remotely. The MEBT, Linac,
and HEBT do not require gain changes. The Ring requires as many as 7
gain changes (dependent upon resolution). The RTBT, although not
requiring gain changes, will operate with two gain selections to
accommodate a single turn signal level for studies and the normal 1ms
accumulated turn case.

## 8- Manual local/remote calibration 

For accurate measurement of the current the system must be calibrated. A
calibration source will provide a known current pulse to the system and
will stimulate the transformer. The calibration pulse will be timed to
occur during the intra-pulse period. The calibration system will be
programmable to achieve signal levels that can exercise the system over
its dynamic range thereby checking all amplifier gain paths. Data
collected during this calibration pulse will be stored within the
instrument and used to adjust the data before it is uploaded to the
control system.

# System Configuration

## Distribution of BCMs

The same type of current transformer will be used in all areas of the
SNS. Approximately 27 current transformers will be installed. The
present distribution is shown in Table 1.

Table 1

+-----------------------+-----------------------+-----------------------+
| **[Lo                 | **[Size               | **[Qu                 |
| cation]{.underline}** | (ID)]{.underline}**   | antity]{.underline}** |
+-----------------------+-----------------------+-----------------------+
| **MEBT**              | **5.5cm**             | **2**                 |
+-----------------------+-----------------------+-----------------------+
| **DTL**               | **\***                | **6**                 |
+-----------------------+-----------------------+-----------------------+
| **CCL**               | **\***                | **2**                 |
+-----------------------+-----------------------+-----------------------+
| **SRF**               | **\***                | **0**                 |
+-----------------------+-----------------------+-----------------------+
| **HEBT**              | **13cm**              | **5**                 |
+-----------------------+-----------------------+-----------------------+
| **Ring**              | **22cm**              | **1**                 |
+-----------------------+-----------------------+-----------------------+
| **RTBT**              | **22cm**              | **5**                 |
+-----------------------+-----------------------+-----------------------+
| **\***                | **2.5cm, 3.0cm, 8cm** |                       |
|                       |                       |                       |
|                       | **Not finalized**     |                       |
+-----------------------+-----------------------+-----------------------+

All Current transformers are Bergoz Fast Current Transformers (FCT).
They are designed to provide less than a 1ns rise-time with a droop of
less than 0.1% per microsecond. The transformer has a 50 turn winding,
and is equipped with an auxiliary winding of 10 turns that must always
be terminated in 50 ohms for proper operation. This will provide the
capability to follow the chopper edge for chopper diagnostics. The
auxiliary winding can be used for calibration purposes. The droop will
be digitally compensated in the instrument.

Channels will be grouped according to common region. Typically, each
instrument provides electronics for two transformers. Racks will be
located so that cable runs are not longer than 100 meters.

## Network Organization

The intelligent current monitor instrument is comprised of a personal
computer (PC), that houses the instrument PCI card. On the card is
appropriate logic to interface with the PC, and utilize direct memory
access (DMA) to store data in "real" time. Also included in the PC will
be calibration electronics. The system architecture is shown in Figure
1.

![](media/image3.jpeg){width="3.9in" height="3.2694444444444444in"}

**Figure 1- Beam Current Monitor System Architecture**

Shown in Figure 1 are two beam current monitor instruments on a
communication line that permits data transfer to a VME collector for
correlation with other detectors, and a workstation for data
manipulation and presentation.

![](media/image4.jpeg){width="4.75in" height="3.5625in"}

**Figure 2 -- Beam Current Monitor PC Architecture**

Figure 2 depicts the beam current monitor architecture. It is an
industry PC tied by channel access to Ethernet. The PC runs Embedded NT,
LabVIEW 6i and Active X CAS and LabVIEW Local CA client. The hardware
includes a digital interface PCI motherboard with an IP module that
supports the timing, and a daughter board that includes the analog
front-end electronics and digitizer circuitry.

![](media/image5.jpeg){width="6.0in" height="4.5in"}

**Figure 3 -- Beam Current Monitor PC Architecture**

> The IP module will get a trigger from the event timing (60Hz) hardware
> to start storage of sampled data for 1ms. After it is finished, the
> PCI board will dump all raw data and a timestamp from the RTDL into
> memory (circular buffer can hold 60 triggers, so it is
> (2Bytes/Sample\*65MHz/s+sizeof (timestamp))\*60) by DMA. When DMA is
> done, the PCI board will generate an interrupt to have the LabView
> program read the data, process the data and then put the result into
> shared memory (ping-pong buffer can hold two triggers). The Channel
> Access Server will get data from shared memory and send it to a CA
> client like MEDM directly.

# Data acquisition 

Generally, arrays of data will be acquired which are sufficiently long
to encompass the start of the beam macro-pulse, the end of the beam
macro-pulse, the calibration pulse and a sufficiently long section of
pulse "tail" to calculate the transformer droop time constant The actual
array length will depend on the sampling rate, the beam pulse width,
calibration pulse timing and required sample of "tail" signal. It is
estimated that a total of 3 to 4 ms of data will be taken for each
macro-pulse. ( If 3 to 4 millisecs of data are taken per pulse, then the
buffer requirements are low by a factor or 3 or 4. Instead of 7.8
Megbytes per pulse, the number is 23.4 to 31.6megbytes. Also if there
are two instruments per pulse, the memory requirements are 46.4 to 63.2
Mbytes.)

Data are acquired and stored in the PC using DMA transfer from the
system PCI circuit board. A circular buffer is generated in the PC to
store 1 second of discontinuous data. Data are processed to provide the
capabilities mentioned earlier. In addition, data taken during the
"tail" of the macro-pulse, after the 1ms macro-pulse has been acquired,
will provide information associated with any calibration pulse used and
an ability to calculate the transformer droop constant. Data recorded
just prior to the macro-pulse will be averaged to determine any DC
offset adjustments required to restore the baseline to zero. This data
is analyzed within the instrument. The calibration pulse provides "self
test" capability. The "tail" is analyzed by a least square fit routine
to fit it to an exponential. Appropriate adjustments are made to the
droop compensation algorithm to correct for observed changes. An
appropriate time stamp will be generated by the instrument to correlate
the data set to the macro-pulse.

In the normal operation mode the system will collect and store limited
data for two, one second intervals. Data from 60 consecutive pulses are
stored in a buffer. The data from the next 60 pulses will be stored in
another buffer. At all times the last complete buffer of data will be
available to the users. To make it easy to correlate data from different
BCM measurement systems there will be an event that will define the
start of each block. All BCM systems will get the same event so data
collection for all BCMs start simultaneously. To correlate data the user
has one (1) second to read data from all BCM before a new event arrives
and old data is overwritten.

Data to be collected by the BCM system will be determined by timing
system events and RTDL data. When a timing event occurs data will be
collected and stored in memory until another event arrives. In normal
operation new events will not come until the data has been read out of
the BCM system. This mode will be used primarily for diagnostics. An
example is sampling data at 1Mhz or faster rates. This would produce
60,000 values per second per BCM.

# Controls Interface 

## The data available is significant and will be, in general, available on a request basis. However, a subset of the available data will be passed to the control system at regular intervals, in a "normal" operating mode, at approximately a one second refresh rate. This data will act as comfort display information. Data stored in the circular buffer of the PC will be available by request and can be provided as a data dump defined by macro-pulse number, or macro-pulse number and turn request numbers. Details for the communications command/response protocol must still be developed. 

## 

## Data format

## The following data formats are presently under consideration: 

Provide the following on request:

-   Average Current for the last 60 macro-pulses, 1Hz update rate, on
    request (60 values).

-   Total Charge for the last 60 macro-pulses, 1Hz update rate, on
    request (60 values)

```{=html}
<!-- -->
```
-   Current vs. time (10usec period, 100 values) for "N" macro-pulses
    (10\<N\<60), starting at an event. One point for every 10
    mini-pulses, "M" Hz update rate (1\<M\<6). The actual value of N and
    M will be dynamically changed, and will depend upon the
    architechture speed. The current version of Acess Server has a limit
    of 2000 values.

```{=html}
<!-- -->
```
-   Current vs. time (1msec period, 1000 values) a specific macro-pulse
    defined by an event. One point per mini-pulse, 1 Hz update rate.

-   

Each of the above is for one detector. If data is correlated in a VME
then the data for many detectors will be reported together.

## Tasks

## The following control tasks have been identified:

-   Install NT, Labview and Channel Access Server on a PC

```{=html}
<!-- -->
```
-   Assist in debugging hardware.

```{=html}
<!-- -->
```
-   Assist in definition of Data format

```{=html}
<!-- -->
```
-   Assist in testing RTDL, Event Link Interface. Need prototype timing
    system setup.

-   Assist in the definition of the Global Controls Interface for data
    correlation

```{=html}
<!-- -->
```
-   Setup VME to read BCM.

```{=html}
<!-- -->
```
-   Determine VME data format.

```{=html}
<!-- -->
```
-   Write application software to display data from BCM.

-   Write application software to display data from VME.

##  

# Channels

To properly load and query the instrument a number of variables are
required to be transmitted to the instrument and expected data received
from the instrument. A list of presently established variables is shown
in the Control Channel Listing below.

## Control Channel list

  ----------------------------------- -----------------------------------
  **NAME**                            **DESCRIPTION**

  Gain Array                          Array containing gain settings

  Calibration table                   Table coefficients defining gain
                                      multipliers

  Operating Mode                      Mode numbers describing the desired
                                      data to up-load

  Data type Request                   Defines avg current and charge
                                      format

  Data Pulse number                   Requested macro-pulse time stamp

  Turn Number                         Requested mini-pulse time stamp
  ----------------------------------- -----------------------------------

## Detailed description

Gain Array: This channel defines gain setting array to be down loaded to
the instrument. It contains an 8 bit word for DAC control, an 8 bit word
for a DAC register address, and amplifier switch coding. It will define
the turn vs. gain relationship.

Calibration Table: This channel defines the calibration array. Normally
this array will be stored in the instrument in a local calibration file.
This file is loaded into the AFE electronics upon start-up. After a
calibration is executed, data will be compared to the calibration data
and an appropriate new table down loaded to the instrument.

Operating mode: This channel defines type of pulse expected. Special
single bunch pulses, low power pulses, or full power pulses will be
definable. This will permit alternate gain tables to be loaded in
preparation for the pulse expected.

Data type: This channel defines the desired data requested for upload.
This is of particular importance for data requests for time histories.

Turn number: This channel defines the turn of interest for requested
data, and can include a single turn, a number of turns, or a full dump
of the circular buffer.

# Schedule

This section reflects a target schedule to satisfy a requirement for
MEBT commissioning. Ring electronics require gain changing that is not
required for the MEBT, Linac, or HEBT. Our experience with MEBT
operation will be reflected in "things learned" and will influence the
final design effort for Linac, HEBT, Ring and RTBT.

For MEBT:

Prototype system is needed on or about JAN 2002. Detailed MEBT schedule
unknown.

There will be only 2 BCM's so the VME system is not needed.

VME will acquire data from several systems and combine data according to
time stamp.

It is estimated that the timing systems will be ready in the June, July
'01 time frame. Testing must wait until then.

BCM Displays will be available.

VME Displays will not be available.

General Schedule:

BCM PDR? 01 ??? ??

Deliver BCM to Site 1 APR '04

BCM Install -- LINAC 15 APR '04 to 17 JUN '04

BCM Install -- HEBT 11 JUN '04 to 16 AUG '04

BCM Install -- RING 21 JUL '04 to 22 SEP '04

BCM Install -- RTBT 21 JUL '04 to 22 SEP '04

BCM Installation Compl. 22 SEP '04

BCM Comp. Test @ Site - LINAC 15 JUL '04 to 29 SEP '04

BCM Comp. Test @ Site - HEBT 17 AUG '04 to 01 NOV '04

BCM Comp. Test @ Site -- RING 23 SEP '04 to 10 DEC '04

BCM Comp. Test @ Site -- RTBT 23 SEP '04 to 10 DEC '04