Accelerator Study System Based on RISC/UNIX
M Shirakata, H. Sato, T. Toyama, K. Marutsuka and D. Arakawa
National Laboratory for High Energy Physics (KEK)
1-1 Oho Tsukuba Ibaraki 305, JapanINTRODUCTION.
A mixed system using RISC/UNIX and LynxOS can provide advantages for control systems foraccelerators, due to its flexibility, calculation power and cost/performance ratio. A workstation-based
accelerator study system is planned for the KEK Photon Source (KEK-PS). The expected performance
will provide a more sophisticated environment for accelerator studies and operation. The unified dataacquisition and control system should shorten the time needed for the accelerator studies and should
produce high quality beams as a result.

COMPUTER NETWORK.
The computing environment is a distributed system, connected by a network. We can now use asophisticated network environment easily and at a relatively low cost. Since the accelerator is a large
machine, the equipment for monitoring and control has to be distributed around it, as the signals frombeam monitors are small compared with noise from such as pulsed magnets, and long cables would makethe situation worse. Such signals are collected and digitized in the auxiliary rooms round the ring andtransferred to the centre through the network.
The accelerator needs a highly-networked data handling system. In high energy physics, much effort has
been spent in developing fast data transfer systems, due to the gigantic data sets from the large
experiments which need to be transferred and processed. The spread of more general networks hasbrought the requirement for ever higher-speed data transfer and the accelerator requirements can now besatisfied by commercial firms. For the data links, Ethernet normally has sufficient speed, is reliable and isrelatively cheap. If the speed is insufficient it can easily be upgraded to a faster network, such as FDDI,by changing cards. It is also worthwhile to use the RISC/UNIX system in computers connected by
Ethernet for accelerator data transfer, rather than developing a special system oneself.
At the KEK-PS, the control system consists of a VME/satellite computer system [1], running VersaDOS
and connected by a MAP network, which gives a data transfer rate of a few tens of kilobytes per second.
Although VersaDOS was developed for distributed real-time computing environments, there is no planfor its updating and the MAP transfer rate is too slow for the increasing requirements for data transfer, so
it should be replaced in the near future. A good candidate for this is UNIX on an Ethernet systembecause such a combination gives flexibility, network advantages and a graphical user interface. Early in
1995, the LANs at KEK were almost entirely replaced to cope with the expected future requirements.
Subsequently, some workstations have been introduced to work in parallel with the VME/satellite system,
as shown in Fig.1.

APPLICATIONS.
Partial replacement of the monitor and control system has begun. We started by making a communication
port to the present VME system from the Ethernet environment. It became possible to transfer commands
and data between UNIX and VersaDOS through shared memory, but this is only temporary and is notperfect. This is the only port connecting the two systems and its capacity is insufficient for continuous
monitoring or any application that requires a large data transfer. In addition, some VersaDOS commands
cannot be invoked through this system.

The UNIX applications first took the user interfaces from the existing system. After the transformation ofthe GUI, subsequent replacement of the hardware can be made transparent to the operator. The
applications described below have become much more effective, both during operation and machinestudies. Graphical interaction already speeds up parameter changes and increases operator efficiency,
even though they are not yet complete.
Magnet Control.
The KEK-PS magnet control system has been transferred to the UNIX system and partly unified. Fig. 2shows the GUI display for the magnet cycle pattern controller.
The power supplies for the magnets are distributed in the auxiliary rooms and the excitation patterns are
given from the DAC modules located in the VME/satellite system. Ethernet has not reached all theauxiliary rooms yet, so most of the DAC modules are left on the original system. Although only the userinterface was replaced, operation became easier and more efficient, especially for the magnets for slow
beam extraction. With the screen editor, the operator can edit the magnet pattern directly on the display.
It is easy to learn and easy to use. Since all the functions were transferred from the former interface, theoperators do not have to interact with VersaDOS.
Closed-orbit correction.
The closed-orbit correction (COD) system [2] has also been transferred to UNIX. The KEK-PS main ringhas 56 beam position detectors and 28 steering magnets, in both vertical and horizontal planes. Taking
into account the lattice parameters, the required correction fields are calculated from the orbit position
data. In the early days, although the orbit was measured at 56 points, it was difficult to solve the 56x56
matrix to obtain the correction fields in a restricted time and memory space, so only half of them wereused. Now it is easy to solve it, resulting in an orbit control to within 1 mm, as shown in Fig. 3.

During accelerator studies, it is often necessary to make a bump or correct the orbit due to a change ofoperating conditions. Unfortunately, this is not simple with the existing system, since the beam position
monitors and the steering magnet power supplies in four auxiliary rooms are controlled by the VersaDOSsystem. It will take time to convert the whole system to UNIX, although most of the modules areavailable.

Injection Error Monitor.
Unlike the applications described above, the injection error monitor [3] has been transferred entirely tothe UNIX environment.
The standard data acquisition system UNIDAQ [4], which was based on LynxOS, was also available on
HP742rt/HP-RT. HP742rt is a VME board computer and HP-RT is a Hewlett Packard operating system.
The requirement for read-out capability increases with the length of the accelerator cycle and the datasize. A RISC/UNIX system has a high cost/performance ratio for data analysis and networking, but thestandard UNIX system is not suitable for fast data acquisition because it does not have preemptive
scheduling, which is required for a real-time system. A number of vendors are now offering real-time
UNIX which satisfy the above requirement.
The speed of data acquisition from CAMAC by HP-RT on a UNIDAQ system has been measured [5] tobe:
CAMAC access time - 20 µs for single action(Block action not yet supported)
Interrupt handling - 65 µs.
The injection error monitor requires the measurement of the beam position at two points in the ring,where the betatron phase advance is not a multiple of π in order to get the beam trajectory in horizontal
and vertical phase space.
A fast position monitor is shown in Fig. 4. It used four wall-current type position detectors with signal
pickups. The beam signals are stored in dual-channel ADC modules, LeCroy 6841, which have a 128 kB
memory for each channel. Four of these are used for position detection at two positions in the two planes.
The signals from these are transmitted to the HP742rt through the VME/CAMAC bus connector andanalysed to give the beam position. The data is reduced and transferred to the UNIX system, using NFS.
The cycle time of the main ring is about 4 seconds. A maximum of about 800 turns of phase space
trajectory can be traced per cycle, as shown in Fig. 5
The maximum number of traces is limited by the data transfer rate from the LeCroy 6841 to the HP742rt,
the signal processing software and the memory size of the ADC modules. In practice, only several tens ofturns are necessary to define the injection error and calculate the correction required. This monitor has
played an important part in the injection studies at the KEK-PS main ring.

SUMMARY.
The evolution in computers and networks has brought many advantages for accelerator control systems.
The time has come for the control system for KEK-PS to be upgraded, and the work has been started. The
workstation-based control system provides useful accelerator study tools. Three of these have been
implemented: the injection error monitor, the closed-orbit analyzer and the magnet pattern controller.
The last two still have some inconveniences resulting from the earlier control system. It is hoped toconvert further to the UNIX system in the near future.

ACKNOWLEDGMENTS
The authors would likr to thank Dr. J. Kishiro, M. Yoshii abd Y. Shoji for their support. We also wish tothank Dr. S. Machida for his useful discussions and suggestions. We express our gratitude to the KEK-PS
accelerator group.

REFERENCES[1] VME-COMPUTER BASED CONTROL SYSTEM FOR THE KEK PROTON SYNCHROTRON, T.
Katoh et al, Europhysics Conference on Control Systems for Experimental Physics, Villars sur Ollon,
Switzwerland, 1987, and KEK Preprint 87-91.
[2] Y. Shoji et al, Acc. Sci. & Tech. 1991, p332.
[3] Injection Error Monitor for KEK 12 GeV PS, M. Shirakata et al, KEK Report 93-11, November 1993.
[4] UNIDAQ Document Set, SDC-93-573, UNIDAQ collaboration, SSC Lab., 1993, UM-HE-93-29.
[5] VMEbus-based computer and Real-time UNIX as infrastructure of DAQ, Y. Yasu et al, KEK Preprint
94-19, May 1994.