Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

KEKB accelerator control system

Nobumasa Akasaka, Atsuyoshi Akiyama, Sakae Araki, Kazuro Furukawa, Tadahiko Katoh*, Takashi Kawamoto, Ichitaka Komada, Kikuo Kudo, Takashi Naito, Tatsuro Nakamura, Jun-ichi Odagiri, Yukiyoshi Ohnishi, Masayuki Sato, Masaaki Suetake, Shigeru Takeda, Yasunori Takeuchi, Noboru Yamamoto, Masakazu Yoshioka, Eji Kikutani KEK, High Energy Accelerator Research Organization, Oho 1-1, Tsukuba Ibaraki 305-0801, Japan

Abstract

The KEKB accelerator control system including a control computer system, a timing distribution system, and a safety control system are described. KEKB accelerators were installed in the same tunnel where the TRISTAN accelerator was. There were some constraints due to the reused equipment. The control system is based on Experimental Physics and Industrial Control System (EPICS). In order to reduce the cost and labor for constructing the KEKB control system, as many CAMAC modules as possible are used again. The guiding principles of the KEKB control computer system are as follows: use EPICS as the controls environment, provide a two-language system for developing application programs, use VMEbus as frontend computers as a consequence of EPICS, use standard buses, such as CAMAC, GPIB, VXIbus, ARCNET, RS-232 as field buses and use ergonomic equipment for operators and scientists. On the software side, interpretive Python and SAD languages are used for coding application programs. The purpose of the radiation safety system is to protect personnel from radiation hazards. It consists of an access control system and a beam interlock system. The access control system protects people from strong radiation inside the accelerator tunnel due to an intense beam, by controlling access to the beamline area. On the other hand, the beam interlock system prevents people from radiation exposure by interlocking the beam operation. For the convenience of accelerator operation and access control, the region covered by the safety system is divided into three major access control areas: the KEKB area, the PF-AR area, and the beam-transport (BT) area. The KEKB control system required a new timing system to match a low longitudinal acceptance due to a low-alpha machine. This timing system is based on a frequency divider/multiply technique and a digital delay technique. The RF frequency of the KEKB rings and that of the injector Linac are locked with a common divisor frequency. The common divisor frequency determines the injection timing. The RF bucket selection system is also described. r 2002 Elsevier Science B.V. All rights reserved.

PACS: 29.20

Keywords: Accelerator control; Control computer system; EPICS; Safety control system; Timing system

*Corresponding author. E-mail address: tadahiko.katoh@.jp (T. Katoh).

0168-9002/03/$ - see front matter r 2002 Elsevier Science B.V. All rights reserved. PII: S 0 1 68 - 9002(02)01786-2 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 139

Overview The guiding principles of the KEKB control computer system are as follows: The KEKB accelerator control system [1–6] (1) use EPICS as the controls environment, consists of: (2) provide a two-language system for developing (1) KEKB accelerator control computer system, application programs, (2) KEKB timing distribution system [7,8], (3) use VMEbus as frontend computers as a (3) KEKB safety control system, and consequence of EPICS, (4) KEKB communication system. The TRI- (4) use standard buses, such as CAMAC, GPIB, STAN communication system [9] is used as VXIbus, ARCNET, RS-232 as field buses, the KEKB communication system without and any significant changes. (5) use ergonomic equipment for operators and scientists. The system design started in 1993. During the years 1993 and 1994 we have designed system and On the software side, we adopted interpretive evaluated several existing control computer soft- languages, Python [15,16] and SAD [17], for ware environments, such as the EPICS [10–12], writing application programs. They are suitable Vsystem [13] and NODAL [14]. We have con- not only for making programs for operations but cluded that EPICS is a feasible and cost-effective also for accelerator studies. By their nature of solution for the KEKB control system. The interpretive languages, we can easily obtain higher advisory committee in the KEKB accelerator reliability and flexibilities in modifications, ease of department also supported this conclusion. The syntax checking, and short turn-around times. first portion of the control computer system, The whole system was developed by close including the server workstation, the network, relationships with link-persons. The link-persons and 15 VMEbus-based computers were installed in are interface people in the hardware groups who March 1997. The full system installation finished are responsible for controlling the equipment of in March 1998 and the KEKB accelerator their groups. For software design and program- commissioning was completed by the end of that ming, we have hired 4–5 engineers from a year. company outside of KEK. They are very powerful While the KEKB accelerators were being in designing, coding, and making documents mounted in the tunnel where TRISTAN Main concerning the software. Accelerator operations Ring (MR) was installed, there was a control are also performed by out-sourcing. computer system for TRISTAN distributed in the local control rooms. We had many CAMAC modules connected to various TRISTAN equip- 1. System design ment. In order to reduce the cost and labor for constructing the KEKB control system, we 1.1. Functional requirements decided to reuse as many CAMAC modules as possible. For RF and vacuum monitoring and The control-system design must be looked at controls, we are now using CAMAC modules from as many points of view as possible. Usually, after overhauling them. However, we had the suppliers of the system and the users tend to changed electrolytic capacitors in the power have different points of view. Therefore, we first supplies of CAMAC crates, and also changed all started to review the functional requirements of of the cooling fans mounted in the chases and the control system for the KEKB accelerators. The racks. Some groups, such as the Beam Monitor, hardware groups that install the accelerator Magnet, and Beam Transport groups, decided to components to be controlled want to monitor the use a completely new configuration and new magnet current values, the voltages of the power equipment for monitoring and controlling their supplies and so forth, and if a failure occurs they hardware. want it to be reported and recorded as soon as 140 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 possible. The operations group wants to record the was installed about 1 year before that. The basic operations sequence of the accelerators and to system for hardware and software development have tools to analyze previous operations and to was installed at the beginning of 1997. It included make correlations between the parameters and the a workstation, VME computers and X-terminals measured values for tuning purposes. Accelerator as operator consoles. Another constraint was that physicists need connections between the beam- there were only a dozen people in the KEKB monitoring, simulation and beam-correction sys- controls group. tems. The principal functional requirements are as 1.3. Basic design concepts follows: Considering the requirements and the con- (1) All the data that can be taken should be straints stated above, the basic guidelines are to taken. use: (2) All the data taken should be saved for later analysis. (1) the so-called Standard Model for the accel- (3) All the operations should be recorded for later erator control system, inspection. (2) international standards for the interfaces (4) All the machine parameters and data about between the three layers, to facilitate later the machine components should be saved in upgrading and maintenance, the database. (3) international standards such as CAMAC, (5) The control system should be operator VME, VXI and GPIB as the interfaces friendly. between the control system and the equipment (6) The programming system for application to be controlled, programs should be programmer friendly. (4) products either from international collabora- (7) The overall response time to an operator’s tions or that are commercially available, to request should be less than a few seconds, minimize the manpower and effort required, ideally 1 s; unless progress of the process is (5) the object-oriented technique or abstraction indicated. to hide the hardware from application pro- grammers, (6) high-speed networks to connect the computers 1.2. Constraints with each other to get a quick response, (7) and the link-persons system, as in the con- The KEKB accelerators are reconstructed ma- struction of the TRISTAN control system, in chines; there were many constraints in construct- which the link-persons make the equipment ing the control system economically and database and code device drivers for the efficiently. The first of them was CAMAC. We application programs because they know the had already accumulated a large number of equipment best. CAMAC modules in the TRISTAN control system, and CAMAC was still thought to be the Finally, we decided to use EPICS as the KEKB only well-defined standard for interface modules control system environment, and joined the EPICS that could be used for process input/output. A few collaboration. new CAMAC modules were added. On the other hand, it was necessary to replace mini computers 1.4. System architecture more than 10 years old with the latest technology. There was no constraint to introducing a new The control computer system is divided into software environment, because all of the applica- three layers—presentation layer, equipment con- tion programs had to be newly developed. trol layer and device interface layer—as shown in Because the final commissioning of KEKB was Fig. 1. The first two layers are divided function- scheduled to take place in 1998, the control system ally, but are connected with each other through an N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 141

To CATV Laborator y Network System Server Workstation

Alarm, Logging, Database, Console, Gateway Display

FDDI Network Switch

X-Term X-Term X-Term X-Term Consoles Presentation Layer

F/E F/E Ethernet Equipment Control VME VME Layer IOCs

CAMAC CAMAC Device Interface Layer

CAMAC CAMAC

Fig. 1. System configuration.

FDDI switched network. This is because the 1.4.1. Presentation layer network traffic between the presentation layer OPI, the presentation layer, includes operators and the equipment control layer computers is consoles, a database manager, a simulation expected to be dominant. There is also a possibility computer, alarm generation/recording, a data of adopting a distributed shared-memory network logging, display and a gateway to the KEK in- to obtain fast data transfer, and event transmission site network. All of the functions are performed by among the computers. The presentation layer the server workstation. A relational database which is called an Operator Interface (OPI) in management system, ORACLE 7, runs on the EPICS is composed of several workstations and server workstation and keeps all information about 20 X-terminals used as operator consoles. concerning KEKB, including the machine para- The main network is an FDDI-switched network meters, equipment specifications and location. The that has a node at each local control building, simulation is performed by the accelerator design where an Ethernet segment is extended. The workstation for such purposes as orbit correction. equipment control layer consists of about 100 Faults in the equipment are monitored by each VME Input/Output Controllers (IOC) distributed IOC and reported to the server for broadcasting around the KEKB rings. Each IOC is allocated to and recording purposes. The data logging pro- a hardware group so as to avoid any conflicts grams collects data from various IOCs for later among groups or users. The final layer, the device analyses. Some display output from the server interface layer, has standard modules, such programs are converted to the standard TV signal as CAMAC, GPIB and VXI. There is a special format and transmitted over the KEKB site interface for controlling the magnet power through the CATV network and other media. supplies. Most of the X-terminals are PCs running X-server 142 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 emulation software. Macintoshes and Microsoft

Windows PCs are used for this purpose (Table 1). Total

1.4.2. Equipment control layer The equipment control layer consists of IOCs exp. that functionally control the equipment of each hardware group. Each IOC is a VME computer equipped with CAMAC serial highway drivers and other standard field-bus driver modules. The operating system for the equipment control computer is VxWorks.1 Several types of processors on the VME processor boards are used. MC68040, MC68060, PowerPC603 and PowerPC750 are used according to the requirements. The software programs for these IOCs were cross-developed and generated on an EPICS server workstation.

1.4.3. Device interface layer There are several field buses for the lowest device interface layer. There are CAMAC crates and CAMAC modules which are re-used from TRISTAN. The CAMAC crates are connected by CAMAC serial highways. There are also other standard field-bus equipment, such as GPIB. VXI modules are used for beam-position monitors and fast signal measuring systems, like beam-feedback systems. There are about 800 BPMs, and the electronics for them are in 20 sub-control rooms around the ring, where the VXI system is used. More than 2200 magnet power supplies are installed in eight power-supply rooms around the ring. These power supplies are controlled through ARCNET, which was specially designed for them. A Power Supply Interface Controller Module (PSICM) is plugged into each power supply and exchanges signals and data with the power supply, and the VME IOC. Schematics of the power supply control configuration are shown in Fig. 2. BPM Feedback SOR Control Timing Operation Magnet Mover QCS

2. Control consoles Linac AR Beam monitor Beam transpt. Control Magnet RF Vacuum Physics The operator consoles of the KEKB accelera- —1———5 — — — 7 1 ————— tors will be described in comparison with the former TRISTAN accelerator control consoles. þ

1 VxWorks is the name of a real-time operating system and a Table 1 Number of VME modules in the KEKB control system CPU/subrackARCNET 3CAMACDIO — 11Event trans. 3Event 27 recvr. 6— —GPIB 11 — 10 — —Modbus — — — — — 3 2 — 20 1 — — — — 7 8 8 — — 4 — — 61 — 62 — — — 1 7 — — — 1 1 — — — — 1 1 — 1 — — 44 — — — 9 — — — — — 10 — — — 8 8 — — 1 13 — 9 — — 8 11 — — — 13 — — — — 2 — — — 43 1 58 9 — 18 — — 107 — 1 21 9 77 registered trade mark of Wind river Systems, Inc. MXIRASTotal — 3 12 — 11 37 46114 269 28 1 1 — 5 46 8 4 3 — 1 4 — 1 3 — 1 71 — 9 40 — 10 — 4 — 33 1 — 57 8 13 — 2 1 42 468 103 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 143

Steering Magne t SYNC Power Supplies

IOC

VME-ARCNET

VME Power Supply Ethernet Control Module

ARCNET

~100m

Fig. 2. System configuration of the steering magnet power supplies control.

The construction policy of the KEKB operators’ X-terminals are used as man–machine interface console is flexibility [18,19]. For TRISTAN, devices. Application programmers using MEDM, there were several sets of identical console SAD and Python run on the server workstation in desks made of iron frames in which two touch- the system, which output information on the panels, two graphic display monitors, and ten X-terminals. TV monitors were packed. Each set of console was directly controlled by a mini computer in 2.1. Console design concepts the TRISTAN control computer network. On the contrary, in the KEKB control system, all In the KEKB control system, consoles are the man–machine interface devices are based on provided as flexibly as possible to reply to any the X-window system and application software requests from the KEKB accelerator commission- runs on a UNIX server workstation. Therefore, ing team. Only several large tables are distributed the number of X-window devices, such as in the central control room, as shown in Fig. 3. X-terminals, Macintosh and PC/AT compatible PC-based X-terminals are placed on large tables PCs with X-server software, is limited only by ð4:0m 1:6mÞ and the latest 15- and 18.1-in. the capacity of the UNIX server and space. Low- Thin-Film Transistor (TFT) Liquid Crystal Dis- cost Network Stations [20] are introduced as play (LCD) monitors and keyboards are placed on X-terminals with a single screen. A Macintosh them. Because these LCDs are light in weight and or a PC can have up to four multi-screens, thin, they require only a little space. Wireless and works as multiple X-terminals with only a keyboard and mouse sets are also used partially, set of a mouse and a keyboard. For space and which makes the table clean and simple. Because ergonomic reasons [19], we adopted TFT flat- of the nature of a new accelerator like KEKB, panel displays, which are thin and light in weight; many people want to operate it and conduct they reduce the reflection of light. For the same studies during the commissioning period. All of reason, a cordless keyboard and a mouse were also them want to use their own X-terminals in the introduced. CCR. There are more than 30 general-purpose X- In the EPICS environment, the system is terminals, including Macintoshes and Windows centralized as far as operation is concerned; PC running X-terminals. 144 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

Fig. 3. Layout of the KEKB control consoles.

2.2. Ergonomic design realized by using a Network Station. It is a thin PC, which allows emulation software of various Previous TRISTAN consoles were made of protocols, such as X-Window and IBM 3270, can iron-framed racks, and various devices were be downloaded and operated. A Network Station mounted in them. In order to keep the operators has no disk drive or fan, and is completely from any reflected images of the light sources on maintenance free. Various types of TFT color the round surface of the monitors, the lighting in LCD monitors are used. An 18.1-in. monitor the control room was limited in both strength and displays an SXGA (1280 Â 1024 pixels) screen, direction. It was so dark and the operator needed and a 15-in. monitor displays an XGA (1024 Â 768 to have a lamp stand when he wrote the logbook. pixels) screen. There are NTSC color TV monitors By using flat display monitors, like LCDs, the as used to display the usual TV signals. The latest reflection problem could be eliminated and we LCD monitors have a characteristic of wide could make the room as bright as in an office viewing angles of more than 1201: room. The brightness gives us benefits of easiness For IBM PC/AT compatibles, we adopted a and comfort when reading and writing. PCI-bus graphic display controller board. It can display 1–4 SXGA screens at one time, and it is 2.3. Console equipment possible to have a Windows screen with 2560 Â 2048 pixels with true color. For a Macintosh, There are many PCs (IBM PC/AT compatibles conventional PCI graphic cards can be added to and Macintoshes) used as X-terminals. Most of obtain more screens. Because we have many the Macintoshes are equipped with 2–4 display keyboards and mice along with connecting cables, cards to support multiple screens. Multiple-video- they are sometimes tangled or tied together. We display controllers can be installed into Windows adopted sets comprising a wireless keyboard and PCs and one can use 2–4 screens. By using mouse for IBM PC/AT compatibles. For a multiple-screens, you can display much more Macintosh, a USB-to-PS/2 converter can be information than single-screen, and are not over- employed to utilize the same keyboard and mouse lapped, but on separated windows. The most set. For the common display use in the central beneficial merit which we obtain is that the use control room, we had been using 27-in. color TV of multiple-screens decreases the number of monitors for years. Some of them were damaged necessary keyboards and mice, thus allowing more as well as obsolete. Therefore, we replaced them by space for logbooks, etc. Low-cost X-terminals are 40-in. plasma display monitors. A plasma display N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 145 monitor is thin (about 15 cm thick) and light PCs Laboratory Network (about 30 kg) compared to a CRT display of 27 in. (about 60 cm deep and 50 kg in weight). Operators’ Consoles acsad KEKB Accelerator Operation Beam Optics Simulation

102 IOCs 3. Computers and network KEKB Control Network

3.1. System configuration: client/server architecture Real-time Control abco1 abco2

KEKB & PF-AR Accelerator Operation IOCs located in the local control rooms collect EPICS Software Development the raw data. They, as a data server, also reply to Relational Database requests mainly from the client programs on the Fig. 4. New system configuration of server workstations. server workstations in the central control room. Operations and data analyses are performed by these server workstations; the outputs are dis- played on the screens of the X-terminals. to cover the Photon Factory Advanced Ring (PF- AR) storage ring as shown in Fig. 4. This server 3.2. Network has two 440 MHz PA-8500 processors, 1 GB of memory and a 36GB system disk. Two server In the KEKB control computer system, an workstations work together to control KEKB and FDDI switched network is used to connect the PF-AR simultaneously. IOCs at local control rooms to the central control room. The distance between the local control 3.4. VME IOCs rooms and the server workstations in the central control room is from 50 to 2050 m: Multi-mode There are about 100 IOCs distributed around optical fiber cables are used for connections of less the rings in the local control rooms. Each IOC is than 2 km; and single-mode ones are used for equipped with a VME subrack, a plug-in power- more than 2 km: In the local control rooms, there supply module, a plug-in cooling fan unit, a system are 100 base TX or 10 base T Ethernet segments. monitoring module and a VMEbus board compu- At each local control room, there is a terminal ter module. Two CPU architectures are used in server for serial ports of the IOCs. this system, namely the MC68k and Power PC architectures. Old MC68040 CPU and MC68060 3.3. UNIX server workstations CPU boards are still used and provide sufficient computing power for some applications. New In the KEKB control computer system, there is Power PC modules of PPC 603e and PPC 750 a UNIX server workstation of PA-RISC architec- are used for more computing power-consuming ture with 4 CPUs. The clock frequency of the applications. The console port of the CPU module server is 100 MHz and the main memory capacity is connected to the terminal server and can be is 2 GB: The system hard disk has a capacity of accessed through the KEKB control network. 4 GB and an external RAID disk has a 20 GB The IOCs were carefully designed to realize high capacity.2 A server workstation for accelerator maintainability. The electric power for the VME simulations is also used for accelerator operations, subrack is supplied by a 250 W power supply communicating with the EPICS server. During the module which is plugged-in from the front side. year of 2000, another server workstation was The system monitoring module monitors the introduced as an extension of the control system power-supply voltages on the backplane, and sends alarm messages through a dedicated serial communication line connected to the terminal 2 Recently, we also added 9 GB internal disk. server. This module can generate a system reset 146 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 signal on the backplane for re-booting the IOC in and the control system remains with few modifica- the VME subrack upon a request to the re-boot tions. Therefore, CAMAC modules are also reused command from the serial communication line. after overhauling the CAMAC crates and racks. This function is very effective and helps the link- Cooling fans in the crates and racks were all persons to develop and test new software or replaced by new ones. The electrolytic capacitors EPICS database. The fan unit seems to be the used in the power-supply units of the CAMAC weakest point of the IOC system. This is the only creates were all replaced by new ones to prevent component that has moving mechanical parts. The future failures. rotating speed of the fan is controlled by the A CAMAC serial highway runs within a local temperature of the air coming out through slots. building to obtain a simpler configuration and Further, the fan unit can be removed and ex- good response time. The data-transmission rate is changed with a new one from the front side in a 2:5 Mbps in the bit serial mode. few seconds. 4.2. VXIbus

4. Field buses The beam monitor group developed VXI modules for measuring about 800 beam positions, The VME computers provide field buses. They and 6VXI main-frames are used in each of 20 are used to obtain more suitable interfaces to the local control rooms. Each position monitor has 4 equipment. In other words, the VMEbus is used electrodes and connected to a 4-input multiplexer only for providing field buses. The VMEbus VXI module, of which the output is cascaded to is designed to transfer digital signals between the next stage multiplexer module; a DSP module the CPU and peripheral modules, and is not is used to detect the beam position. suitable for handling high-precision analog signals. We decided to use field buses for isolation, both 4.3. ARCNET functionally and electrically. The field buses that we have adopted are: a ARCNET is used to control the magnet power CAMAC serial highway, ARCNET, GPIB, Mod- supplies. The ARCNET controller chip has a very bus Plus, and RS232. We had many CAMAC nice feature, that the chip, itself, manages the Modules used for TRISTAN accelerators. RF network configuration automatically and dynami- acceleration system uses almost all the CAMAC cally; namely, it detects any errors caused by modules used for TRISTAN RF control system. removing a node or incomplete communication Some parts of the beam-transport control system and modifies the network configuration by sending and vacuum-control system also use CAMAC a reconfiguration packet to other nodes. After modules. ARCNET is used mainly to control the reconfiguration, the network communication is magnet power supplies. GPIB is used mainly for recovered without the node that caused an error. magnet current measurements and to control the Also, if a new node is added to the network, the vacuum equipment. Modbus Plus is used to newcomer sends a packet, which is detected by monitor the status of the safety control system. other node, which sends a reconfiguration packet MXIbus is used for interfacing VME IOC with to the members, and the network is configured VXI modules. dynamically. It gives us live-insertion/deletion of ARCNET nodes. 4.1. CAMAC system 4.4. GPIB As mentioned above, there are more than 2000 CAMAC modules still being used mainly for GPIB is used to connect measuring instruments controlling the RF and vacuum equipment. to the KEKB control system. There are digital High-power RF sources, themselves, are reused voltmeters used to measure magnet currents. For N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 147 some remotely located equipments, LAN-GPIB These EPICS tools, or CA client software, are interface controllers are used by connecting to an configurable through specific configuration files. In Ethernet. many cases in the applications of EPICS, standard EPICS tools can satisfy needs of the system. 4.5. RS-232 However, once the requirements exceed the ability of these tools, we need to find some way to extend Some devices are equipped with RS-232 serial the capability of these tools. These are mostly communication line interfaces. For them, we written in compiler languages, such as C and/or provide RS-232D interfaces from the VME IOCs. C++. However, it does not prevent us from An example is the mass-spectrum analyzers in the extending these tools; the extending process is in vacuum control sub-system. RS-232 is also used to general time consuming. In an experimental communicate with the PLCs. Device/driver sup- facility like an accelerator for high-energy physics, port routines for these PLCs have been developed quick application development is required. To based on Ascii/serial driver/device support rou- solve this dilemma, we introduced the use of tines developed by Jeff Hill and Allan Honey for interpretive languages in the KEKB control the KECK Observatory. system. We discuss the details in Section 5.4.

4.6. Modbus Plus 5.1. EPICS environment

Several kinds of PLC devices are used in the The first version of EPICS installed in the KEKB control system. Among these, the PLCs computer of the KEKB control group for evalua- which talk the Modbus Plus protocol are used in the tion was EPICS release 3.12.beta11. Currently, magnet protection systems and the radiation safety the KEKB control system uses EPICS release system. While these systems are managed by the 3.13.2 with minor modifications for the KEKB PLCs locally and autonomously, the interlock status control system; we plan to change 3.13.5 in the should be monitored on the console in the central near future. Because EPICS 3.12beta11 just control room. A set of software has been developed supported the Motorola 68K family CPU board, in order to interface these PLCs to EPICS. It has the we had to port EPICS 3.12beta11 and later standard structure required for the device access versions to a CPU board based on a PowerPC, layers of EPICS. It consists of a device support and a which is widely used in the KEKB control system. driver support. The device support deals with the Most of the code in EPICS can be used for both processing specific to the Modbus Plus protocol. 68K CPUs and PPC CPUs without any modifica- The driver support [21] interfaces directly with the tion; however, we have to resolve any problems hardware and handles physical I/O requests. caused by the architecture and compiler differ- ences [22]. Concurrent Version System (CVS) [23] is used to keep track of any modifications to the 5. Software system software. Device drivers for Modbus Plus [21] and The KEKB control system adopted EPICS as a ARCNET [24] were written to support these basis of control software. EPICS provides basic field buses in the KEKB control system. CAMAC functionality, including periodic scanners, event modules are controlled by using device drivers scanners and the network protocol called Channel and device support routines in the EPICS dis- Access (CA). It also provides CA client applica- tribution, except an ADC module in KEKB. This tions, such as an application to monitor any ADC module, designed and used for the TRI- alarm-status change, an application to record STAN accelerator control, uses MSB of 12-bit control data into permanent storage for later long data as a sign bit. We therefore needed to analysis and applications to construct operator develop a device support routine for this CAMAC interface displays. module. 148 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

5.2. EPICS database types developed for the KEKB control system. Analog Input (AI) and Analog Output (AO) CapFast is used as a graphical tool to design the records are dominant record types, which occupy EPICS database. For a simple database, a text about half of the records population. editor, such as EMACS, is also used. A large part of the EPICS database down loaded onto IOCs is 5.3. Relational database generated from the dbLoadTemplate command using a template database designed by CapFast, We are using relational databases to manage the and parameter files generated from an ORACLE data used in the accelerator control system [25], database (see Section 5.3) (Fig. 5). such as hardware addresses. The KEKB database The EPICS runtime database in the KEKB is used to generate the configuration files for the control system has more than 270,000 records in EPICS runtime database. The logical design of total. It uses 51 record types, including 15 record the KEKB database is based on Entity-Relation

Console Terminal Color Printer A3 Printer X-Terminals Server

FDDI-Ethernet Bridge FDDI-Ethernet Bridge

FDDI Concentrator

Server VME Workstation FDDI Switch Computers

Central Control Room Timing Computer, etc.

26 Local Stations Network

Terminal FDDI-Ethernet Server Bridge & Hub

IOC CPU Module RS-232C Module CAMAC Serial Highway Driver VME-MXI Controller GPIB Controller System Monitor Module Magnet Power Supply Interface Power Supply VXI Main Frame Measuring Instruments Magnet Power Supplies Measuring Instruments CAMAC Serial Highway Fig. 5. Schematic configuration of the KEKB accelerator control computer system. N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 149

(ER) diagrams. We use ORACLE as a relational tools of the EPICS system, which displays opera- database manager. An ER diagram is converted to tion panels, menus and other objects on a display an ORACLE database using a commercial tool. window. The configuration file of MEDM is The device information database for the KEKB named ‘‘*.adl’’ Each configuration file type has accelerator control system is created by this its own generator in the KEKB database. These method. generators are written in SQL*PLUS language.

5.3.2. EPICS database generation 5.3.1. Automatic generation of EPICS files We expect over 100,000 EPICS records in the The KEKB database system automatically KEKB control system. It is not feasible to fill out generates several types of configuration files used every field of these records by hand. Some in EPICS system, as listed below: automation is necessary. We describe EPICS (1) EPICS Database. template records using CAD software ‘‘Capfast’’ (2) MEDM File (*.adl). (Fig. 6). Template files may include EPICS macro names. When this template database is down- An EPICS database is a file to be downloaded loaded onto IOC, a macro name is substituted by into each IOC (IOC: Input/Output Controller, a an actual value. The KEKB database provides a VME computer), which contains the configuration pair of the EPICS macro name and the EPICS of the runtime database on the IOC. Motif Based macro value. ‘‘dbLoadTemplate’’ (EPICS tool) is Display Manager (MEDM) is one of the client used for downloading a database.

Fig. 6. An example EPICS database as CAPFAST schematic. 150 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

5.3.3. MEDM files generation compiled language with Fortran-like syntax and To generate MEDM files, we use EPICS extensions for a real-time system. PCL is used parameter files as intermediate files. We make mainly to develop data modules in Nodal to access MEDM template files, which include EPICS hardware. Most of the user interfaces and applica- macros, using MEDM as a graphical panel editor. tions in the TRISTAN control system were written Finally, we generate a configuration file for control in NODAL mainly by accelerator physicists. This windows by some tools described in UNIX shell kind of ‘‘two-language’’ system is widely seen in script or ‘‘awk’’ language. successful computer systems [31]. Unix, for exam- ple, has shell scripting languages and C. Elisp and 5.4. Interpretive languages C in the EMACS is another good example. This observation suggests that a successful user extend- 5.4.1. Two-languages system able system has (at least) two programming In the control system for a high-energy accel- languages, an interpretive language and a com- erator, like KEKB, quick application development/ piled language. modification is required. A short turn-around In a two-language system, a compiled language time is especially important during commissioning is used to extend the capability of the interpreted of an accelerator. MEDM and/or EDD/DM language. This extension is modular so that (EPICS Display Editor/Display Manager) are users can add or delete this extension at anytime. useful development tools for such a purpose. A The interpreted languages are used as glue to user of MEDM can build a graphical user inter- combine these modules. This approach is also face screen without any conventional program- useful to avoid a fat application which includes ming. However, some high-level applications may everything (Fat software). Modular design of not fit in this framework. In the KEKB control software also makes development/test/mainte- system, we have achieved this goal by introducing nance easier. interpretive programming languages, Python and Another advantage of a ‘‘two-language’’ system SAD, into the control system. SAD is a language is the participation of users. An interpreted originally developed at KEK for accelerator lattice language usually has simpler syntax and is easy design. The other, Python, is a general-purpose to learn and use for people, including NON- language system distributed as public-domain professional programmers. In KEKB, application software. These languages are used not only for programs which require knowledge of accelerator prototyping applications, but also for developing physics are written by accelerator physicists. In application software used in daily operation this case, there is a large overlap in users of an [26,27]. These languages are easier to learn and application and its developer. This reduces over- safer to use compared to compiled languages, such head of communication between the user and the as C or C++. The interface to the appropriate developer. They use mostly SAD [17] language widget library from these interpretive languages, because they use it for their research anyway. such as Tk/gtk+ widget, greatly reduces the effort Python is used to develop an application where an needed to develop graphical user interfaces. accelerator model is not required. Hardware Modular and object-oriented features in the engineers and accelerator operators can develop languages allow an incremental development of there own applications to simplify their own daily application software [28,29]. This method bene- tasks. The clean and simple syntax of Python fits the reliability and maintainability of the makes learning it easier. Although there are several software. textbooks on Python in English, only a couple of The TRISTAN control system uses NODAL these [15] are available in Japanese. These text- [14] and Process Control Language (PCL) [30] for books and a Python tutorial translated into software development. NODAL is an interpretive Japanese, which is available on WWW [32], were language with Basic-like syntax and features used at KEKB. Self-training with these texts is specific to a distributed control system. PCL is a sufficient to start using Python. Users can also find N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 151 a SAD/Python/medm/java control program functions. By default, PythonCA registers the launcher. socket associated with the channel to the file descriptor manager of the Tk library. 5.4.2. Python A Python–EPICS interface has been developed 5.4.3. SAD to utilize a scripting language, Python, in the SAD is the name of an accelerator modeling KEKB control system as a one of the two program and its programming language. The languages described in the previous sub-section. syntax of the SAD programming language is Python is an object-oriented scripting language designed after the Mathematica programming developed by G. van Rossum. The clear yet language [34]. These two programming languages powerful syntax of Python is suitable for rapid are almost compatible with each other, except for application development. A Tk widget is inte- a few points. The largest difference is the symbolic grated with Python as a Python object. It allows a manipulation of expression. Mathematica was user to access Tk widgets from Python in a originally developed for it, while SAD cannot seamless way, and makes it easier to develop and handle it. For the numerical handling of mathe- maintain a Python program with Graphical User matics, SAD may in general be faster. Interface (GUI). In the original implementation of Tk widget Another advantage of Python is the ‘‘module’’. interface was used to be routed to an embedded Functions and classes in the module can be Python/Tk interface. However, the current SAD imported into a Python program as a library. can call the Tk widget library directly. Modules can be either written in Python or C. This The EPICS interface in SAD supports open/get/ module structure allows the developer of a Python put/monitor functions. A monitor callback func- program to convert a Python module into a C tion can be written in SAD, itself. module without affecting the client applications of Most of the beam-handling applications are this module. Well-defined API to access Python written by accelerator physicists in the commis- program data type from a C program helps to sioning group. These applications, including a develop a C module. It is also possible to create a beam-orbit control program and a beam-collision module from an existing C program using Simple control program, were registered to an application Wrapper and Interface Generator [33] (SWIG).3 launcher program, ‘‘kbl’’. SWIG can generate a wrapper program for Python from prototype declarations in C, automatically. 5.5. Portable channel access server A wide range of modules are available for Python, including an ORACLE interface, a To operate KEKB accelerators, tuning of the PosgreSQL interface, Unix libraries, WWW/ linac as the injector for the KEKB rings is thought HTML support libraries, X windows, Tk widgets, to be very essential. Ideally, the KEKB control and Gtk widgets. Numerical Python provides system can control both KEKB rings and the many linear algebra functions. linac. Also both operators in linac control room The EPICS interface in Python, PythonCA, and in KEKB control room should be able to consists of two modules. One is a C module, ca.c, monitor and adjust the equipment of the other and the other is a Python module, ca.py. The C accelerators. For that purpose, we had to develop module provides basic access to the CA library, suitable method in between the two systems to including open/close, get/put, and monitor. It also communicate with each other. In EPICS colla- supports synchronous group operation at the borations, there is a portable CA server for EPICS Python level. A monitor callback function is also developed at Los Alamos National Laboratory for defined as a Python function. The Python module, SUN workstations. We decided to modify it for ca.py, defines a channel object and other utility our purposes, and have been implementing it to the KEKB control system step by step [35]. 3 URL: http://www.swig.org We can now monitor and set the magnetic field of 152 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 the Q-magnets in the linac, control the beam- database. It is also useful to have utility programs transport magnets in the linac beam line, control to generate screen-configuration data for a man– klystrons, and measure the beam positions by machine interface program, MEDM. For these strip-line monitors through EPICS. purposes, tools were designed and developed. A tool named CreateLinacDatabase was developed. 5.5.1. Connection of two control systems It generates a linac parameter configuration file To connect the KEKB control system and the Linac.conf, which in turn is converted to an existing linac control system, a gateway must be EPICS database file using dbLoadTemplate, a provided between the two systems. In the first case, database template file. Another tool, CreateLinac there is an IOC dedicated to the linac, which keeps AdlFile, generates a screen description file for the database of the parameters and values of the MEDM. linac equipment. In the KEKB case, the total number of channels is estimated to be very large, 5.6. Future operating system on IOCs and is too much for an IOC. Therefore, this method may not be realistic. On the other hand, a gateway The operating system on the IOCs is VxWorks. workstation is provided in the configuration in the This operating system is not an open system, but a second case shown in Fig. 7. The functionality of proprietary one. Recent trends concerning soft- the EPICS CA is realized by a portable CA server ware operating systems indicate that open soft- implemented in the gateway workstation. The ware, like Linux, will be the main stream. EPICS is EPICS portable CA server was designed and now ported to a Linux operating system by M. developed by members of EPICS collaboration Kraimer at Argonne National Laboratory. But, society. Its aim is to integrate a control system Linux, itself, is not suitable for real-time purposes, which does not use EPICS into a control system and limited application programs can run on based on EPICS. A UNIX gateway computer will Linux. For real-time applications, we surveyed be placed between the two systems and will on the so-called real-time Linux, such as RT translate messages between the two languages; one Linux, L4-Linux, and other implementation of is EPICS and the other is a protocol specific to the Linuxen. We have chosen L4-Linux as a base of non-EPICS system. The CA protocol was imple- software to test the idea of EPICS on Linux with a mented as a set of C++ classes. A user can easily real-time scheduling kernel [36]. extend CA server classes using an inheritance L4-Linux is a port of a Linux kernel on top of a technique to build a custom-made CA server. real-time micro-kernel, named L4, or its successor, named fiasco [37,38]. In this system, Linux as well 5.5.2. Implementation of a CA server as its processes run as an independent task We have tested the two approaches described scheduled by a real-time scheduler in L4. L4-Linux above. In both cases, an EPICS record database is was developed while aiming to run a real-time automatically generated from the equipment system and a time-sharing system on a single computer, and hence L4-Linux in itself is not a real-time system [39]. However, its basic architec- KEKB CA Clients Linac Console ture allows Linux processes, with some modifica- tion, to be turned into a real-time process that Linac Main Controls Linac CA Server serves time-critical events. The point here is that the real-time process can share its virtual address space with other normal Linux processes to Linac Sub-Controls KEKB IOCs communicate. This is an advantage in porting IOC core programs, which are based on a multi- Linac Equipment KEKB Equipment threading scheme [40]. In addition, the real-time Fig. 7. Schematic configuration of portable channel access processes can be connected to a hardware interrupt between KEKB and injector linac control systems. through only L4, thus avoiding Linux involved in N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 153 the decision of process dispatching on interrupts. are those for small magnets, like steering magnets. This feature enables IOC application developers to To connect such a large number of power supplies implement device drivers as a user-level applica- to the IOCs, we adopted ARCNET as a field bus, tion, even if they utilize hardware interrupts. In and developed the Power Supply Interface Con- order to evaluate the feasibility of this scheme, we troller Module (PSICM) [41], which is an ARC- have ported a CAMAC driver of EPICS to an L4- NET interface board for the power supply. A Linux-based system running on a PC-compliant PSICM has the shape of 3U Euro-card format VME CPU board. We have also measured the ð100 mm  160 mmÞ with a DIN 64-pin connec- interrupt response of the system with heavy disk I/ tor, and can be plugged into the power supply O activities as a background, using the same CPU (Fig. 8). The ARCNET allows the use several board. The measured interrupt latency was about kinds of media. We adopted a Shielded Twisted- 800 ms; which is considerably lower than the value Pair (STP) cable as the media and HYC2485 as the of several tens of milliseconds expected in normal media driver. This configuration allows up to 20 Linux [36]. We expect that the latency can be ARCNET nodes to be connected on single further reduced, down to around 100 ms or less. segment in a daisy-chain manner. The STP cable includes an auxiliary twisted-pair for the external trigger signal other than for ARCNET use. The 6. Power supply interface controller module maximum number of ARCNET nodes is 20 in one segment, and is limited by the error rate of the The number of power supplies used for two communication. Sometimes ARCNET reconfi- accelerator rings is more than 2200. Most of them guration occurs in some conditions affected by

Fig. 8. Photograph of the PSICM. 154 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 the temperature and other environmental para- the current setting, which is caused by a delay in meters. We finally introduced an ARCNET hub to the power supply and a delay in the vacuum reduce number of nodes in a segment to obtain chamber. This feature gives us another benefit, much more stable operation. As described above, even for the asynchronous operation. For power there are several types of power supplies. There are supplies with a slow response, a proper tracking unipolar and bipolar power supplies, new and curve makes current setting faster without any modified old ones, 12 and 16bits in accuracy. The overshoot than linear tracking. To make applica- required specifications for such power supplies tion programming simple, the magnet power are widely distributed. We decided to design the supply control system requires that a control software installed on the PSICM which can parameter can be given not only by current in recognizes what kind of power supply is con- ampere, but also by some abstracted parameter of nected. In other words, each power supply must beam optics, such as K1 for a quadrupole magnet, have its unique type and serial number data in K0 for a steering magnet, etc. We generically call itself. While ARCNET and PSICM reduced a such parameters ‘‘K-values’’ for simplicity. great deal of wiring cost, there are other control paths between the IOCs and subsystems of the 6.2. Functions of PSICM magnet power supply system [24,41]. The power supply output current is monitored by a digital Since the PSICM has a microprocessor, it is not voltmeter with scanner. They are connected to the only an ARCNET interface board but also an IOC using GPIB. There are 274 magnet power intelligent controller. The control program is supplies for the KEKB injection beam-transport stored in EPROMs on PSICM. It provides lines. They are also controlled in a similar manner. advanced functions of the power supply. The PSICM provides the following three functions: (1) 6.1. Functional requirements and design generating control signals to the power supply for single actions such as power on/off, interlock reset Although the KEKB storage rings do not and a polarity change; (2) setting the output require any synchronous ramping of magnetic current; and (3) sending the status of the power fields for acceleration, synchronous operation of supply and the PSICM, itself. The status can be the magnet power supplies is still important. For sent periodically on demand or when specific efficient beam handling, the beam optics should be status is changed. The PSICM communicates with changed without loosing the stored beam. To an IOC through ARCNET. The elemental unit of achieve this, the magnet power supply control communication is a ‘‘message’’. The message from system has two features. One is the synchronous an IOC to a PSICM is called a ‘‘command’’. More operation of PSICMs. A PSICM can receive an than one command can be packed in single external trigger signal to start current tracking. ARCNET packet. The message from a PSICM The external trigger signal generated by the IOC in to an IOC is only the status with a fixed format. To the central control room is distributed to the IOCs set the output current, the PSICM writes a digital in the local control rooms through the software value to a Digital to Analog Converter (DAC) in trigger system [8]. From an IOC to PSICMs, the the power supply. There are three tracking modes trigger signal is sent through an auxiliary twisted- and two trigger sources. The tracking modes are as pair in STP cables for ARCNET. Using an follows: (1) the direct output mode: the output external trigger signal, PSICMs can start tracking current is set directly to the DAC without synchronously within 0:1 ms or less. The other tracking. This mode is only for diagnostics of the feature is a flexible tracking curve. The PSICM is DAC and PSICM, itself. (2) The constant slewing designed to receive arbitrary tracking data. This rate mode: the output current is changed with feature is useful for fine synchronous operation. linear tracking. The PSICM receives the target By using a proper tracking curve, it is possible to current and the time of the tracking duration from compensate for the delay of magnetic field against the IOC and writes a linearly interpolated value to N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 155 the DAC every 1 ms: This mode is mainly used for magnet power supply at KEKB. Most of the stand-alone tests of the power supply. (3) The control logic is concentrated in the PS-record and wave-generator mode: the output current is programmed in C. changed with an arbitrary tracking curve. The PSICM receives tracking data as an array of 6.3.3. Parameter conversion currents from the IOC, then sequentially writes The most complicated logic is current setting. them to the DAC every internal clock interval, Since an application program may request current which can be a multiple of 1 ms: This mode is used setting in terms of a K-value, middle-level software for usual operation. The constant slewing rate must have parameter conversion logic using some mode and the wave-generator mode require a information, such as a magnetic field excitation trigger to start tracking. The trigger source is curve. The parameter conversion is typically either a ‘‘start’’ command sent from the IOC carried out in the following manner: (1) a K-value through ARCNET or an external trigger signal is multiplied by the beam-line momentum to yield sent through the auxiliary twisted-pair. an integrated magnetic field strength. The momen- tum is kept in an EPICS software record. Each 6.3. Power supply control software storage ring or injection beam transport line has such a momentum record. (2) The integrated 6.3.1. Driver level software magnetic field strength may be modified by a Low-level software is EPICS driver support and ‘‘fudge’’ factor and a fudge offset. They are EPICS device support in the IOCs. The driver introduced to correct the magnetic field excitation support is designed to perform communication curve in an empirical manner. (3) The integrated through ARCNET. The elemental services of the magnetic field strength is converted to current driver support are transmitting and receiving using a magnetic field excitation curve. Each PS- single packet. Inside the driver support, packets record has the characteristic parameters of the are queued. There are a transmission queue and a excitation curve of its own magnet. receiving queue for each power supply indepen- dently. The device support is designed to provide two kinds of services. One category includes the 6.3.4. Asynchronous operation services dedicated to the PSICM. Each service Asynchronous operation of current setting is an corresponds to the single command of the PSICM operation on a single power supply independently such as power on/off, interlock reset, etc. Using of other power supplies. For this operation, an these services EPICS records which perform the external trigger is not used. A PS-record provides single action can be easily created. Other category four methods of current setting. One is called includes general purpose services which perform ‘‘Direct Setting’’, in which current setting is carried single packet I/O. They are nearly same as ones in out regardless of magnetic hysteresis. The other the driver support. Using these services, although three methods are ‘‘Standardize Setting’’, ‘‘Simple EPICS record support should directly encode or Standardize Setting’’ and ‘‘Sequence Setting’’. In decode messages on an ARCNET packet, it is these methods, the regular hysteresis loop is more rather convenient when a record issues various or less considered. To set a lower current by commands sequentially. Sequence Setting, for example, the current first goes up to the maximum current, and then keeps 6.3.2. Middle-level software the maximum current for a moment. Next, it goes Middle-level software provides various logic to down to zero current, and then keeps zero current the power supply system. Most of them are for a moment. Finally, it goes up to the target resident in IOCs using a EPICS runtime database, current. Thus, unless Direct Setting is used, the which is a collection of the EPICS records. Each magnetic fields is kept on a regular hysteresis loop. power supply has a large special record, called a These methods are particularly useful for magnets PS-record, which has been developed only for in the injection-beam transport lines. 156 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

6.3.5. Synchronous operation has 33 channels downward and a few channels Synchronous operation of current setting is an upward. The frequency range is not popular now operation on more than two power supplies in Japan and the equipment is now obsolete. simultaneously without loosing the beam in the Therefore, we are going to use the KEK in-site storage ring. In this operation, only Direct Setting network for distributing video information. is possible. To perform a synchronous operation, frequent negotiations among power supplies are 7.2. Information exchange system necessary. As an arbiter of them, we introduced a server process for each storage ring. It manages the There are mutual information exchange systems sequence of the synchronous operation. The server with other section in the KEK site, such as the process runs in the host computer and is pro- facility support group, the physics experiment grammed in Python. Synchronous operation is group and the photon factory group. A serial carried out according to the following steps: (1) the communication line is used to receive information server receives a request with parameters from an from the facility support group, i.e. air condition- application program. The parameters are a set ing, cooling water and electric power supplies data. of power supply ID numbers, a set of K-values to Between the physics experiment group and the be set and the time of the tracking duration. These KEKB accelerator control group, a gateway IOC parameters are passed through EPICS software is located near the BELLE detector, and informa- records. (2) The server sends the K-values to tion is exchanged through the memory of the IOC. the PS-records. (3) Each PS-record converts the Information exchange between the Photon Fac- given K-value to the current, and then estimates tory and KEKB is done mainly using video the minimum time of the tracking duration and information and an intercom. sends it back to the server. (4) The server checks the estimated minimum times. If the application 7.3. Video signal distribution system program does not specify a time, the maximum estimated times is adopted. (5) The server sends Almost all of the video signals generated around the adopted time to the PS-records. (6) Each PS- the KEKB accelerators are sent once to the central record calculates tracking data and sends them to control building for distributing them to various the PSICM. (7) Each PS-record checks the status parts of the accelerators. The signals are sent of the PSICM. If the PSICM is ready to start through optical-fiber cables using E/O and O/E tracking, the PS-record sends ‘‘ready’’ to the converter pairs. The signals which come into the server. (8) The server waits until all PSICMs central control building are buffered by amplifiers, become ready, and then the server generates an and some of them are sent to the CATV system. external trigger signal. (9) The server checks Some of the signals are sent to local control rooms whether all power supplies have started tracking. through a patch-panel. Using this system, we can record, distribute or display utilizing commercially available equipment. 7. Communication system

The KEKB accelerator communication system 8. Radiation safety system consists of a bi-directional CATV network, a mobile-phone system, a public-address system and 8.1. Overview a directly connected intercom system. The purpose of the radiation safety system of 7.1. CATV system the KEK B-factory (KEKB) is to protect person- nel from radiation hazards. It consists of an access The CATV system has been working for about control system and a beam interlock system. The 18 years, since TRISTAN was commissioned. It access control system protects people from strong N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 157 radiation inside the accelerator tunnel due to an Programmable Logic Controllers (PLCs), which intense beam by controlling access to the beamline satisfy the requirements for the safety system, such area. On the other hand, the beam interlock as the reliability, maintainability and flexibility. A system prevents people from radiation exposure supervisory PLC and two PLCs, one for access by interlocking the beam operation. The present control and the other for communication with the system was originally constructed [42] for the accelerator control system, are installed in the TRISTAN eþeÀ , and modified to meet the KEKB control building, while local PLCs requirements of KEKB. It secures not only (PLC#1–PLC#15) are distributed around the KEKB, but also the PF-AR, which used to be KEKB and PF-AR rings. The maximum distance the booster ring of TRISTAN, and is now between the supervisory PLC and the local PLC is dedicated to synchrotron photon experiments. 2000 m: For the convenience of accelerator operation and Typical local PLCs have 80 input channels and access control, the region covered by the safety 96output channels for the status read and control system is divided into three major access control of local devices, such as entrance doors and beam areas: the KEKB area, the PF-AR area, and the stoppers. Each local PLC has a 16ch output beam-transport (BT) area. These areas are sche- module and a 16ch input module for exchanging matically shown in Fig. 9. The KEKB and BT safety signals with the supervisory PLC. Because areas are separated by interarea gates, and so are the number of channels for the communication is the PF-AR and BT areas, while a concrete wall of relatively small, signals from local devices are 3 m-thick separates the BT area from the linac processed in each local PLC, and the summarized area, which is secured by another safety system. signals are sent to the supervisory PLC. These signals are transmitted by optical-fiber links. In the 8.2. System architecture case of communication errors of the fiber links, the safety system stops accelerator operation. Fig. 10 schematically shows the present safety The main operator interface of the system is a system. The core of the system consists of classical panel with key switches and push buttons

East Arc Beam Stopper Safety Magnet Tsukuba Oho Inter-area Gate BELLE Detector RF Section

KEKB Area South Arc BHR1E.1-4 BBS3 BV1E.3-4 PF-AR Area BH1AE North Arc BT Area B1E BBS2 BV1E.1-2

PF-AR BBS1 BH1E.1-5 B1P Linac BBS4 Concrete Linac Area Gun W all LER Beam Dump Fuji Nikko

West Arc HER Beam Dump

Fig. 9. Access control areas and devices for access safety. 158 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

KEKB/PF-AR Operator's Access Control System Panel Control Panel

PLC PLC

Supervisory PLC Programming Optical Fiber Links PC

PLC #1 PLC #15

Monitor PC Modem Local Local Devices Devices Bridges

Fig. 10. Architecture of the radiation safety system. for setting the system state, LED lamps for status entrances, and 18 emergency exits. Each entrance indication, and an alarm buzzer. It has the is equipped with an ID card reader and a key advantage of reliability, but the disadvantage of box with safety keys. A person intending to access inflexibility. It provides minimum information this area must put his/her ID card into the about the system status. LED lamps of the card reader. The data on the card are checked operator panel indicate whether each area is safe with a database, and if he/she is registered, a safety or not, but cannot display the status of each local key is released. The entrance door can be unlocked device. Detailed monitoring is carried out with using the safety key. He/she is required to keep color graphic displays. For example, a building the safety key during the stay in the area, and outline with doors is indicated on the display, return it to the key box when leaving. The safety showing the door positions; the status of each door system can enable/disable the key release and door is indicated by color. All of the status information release for the access control. The access procedure on local devices and PLCs is obtained through described above is the one used when they are Modem links, which are utilized to upload each enabled. An intercom and a TV camera are also PLC program developed on a workstation as well. installed at each entrance to facilitate access The access control panel is also an important control. operator interface, which is used for the access control described below. 8.3.2. Access states For the present system, there are three access 8.3. Access control system states: Free access, limited access, and no access, which are described below. 8.3.1. Entrance Free access: In general, all of the hazardous As mentioned before, there are three access components are shut down, and the area is safe in control areas: the KEKB area, the PF-AR area, this state. Even in this state, however, the entrance and the BT area. Every area has several entrances doors are locked to prevent access of non- and emergency exits. The KEKB area, for radiation workers. Radiation workers can access example, has eight entrances, seven auxiliary the area without an operator’s supervision. N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 159

Limited access: When an area is transferred to section and superconducting RF cavities in Nikko this state from the free access state, a search of the straight section. The RF operation of the cavities area must be carried out to sweep it. After a is interlocked to be off when the corresponding search, only access under the operator’s super- subsection is in the free access state. Door switches vision is allowed. To prevent access without are also included into the RF interlock to prevent supervision, the key release and door release are people from X-ray exposure during access in the disabled. When access is necessary, the operator limited access state. enables them by turning on switches at the access control panel. The operator can communicate with 8.4. Beam interlock system workers entering by the intercom and watch them on TV screens. The beam interlock system consists of emer- No access: This is a state for beam operation. gency-stop buttons, door switches, safety keys, No access is allowed. Transition to this state is radiation monitors, beam-loss monitors, and possible only when no emergency-stop button is meter relays. The main purpose of the former depressed, all of the doors are closed and locked, three kinds of devices (emergency-stop buttons, and all of the safety keys have been returned to the door switches, and safety keys) is to protect people key boxes. against radiation exposure inside the accelerator tunnel. On the other hand, the function of 8.3.3. Access safety radiation monitors, beam-loss monitors, and Safety of each access control area is accom- meter relays is to protect people outside the plished by beam stoppers and dipole magnets accelerator housing. The response of the safety (safety magnets), which are shown in Fig. 9.To system to the activation of each interlock device is make the KEKB area safe, for example, stored summarized in Fig. 11 and described below. beams in the High-Energy Ring (HER) and the Emergency-stop button: When an emergency- Low-Energy Ring (LER) must be dumped, and stop button is pushed, the safety system triggers injection to both rings must be inhibited. To the beam-abort system, and turns off all of the ring inhibit HER injection, dipole magnets, BH1AE magnets and the RF system. A beam-request and BH1E.1-5, are turned off and a BT Beam signal to the linac is removed to stop beam Stopper BBS4 is inserted. LER injection is injection. Furthermore, safety magnets are turned prevented by turning off the dipole magnet, B1P, off, and BT stoppers are inserted. When an area is and by inserting a BT beam stopper, BBS1. KEKB transferred to the no access state and beam has four ring-stoppers: two for LER, and two for operation is going to be started, an audible alarm HER. However, they are not designed to with- is sounded in the area. People accidentally left stand the high beam power of KEKB, because without a safety key can prevent beam operation their purpose is not to dump the high-current by pushing an emergency-stop button. beam, but to assure access safety. To dump a Door interlock: Every door separating an access beam, a beam-abort system is installed in each control area from other areas has an electrical lock ring, which consists of kicker magnets, a Lam- and at least one switch to indicate the door status. bertson magnet, and a beam dump. When people If a door fault is detected during beam operation, access the KEKB area, the abort systems of both the safety system sends a trigger signal to the rings are triggered first, and then the ring stoppers beam-abort system, and turns off one ring magnet are inserted into both rings. Even if a small potion of each ring. Beam injection is also stopped by of a beam is accidentally left after a beam abort, it removing the beam-request signal, turning off the is completely dumped by beam stoppers. safety magnets, and inserting the BT stoppers. In The KEKB area is subdivided into eight sections the no access state, the door release signal to the by intersection gates: four straight and four arc electrical lock is disabled. section shown in Fig. 9. Normal-conducting RF Safety key: A key box with safety keys is cavities are installed in the Oho and Fuji straight equipped near to each entrance together with an 160 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

Radiation Safety System

Access Control System Beam Interlock System

Door Lock Safety Key Radiation BT Beam Free Access Monitor Loss Limited Access Monitor No Access Enable/ Disable Emergency Stop Meter Relay ID Card Reader Warning Lamp Door Switch Intercom TV Camera Remove Gun Trigger

Turn off a Bend of Each Ring Turn off All Ring Bends and RF

Turn off Gun High Voltage

Dump Stored Beam Stop Injection -> KEKB: Trigger Abort System -> Turn off Safety Magnets -> PF-AR: Insert Ring Stoppers -> Insert BT stoppers

Fig. 11. Devices for access control and beam interlock.

ID card reader for key release. It is required for filled ionization chamber for photons. If the everyone accessing the area to take a key and to radiation level becomes higher than the preset carry it during a stay in the area. Once a key is limit, the safety system stops beam injection to the removed, the beam operation is interlocked until KEKB rings. all keys are returned. The key release is disabled in Beam-loss monitor: Beam-loss monitors were the no access state. installed in the BT area, which are included in the Radiation monitor: Although concrete shielding interlock system. If there is an accidental beam has been added along the beam line in the loss in BT, the radiation level on the ground above experimental halls, the experimental halls are still the BT tunnel may become larger than the limit. the weakest parts concerning the radiation con- Therefore, the beam injection is interlocked to be tainment, because the other parts of the KEKB off. Beam-loss monitors are also installed in the ring are covered with earth soil with a thickness of KEKB area, and are used to stop beam operation 6:7m: The shielding walls are designed so that the for machine protection. They are not included in radiation level due to beam loss under normal the safety system because the KEKB tunnel has operation is less than the acceptable limit. How- sufficient shielding. ever, accidental beam loss may cause a higher Meter relay: The current of the dipole magnet, radiation level outside the shielding walls. There- BH1AE, is monitored by a meter relay. If the fore, two radiation monitors are installed in every current of BH1AE is accidentally turned off experimental hall. Each monitor has a BF3 during KEKB injection, the beam is proportional chamber for neutrons and an air- transported to the AR injection line and lost N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 161 somewhere near the BT-AR boundary. This may divisor frequency ð10:385 MHzÞ: The common increase the radiation level of the AR area near the divisor frequency determines the injection timing. boundary. When a decrease of current is detected This section gives an overview of the KEKB during KEKB injection, therefore, the beam is timing system and the RF bucket selection system turned off by removing the gun trigger. [43].

8.5. Other hazards 9.1.1. Difference in the injection schema between TRISTAN and KEKB In the accelerator tunnel, there are various At TRISTAN a 5-bunch injection system was hazards other than the radiation. They are adopted, which means that 5 bunches of the linac electrical (high voltage, and high current), high beam were merged into a bunch of the TRISTAN magnetic field, and cryogenic hazards. The safety beam. We cannot inject multi-bunch beams in system is also useful to control the access into an order to match the low longitudinal acceptance, area with these hazards. because the KEKB ring is low-alpha machine. In the interaction region of the KEKB ring, Timing jitter between injected beam and RF there are superconducting quadrupole magnets bucket is allowed less than 30 ps: That of low- and a solenoid magnet of the BELLE detector, level control system is limited within several all of which yield strong leakage magnetic picoseconds. We thus intended to inject a single, fields. Therefore, the excitation of these magnets high-current bunch beam. Furthermore, we syn- is usually carried out after the Tsukuba chronize the KEKB RF frequency ð508:887 MHzÞ straight section is transferred to the limited access and linac frequency ð2856MHz Þ so that we can state. always catch Linac beams at the same phase of the Superconducting accelerating cavities are in- KEKB RF frequency. stalled in the Nikko straight section. The acciden- tal release of liquid helium or nitrogen in the 9.1.2. 2856 and 508:887 MHz accelerator tunnel may cause a shortage of oxygen. Although the KEKB RF frequency is not a Therefore, access is limited during operation of the divisor of the linac RF frequency, those frequencies cryogenic system. The oxygen level is monitored at have a common divisor frequency ð10:385 MHzÞ: several points along the beam line. If the oxygen Because of the existence of a common divisor level decreases below 18%, the safety system frequency, we can synchronize the KEKB RF sounds an alarm to evacuate the Nikko straight bucket timing and Linac beams at the common section. divisor frequency intervals. The linac RF frequency and the KEKB RF frequency are locked by a common divisor frequency with a newly developed 9. KEKB timing system multi-synthesizer.

9.1. Introduction 9.2. Multi-synthesizer

The KEKB control system required a new There are two types of multi-synthesizers newly timing system to match a low longitudinal developed for KEKB. We now introduce one type. acceptance due to a low-alpha machine. This Fig. 12 shows a block diagram of the synthesizer. timing system is based on a frequency divider/ The source of the synthesizer is 571:2 MHz; which multiply technique and a digital delay technique. is used with a subharmonic buncher in the linac. The KEKB timing system is slightly complicated, The frequency, 571:2 MHz is multiplied by 5 and because the KEKB ring RF frequency generates 2856MHz ; which is used as the linac RF ð508:887 MHzÞ is not a divisor of the Linac RF frequency. Simultaneously, the frequency frequency ð2856MHz Þ: The KEKB ring frequency 571:2 MHz is divided by 5 and generates a and the linac frequency are locked with a common 114:2 MHz frequency, which is also used with 162 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

275F0 55F0 49F0 x5 X

2856MHz 6F0 508.8875MHz 55F0 11F0 F0 55F0 1/5 1/11 x6

F0 571.2MHz 55F0 11F0 571.2MHz 114.2MHz 10.385MHz Fig. 12. KEKB multi-synthesizer.

Table 2 simultaneously, no problems have occurred with The reference frequencies used in KEKB ring and linac the single reference system. KEKB ring reference (MHz) Linac reference (MHz)

2856 9.3.2. Distributing the reference frequency 571.2 The reference frequency is distributed with 508.887 508.887 coaxial cables and optical fiber cables as shown 114.2 in Fig. 13 Main line which is circulated around 10.385 10.385 the KEKB ring consists of coaxial cables, which are locked with PLL in phase. The main line has stabilized within 11 around the KEKB ring. Satellite lines consist of optical another subharmonic buncher. The 114:2MHz fiber cables, of which phase stabilities match frequency is divided by 11 and generates a less than 0:2 ppm per degree in electrical length. 10:385 MHz frequency, which is a common divisor The satellite line has stabilized less than 0:51 in frequency. The common divisor frequency is total (Fig. 14). multiplied by 5 and mixed with 571:2MHz frequency, and finally generates a 508:558 MHz 9.4. Bucket selection method frequency, which is the KEKB RF frequency. All of the frequencies are connected and locked with a 9.4.1. 10:385 MHz and 2:028 kHz common divisor frequency 10:585 MHz: All re- Since the KEKB RF frequency ð508:887 MHzÞ ference frequencies are listed in Table 2. and the linac frequency ð2856MHz Þ are locked in 10:385 MHz intervals, as shown in the synthesizer 9.3. Overview of the KEKB timing system paragraph, we can inject linac beams in this intervals. The interval equals a 49-bucket spacing 9.3.1. Single reference frequency in the KEKB in the KEKB ring. Since the frequency machine ð10:385 MHzÞ divide by 5120 (KEKB harmonic Although the KEKB machine consists of two number) equals 2:028 kHz; we can inject linac rings (HER and LER), it has a single reference beams in 2:028 kHz intervals at the same bucket in frequency 508:887 MHz: We cannot change the the KEKB ring. We thus choose a frequency of reference frequency of each ring independently. Of 2:028 kHz as the basic injection frequency. We can course the phase of the reference frequency of each choose any buckets with delay timing from the ring can be changed independently. We avoided basic frequency in 10:385 MHz interval units, that the complication of a double reference system. is 49-bucket spacing in the KEKB ring. Since Since we never measure the dispersion parameters the number 49 and the number 5120 have or the chromaticity parameters of both rings no common divisor, the 10:385 MHz intervals N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 163

RRR R R D1-Lazer T 12LC7 D12 12LC8 R T R D11 D1 R phase R monitor R T D10 T T D2 T R R R R 9LC6 R Tsukuba-B4 Tsukuba-Exp. R 3LC1

RING Center R D9 Synthesizer control room R R R phase D3 monitor T PLL T Transmittor R 9LC5 D8-Light R R T R 3LC2 R Receiver R T R Fuji-B4 D8 T R phase monitor D4 T R R R T Multi-synthesizer. T R T D4-Light D7 T R D5 6LC4 D6 6LC3 T R R R R R D5-Lazer

Fig. 13. Reference frequency distribution diagram.

2856.00 MHz 571.200MHz to Linac RF 114.240MHz 10.38546MHz

clock clock 508.8875MHz clock Main synthesizer clock delay for to H-septum H-septum synchronizer delay delay for bucket selection to L-septum delay for L-septum 10MHz ref clock 1/N to grid pulser delay for grid beam pulser gate 50Hz bucket # 10.38546MHz

1/49 phase beam on/off detector change feedback changer computer phase feedback detector controller on/off 508.8875MHz

phase shift RING synthesizer 99.3921kHz 2.02841kHz 1/5120 1/49

phase shifter to KEKB RF revolution reset

1/5120 & delay & delay bunch selection trigger

Fig. 14. KEKB timing diagram. 164 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

(49-bucket spacing) times 5120 equals 2:028 kHz beam during the rise time interval, which is called interval. Thus, within a 2:028 kHz interval we can beam gap. Besides, we have to adjust the abort select any bucket addresses, as shown by timing to the beam gap when the beam is aborted. Address# ¼ modðdelay# Â 49; 5120Þ: Thus, the abort kickers are synchronized with the revolution timing that is connected the beam gap. In reverse Delay# ¼ 209 Â modðaddress#; 49Þ 9.7. Summary þ intðaddress#=49Þ: Since we introduce single-bunch injection and a frequency lock system between the KEKB ring 9.4.2. Injection phase and collision phase frequency and the linac frequency, we can inject We can match the phase between the KEKB RF linac beams within several psec jitters. We can bucket and the linac beam by changing the KEKB select any bucket address in the KEKB ring, reference frequency phase. The phase between the change the ring frequency freely without injection electron and collision timing at the timing, and inject linac beams continuously during intersection region can be adjusted by changing the next injection timing. the LER RF phase.

9.5. Frequency shift and phase lock to the linac Acknowledgements synthesizer The authors thank Prof. Shin-ichi Kurokawa At injection timing, the KEKB RF frequency for his valuable support and advice during and the linac frequency are locked at a frequency designing and constructing the KEKB control 10:385 MHz: After injection, The KEKB RF system. They also want to express their thanks to frequency can be changed in order to adjust the link-persons for their cooperation. ring circumference and in order to measure the The authors also wish to thank members of the dispersion and chromaticity parameters. When the Radiation Science Center of KEK for their help in KEKB RF frequency is changed, the frequency- constructing the radiation safety system. lock system with the linac frequency is killed. At the next injection timing, we first lock the KEKB 10:385 MHz frequency with the linac 10:385 MHz References frequency and then lock the KEKB 508:887 MHz frequency with the linac 508:887 MHz frequency. [1] T. Katoh, S. Kurokawa, Design of KEKB control system, We can thus continuously add KEKB ring beams Proceedings of the CTDCA, VECC, Calcutta, December even after frequency changing. The linac 508 MHz 6–8, 1994. frequency and the linac 2856MHz frequency are [2] KEKB Design Group, KEKB B-Factory Design Report, KEK Report 95-7, August 1995. always locked with the linac 10:385 MHz fre- [3] T. Katoh, S.I. Kurokawa, T.T. Nakamura, T. Mimashi, quency. N. Yamamoto, Control system design for KEKB accel- erators, IEEE PAC, 1995, pp. 2205–2207. 9.6. Beam abort timing [4] T. Katoh, et al., Present status of the KEKB control system, Proceedings of the ICALEPCS’97, Beijing, China, November 3–7, 1997, pp. 15–18. In order to protect insertion detectors and [5] T. Katoh, et al., Status of the KEKB accelerator control accelerator instruments, we must sometimes abort system development, in: Harima Science Garden beam in the case that the beam irradiate radiation City 1997, Accelerator Science and Technology, 1997, to the detector, or in the case accelerator instru- pp. 452–454. [6] A. Akiyama, S. Araki, J.-I. Odagiri, T. Katoh, T. ments suffer heavy beam loading. Since we Kawamoto, I. Komada, K. Kudo, T.T. Nakamura, T. introduced kicker magnets to abort beam, of Naito, N. Yamamoto, M. Kaji, T. Kitabayashi, K. Yoshii, which rise time is around 1 ms; we cannot fill the N. Koizumi, M. Takagi, S. Yoshida, KEKB control N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166 165

system: the present and the future, Proceedings of the 1999 [23] Per Cederqvist et al., Version management with CVS, Conference, New York, 1999, URL: http://www.cvshome.org/docs/manual pp. 343–345. [24] T.T. Nakamura, A. Akiyama, T. Katoh, Ta. Kubo, N. [7] T. Naito, J. Odagiri, M. Suetake, N. Yamamoto, T. Yamamoto, M. Yoshida, Magnet power supply control Katoh, Synchronization scheme for the KEKB accelerator, system in KEKB accelerators, Proceedings of the Seventh Proceedings of the ICALEPCS’97, Beijing, November 3–7, International Conference on Accelerator and Large 1997, pp. 247–249. Experimental Physics Control System (ICALEPCS’99), [8] T. Katoh, A. Akiyama, K. Kudo, T.T. Nakamura, J.-I. 1999, Trieste, Italy, pp. 406–408. Odagiri, N. Yamamoto, Performance of the timing system [25] M. Kaji, et al., Relational database system in the KEKB for KEKB, Proceedings of the Seventh International accelerator control system, Proceedings of the First Asian Conference on Accelerator and Large Experimental Particle Accelerator Conference (APAC98), Tsukuba, Physics Control System (ICALEPCS’99), 1999, Trieste, Japan, 1998, pp. 501–503. Italy, pp. 214–216. [26] T. Katoh, A. Akiyama, S. Araki, J.-I. Odagiri, T. [9] T. Katoh, S. Takeda, K. Kudo, A. Akiyama, Commu- Kawamoto, I. Komada, K. Kudo, T. Naito, T.T. nication System for the TRISTAN Accelerators, Washing- Nakamura, N. Yamamoto, M. Kaji, T. Kitabayashi, N. ton PAC, 1987:067, 1987. Koizumi, M. Takagi, S. Yoshida, Some utilities for EPICS [10] L. Dalesio, et al., Distributed software development in the toolkit, Proceedings of the First Asian Particle Accelerator EPICS collaboration, Proceedings of the ICALEPCS’95, Conference, Tsukuba, Japan, 1998, pp. 504–506. Chicago, USA, 1995. [27] T.T. Nakamura, T. Katoh, N. Yamamoto, Development [11] L. Dalesio, et al., The experimental physics and industrial of the Python/TK widgets for the control system based on control system architecture: past, present, and future, EPICS, Proceedings of the Seventh European Particle Proceedings of the ICALEPCS93, Berlin, Germany, 1993, Accelerator Conference (EPAC2000), Vienna, Austria, pp. 179–184. 2000, pp. 1865–1867. [12] W. McDowell, et al., EPICS Home Page, http://epics. [28] N. Yamamoto, A. Akiyama, S. Araki, T. Katoh, T. aps.anl.gov/asd/controls/epics/EpicsDocumentation/Epics Kawamoto, I. Komada, K. Kudo, T. Naito, T.T. General/ Nakamura, J.-I. Odagiri, M. Kaji, N. Koizumi, M. Takagi, [13] Vsystem, a software product of Vista Control Systems Inc., S. Yoshida, Use of object oriented interpretive languages http://www.vista-control.com/ in an accelerator control system, Proceedings of the [14] M.C. Crowley-Milling, et al., The NODAL System for the Seventh International Conference on Accelerator and SPS, CERN LAB II-CO/74-2, 1974. Large Experimental Physics Control System (ICA- [15] M. Lutz, Programming Python, O’Reilly & Associates LEPCS’99), 1999, Trieste, Italy, pp. 600–602. Inc., USA, 1996. [29] N. Yamamoto, M. Takagi, Dynamic execution of scripts [16] Python Home Page, URL: http://www.python.org/ on EPICS IOC, Proceedings of EPAC 2000, Vienna, [17] SAD home page at http://www-acc-rheory.kek.jp/SAD/ Austria, pp. 1883–1885. sad.html [30] PCL (Process Control Language) Manual, Hitachi Lim- [18] T. Katoh, A. Akiyama, K. Kudo, T.T. Nakamura, J.-I. ited, Japan. Odagiri, N. Yamamoto, The operators consoles for KEKB [31] J.K. Ousterhout, Scripting: Higher Level Programming for accelerators, Proceedings of the Seventh International the 21st Century, http://www.scriptics.com/people/ Conference on Accelerator and Large Experimental john.ousterhout/scripting.html Physics Control System (ICALEPCS’99), 1999, Trieste, [32] Guido van Rossum, L. Fred, Python Tutorial, Drake Italy, pp. 101–103. http://www.python.org/doc/current/tut/tut.html; Japanese [19] T. Katoh, A. Akiyama, K. Kudo, T.T. Nakamura, J.-I. Translation http://www-acc.kek.jp/WWW-ACC-exp/ Odagiri, N. Yamamoto, Ergonomics in KEKB control KEKB/control/Activity/Python/doc-j/tut-ja2.1.pdf system, Proceedings of the Workshop on Accelerator [33] SWIG: Simplified Wrapper and Interface Generator, Operation 2001 (WAO 2001), Villars-sur-Ollon, Switzer- URL: http://www.swig.org/ land, January 28–February 2, 2001, pp. 5–9. [34] S. Wolfram, Mathematica: A System for Doing Mathe- [20] IBM now calls it a NetVistaTM thin client. URL: matics by Computer, 2nd Edition, Addison-Wesley, Read- http://www.pc.ibm.com/us/netvista/thinclient.html ing, MA, USA, 1991. [21] J. Odagiri, T. Katoh, K. Kudo, S. Kurokawa, T.T. [35] N. Yamamoto, K. Furukawa, N. Kamikubota, T.T. Nakamura, N. Yamamoto, Interfacing modbus plus to Nakamura, T. Katoh, M. Kaji, T. Kitahayashi, S. EPICS for KEKB accelerator control system, Proceedings Yoshida, Implementing portable channel access server of the Seventh International Conference on Accelerator software in the KEKB accelerator control system, Pro- and Large Experimental Physics Control System (ICA- ceedings of the First Asian Particle Accelerator Con- LEPCS’99), 1999, Trieste, Italy, pp. 367–369. ference, Tsukuba, Japan, 1998, pp. 498–500. [22] J. Odagiri, et al., Performance evaluation of EPICS on [36] J.-I. Odagiri, T. Katoh, N. Yamamoto, Porting EPICS to PowerPC, Proceedings of the ICALEPCS’97, Beijing, L4-Linux based system, Proceedings of the PAC2001, China, November 3–7, 1997, pp. 240–242. Chicago, Ill. USA, June 18–22, 2001. 166 N. Akasaka et al. / Nuclear Instruments and Methods in Physics Research A 499 (2003) 138–166

[37] http://os.inf.tu-dresden.de/L4/LinuxOnL4/ [42] S. Takeda, et al., Contribution to the 1987 Particle [38] http://os.inf.tu-dresden.de/fiasco/ Accelerator Conference, March 16–19, 1987, Washington [39] http://os.inf.tu-dresden.de/drops/ DC, USA; KEK Preprint 86–126, March 1987. [40] M. Kraimer, et al., EPICS: porting iocCore to multiple opera- [43] E. Kikutani, M. Suetake, M. Tobiyama, Bucket Selector ting systems, ICALEPCS’99, Trieste, Italy, October 1999. System for KEKB, Proceedings of the seventh Interna- [41] A. Akiyama, et al., KEKB power supply interface tional Conference on Accelerators and Large Experimental controller module, Proceedings of the ICALEPCS’97, Physics Control Systems (ICALEPCS’99) 1999, Trieste Beijing, China, November 3–7, 1997, pp. 243–245. Italy, pp. 278–280.