Status of the Control System for the CLAS Detector at Jefferson LabT. Carroll and M. Vineyard
University of Richmond, VA, USA
T. Auger, W. Brooks, S. Fabbro, A. Freyberger, V. Gyurjyan, M. Ito,B. Madre, Y. Patois, S. Philips, M. Swynghedauw and J. Tang
Thomas Jefferson National Accelerator Facility, Newport News, VA, USA
Abstract
A control system for Hall B at the Thomas Jefferson
National Accelerator Facility is being developed within theframework of the Experimental Physics and Industrial Control System (EPICS). The Hall B equipment currently under
EPICS control includes numerous beam line devices, highvoltage power supplies, detector gas systems, and safety systems. The status of the control system is described.
1 Introduction
The Continuous Electron Beam Accelerator Facility (CEBAF) at Jefferson Lab provides a unique tool for basic research in nuclear physics. The central instrument of CEBAF
is a superconducting electron accelerator with a maximum
energy of 4-6 GeV, a 100% duty cycle, and a maximum current of 200 A. These excellent beam characteristics allow
for novel experiments that are being used to develop a quarkbased fundamental understanding of nuclei.
The electron beam at CEBAF is used simultaneously for
scattering experiments in three halls that contain complimentary experimental equipment. Hall B, shown in Figure 1,is devoted to experiments that require a large acceptance detector. The experimental equipment in Hall B can be divided
into three main systems:
 The CEBAF Large Acceptance Spectrometer (CLAS).
 The photon tagging system.
 The target and beam line systems.

The primary instrument in Hall B is the CLAS shown inFigure 2. This device is a toroidal multi-gap magnetic spectrometer and is described in detail in the Conceptual Design Report on CEBAF Basic Experimental Equipment [1].
The magnetic field is generated by six iron-free superconducting coils. The particle detection system consists of drift
chambers to determine the trajectories of charged particles,
Cerenkov detectors for the identification of electrons, scintillation counters for time-of-flight measurements, and electromagnetic calorimeters to identify electrons and to detectphotons and neutrons. The six segments are instrumented
individually to form six independent spectrometers. Commissioning of the CLAS was completed in the fall of 1997.

Figure 2: Exploded view of the CLAS.

Figure 1: Hall B at Jefferson Lab.

The Hall B control system is being developed within theframework of EPICS [2] and is required to control and monitor the various systems in such a way as to allow:
 Safe operation of Hall B.
 Remote monitoring of signals.
 Remote control of system elements.
 Ease of use via graphical user interfaces (GUI).
 Detection of anomalous operational modes, alerting theusers of such situations and, where possible, executing
automatic procedures to ensure personnel and instrument protection.
 Archiving operational parameters for future restoration
and analysis.
 Automation to handle the processing of very large numbers of signals.

The system currently uses four input/output controllers(IOC) to control numerous beam line devices, high voltage
power supplies, detector gas systems, and safety systems. In
this paper we describe the current status of the Hall B controlsystem.

The converter application uses an OMS stepper motor tomove a metal plate into the photon beam downstream of theCLAS. Electron-positron pairs created by the incident photon beam on the plate are detected in coincidence to determine the intensity of the photon beam.

2 Beamline devices

3 High voltage controls

Devices installed on the beam line are used to monitor andcontrol the beam quality and to move targets in and out ofthe beam. The instruments currently under EPICS control
include the target wheel, the harp, the photon collimator, thephoton beam converter, and scalers.
The target wheel application uses an Oregon Microsystems (OMS) stepper motor to position solid targets in thebeam at the center of the CLAS. The user selects one oftwelve possible targets from a GUI that controls the motor.
The harp is positioned upstream of the photon tagger andis used to control the photon radiator and to perform beamscans. Real photon beams are created by putting a radiatorin the electron beam. Four different targets can be selectedfrom the GUI that controls the stepper motor. The device
also has two wires mounted at 90o to each other. To performa beam scan, the two wires are swept through the beam while
the counting rate in the beam line detectors is monitored withthe scaler application. The counting rate as a function of
the position of the wires is written to a disk file that is thenprocessed by Perl scripts and Paw to produce beam profileplots. The result of a beam scan is shown in Figure 3.

The LeCroy 1450 Series High Voltage System is used tosupply high voltage (HV) to all photomultiplier tubes in theCLAS detector. We are currently running fifteen 1458 HV
mainframes, each containing up to sixteen 1461 HV modules. Each 1461 module has sixteen independent HV channels. Direct control of the mainframes is done by an EPICS
IOC over an Arcnet local area network (LAN). We currently
are running two such IOC/network combininations in theHall.
The LeCroy system uses a call-and-response protocol
where all transactions are initiated by the IOC. Becauseof the use of a LAN, transactions can take place between
more than one mainframe at a time, improving system performance. The IOC software maintains a virtual imageof the mainframes at a level below the EPICS database.
The database only makes transactions with the virtual mainframes, and therefore the database sees a very fast response.
The virtual mainframes then communicate with the low level
device driver via a system of message pipes, on a time scale
set by the real mainframes.
On the host side we have developed a Perl-based system
to build databases from a flat ascii file. In addition we havedeveloped a flexible program to build medm screens using alibrary of C callable routines which takes as input the sameascii file as that used by the database builder. The importantfeatures of this system are a configurable set of labels forchannels in the resulting medm screens, guaranteed consistency between the EPICS database and their control screens,and the ability to create and modify control systems for various HV configurations very quickly.
4 Drift chamber gas system

Figure 3: Beam profile plots.
The photon collimator application controls the positionof two sets of collimators located downstream of the photon
tagging system. These collimators are used to clean up thephoton beam after it is generated by the radiator and taggedby the tagger. The collimators consist of bored nickel cylinders. The cylinders are positioned with high precision using
an OMS stepper motor controlled by a GUI.
The scaler application uses 32 bit scalers to monitor thecount rate in 11 detectors positioned around the beam line
to measure the beam halo. The ouput of the scalers are displayed on a GUI. This application is used with the harp toperform beam scans.

Tracking of charged particles is accomplished with theCLAS using three regions of drift chambers that are located at different radial positions from the target. Achieving
the design goals of better than 0.5% momentum measurement and angle resolutions of approximately 1 mrad requires
placing constraints on the gas mixture within the chambers.
These contraints require control and/or monitoring of theflow rates, mixtures, pressures, temperatures, and contaminant levels of the gas.
The quantities of interest are measured with sensors thatare powered and monitored with three different hardware
controllers that have local readout and programming capabilities. The flow controllers and transducers are operated
with two MKS 647A mass flow controllers. Pressure sensors are controlled with three MKS 146B pressure gauge
controllers. Panametrics instruments are used to monitor
temperatures and the concentrations of oxygen, water, andcarbon dioxide. All of these instruments have RS-232 interfaces for remote control and monitoring. Analog signals
are also available for many of the parameters. The instruments have programmable alarms that produce signals thatare used to bypass or shut down portions of the gas system.
In the event of a failure due to any of a number of conditions,the chamber is bypassed automatically with electronicallyactuated valves immediately before and after the chambers.
These safety features are hardwired and are not controlled bysoftware. The computer control system is needed to monitor
parameters and alert the operator of abnormal conditions sothat they may be corrected to avoid hardware activated shut
downs. The system is also needed for remote control of thehardware and archiving of parameters for analysis.
The analog signals from the gas system instrumentation
are continuously monitored with XYCOM XVME-560 analog input cards. Many of these signals are configured fordata logging and alarms.
Remote control of the hardware and verification of theanalog readings are accomplished through the RS-232 interfaces. The RS-232 device support software has been written
for all three types of hardware controllers. Standard EPICS
analog output records and string input records are used tosend commands to and receive data from the device support. The seven RS-232 instruments are interfaced througha Green Spring IP-octal 232 industry pack mounted on theMotorola MV 162 single board computer in the gas system
IOC. More detail on the drift chamber gas system controls
can be found in Ref. [3].

is a commercial high-sensitivity smoke detector with a distributed air sampling system. While this system is interfaced
to the building fire alarm system in a conventional way, theanalog outputs from it are monitored in EPICS using an XYCOM XVME-560 ADC. Each VESDA channel is monitored
in the alarm handler, and the analog voltage signal is displayed in a prominent bar chart and strip chart format on
a GUI. The use of this system allows significantly earlier
warning of a developing problem than is provided by thebuilding fire alarm system since the alarm handler thresholds can be set to a much lower value than those that activate
the building fire alarm system.

5 Safety[3]

The CLAS spectrometer has a large number of cables and alarge mass of exposed plastic scintillator. Because these materials are flammable, fire safety is a concern for the spectrometer. Among other safety systems, there is a multichannel Very Early Smoke Detection System (VESDA) which

Acknowledgements
This work is supported by the U. S. Department of Energy
under Contract Nos. DE-AC0584ER40150 and DE-FG0588ER40459, and by the University of Richmond.
References[1][2]

Conceptual Design Report, Basic Experimental Equipment, CEBAF Report, April,1990.
The Experimental Physics and Industrial Control
System (EPICS) is a set of software tools originally developed by Argonne National Laboratory andLos Alamos National Laboratory for the purpose ofbuilding distributed control systems. Information on
EPICS can be found on the World Wide Web at
http://www.aps.anl.gov/asd/controls.
M. F. Vineyard, T. J. Carroll, and M. N. Lack, proceedings of ICALEPCS ’95 The International Conferenceon Accelerator and Large Experimental Physics Control Systems, Oct. 29 - Nov. 3, 1995, Chicago, IL (FermiLab Report CONF-96/069).