Drift-Chamber Gas System Controls Development
for the CEBAF Large Acceptance Spectrometer
M. F. Vineyard, T. J. Carroll, and M. N. Lack
Department of Physics
University of Richmond, VA 23173
ABSTRACTThe CEBAF Large Acceptance Spectrometer (CLAS) is a superconducting toroidal magnet with a large volume ofdrift chambers for charged particle tracking. The performance of these chambers depends on accurate monitoring andcontrol of the mixture, flow rate, pressure, temperature, and contaminant levels of the gas. To meet theserequirements, a control system is being developed with EPICS. The interface hardware consists of VME ADCs andthree RS-232 low-level hardware controllers. The RS-232 instruments include MKS 647A mass flow controllers tocontrol and monitor the gas mixture and flow, MKS 146B pressure gauge controllers to measure pressures, and a
Panametrics hygrometer to monitor temperatures and the concentrations of oxygen, water vapor, and ethane. Manyof the parameters are available as analog signals which will be monitored with XYCOM VME analog input cards
and configured for alarms and data logging. The RS-232 interfaces will be used for remote control of the hardware
and verification of the analog readings. Information will be passed quickly and efficiently to and from the user
through a graphical user interface. A discussion of the requirements and design of the system is presented.

INTRODUCTION
The primary instrument in Hall B at the Continuous Electron Beam Accelerator Facility (CEBAF) is the CEBAF
Large Acceptance Spectrometer (CLAS) shown in Fig. 1. This device is a toroidal multi-gap magnetic spectrometerand 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
detect photons and neutrons. The six segments will be instrumented individually to form six independent
spectrometers. Commissioning of the CLAS will begin in the fall of 1996.
The tracking of charged particles is accomplished by three regions of drift chambers that are located at different radialpositions from the target. The inner chambers, called “Region I”, surround the target in a region of low magnetic
field. The “Region II” chambers are somewhat larger and are situated between the toroidal magnet coils in a regionof high field, while “Region III” chambers are large devices located radially outward of the magnet. Achieving thedesign goals for an accuracy of better than 0.5% in momentum and angular resolution of ≈ 1 mrad requires tightconstraints on the gas mixture within the chambers. These constraints are discussed in detail in the User Manual andOperation and Safety Procedures (OSP) for the Hall B Drift Chamber Gas System [2] and require control and/ormonitoring of the flow rates, mixture, pressures, temperatures and contaminant levels of the gas.
There will be two levels of control in the gas system. The basic flow control loops and alarm system will behardwired at one level. At a higher level, the system described in this paper will control and monitor the gas systemin such a way as to allow:• Safe operation of the gas system.
• Remote monitoring of signals.
• Remote control of system elements.
• Ease of use via a graphical user interface (GUI).
• Detection of anomalous operational modes, alerting the users of such situations and, where possible,
executing automatic procedures to ensure personnel and hardware protection.
• Archiving operational parameters for future restoration and analysis.
• Automation to handle the processing of very large numbers of signals.
The drift chamber gas system control has been identified as one of the highest priority components of the Hall B
control system [3, 4].

Figure 1. Exploded view of the CLAS showing the magnet and the various detector components.
THE DRIFT-CHAMBER GAS SYSTEM
The gas system has been designed to meet the stringent requirements outlined in the User Manual and OSP for theHall B Drift Chamber Gas System [2]. A schematic of the system is shown in Fig. 2. The basic gas system
operation consists of mixing, filtering, monitoring, and recirculating (Regions II and III) the gas. When raw gas
arrives on site, it is analyzed using a residual gas analyzer (RGA). Once accepted, it is cleared for use with theCLAS drift chambers. During steady state operation, two fresh gases are precisely mixed to achieve the correct
relative fraction. The newly mixed gas is stored in large buffer volumes that supply the process loop that contains
the CLAS drift chambers. The pressure and percentage of ethane in the gas in the buffer tanks are continuously
monitored. As the mixed gas enters the loop, it is first filtered to remove contaminants. An adjustable orifice thendrops the pressure and controls the flow. For fine tuning of the gas mixture, additive bubblers are then provided as
an option. Directly following the bubblers the oxygen and water content and the temperature and flow rate aremonitored before the gas leaves the shed for the hall. As the gas enters the hall, it passes through heat exchangers todamp temperature fluctuations. The gas then enters the chambers where it serves its purpose. At the chamber exit
manifolds, the gas passes by safety bubblers. Downstream of the manifolds, the gas temperature and differential
pressure with respect to atmosphere are monitored. This pressure reading is transmitted back to the shed where it
controls a proportioning solenoid valve in front of a pump. The pump and “throttle valve” pull gas out of the hallwhile controlling the pressure in the chambers. Once back at high pressure again in the shed, oxygen and water
monitors continuously monitor contaminant levels. Finally, a fraction of the gas is exhausted and the rest reenters
the cycle above the filters (Regions II and III).

Figure 2. Prototype of the main window of the graphical user interface for the CLAS drift chamber gas system
controls. A schematic of the gas system is shown with digital displays to present the analog information.
The various sensors are powered and monitored with three different hardware controllers that have local readout andprogramming capabilities. The flow controllers and transducers are operated with two MKS 647A mass flowcontrollers. Pressure sensors are controlled with three MKS 146B pressure gauge controllers. A Panametrics
hygrometer is used to monitor temperatures and the concentrations of oxygen, water, and ethane. All of these
instruments have RS-232 interfaces for remote control and monitoring. Analog signals are also available for manyof the parameters. The instruments have programmable alarms that produce signals that are 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 isbypassed automatically with electronically actuated valves immediately before and after the chambers. These safety
features are hardwired and under no software control. The computer control system is needed to monitor parameters
and alert the operator of abnormal conditions so that they may be corrected to avoid hardware-activated shut downs.
The system is also needed for remote control of the hardware and archiving of parameters for analysis.

THE CONTROL SYSTEM
The control system is being developed within the framework of the Experimental Physics and Industrial Control
System (EPICS) [5]. A schematic of the control system hardware is shown in Fig. 3. The operator interface (OPI)
is a Hewlett Packard workstation with an X-windows GUI. The input/output controller (IOC) is a Motorola MV
162 single board computer running the VxWorks operating system and mounted in a VME crate. The crate also
contains two XYCOM XVME-560 analog input cards and a Green Spring IP-octal 232 industry pack.
Communication between the OPI and the IOC is accomplished through ethernet with the EPICS network
communication software called Channel Access. The system includes RS-232 interfaces to the two mass flow
controllers (MFC), the three pressure controllers (PC), and the hygrometer (HYG).

Analog Signals
The analog signals from the gas system instrumentation
will be continuously monitored with the VME ADCs
operating in the 32-channel differential input mode.
Device and driver support routines for the XYCOM
XVME-560 have been obtained from the SSC and arerunning on our EPICS development system after somemodifications. All of the analog signals are being
configured for data logging and many for alarms.

Figure 3. A schematic of the control system hardware
showing the operator interface (OPI), the input/output
controller (IOC) and the low-level hardware controllers.

Figure 4: A schematic of the RS232 software interface

RS-232 Interfaces
Remote control of the hardware and verification of theanalog readings will be accomplished through the RS232 interfaces. The RS-232 device support software has
been written and tested for the flow and pressure
controllers. The device support for the Panametrics
hygrometer will be developed in the near future. Anoverview of the RS-232 software interface is illustrated
in Fig. 4. Standard EPICS analog output records areused to send commands to the device support.
Commands without special parameters use a common
analog output record, while those with special
parameters each have their own analog output record.
The device support is split into synchronous andasynchronous parts. This is necessary because EPICS
is a synchronous system that cannot wait for a slow
asynchronous device to process commands and respond.
The synchronous device support is essentially asimulated synchronous device. It utilizes two Tx pipes,
which are standard data structures in the VxWorksenvironment; one to send commands and one to receiveresponses. These pipes communicate with theasynchronous device support, which is essentially aninfinite loop that continuously checks the output pipefor a command. The asychronous device support isspawned as a task in VxWorks, and it is what actuallycommunicates with the device. Once a command isfound, it is converted into an ASCII string of a format
acceptable to the device. The asynchronous support
then waits for a response from the device. Once it isreceived, the response is placed in the other of the Txpipes, where it can then be removed by the synchronous
device support. Having been removed, the response isplaced in a standard EPICS string input record. If anyerrors are encountered, the device support will instead
place an appropriate error string into the record. Oncein this record, the response can then be accessed by theGUI.
Graphical User Interface
The GUI is being developed using an EPICS tool called
the Motif Edit and Display Manager (MEDM). The
main screen of the GUI will consist of a schematic of
the gas system with the analog information presented indigital displays. A prototype of this window is shown in Fig. 1. Along the bottom of the main screen will be amenu to bring up windows for the different RS-232 instruments. These lower level screens include buttons, which
are connected to the analog output records and send commands and text displays connected to the string input records
for the responses. Examples of these screens are shown in Figs. 5 and 6.

Figure 5: The GUI screen for the mass flow controller.

SUMMARY
A control system is being developed with EPICS for the drift-chamber gas system for the CLAS detector at CEBAF.
The gas parameters will be continuously monitored and configured for alarms and data logging. Remote control ofsystem elements will be accomplished through RS-232 interfaces to low-level hardware controllers. Information
will be passed efficiently to and from the operator via a GUI. The design of the system is nearly complete. Device
support software has been written and tested for all the hardware except the Panametrics hygrometer, and prototype

GUI screens have been developed. Future work includes device support development for the hygrometer,
implementation of valve status monitoring, and integration with other components of the Hall B control system.

ACKNOWLEDGEMENTS
This work is supported by the U. S. Department of Energy under Contract No. DE-FG05-88ER40459 and by theUniversity of Richmond.

REFERENCES[1] Conceptual Design Report, Basic Experimental Equipment, CEBAF Report, April, 1990.
[2] User Manual and OSP for the Hall B Drift Chamber Gas System, S. Christo,W. Major, M. Mestayer, R.
Wines, and Pete Woods, Working Draft CEBAF Report, June, 1995.
[3] Hall B Slow Controls System Requirements Document Overview (SRD), D. Barker and the Hall B Controls
Group, Draft CEBAF Report, June, 1995. Information on the system can be found on the World Wide Web at
http://www.urich.edu/~vineyard /SRD.book_1.html.
[4] Commissioning the Hall B Experimental Equipment, Draft CEBAF Report, June, 1995.
[5] The Experimental Physics and Industrial Control System (EPICS) is a set of software tools originally developed
by Argonne National Laboratory and Los Alamos National Laboratory for the purpose of building distributed
control systems. Information on EPICS can be found on the World Wide Web at
http://www.aps.anl.gov/asd/controls/epics_home.html.

Figure 6: The command subscreen for the mass flow
controller.