The Control System for a New Proton Extraction Probe at TRIUMF
D.B. Morris and K.S. LeeTRIUMF
4004 Wesbrook Mall, Vancouver, B.C. Canada V6T 2A3Abstract
A motor control system was designed for the new Beamline 2A Proton Beam Extraction Probe of the 500 MeV Cyclotron at TRIUMF. The probe uses four motors for positioning the extraction foil within the vacuum tank. The mechanics of the probe use a pantograph for lowering the extraction
foil into the beam plane, which affects the radial position ofthe foil. An automatic correction of this shift was crucial toproper foil positioning.
Requirements of the system included accurate positioning, integration into the existing control system, and the potential to replace existing systems in use at a future date.
1 History
Existing extraction probes in the TRIUMF cyclotron use a
hardware based stepping motor control system. This system
uses full step activation of the motors and does not employ
acceleration. The lack of acceleration in the motor drive canlead to slipping of the motor during motion. Each motor axis
requires a shaft encoder to ensure proper movement.
Interlocking of each probe axis is controlled by relay
boxes wired to produce logic statements.
The equipment was designed and built at TRIUMF andhas worked fairly well for the last 20 years. Many of thecomponents are now obsolete and much of the equipment isdifficult to support.
2 Recent developments
Newer motor systems have used various computer systems
and a variety of control and drive modules. These include: a CAMAC based general purpose single board computer designed and built by TRIUMF running motorcontrol software in ROM. This system integrates easily
into the existing control system, and is used for manysmall motorized systems. The interface between theautonomous motor system and the control system iswith a shared CAMAC memory module.
 commercial motor control systems using stepper andDC motors. Some of these interface using RS-232C,
others are adapted to interface to the existing controlsystem.
These newer systems use acceleration in their motion algorithms to reduce the possibility of slippage. Most of thesesystems do not use encoders to read back position. They run
open loop with a possible secondary position readback using a potentiometer. There is a high level of confidence inthe motor operation, reducing the need and cost of a closed
loop control system.
3 Hardware overview
The control system computer is VME based using a Motorola MVME162-023 Single Board Computer. This computer has several useful features including:
VME Interface Provides system controller functions for
the VME enclosure and access to VME modules.
SCSI Interface Used to communicate with a local CAMAC Crate.
Flash Memory Used to store the operating system kernelin compressed form along with boot and decompressor
modules. The kernel is decompressed from here into
the main memory during the boot process.
Battery backed SRAM Used to simulate a disk drive tostore application and database files. This allows easychanges to the application by copying the new object
files from the development system. Several boot scripts
are stored here to change how the system starts up during development.
Ethernet Interface Used for communication with the diagnostic program to build and modify the database andcontrol motors during testing.
Motor control is handled by an Oregon Micro Systems
VME58-8 Stepping Motor Controller module. This VME
module has a versatile internal language for controlling single and multiple axis motions. Different acceleration anddeceleration profiles are available.
A Jorway 73A SCSI to CAMAC Crate Controller is used
to access a local CAMAC Crate. The Crate holds a sharedmemory module used by other motor systems and the Central Control System as a communication port. There are also
digital input and output modules in the CAMAC Crate used
for position encoder inputs and general purpose input/output
bits. A library of routines was written to allow ESONE CAMAC calls to be made with the SCSI interface on the Motorola computer.
4 Software overview
During development of the system, it was decided to makethe device database for the system expandable. This would
allow future additions to the system (See section 7). The
database describes all parameters for each device, including
motor parameters, storage locations, interlocks and dependencies.

4.1 Real time control
The control program runs under WindRiver VxWorks 5.2, areal-time kernel. The control program runs autonomously,
and does not use any display functions of its own. The program is written in the C language. Tasks are created to: monitor requests for motion via the shared memory inCAMAC. Each new motor command is acknowledged
and processed by the system.
 monitor motor positions and limit switches. This datais written into the shared memory in locations definedby the device database.
 monitor input bits and control output bits.
 provide server services to the diagnostic program.
There are several different devices defined for use in thesystem. These include:
Stepping motors controlled by the VME58-8.
Digital inputs and outputs from auxillary bits on theVME58-8
Digital inputs and outputs from bits in VME modules
Digital inputs and outputs from bits in CAMAC modules
Digital values from CAMAC input gatesCounters for monitoring extraction foil positions
Links to join one device to another for complex behavior

Figure. 1. Interlock Editor Dialog Box

4.2 Diagnostic display
The diagnostic display is an X/Motif application running under UNIX. The program communicates with the real time
server via Remote Procedure Calls using the Ethernet interface on the Motorola computer. The program has a client
application which requests regular updates of system statusfrom the server routine.
The diagnostic program uses a series of dialog boxes
for editing device parameters, interlocks and dependencies.
Other dialogs are used for control and monitoring of eachtype of device in the system.

Figure. 2. Dependency Relationship

4.3 Interlocks and dependencies

4.4 Outputs

Interlocking is crucial for safe operation of the BL2A Probe,and data entry and modification were carefully addressed toreduce errors. The Interlocks are implemented as a series ofAND statements ORed together. This format causes duplication of information, since the entries are not simplified, butalso allows concise descriptions. The underlying structure
allows a variable length interlock statement for each device,
both in the ANDed members and the ORed statements.
Figure 1 shows the dialog box used to describe the interlocks for the radial motor.
Dependencies describe positional interference information between different motors. There are devices in the cyclotron vacuum vessel that can collide with each other. Instead of describing these motions using interlocks, which are
one sided, dependencies describe the interaction zone between two devices, and can prevent motion if a device is ina danger zone for another device’s movement. See Figure 2.

To simplify the implementation, interlocks are also used todescribe the equations determining the state of output bits.
Bits are set true or false based on a regular evaluation of
the interlock statements associated with that bit, and the newvalue is written either to auxiliary bits on the VME58 motor
board or to CAMAC modules.

5 Integration
There is no direct access to the Motorola computer by theCentral Control System (CCS). Communication is via ashared CAMAC memory module. Most newer motor systems at TRIUMF use a standard format for command anddata transfer, and this format was kept for consistency. Position and status are written by the motor system into locationsin the memory to provide updated information to the CCS.

6 CCS XTPageThe operator interface is provided by the CCS which consistsof a mixture of DEC VAXes and Alphas running OpenVMS.
It is an X/Motif based program called XTPAGE. The data isconstantly updated and the command request monitored by
the local processor. A location in the shared memory is used
as a watchdog counter. If it stops counting, the operator will
be notified by messages.

The XTPAGE shows all relevant data for the Probe Motor System. The update rate is once a second. A slider isused to show the coupling effect of the R and Z motors. Itis our experience that limiting the variety of colors on thepage helps operators to assimilate the information. Black isused for background color to reduce glare for the operator’scomfort. Five foreground colors are used for different purposes: Coral for headings, Off-White for general text, Red
for alarm states, Green for normal states and Blue for thecurrently active state.
A pull-down menu is used for sending commands via theCAMAC memory to the local processor. After a commandis sent, further checking is done to test for the command accept/reject code. Error codes for a rejected command are
displayed on the page. Buttons are used to facilitate themost frequently used commands. To prevent executing acommand by mistake, an activate button is implemented.
Commands will only be sent if the activate button has been
pushed.
7 Future plans

Figure. 3. XTPage Display

Future plans for this system include the replacement of manyof the older motor controllers running extraction and monitor
probes in the cyclotron. Many motors can be accomodated
by the software, and a variety of different drive systems canbe supported while keeping the same interface to the Central
Control System.
Replacement of relay logic will improve reliability andaddition of motor acceleration will improve performance.