CONTROL SYSTEM OF THE KEKB ACCELERATOR COMPLEX
K. Furukawa∗ , A. Akiyama, N. Kamikubota, T. Nakamura,J. Odagiri, M. Satoh, T. Suwada, N. Yamamoto
High Energy Accelerator Research Organization (KEK)
Tsukuba, Ibaraki, 305-0801, Japan
Abstract

KEKB Control System

The KEKB collider complex consists of high- and lowenergy rings, and an 8-GeV Linac. Some of the resourceswere inherited from the previous TRISTAN project, andalso they are shared with the Photon Factory and PF-AR
light sources. In order to realize the long lifespan of thesystem, de-facto and international standard technologies
were employed since the early stage, which have been efficiently operated. Several gateway methods were implemented in order to integrate heterogeneous sub-systems,
which are gradually converted into EPICS. Scripting languages are employed for high-level applications. The everevolving control system has enabled flexible and reliablebeam operations at KEKB for a long period.

The KEKB is a 3-km dual ring asymmetric collider consisting of 8-GeV electron and 3.5-GeV positron rings. In
order to achieve a higher luminosity, improvements are
made daily and therefore the requirements to the control
systems have changed.
The KEKB control system is a standard EPICS system(experimental physics and industrial control system) withapproximately 100 VME-based IOCs (I/O controllers) [1].
For the field interfaces, 200 VXI mainframes through MXI2 interfaces, 50 CAMAC crates through serial highways,
and 200 ARCNet segments are installed in addition to the
VME frames. Many GPIBs, RS232C devices, and PLCs
are also employed. Control services are provided by different types of Unix computers such as HP-UX, Tru64 Unix,
Solaris, Linux, and MacOSX. MacOSX computers manage
most of the data processing tasks and graphic displays.
Because of a five-year gap between the previous project
TRISTAN and the KEKB project, a majority of the software and hardware resources was reconstructed, whereassome CAMAC resources were reused.
The software for EPICS R3.13 and R3.14 applications
is developed using various EPICS development tools. Approximately 250,000 EPICS records are distributed across
100 IOCs. While many of the established hardware-related
algorithms are programmed in dedicated record types or
as record links, most of the control and operational algorithms are implemented using scripting languages such as
SADscript/Tk and Python/Tk.

INTRODUCTION
The KEK B-factory (KEKB) asymmetric electronpositron collider complex was built for the study of CP violation. Since the KEKB is a factory machine, it requires
stable and robust operation. At the same time, it has many
active operation parameters to improve the machine quality. Hence, the control system is important.
The control systems at the KEKB ring and Linac havedifferent histories and architectures in the past. The numberof accelerator components and control points of the KEKB
rings are approximately four times larger than those of the
Linac. This difference leads to slightly different strategies
in effective use of the resources.
Furthermore, during the upgrade of the accelerators towards the KEKB project, Linac had only a five-month shutdown period, while the rings had a five-year shutdown period. In reality the Linac control system had to perform
rejuvenation due to discontinuous support of the main computers and networks just before the machine was upgraded.
This caused discrepancies between rings and Linac.
Nevertheless, both the control systems have evolved inorder to meet the advancing requirements.
In the following sections, the KEKB and Linac control
systems are described briefly. Subsequently, several aspects of their evolutions are described by comparing Linac
and KEKB rings.

KEKB AND LINAC CONTROLS
There have been several control systems in KEK. The
KEKB and Linac control systems are described here.
∗ < kazuro.furukawa @ kek.jp >Linac Control System
The electron/positron Linac has been in operation since
1982; it was upgraded for the KEKB injection from 1994
through 1997 with 8-GeV electrons and 3.5-GeV positrons.
Its length is 600 m and it has 60 high-power RF stations and
400 magnets. As it was operational for the PF injection during the upgrade, it continued to utilize many components
from the previous projects.
The Linac provides beams with different characteristics
to the KEKB, PF, and PF-AR rings, and the beams are
switched more than 300 times a day. Because these rings
are factory machines, the upstream Linac is required tocarry out reliable and stable beam injection and to precisely
control the beam characteristics such as Twiss parameters,
timing, and charge. Furthermore, new operational beammodes have been added almost every year [2].
The Linac control system was revived between 1991 and1993 just before the approval of the KEKB project, andminor and gradual modifications were made during its upgrade for use in the KEKB. The control system comprises
30 VMEs, 150 PLCs, 15 CAMACs, 30 VXIs, 24 intelligent oscilloscopes, many Unix computers, and redundant
Ethernet/IP networks.
The design concept of this system was based on the useof de-facto standards such as Unix, VME, and TCP/IP and
the use of optical Ethernet/IP networks for all device controllers without any special field networks [3]. This concept
was inherited by J-PARC controls, while the use of EPICS
was inherited from KEKB controls [4].
Most of the communication in the control system isachieved by a locally developed RPC (remote procedurecall). The overall system is multitiered; the lower levelis controlled by the UDP-RPC or simple UDP protocols
in order to recover failures promptly. The upper level iscontrolled by the TCP-RPC, and a network-wide softwarebased shared memory system is provided for read-only information. The Linac API (application program interface)provides a transparent access to the UDP-RPC, TCP-RPC,
and shared memory.
It also has communication links to console systems,
utility facilities, and downstream accelerators including
EPICS gateways. The EPICS gateways are implemented inseveral methods such as soft-IOCs, portable CASs (channel access servers), and dedicated IOCs with gateway programs. Currently, the EPICS gateways are utilized for mostof the data archiving operations using an EPICS channelarchiver and a KEKBlog and for operational alarms usinga KEKB-alarm.

Operation of KEKB and Linac
Most of the operational panels are developed using
scripting languages, and those for beam operations are
written using SADscript [5].
SADscript is a Mathematica-like language whose processor is written in Fortran and has built-in interfaces for
EPICS channel access (asynchronous and synchronous),
Tk X11 widgets, CanvasDraw, Plotting, KBFrame graphic
libraries on top of Tk, numerical data processing such as fitting and FFT, inter-process communication, and SAD-core,a full accelerator modeling engine including a symplectic
beam tracking method and beam envelope capabilities [6].
SAD and SADscript are designed to perform almost all
tasks related to the accelerator and beam operation. The
Mathematica-like list-processing functions of SADscript
enable the rapid development of online operational software. Many novel concepts have been tested using suchrapid prototyping soon after the proposal. Virtual accelerators are also built using SAD in order to analyze thebehavior of accelerators with new operational parameters.

COMMUNICATION NETWORKAt the Linac, most of the communication links had tobe fiber-optic links, because the electromagnetic interfer-

ence from high-power RF pulse modulators is significant.
Since 1982, home-grown fiber optic networks with various speeds were developed. However, some of them often
failed because the fiber-optic technology was not yet established. Furthermore, the diagnosis was time-consuming as
the network topology was a loop topology.
In 1993, during the control upgrade, commercially available technologies were employed, namely, exclusive use offiber-optic Ethernet/IP networks, without any special field
networks. This step enabled us to concentrate on other important areas. The IP network also enabled us to make atransition from slow (10 Mbps) technology to an improved
one (1 Gbps) without software modifications.
During the upgrade towards the KEKB project, a redundant technology was introduced at 40 fiber-optic Ethernet
links, which ensured continuous operation of the accelerator. Employed technologies were redundant transceivers
at first, and subsequently the standard protocols of rapid
spanning-tree and HSRP/VRRP.
On the other hand, at the ring, the TRISTAN project employed a token ring network between minicomputers and
CAMAC serial highways for equipment.
For the KEKB project, the IP network was introduced
for the EPICS. Also introduced there were more than 200
ARCNet segments for various equipment controllers, 20
segments of MXI-2 interconnect for VXI mainframes, and
CAMAC serial highways.

EQUIPMENT CONTROLLERSAt the Linac approximately 300 microprocessor-based
controllers were used from 1982 to 1997. They were linked
with home-grown fiber optic networks.
After the control upgrade in 1993, PLCs (programmable
logic controllers) were employed and attached to the fiberoptic Ethernet link. Currently, 150 PLCs are utilized.
During the Linac upgrade since 1995, 30 VXI mainframes for RF measurement, 5 VMEs and 10 CAMAC
crates for timing, and 20 VMEs for beam monitors were
installed. In 2006, 24 oscilloscopes with embedded
Windows-XP 3GHz computers were introduced for 100
BPMs. These oscilloscopes enabled 10 GS/s 50 Hz acquisitions with local processing of 20 calibration parameters.
At the ring, the CAMAC served as the interface to theequipment during the TRISTAN project.
For the KEKB project, various platforms were introduced, such as 100 VME/IOC without analog processing,200 VXI/MXI mainframes for 900 BPMs, 50 CAMAC
crates for RF and vacuum, ARCNet boards for magnet,
GPIB for measurement, and PLC for interlocks.

TRANSITION TO EPICS
During the Linac control upgrade from 1991 to 1993, we
replaced old software with home-grown RPC software. It
was an unpleasant timing soon before the KEKB upgrade.
After the EPICS was chosen at the KEKB ring, several
facilities were employed to connect the Linac controls withthe EPICS.
At first, real-time processing computers, which served
both Linac RPC and EPICS IOC, were investigated and developed. LynxOS was chosen as the platform and the Linac
RPC was implemented immediately. EPICS R3.12 implementation was almost completed using pthread and posix
services in 1995. However, it was found that the funding
was not available because the control upgrade in 1993 hadjust concluded.
Then, gateways between the Linac controls and the
EPICS were developed in several ways. At first, a softwareonly IOC as an EPICS record container and a gateway program that talks the both EPICS CA and Linac RPC protocols was installed. A more efficient PCAS (portable channel access server) of EPICS-R3.12 was used since 1995.
Since 2002, several IOCs with a device support layer for
the Linac RPC were installed.
Real IOCs are also increasing such as Linux IOCs forserving PLCs for RF, magnet, and vacuum systems, Windows IOCs embedded in oscilloscopes for BPMs [7], and
RTEMS/VME for LLRF and event timing [8].
At the ring, the Nodal control environment at TRISTAN
was completely replaced with the EPICS during the KEKB
upgrade because the five-year construction time could be
utilized to upgrade the system without any beam operation. RPC/CORBA and reflective memory hardware werethe candidates as a basis of the control system replacement
as well. However, the EPICS was chosen because international collaboration was desirable and there was no manpower for system software development. The choice of the
EPICS at the SSC project was also a motive force.

SCRIPTING LANGUAGE
Both the Linac and KEKB heavily utilize scripting languages for the rapid prototyping of the beam operation.
At the Linac, Tcl/Tk language was used as a test toolon Unix computers since 1992. It was chosen as a main
beam operation tool for the commissioning of the KEKB
injection, thereby replacing the Windows environment in1997. Since then, SADscript/Tk, Python/Tk, and Tcl/Tk
have been utilized for the beam operation.
At the ring, the Nodal interpreter was utilized for the
TRISTAN operation. For the KEKB, Python/Tk covers many areas such as dynamic graphical user interfaces
or object-oriented programming, which is not covered by
MEDM. SADscript is used by operators and physicists.
During the commissioning, it was necessary to test novel
ideas within a short time. As only a few ideas are effective,
rapid prototyping is the most important and the SADscript
environment plays a significant role.

POSSIBLE FUTURE ENHANCEMENTS
SADscript will be maintained because the KEKB and
Linac cannot work without it. However, new operating
environments such as XAL-CSS (control system studio)
should be evaluated in the future.

For the EPICS, we still have hopes left to be realized.
We are working on some of them such as redundancy.
There are more areas where PLCs can be used. The
IEC61131-3 standard for the PLC software is being investigated because it may solve the software management issue
in the future.
The FPGA will also be utilized increasingly. It will serve
as a favorable platform for embedded controllers and instrumentation.
Although the complete downtime of the control system
is quite low and less than 1 %, the partial availability isoccasionally compromised. Hence, a more reliability study
is required.
Integration of the control systems is expected to advancein order to increase the reusable resources and reduce theredundant efforts. In spite of the above challenges, the basic control system is stable and mature, so that the extension of the operation software would be desirable in orderto achieve rapid improvement of the accelerator.

SUMMARY
While the Linac had slow and gradual modernization because of a lack of long shutdown for 25 years, the KEKB
made a huge and effective transition during a five-year
shutdown period with an enormous help from the EPICS
community. The both systems run without much modification ever since. We learned that the design of the accelerator control system required a balance between several
different aspects, some of which are investigated. In addition, large and small installations may require different
solutions.
The EPICS and scripting languages have brought
tremendous success to both the KEKB and Linac beam operations. The KEKB and Linac groups are expected to continue the enhancement in order to have ever-evolving control systems, which enable flexible and reliable beam operations. If we have some “phronesis” or practical wisdom,
we can solve our problems.

REFERENCES[1] N. Akasaka et al., “KEKB Accelerator Control System”,
Nucl. Instrum. Meth. A 499, 2003, p. 138.
[2] I. Abe et al., “The KEKB Injector Linac”, Nucl. Instrum.
Meth. A 499, 2003, p. 167.
[3] K. Furukawa et al., “Accelerator Controls in KEKB Linac
Commissioning”, Proc. of ICALEPCS99, Trieste, Italy, 1999,
p. 98.
[4] K. Furukawa et al., “Implementation of the EPICS Device Support for Network-based Controllers”, Proc. of
ICALEPCS2001, San Jose, U.S., 2001, p. 197.
[5] K. Akai et al., “Commissioning of KEKB”, Nucl. Instrum.
Meth. A 499, 2003, p. 191.
[6] <http://acc-physics.kek.jp/SAD/sad.html>.
[7] M. Satoh et al., “Fast BPM DAQ System Using Windows
Oscilloscope-based EPICS IOC”, these proceedings.
[8] K. Furukawa et al., “Timing System Upgrade for Top-up Injection at KEK Linac”, Proc. of EPAC2006, Edinburgh, UK,2006, p. 3071.