Control System Prototype for the ISAC Radioactive Beam Facility
R. Keitel, M. Leross, and G. Waters
TRIUMF, 4004 Wesbrook Mall, Vancouver, B.C., V6T 2A3, Canada
Abstract
The ISAC ion source test stand at TRIUMF was used toimplement a prototype control system in preparation for theISAC radioactive beam facility, which is currently underconstruction. The test stand consists of an ion source, anelectrostatic beam line with an analyzing magnet, andvarious beam diagnostic equipment. The control system(approximately 300 control channels) was implemented
using the EPICS toolkit. It integrates three systems: anindustrial PLC for vacuum and ion source control, a set of
distributed power supply controllers on a CAN-bus networks
for beam control, and the beam diagnostics systems which
was implemented in CAMAC for cost and historical reasons.
Experience with EPICS, necessary extensions andintegration issues will be discussed.
1 Introduction
ISAC is a new radioactive beam facility presently underconstruction at TRIUMF. Protons from the TRIUMF
500Mev cyclotron will strike one of two hot undergroundtargets. The resulting beams of short lived radioactive
isotopes are analysed in a mass separator and transported toeither low energy experiments or to an RFQ / Drift-TubeLinac accelerator. After acceleration, these beams of short
lived isotopes are used for nuclear reaction studies, inparticular in the field of nuclear astrophysics. In order to test
and characterize different types of target-ion-sources before
use in ISAC, an ion source test facility was constructed.
The ISAC machine is only loosely coupled to the existing
TRIUMF accelerator. It was therefore possible to consider anon-evolutionary, new approach for the control systemdesign. The ion source test stand seemed to present an ideal
opportunity to build a prototype control sytem in order tovalidate an EPICS based concept. Joining the EPICS
collaboration promised to reduce in-house development andreduce overall system costs.
2 System overview
The test facility consists of the ion source at 60 kV
potential, an electrostatic beam line with six quadrupoles,
two sextupoles, two octupoles and several steering elements,
an analyzing magnet, and various beam diagnostic
equipment such as faraday cups, wire scanners, andemittance measurement stations. This translates into acontrol system with approximately 300 hardware I/Ochannels, roughly 10% the expected size of the initial ISAC
control system.
The decision to design this prototype control system basedon EPICS was made easier by the fact that most of thenecessary infrastructure was already in place so that nomajor start-up costs were incurred. For a number of years
the vxWorks kernel [1] and 680x0 based CPUs have beenused at TRIUMF by the data acquisition group and forembedded systems development in our group. Also available
were two Sun SPARCstations.
3 Hardware implementation
The control system for the test facility consists of one
EPICS input/output controller (IOC), using a VME cratewith a Motorola MVME162 CPU. This IOC controls threesub-systems, which are implemented with different I/O
hardware:•ion source, vacuum system and services•
beam optics•
beam diagnostics
3.1 Vacuum system
The vacuum system and the services (such as water, air,etc.) are controlled by a commercial PLC system in order toprovide high up-time and use the advantages of ladder logic
programming. The ion source was included with this subsystem because of the interlock requirements and costconsiderations. We chose the new Quantum PLC line from
Modicon with a model 160 CPU which is VME based andallowed easy integration with EPICS. For this sub-system,
EPICS acts in a supervisory function only.
3.2 Beam optics
From a technical point of view, the PLC approach could
also have been used to control the beam optics system, but
this would not have been cost-competitive for ISAC where
several hundred electrostatic and magnetic power supplies
have to be controlled. Instead, we developed intelligent”
power supply controller modules, which are connected
directly to the power supplies’ remote control connectors.
These controllers communicate with EPICS via CAN-bus,using a TIP810 industry pack [2] on the MVME162. With
this approach analogue signals are digitised right at theirsources and cabling and documentation costs are
drastically reduced. The power supply controller design isdiscussed in detail in a separate contribution to thisconference [3].
3.3 Beam diagnostics
The beam diagnostic sub-system was implemented inCAMAC. This decision was driven by time and costconsiderations because TRIUMF has a large base ofavailable CAMAC modules. Some diagnostic elements,
such as the TRIUMF emittance rigs were only available
packaged in CAMAC. For the ISAC facility, this sub-system
will be migrated into VME to allow for tight integration withthe front-end CPUs.
A block diagram of the control system hardware is shownin Figure 1.

Application Computer(SUN Sparcstation4)

Operator Stations(PC-Xterminals)

ISAC control ethernet

I/O Controller
Motorola MV162 CPU

PLC I/O

Ion Source
Vacuum System

CAMAC I/O

Diagnostics

Modbus+Stepper Motor Controller

CAMAC
Modicon PLC

Slitsdirect
PS controller

CAN-bus

PS controller

PS controllerFigure 1: Block Diagram of the ISAC Test Stand Control System

4 Software implementation
The software effort for producing this control system fell
into three broad categories:•using EPICS tools to configure the IOC function block
data base, operator interface screens, etc. This part did
not involve any conventional code development.
•writing C code
- to integrating the Modicon PLC system into EPICS- for the CAN-bus controller embedded program- to adapt the EPICS CAMAC system for TRIUMF- for special devices•
programming the PLC in ladder logic.
4. 1 EPICS tools
Up to now, only a few of the many available EPICS tools
have been used extensively. We selected edd/dm over medm
for building the operator interface because of the higher
performance.
As the primary tool for building EPICS databases weselected the CAPFAST schematic drawing package [4]. In
addition to the possibility of graphically visualising the IOC
code functionality we were attracted by the support for
multi-level schematic hierarchies which we implemented in
the form
Sub-system >> device >> component >> EPICS primitives.
Each schematic drawing is represented at the next higher
level by a corresponding symbol. Device functionality isconstructed from reusable components wherever possible.
To define device specific operating parameters, hardware
type, etc. macro substitution is used at the device symbol
level.
4.2 Code development
One of the attractive features of EPICS is the reduction of
conventional code development during the building of acontrol system. Only 2200 lines of C code and 160 lines ofassembler code needed to be written for the following areas:
4.2.1 Modicon PLC integration
The Modicon 160 Quantum PLC is a VME master module
which has ladder logic instructions to copy data to and from
the MVME162 dual port VME memory. In order to makethese data available to EPICS, simple device and driver
support software layers were written.
4.2.2 CAN-bus controller embedded code
Integration of the CAN-bus power supply controllers into
EPICS was straightforward as device and driver support for
CAN-bus and the TIP810 industry pack were available fromthe collaboration [5]. A simple application layer protocol forpeer to peer interaction between EPICS and the controllers
was implemented. The code for the embedded
microprocessor on the power supply controllers wasdeveloped in C with minor assembler portions. This isdescribed in more detail in ref. [3].

device behaviour..

4.2.3 CAMAC driver adaptation

5 Conclusion

The existing EPICS drivers for the HYTEC 2992 serial
branch driver were modified to support the JORWAY 73
SCSI crate controller which was used in this system. Thiswas done by replacing the hardware dependent inline codewith calls to the SCSI driver.

The experience with EPICS in this prototype system wasvery positive. Starting from zero EPICS knowledge, theISAC test stand control system was delivered within eightmonths using 1.5 person-equivalents for the EPICS part.
One additional person worked on the hardware installation
and PLC programming. With these limited resources wewere able to provide a reliable and easily understood control
system and operator interface. EPICS combines flexibility
due to extensibility at all levels with a wide base of expertiseavailable from members of the collaboration throughout theworld. We were also able to integrate existing control
software from other sources using subroutine records. Data
gathered by epics was made available in file format toanalysis software written by operators and physicists atTRIUMF.

4.2.4 Special devices
A few devices of the test stand needed faster controls thanprovided by the standard EPICS scan classes. Fast read-outloops were implemented to acquire data from free-runningbeam profile wire scanners at 3 kSamples/sec as well as fast
drive loops for the emittance measurement stations. For this,EPICS subroutine records were written using the vxWorks
auxiliary system clock.
4.3 PLC programming
The PLC was programmed in ladder logic, using Modicon's
MODSOFT programming tool. For ease of program statevisualisation in on-line mode, the program was implemented
as a linear ladder and no subroutine programming was used.
A simple hand-shake and watchdog protocol wasimplemented to ensure safe startup and synchronisation
between the PLC and EPICS. The PLC program can beswitched between simulation mode and run mode by thesupervisory system. This is achieved by using intermediatevariables instead of hardware input or output values in theladder logic. In run mode, the hardware I/O space is mapped
to these variables before executing one ladder scan cycle. In
simulation mode, this hardware mapping is replaced by theexecution of a simulation code segment, which mimics real

Acknowledgements
We would like to thanks Rozelle Wright of Los Alamos
who helped us up the EPICS build learning curve as well as
all other collaboration members who quickly responded tocries for help.
References[1] Wind River Systems, Alameda, CA, USA[2] TEWS Datentechnik, Haltenbeck, Germany[3] D. Bishop et al., contribution P155 to this conference[4] Phase Three Logic Inc., Beaverton, OR, USA[5] Andrew Johnson. http://www.ast.cam.ac.uk/~anj/epics