The PC Based Control System of the NAC
H.F. Weehuizen, I.H. Kohler, M.E. Hogan, P.J.Theron
National Accelerator Center, P O Box 72, Faure, 7131, Republic Of South Africa
Abstract
The NAC has been operating a PC based control systemsince 1990. Currently it consists of 30 PCs grouped intofunctions of operator consoles, instrumentation nodes anda database node communicating over an Ethernet LAN.
The PCs run the OS/2 operating system and use
LANServer to communicate over the network. The
operator consoles offer a mouse based graphical userinterface while the instrumentation nodes interface to theelectronics. The system grew to its present size from an
original pilot system as it incrementally replaced aprevious minicomputer base system which had come tothe end of its useful life. This paper looks at the design ofthe system, discusses the integration process and thedifficulties encountered in its development andintegration.

readily available. Loading is kept light to avoid theprobabilistic nature of Ethernet becoming a problem.
Currently the average loading is about 2.5% with the peakloading at about 18%. The average rate of collisions isabout one every 10 seconds, so the probabilistic

Graphics
NodeDatabase
Node

ConsoleNode

ConsoleNodeInstrumentation

Instrumentation

Instrumentation

Node

Node

Node1 Introduction
The National Accelerator Center operates a 200 MeV
Separated Sector Cyclotron and two injector cyclotrons[1].
One of the latter is a light ion injector while the other has
two external ion sources. One is an ECR source which isused to accelerate heavy ions while the other is apolarized ion source. The original control system for thisfacility was of classical design and consisted of aminicomputer controlling remote hardware which had
little or no intelligence. However this system aged and therequirements of the facility began to outgrow thecapabilities of the system.
There was thus a need to develop a new system that
could cope with the anticipated future requirements of theNAC facility.
A distributed system was chosen as it offers superiorreliability, flexibility in configuration and is readily
expandable. It is described in the next section.
2 The distributed control system
In keeping with control strategy, this system is designed
to be as homogeneous as possible. It has five separatefunctional parts namely, network, instrumentation nodes,
console nodes, database nodes and graphics nodes. Its
logical layout is illustrated in figure 1. The design choices
for this system are discussed in more detail in reference[2].
2.1 The network
This is an Ethernet CSMA/CD 10BASE5 network
which was chosen because the product was mature andFigure 1. A block diagram of the distributed systemcomponent is negligible. At this loading the transmission
delay of the Ethernet system is small [3].
The communication strategy is designed to keep thetraffic on the network low. In event driven systems,
traffic is proportional to the number of events occurring inthe system. Unfortunately when an abnormal situation
develops, a large number of state changes can occur,
generating a large amount of network traffic.
Transmission delays could then become significant attimes when good network response is needed. Thus a
combination of event and state driven philosophies isused. All operator initiated traffic is event driven
providing a quick response. The actual value readback is
partly state driven, partly event driven. If events at a nodeoccur at intervals between 1 and 15 seconds, then thecommunication is event driven. Outside these intervals,
communication is state driven, limiting traffid at highrates or indicating that a node is still active at low rates.

2.2 The system nodes
The decision to use PC compatible computers for thenodes has proved to be good . The costs have remained
low despite a dramatic increase in the performance of thehardware and they have proved to be reliable. A mix of
486 and Pentium based computers are used. The OS/2
operating system is used as it is a stable and reliable.
2.3 The instrumentation nodes

These interface to the electronics that control ormeasure the cyclotron parameters. Two interface types areused. The one is the CAMAC system while the other isbased on the 8051 microcontroller. The latter is theslightly newer system and was introduced for economicreasons.
The function of the instrumentation controller iscentered around a variable table which holds all thevalues of the parameters controlled by the node. There areseveral values for each parameter. The first group ofvalues consists of a set point reference value and an
associated reference status. The second group holds theactual value and its status, including an error status if
relevant. Further fields are used for housekeeping andlinkage requests to the variable. This forms the standard
control system software for each instrumentation node. It
communicates over the network as described above andprovides a standardized interface to all the application
software. The latter take the cyclotron related parameters
and translate these into the device specific operations toeffect the control of the hardware. Application tasks areactivated when any change to the reference group occurs.
Those tasks providing the actual value information arescheduled on a regular basis to update the actual value
data in the table.
The communications task also receives commands fromthe console nodes to control the reference value of thevariables. Before a reference value can be accessed, any
contention for access from more than one console isresolved at the node that controls the variable and is doneon a first come, first served basis.
Functions such as the acquisition of dynamic data
would be handled by a separate process as these would beapplication specific.
2.4 The console nodes
The system controls some 1500 variables associatedwith the cyclotrons. For convenience these are logicallydivided into a hundred pages so that about 20 variables at
a time can be presented on the console for access by theoperators. Joysticks and touchpanels were used on theoriginal system to provide operator input to the system.
The operating personnel were very keen to maintain thisform of interaction on the present control system but
mouse control was provided as an alternative because it
was easy to implement. With time mouse control became
the preferred method of interaction, so the joysticks andtouchpanel have now been removed. Page selection canstill be done by keyboard as this provides a faster methodof interaction than the mouse.
The console software is designed around a large
variable table which holds a copy of the information in the
instrumentation nodes together with the nodes from which
they originate. The information in this table is updated by
the transmission of the variable data from the instrumentation nodes. When a page is selected for display on theconsole, information is selected from the local tableprocess from where the commands are directed via virtual
circuits to the correct instrumentation nodes.
At startup the page layouts and variable groupings arefetched from the database node and held in memory thus
forming a local memory resident database. The latter isused in preference to a networked or disc based databasein the interests of speed.
This design has resulted in a great deal of flexibility inthe control of the cyclotrons as up to 8 consoles are
currently used in the control of the cyclotrons. This
contrasts sharply with maximum of two that could be usedin the original system where simultaneous use of theconsoles consumed all the available resources of theminicomputer system.
2.5 The database node
The NAC has had a long period during which there has
been construction, development and modification of thefacilities on the site which still continues. Therefore it is
an important criterion that the control system be flexible
and readily expandable. This is most easily met by using a
database to hold the configuration information for thecontrol system. Thus it is possible to reconfigure theparameters of the system at a single point to allow forexpansion and modification.
When the system is started, subsets of the main
database are transferred to each node of the system asrequired and remain memory resident for access by thelocal node. The console nodes each have a complete set ofthe page configurations and display formats while theinstrumen-tation nodes have a list of variables pertinent totheir respective nodes.
Another function of the database node which is still tobe developed, is to log the status of the system at regularintervals for collecting trending information and forsystem status recovery after interruptions in operation orreturn to operation at a previously used energy level. The
use of the database node is such that it is not crucial to theoperation of the system. If it did fail, operation of thesystem would continue but several important facilities
would be lost. Thus a second node is available on standby
if the primary node should fail.
Currently SQL Server is used as the database server
running with LAN Manager to provide the network
interface. As this is no longer supported under OS/2 it isin the process of being replaced with DB2/2. This is fully
network aware and so requires no supporting network
software.
2.6 The graphics nodeThis is a specialist operator interface that was designed
primarily to provide a dynamic display of the beamprofiles as derived from profile grids (harps) and profile
scanners. The latter devices are situated on the various
beamlines throughout the facility. Local instrumentation

nodes control these devices and acquire the raw data fromthem. Each scan derived from the profile devices is sent
as a packet to the graphics node where it is processed andpresented for display. Virtual circuit communication isused to provide flow control over the network as thegraphics display task is computation intensive and is thus
slower than the acquisition task.
This node provides a graphical representation of
theFaraday cups, neutron shutters and the profile monitors inthe beam lines. Their positional status is displayed on themonitor, any error conditions being indicated by the colorof the background. Further status information can beobtained by means of a pop up menu. The position of any
device can be controlled by the mouse. When the profile
monitors are inserted the data acquisition system is started
and the profile is displayed in the top two thirds of thescreen. Up to six devices can be displayed simultaneously.
Hard copy of the dynamic displays can be made on a laser
printer.
This system has been very well received by theoperators because it gives a clear indication of the statusof the devices at a glance and the control of the devices isintuitive. The performance of the system both in terms of
response to operator commands, indicated response andrefresh rate of the dynamic display is far superior to thatof the original system. The refresh rate when two or lessdevices are displayed is such that a delay has been
inserted between scans to slow down the display to makeit more readable for the operators.
3 Integration
Installation of the system had to be done duringscheduled service periods. The only suitable times
available are a three week shutdown period in January
and a one week shutdown period in July. Thus only asection of the system could be integrated during eachperiod. The process was divided into six stages which
took three years to complete. Control remained available
at all times on the original system while the present
system was integrated. Where CAMAC is used, it waseasy to arbitrate between the old and the new systems atthe CAMAC level as the standard supports more than one
source of computer control. The newer interface does nothave this facility, but they require a local processor tointerface to the original system via CAMAC. Thus theoriginal local processor was replaced by theinstrumentation node of the present system. The node wasthen also interfaced to CAMAC, retaining the link to theoriginal system.
Except for the instance of dynamic data acquisition, noattempt was made to avoid control conflicts between theoriginal and the present systems. Few problems arose as aresult of this. Those that did were secondary effects andwere eliminated by disabling control of those functions on
the original system. The only instance where the complexity of control was such that the facility had to bedisabled on the original system before commissioning on
the present, was that for the control and display of thebeam profile information. The process of changing over
was very simple and took only five minutes to effect.
The operators experienced little inconvenience in theprocess of installing the new system. Howeverconsiderable planning had to be done by the control
division and many hours of overtime had to be spentcommissioning the new hardware and software in thelimited time available during each shutdown.
4 Conclusions
The new distributed control system has proved to besuccessful. The use of personal computers throughout thesystem has been justified as they have proved to bereliable and extremely cost effective. The chosen
operating system has also proved to be reliable, mostproblems arising from lack of familiarity and lack ofadequate time for fully testing the application software
owing to very severe time constraints during installation.
The system has proved to be flexible and easilyexpandable with no deterioration in system performanceas the system has expanded.
Machine parameters are readily available for systemanalysis and diagnostic purposes. Specialist programs formachine optimization can now be readily interfaced,saving significantly on development time.
References[1] G F Burdzik et al, Proc. 11th Int. Conf. on Cyclotrons
and Their Applications (Ionics, Tokyo, 1986)
pp. 422-425.
[2] H F Weehuizen et al, Proc. 13th Int. Conf. on
Cyclotrons and Their Applications (World Scientific,Singapore, 1993) pp.656-659.
[3] H F Weehuizen et al, Proc. 7th IFAC Workshop on
Distributed Computer Control Systems (Pergamon,London, 1987) pp. 73-77.