Automatic Prompt Gamma‐Ray Analysis System: Automation of an Existing Large‐Scale Analytical Device

The prompt gamma‐ray analysis (PGA) system installed in the Japan Research Reactor‐ 3 (JRR-3) was automated between 2012 and 2013. This automation is a good example of a large‐scale old analytical device automated in a nuclear facility. This automatic system has several useful functions, such as automatic sample exchange and analysis, automatic helium gas flow control and flow channel switching function, automatic neutron recording system, and fail‐safe function using Machine Vision, and the Internet. The analysis system was automated using a vertical revolute joint robot, control pro‐ grams, and data acquisition devices. The main control software named AutoPGA was developed using LabVIEW and the program can control all functions of the automatic system, capable of analyzing up to 14 samples automatically. In the automation, the core of the PGA system was not modified and the extremely low background level of gamma rays was maintained well; however, the efficiency of routine measurements dramatically increased. Because the instruments used in the automatic PGA system are not unique, the basic design of the system can be easily applied to other large‐scale analytical devices.


Introduction
Recently, many laboratory-scale analytical devices have been automated because most users are not analysis experts; hence, simple operation is generally very attractive for consumers. In particular, many instruments used in biology and medicine are highly automated and userfriendly. Users can execute the analysis by a mere push of a button. State-of-the art instruments can automatically analyze the data and produce sophisticated reports. In general, users never conduct the complex data analysis themselves. For example, modern X-ray diffraction systems can automatically output the structural analysis results of macromolecules using online databases for materials. Routine analysis will become easier in the future owing to the evolution of robotics, information technology, and artificial intelligence. Most laboratory-scale analytical devices will be automated in the near future.
On the other hand, most large-scale analytical devices, for example, instruments installed in accelerators, nuclear reactors, and synchrotron radiation facilities, are not presently automated because they are built for specific scientific purposes and most users are experts in their respective fields. Thus, user interface is typically neglected and overall operation of instruments is complex. Because substituting a large-scale device with a new one is difficult, existing large-scale devices tend to be used longer than small devices. Further, such large instruments are not commercially available, unlike the laboratory-scale analytical devices listed in a product catalogue and they are developed for specific purposes. Therefore, automation of such devices is preferable; however, automation is not easy because many of them are old and not designed for automation. The automation of such devices, that is, those requiring complex and manual operation, is slowly but surely progressing. In this study, one example of automation of a large-scale analytical device installed in a nuclear reactor is provided. Before describing the automation, the analytical device will be explained. Prompt gamma-ray activation analysis is a convenient and nondestructive method to determine the concentrations of many elements in bulk samples that requires the use of a neutron beam, which is generated by a nuclear reactor or an accelerator. The gamma rays emitted from target atoms are recorded within 10 −14 s after the neutron capture reaction. PGA is widely used in agriculture, earth and planetary sciences, materials science, environmental science, and archeology [1][2][3][4][5] because of its high sensitivity for specific light elements, such as boron, hydrogen, and chlorine. Because the atomic nucleus emits prompt gamma rays with specific energies when it reacts with a neutron, concentrations of elements can be determined by detecting the emitted gamma rays using a germanium detector.
The PGA system installed in the Japan Research Reactor-3 (JRR-3) was constructed in 1992 [6]. The system has achieved a very low gamma-ray background level, but it is outdated because no notable improvements have been made since its construction. In addition, the PGA system was considerably damaged by the Great East Japan Earthquake on March 11, 2011. The automatic system for PGA was developed to update the old analytical system and improve its measurement efficiency [7]. The development was conducted between 2012 and 2013 after the system was repaired following the earthquake. The location of PGA in the JRR-3 and a comparison of the system outline before and after the upgrade are shown in Figure 1.
The basic strategy for the automation of the existing analytical equipment is listed below. Please note that a field-programmable gate array (FPGA) and programmable logic controller (PLC) are intentionally not used in the automatic system.

1.
The inside of the shielding bodies of the analytical system is not modified because the measurement system is highly sophisticated and has very low background level. This property is also very important in other large-scale devices because special devices cannot be completely modified, as it is vital to maintain their original function and performance. Therefore, adding automatic functions without remodeling the core of the device is important. In addition, strict restrictions on the type and position of the sensors used as components for the automatic system exist, in particular when the sensors are used in an environment with intense quantum beams and radiation. For example, metallic components should not be exposed to neutron beams because metallic elements will be activated.
numerous add-ons, and its support of various hardware [8][9][10][11]. The considerably complex system developed in this work can be formulated based on using LabVIEW and NI hardware.

4.
The existing measurement program (Spectrum Navigator) and an old system are used according to the users' needs because the program is widely used in the gamma-ray and X-ray analysis [12][13][14][15]. To satisfy the demand, two computers and four programs, namely, Auto PGA, a communication program (PGA-Talk), Spectrum Navigator, and a robot control program, are developed. A new measurement program is not developed because many experienced users want to use existing measurement programs.

5.
The helium gas flow and flow channel are automatically controlled in the automatic system. The Teflon sample box used for the passage of neutron beams is well shielded and purged by pure helium gas to reduce the background level because the neutron cross section of helium is very small. Therefore, a large amount of helium gas is used in the activation analysis and the decrease in the consumption of helium gas is critical to the improvement of the PGA. This study improves the trade-off between the consumption of helium gas and background by using a highly sophisticated control program.

6.
Neutron flux and neutron scattering are monitored and automatically recorded using a counter/timer board. Before the upgrade, these two parameters were recorded by a thermal printer and an X-Y recorder, respectively. The condition of the measurement device should be recorded to improve the accuracy of the analysis because the neutron flux is directly related to the sensitivity of the target elements. Thus, an automatic recording system for these parameters improves the quality of measurements. In addition, the recording system is the only method to directly check the condition of the white neutron beam of the facility and the activity of the nuclear reactor. Although such a data acquisition system is typical, the shift from an analog device to digital device must be smooth.

7.
The system implements network functions. Because most modern equipment support network functions, connecting an old device to the network for more convenience and adding remote control or remote supervision. Particularly, the remote supervision through the Internet reduces the exposure dose in the case of analytical devices installed in a radiation control area. The new PGA system automatically sends e-mails and tweets.

8.
Machine Vision, an imaging-based automatic inspection technology, is widely used in many fields, for example, the manufacturing industry and agriculture [16][17][18][19][20][21]. This technology is implemented to improve the fail-safe function in the PGA system. Image recognition is one of the most effective technologies to construct an automated system, and this function can be easily used by a LabVIEW add-on. Advanced and complicated sensing can be enabled through a USB camera. In particular, Machine Vision is available to devices in which a contact sensor cannot be used, for example, inside a chamber directly irradiated by gamma rays, X-rays, or a neutron beam. Image recognition technology overcomes this difficulty by setting up a small camera outside the beam path where typical sensors cannot withstand severe conditions.
The above-described strategies can be applied not only to PGA, a special analytical device, but also to other equipment. In this chapter, automation of large-scale experimental devices is explained by referring to the development of the automatic PGA system in JRR-3.

System outline
Images of the automatic PGA system are shown in Figure 2. The new automatic PGA system is mainly composed of two personal computers (PC1 and PC2), four programs, a six-axis vertical revolute joint robot (Mitsubishi RV-3SD), and data acquisition devices. The PGA system ensures low background noise without greatly modifying the interior of the shielding body. The installation of the device inside the PGA would increase the background level, and the electronic equipment would malfunction almost instantly owing to the intense neutron beam and gamma rays. However, in this study, most of the devices and systems outside the shielding body were considerably improved. The automated PGA is shown in Figure 3. The core function of the new system is an automatic sample exchanging and measurement system, with several automatic control functions integrated into the system. Each function of the reformed system is detailed in the following sections. Figure 3. Connection diagram of the automated PGA system. The AutoPGA program installed in PC1 controls all the functions of the complex automation system and PC2 conducts prompt gamma-ray analysis using the existing measurement program and multichannel analyzer.

Software
The integrated PGA control program (AutoPGA) was developed by using the LabVIEW Developer Suite. The program runs on the Microsoft Windows operating system and is designed to easily control all functions of the PGA system with a user-friendly interface. Figure 4a shows the main screen of the program. The program is composed of seven screens, including the main screen, the neutron monitor screen, the helium flow control screen, the input/output signal screen, the Machine Vision screen, the logging and communication screen, and the error message screen. Switching between screens is accomplished by selecting the appropriate tab. Users other than administrators generally open only the main screen, and end users of the PGA use only selected functions included in the other screens. On the other hand, administrators can control all functions of the complex system by entering their password. When an administrator logs on the program, all the hidden control buttons become visible and available. This security function prevents the system from malfunctioning and mishandling by end users. Because most large-scale devices in research institutes are shared or used by many end users, the system architect should establish foolproof mechanisms in the control program.

Automatic analysis system
The automatic measurement sequence is that of the conventional manual measurement method. Samples are sealed in Teflon filters using an electrothermal sealer and hung on the center of Teflon frames with two Teflon strings. In the automatic PGA system, 14 samples are placed onto a sample stand beside the robot. Each sample frame is selected and introduced into the Teflon sample box that is purged with helium gas using the revolute joint robot.
The robot hand's design is important in the automation. There are many types of robot hands and the appropriate design should be adopted, keeping the purpose in mind. The robot hand of the automatic PGA system can not only grasp the sample frame but also expand and contract with compressed air (Figure 2b). This expansion mechanism is necessary while inserting the sample frame into the Teflon sample box because the height of the neutron beam at its center, which corresponds to the position of the center of the sample frame, is 20 cm lesser than the height of the trestle on which the robot is mounted. Although customization of the robot may be necessary for some existing devices (as the devices cannot be modified), the customization is unnecessary in most cases. There are several types of industrial robots, such as vertical-type robot, horizontal-type robot, ceiling-mounted-type robot, parallel link robot, and orthogonal robot. A vertical-type robot (RV-3SD) by Mitsubishi was selected in this study because of its reasonable price, high performance, and flexibility. When a robot is installed into an existing system, the designer must carefully consider the installation location because of the many physical restrictions. Since the shielding bodies, which are composed of iron plates and lead, cannot be modified in the case of the PGA system, there are naturally restrictions on the location of the robot. In addition, the heavy loading hatch that opens when the sample is inserted into the sample box was not automated before the improvement. The interference between the robot and the shielding bodies was carefully checked by 3D simulations using the data of the operation range of the robot, and an appropriate small robot was selected for the PGA system. Many system designers tend to choose robots manufactured by FANUC but they are virtually the same as the Mitsubishi robot. The robot was set up on the side of the shielding body and was controlled by a robot controller (Mitsubishi CR1D-700). A robot controller memorizes the operating positions of the robot and the coordinate data are taught and corrected during the trial operation. A sequence program written in MELFA BASIC V was uploaded to the robot controller through a universal serial bus (USB) port, and the controller was connected to a digital output module (NI 9477) and digital input module (NI 9426). These digital modules were controlled by AutoPGA through the USB (Figure 3).
Opening and closing the loading hatch was enabled by an actuator, which moves using compressed air and air valves controlled by a 24 V digital output signal from the digital output module (NI 9477). This module can be controlled by AutoPGA. Because there is an interlock system and the loading hatch cannot open when the neutron beam shutter is open, the interlock system was modified to be externally controlled by the computer. The physical interlock on the loading hatch was operated by a single-pole single-throw relay (NI 9481), and the relay also controlled the opening and closing of the neutron beam shutter. The lock of the hatch can be unlocked by an open signal from the relay but the lock is never unlocked when the beam shutter is opened. The fail-safe mechanism is important to prevent radiation hazards.
Another interlock mechanism was installed in the door, which was used to place the samples on the sample stand. When the electronic key was removed and the door was open, the servomechanism of the revolute joint robot was shut down and the alarm beeped. When the door was closed and the electronic key was connected, the AutoPGA sent the reset signal to the robot controller using NI 9477 and the alarm stopped. Thus, the user does not need to directly operate the reset switch of the robot controller. In addition, the door cannot be opened when the electric key is connected, thus protecting the user from the powerful robot.
The AutoPGA program developed by LabVIEW is installed in PC1 and controls the entire series of analytical operations. The user inputs a user name and the number of samples on the main screen and then clicks the start button. Then a voice message is played and AutoPGA automatically starts the servomechanism of the robot and initiates the sequence program. It then closes the neutron beam shutter, releases the interlock, and opens the loading hatch. The robot begins operation and the Teflon lid on the sample box is removed and placed on a stand. The robot selects the sample frame, introduces it into the sample box, and places the lid on the sample box. The loading hatch is closed, the neutron shutter is opened, and the measurement begins. The sample exchange requires approximately 40 s. The sequence flow of the automatic sample exchange and measurement is shown in Figure 5.

An existing measurement program (SEIKO EG & G Spectrum Navigator) is installed in PC2
and is used in the gamma-ray measurements. In the automatic analysis, a batch-processing mode is used, which calls the communication program (PGA-Talk, Figure 4b) after each measurement. PGA-Talk, also designed using LabVIEW, sends a signal to PC1 through the transmission control protocol (TCP) and the AutoPGA recognizes the completion of the gamma-ray recording and begins the sample exchange. When the sample exchange is complete, the AutoPGA sends a signal to PC2 through TCP and PGA-Talk automatically shuts down. Spectrum Navigator then begins the measurement of the next sample. Upon completing the measurement of the last sample, AutoPGA sends an end signal to the robot controller, and the robot removes the last sample from the sample box. The loading hatch and neutron beam shutter are closed, an end message appears as a popup window, and a voice message is played informing the user of the end of the measurement.
The AutoPGA program communicates with the robot controller using the 24 V digital output/ input modules (NI 9477 and NI 9426) installed in the NI cDAQ-9178. The AutoPGA sends a set of digital signals, including the sample number expressed as 4-bit data, the start signal, the last sample signal, the operation permission signal, and the robot control signals. The AutoP-GA can control all functions of the revolute joint robot when the permission signal for the operation of the robot is on. However, a user cannot control the robot in the user mode; this is only possible in the administrator mode.
Users can manually measure their samples when the AutoPGA analysis mode is switched to the manual mode to compare the effectiveness of measurement with that achieved before the upgrade. The neutron beam shutter and the loading hatch can be opened and closed by the four switches of the AutoPGA program (Figure 4), and the users can manually perform the sample exchange when the loading hatch is opened. On the other hand, users can control the hatch without the AutoPGA and the computer; state-of-the-art buttons with organic EL display are used as open/close buttons to control the air valves directly connected to the actuator.

Helium gas flow control and neutron recording systems
Before the automation, the Teflon sample box was purged with pure helium gas during the measurement, but the mass flow of helium was controlled manually. Therefore, in this upgrade, an automatic mass flow control system was developed and integrated into the AutoPGA program. The helium gas flow control panel in the AutoPGA is shown in Figure 6a. Helium gas flows into the sample box through a tube connected by a joint, and the small amount of air in the box is aspirated using a small diaphragm pump through another tube connected to the bottom of the sample box. An oxygen monitor (JKO-O2LJD2) is installed upstream of the pump, and the partial pressure of oxygen in the air in the box can be recorded by the monitor (Figure 3). The AutoPGA reads the partial pressure of oxygen through the analog voltage input (NI 9215) and automatically controls the mass flow controller (Azbil MQV0010) through the analog voltage output (NI 9263). The mass flow is also recorded by the analog voltage input module (NI 9201). When the loading hatch is opened, the flow volume is zero, and when the hatch is closed, the box is rapidly purged. The concentration of oxygen (%) and the settings for the flow volume and current flow volume are always displayed on AutoPGA program screen. The mass flow of helium is maintained between 1 L/min and 10 L/ min using three parameters: the minimum flow, upper threshold, and lower threshold. If the oxygen pressure is higher than the upper threshold, the mass flow is set at a maximum of 10 L/min, whereas if the oxygen pressure is lower than the lower threshold, the mass flow is set at a minimum of 1 L/min. The helium mass flow continuously fluctuates between the upper and lower thresholds. This system efficiently reduces helium gas consumption and contributes to the decrease in the background noise level for the gamma-ray analysis. The automatic gas flow control system also has an automatic flow switching function (Figure 7). A special stainless steel gas cylinder holder is equipped with two semiautomatic pressure regulators (Yamato TN-50B) and four digital pressure gauges (Nagano Keiki GC31) with an analog output of 1-5 V DC. Two gas cylinders can be connected to a semiautomatic pressure regulator and the regulator automatically switches the flow channel; when the right side flow channel is selected and the right side cylinder empties, the regulator automatically switches to the left side channel. The two pressure regulators are connected through a threeway valve operated with compressed air through a solenoid valve. The valve is controlled by AutoPGA according to the pressure data from the digital pressure gauges. When the automatic passage switching system is activated, the user does not need to check the regulators and the valve because an appropriate channel is automatically selected. When the empty cylinder is replaced with a full one, no operations of the valve and control program are required. However, the user can skip the automatic mass flow control system and manually control the mass flow using the pressure regulator. When the user exits the AutoPGA program, the switch of the solenoid valve upstream of the mass flow controller is automatically turned off and the helium gas flows into the bypass tube (Figure 7c). When the user opens the AutoPGA program, the switch of the solenoid valve is automatically turned on again. When the valve controller is switched to the manual mode (Figure 7d), even if the AutoPGA is running, the function of the automatic flow channel switching is nullified and the user can select the flow channel manually.
Two neutron helium-3 detectors are installed in the PGA; one is for the neutron flux and the other is for the neutron scattering. Prior to this study, the neutron flux and neutron scattering were recorded using a thermal printer and an X-Y recorder, respectively, and the pen for the recorder is no longer for sale. This old system was updated in this study using a counter/timer (NI PCI-6602) installed in the PCI bus of PC1. The neutron flux data are continuously recorded and automatically saved in Excel sheet daily by the AutoPGA. The neutron scattering is also monitored, and the data are used to check the degree of purging of the helium gas in the sample box. The neutron monitor panel in the AutoPGA is shown in Figure 6b.
It is important to monitor the flux of the neutron beam to evaluate the operation of the nuclear reactor and the accuracy of the measurement. Previously, the flux of the neutron beam was checked every morning before the start of operation but the shifting of the neutron flux during the day could not be estimated. The new system can continually record the state of the neutron beam and the measurement, thus improving the accuracy even when rapid changes in neutron flux occur. The daily neutron flux fluctuation was observed to be approximately 2.5% in an operation cycle (26 days). If the same fluctuation occurs hourly, the accuracy of the measurement may improve by 2.5%.

Machine Vision
Machine Vision is one of the most important technologies in modern automation systems and is used in many automatic manufacturing systems. Machine Vision offers many advantages; one of them is that contact-type sensors can be replaced by cameras. As aforementioned, the technology is well suited for nuclear reactors because contact-type sensors cannot be used inside shielding bodies where materials are exposed to high-intensity neutron beams and gamma rays.
AutoPGA provides imaging-based automatic inspection that is used to enhance the fault tolerance of robot operation. Images are acquired by a USB camera placed above the loading hatch. Note that the camera is not a sophisticated industrial camera but a cheap commercial product. Screenshots of the Machine Vision panel of AutoPGA are shown in Figure 8. Although there are many automatic inspection methods, edge line detection is used in the PGA system because of it is very simple and consistent. Color inspection cannot be used in this case because the Teflon lid and sample frame, the objects to be detected by Machine Vision, are in the Teflon sample box and there is no clear difference in color between the white objects and the white box. In edge detection, the detection area is set in advance, as shown in Figure 8c. When the Teflon lid is in the normal position, the Machine Vision inspection system can detect the two horizontal edge lines of the handle of the lid (Figure 8c). However, when the Teflon lid is not in the normal position, the Machine Vision system cannot detect the horizontal edge lines and the robot stops. AutoPGA simultaneously displays an alert window to prevent the robot from malfunctioning. If the lid is set in the normal position, the robot operates normally and removes the lid according to the procedure of the automatic analysis shown in Figure 5. Similarly, the sample frame in the sample box can be detected by the system as two edge lines inclined by 45° (Figure 8b). The presence of a frame in the sample box at the beginning of the automatic analysis implies that a previous user forgot to remove the last sample during manual analysis and AutoPGA displays an alert window and stops the robot.

Logging, Internet, error, and memory release functions
AutoPGA uses several other functions, for example, logging, Internet, error, and memory release functions. All events in the automatic system including such as the start of the analysis, the exchange of samples, the end of the analysis, and error warnings are logged on a panel of the AutoPGA program. The users can easily confirm the operational conditions by using the time series log and the log information is automatically e-mailed to the administrator through the e-mail function of LabVIEW. In addition, the same information is automatically tweeted; therefore, all users can remotely know the condition of the PGA.
Automatic memory release is a characteristic function of AutoPGA and it can automatically deallocate the memory resource associated with the program using processHandles.dll. The function regularly specifies its own process ID and release memory area regularly. The most severe problem of the complex control program developed by LabVIEW is memory leak. This function is a coping process to solve the problem of memory leak because the AutoPGA program is large and resource hungry. Further, although this program has been debugged for a long time and performs stably, the memory release function has not been modified.

Conclusion
The archaic PGA system installed in the JRR-3 of JAEA a quarter of a century ago was totally revamped, and a new automated PGA system was developed using a revolute joint robot and original software. The main control program AutoPGA developed using LabVIEW can control the entire analysis system automatically. The important points of the improvements are given below.

i.
The automation of existing large-scale analytical equipment is achieved by using an industrial robot and in-house programs without modifications inside shielding bodies. The core of the analytical system is thus perfectly preserved even after the automation and the high performance of the analytical system is maintained. The basic design concept of the automation can be applied to other large-scale analytical devices. ii.
The existing measurement program, Spectrum Navigator, is still used to minimize users' discomfort. The automatic analysis system is realized by an elaborate system design in which the communication program (PGA-Talk) operates jointly with the measurement program. PGA-Talk is called by the batch-processing mode of Spec-trum Navigator in the system, but this might not be used in other measurement programs. If an existing program cannot use the batch-processing mode, the system designer should either develop a new measurement program or develop another program that calls the existing measurement program. If there is no demand by end users, a new measurement program that is integrated with the control program should be designed.
iii. An automated helium gas flow control system with automatic flow channel switching function was developed using a mass flow controller and two semiautomatic pressure regulators. This system can execute all the steps of gas regulation except the exchange of the empty gas cylinder; therefore, the burden on the operator is lesser and the consumption of helium gas decreases. This unique system can be applied to most devices using high-pressure gas cylinders.

iv.
Machine Vision can be implemented by using a cheap USB camera easily available to consumers and improves the safe operation of the revolute joint robot. Thus, it can be used even if one has insufficient funds for automation, as it does not require high economic investment. In particular, it is useful for cases where the user requires neither high speed nor high sensitivity. In addition, despite the simplicity of the edge detection method, it is capable of detecting the lid and sample frame.
In summary, the strategies for the automation of PGA can be applied to other large-scale experimental devices without significant cost. Most of the hardware and software used are easily accessible. An extremely cheap, small computer, such as Raspberry Pi, may facilitate automation efforts and many large-scale devices may be automated in a similar manner in the future.