Wendelstein 7-X Near Real-Time Image Diagnostic System for Plasma-Facing Components Protection

Abstract The Wendelstein 7-X (W7-X) fusion experiment is aimed at proving that the stellarator concept is suitable for a future fusion reactor. Therefore, it is designed for steady-state plasmas of up to 30 min, which means that the thermal control of the plasma-facing components (PFCs) is of vital importance to prevent damage to the device. In this paper an overview of the design of the Near Real-Time Image Diagnostic System (hereinafter called “the System”) for PFCs protection in W7-X is presented. The goal of the System is to monitor the PFCs with high risk of permanent damage due to local overheating during plasma operations and to send alarms to the interlock system. The monitoring of the PFCs is based on thermographic and video cameras, and their video streams are analyzed by means of graphics processing unit–based computer vision techniques to detect the strike line, hot spots, and other thermal events. The video streams and the detected thermal events are displayed online in the control room in the form of a thermal map and permanently stored in the database. In order to determine the emissivity and maximum temperature allowed, a pixel-based correspondence between the image and the observed device part is required. The three-dimensional geometry of W7-X makes the System particularly sensitive to the spatial calibration of the cameras since hot spots can be expected anywhere, and a full segmentation of the field of view is necessary, in contrast to other regions of interest–based systems. A precise registration of the field of view and a correction of the strong lens distortion caused by the wide-angle optical system are then required. During the next operation phase the uncooled graphite divertor units will allow the System to be tested without risk of damaging the divertors in preparation for when water-cooled high-heat-flux divertors will be used.


I. INTRODUCTION
Wendelstein 7-X (W7-X) is a drift optimized nuclear fusion device of stellarator type built in Greifswald by the Max-Planck-Institut für Plasmaphysik 1 (IPP). Its main goal is to prove that the stellarator design is suitable for *E-mail: aleix.puig.sitjes@ipp.mpg.de This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/ by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. With plasmas of up to 30 min and with a steady-state heating power of 10 MW, a continuous real-time data acquisition, analysis, and control system is necessary in order to protect the plasma-facing components (PFCs) from overheating. The road map to steady-state operation consists of different operating phases (OPs) with increasing machine performance with every phase. The so-called OP1.2 test phase, in operation between the second half of 2017 and the first half of 2018, will be used to test the Near Real-Time Image Diagnostic System (hereinafter called "the System") aimed to protect the PFCs during the steadystate operation. During this phase, an inertially cooled graphite divertor will be used, and the System will be tested without risk of damaging the divertor. After this phase, further developments will follow in order to port the near real-time system (online, but not real time) to a true real-time operating system with deterministic behavior. 2 In OP2, planned for the beginning of 2020, a high-heat-flux (HHF) water-cooled divertor will be installed, and the System will be able to protect the PFCs in steady-state operation.
This paper is organized as follows. Section II describes the PFCs operational limits and the main requirements of the System. In Sec. III, an overview of the imaging system and the technical specifications of the endoscopes, immersion tubes, and thermographic and video cameras are given. In Sec. IV, the software architecture and main functions are introduced. Section V describes the image processing algorithms used to detect and classify the hot spots and to detect and analyze the strike-line shapes. Section VI describes the structure of the detected thermal events and how the generated metadata are displayed in the control room. Finally, in Sec. VII, the conclusions and the future work outlook are given.

II. PLASMA-FACING COMPONENTS OPERATIONAL LIMITS
W7-X is a three-dimensional (3-D) helically shaped stellarator with five symmetric modules and ten divertors (five upper and five lower divertor units) utilizing large magnetic islands for heat and particle exhaust. In OP2, the HHF water-cooled target elements will be made of carbon fiber composite (CFC) tiles that are joined to a copper chromium zirconium (CuCrZr) heat sink (see Fig. 1). The thickness of the tile depends on its position in the divertor due to the 3-D shape of the device (up to a maximum value of 2 mm). The divertors have three target elements: the vertical target, the low-iota target, and the high-iota horizontal target. Between the low-iota and high-iota horizontal targets, there is a lowloaded central part made of graphite tiles. The other water-cooled PFCs are the baffles, the heat shields, and the wall and pumping gap panels. The baffles and the heat shields are made of graphite tiles bolted on CuCrZr, and the wall and pumping gap panels are made of stainless steel. 3 W7-X has a total steady-state plasma heating power of 10 MW provided by the electron cyclotron resonance heating system, which can operate up to 30 min. Together with the main heating source, two more systems provide additional power for a short period of time (up to 10 s): the neutral beam injection (NBI) system, which provides 10 MW, and the ion cyclotron resonance heating system, which provides 4 MW. The divertor target elements are designed to dissipate up to 10 MW/m 2 in continuous operation. The graphite element between the high-iota and low-iota divertor targets can dissipate up to 1 MW/m 2 . The baffles can dissipate 0.5 MW/m 2 , the heat shields 350 kW/m 2 , and the wall and pumping gap panels 100 kW/m 2 . Table I summarizes the operational limits of the PFCs.
The consequences of overloading the divertor target elements are an increase of thermal resistance and, thus, a reduced performance of the element and at the end the delamination of the tile. This can lead to a complete debounding and loss of the thermal connectivity to the W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION · PUIG SITJES et al. 117 cooling structure of the tile. The Cu interlayer of the divertor tiles cannot exceed a temperature of 475°C to prevent such damage. If the surface temperature reaches 1200°C, the Cu interlayer reaches the maximum temperature in 3 s. For safety, the System will send an alarm to the interlock system when the surface reaches 1000°C, and the plasma control system is required to react and change the scenario within 1 s. This means that the System must detect a hot spot, analyze its risk, and send an alarm within 100 to 200 ms.

III. THE IMAGING SYSTEM
The imaging system consists of ten infrared cameras and ten video cameras. In OP1.2, nine immersion tubes and one endoscope 4-6 will be tested to observe the ten divertors in the infrared range. The mixture of the diagnostics is a result of different requirements for different PFCs and historical development of W7-X. It is also not a final setup of the diagnostics. In OP2, with full heating power of 10 MW for 30 min, the uncooled immersion tubes cannot survive the radiation from the plasma. Therefore, they will be replaced by water-cooled endoscopes. The video system, covering the visible spectrum, is based on the Event Detection Intelligent Cameras (EDICAM) systems 7-10 providing a tangential view of the plasma vessel and extra coverage of the walls in order to detect fast particle losses due to the NBI heating. Below, we present a short description of the diagnostics. More details can be found in the references.

III.A. The Immersion Tubes
The immersion tubes provide a field of view of 116 deg horizontally and 100 deg vertically with an optical resolution of the order of 5 to 20 mm, depending on the distance and the viewing angle of the divertor. They are equipped with IRCAM Caleo 678k L microbolometer cameras covering the spectral range from 8 to 14 µm. They have a sensor size of 1024 × 768 pixels, with a pixel size of 17 × 17 µm, a bit depth of 14 bits, and a maximum frame rate of 120 Hz.

III.B. The Endoscopes
The endoscope prototype, designed to monitor the divertors during HHF steady-state operation, will be tested in the coming experimental phase. It consists of an off-axis Cassegrain optical system with a pinhole aperture of 6 mm. The light is transmitted to the camera sensor through two mirrors in the front and the off-axis Cassegrain mirrors. The off-axis design avoids the diffraction caused by the central obstruction. The light is divided by a dichroic splitter into visible and infrared beams, which are detected by the cameras after being corrected by a group of lenses.
The endoscopes monitor the 5-m-long and 1-m-wide divertors with a field of view of 115 deg horizontally (−75 deg, +40 deg) and 60 deg vertically (−40 deg, +20 deg). The target elements require a resolution of 8 mm in the divertor plane in order to resolve each of the small tiles forming the divertor. The endoscopes have an optical resolution from 6 mm (at 40% modulation transfer function) to 20 mm depending on the distance and the viewing angle of the observed part of the divertor. Therefore, the end system needs to significantly improve the optical resolution.
The main part of the endoscope is the Infratec ImageIR 9300 infrared camera. These cameras have an indium antimonide sensor covering the spectral range from 2 to 5.7 µm, with 1280 × 1024 pixels, a pixel size of 15 × 15 µm, a bit depth of 14 bits, and a maximum frame rate of 106 Hz.

III.C. Event Detection Intelligent Cameras
To protect the walls from localized losses of energetic particles, EDICAMs are used. These cameras The EDICAMs cover the visible spectrum from 450 to 720 nm, using a CMOS LUPA-1300 sensor with 1280 × 1024 pixels and a pixel size of 14 × 14 µm, a bit depth of 12 bits, and a maximum frame rate of 440 Hz. The sensor allows a nondestructive readout of the data, and the cameras are equipped with an on-board field-programmable gate array, which is used to detect thermal events and send trigger alarms in real time to the interlock system. The cameras can analyze multiple, dynamic, and arbitrary shaped regions of interest (ROIs).

IV.A. Software Functions
The software is divided into two main applications, which communicate through the network in a serverclient topology (see Fig. 2). Ten workstations acquire and analyze the video streams from the thermographic cameras, and ten workstations acquire and analyze the images from the EDICAMs. The video streams are stored locally, and they are sent in real time to the control room for visualization. The video streams are analyzed online by means of computer vision techniques to detect the strike line, hot spots, and other thermal events. If a critical condition is reached, an alarm is sent to the interlock system, and proper action has to be taken: strike-line sweeping, reducing the heating power, or stopping the entire experiment. The metadata generated by the image analysis and the triggered alarms are sent to the control room for visualization and saved in a SQL database. The video streams are sent to the permanent archive system after the discharge.
In the control room an application displays the video streams in a 9 × 9 cell grid downsampled to a resolution of 640 × 480 and 25 Hz, except one video stream upon request, which is displayed at full spatial resolution. All the associated metadata, which include the detected hot spots, strike lines, and generated alarms, are also displayed overlaid on the video streams. The history and evolution of these events are also shown in a thermal map, which provides an overview of all the thermal events occurring in the entire device.
The software also provides off-line tools to replay the video streams with the detected thermal events just after the discharge.

IV.B. Software Architecture
The software is based on ThermaVIP SDK (Refs. 11 and 12), a plug-in-based open source C++ framework initially developed at CEA and designed to process and Fig. 2. The System overview. Ten workstations acquire and analyze the images from the thermographic cameras, and ten workstations acquire and analyze images from ten EDICAM video cameras. The acquisition workstations analyze the video streams and send alarms to the interlock system. The video streams and the detected events are also sent to a centralized computer in the control room for visualization and control of the cameras.
W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION · PUIG SITJES et al. 119 display multimodal data for online and off-line analysis (see Fig. 3). The framework is being further developed by the ThermaDIAG company in collaboration with CEA and IPP, and it is aimed to be an open source framework for camera control and image analysis for the fusion community.
The software of the System consists of a set of plug-ins sitting on top of ThermaVIP SDK for acquisition, trigger management, processing, storage, and graphical user interfacing (see Fig. 4). ThermaVIP provides tools to create multithreaded processing pipelines that can take advantage of the multicore CPU architectures (see Fig. 5 for a detailed view of the processing pipeline).

V. IMAGE ANALYSIS
The image analysis consists of the detection and classification of hot spots and the detection and analysis

120
PUIG SITJES et al. · W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION of the strike-line shape in real time. Their temperature and position in the device are evaluated, and thermal events and alarms are generated in order to protect the device integrity when a critical event occurs. The image analysis algorithms have been implemented in a graphics processing unit (GPU) architecture using the CUDA library. They can run in real time, with a processing time of 20 ms/frame, and they have been tested in the GLADIS experiment. 13

V.A. Scene Model
In order to evaluate the risk of a given thermal event, a scene model is required to know its position, physical size, and temperature. Because of the 3-D geometry of W7-X, thermal events can be expected anywhere in the field of view of the cameras. Instead of using a ROI-based scene model, the System uses a full segmentation of the field of view, so that for each pixel there is a correspondence with the computeraided-design (CAD) model (see Fig. 6). This requires a precise geometric calibration of the cameras that has been performed using the Zhang calibration method 14 to compute the intrinsic camera parameters and the lens distortion model. In this case a radial distortion model has been used.
The scene model stores the information of the target elements in a multidimensional image in HDF5 format with the following data: The model provides pixelwise information on the emissivity of the target element: CFC, graphite, or stainless steel. The cameras have been calibrated for all these emissivities, and according to the scene model, the corresponding calibration is used for each pixel. The conversion from digital levels to temperature is done by means of lookup tables in order to shorten the image processing time. The surface temperature of the thermal event is then computed taking into account the emissivity of the material, its distance to the camera, and the angle with the normal to the surface. The world coordinates are then used to measure the physical size and the position of the event inside the device. All this information is stored in a metadata structure for each individual frame.
Another issue is how to correct these temperatures when the emissivity of the target element changes due to deposition during operation. A recalibration of the cameras will be required by observing the vessel in thermal Fig. 5. The software processing pipeline consists of a set of interconnected processes, each one running in an independent thread, with circular buffers in each connection. Ten acquisition and analysis workstations act as servers and provide the video streams, the metadata, and the status information to the remote client, a central workstation, which displays the data in the control room.
W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION · PUIG SITJES et al. 121 equilibrium both before and after the discharges. Some PFCs in W7-X are equipped with thermocouples, and this allows measurement of the emissivity correction needed. The experience gained during OP1.2 will be of great value to understanding how fast the emissivity is altered in the PFCs and the impact of these changes during long plasmas.

V.B. Hot-Spot Detection
The System detects the hot spots in the thermographic images by temperature thresholding. The segmented pixels are clustered with a connected components algorithm, and they are tracked over time.
The scene model provides the information required to evaluate the risk of the hot spot: its position, size, and mean and maximum temperatures (see Fig. 7).
The video streams in the visible spectrum are also analyzed in order to detect "bright spots" due to localized fast particle losses from the NBI. In this case, however, only brightness is taken into account, and no temperature measurement can be evaluated.

V.C. Hot-Spot Classification
High surface temperatures can be caused by different phenomena: 1. A hot spot may show up due to a power overload, in which case the System must react, or otherwise the PFC may suffer serious damage.
2. Hot spots may also be caused by fast particle losses from the NBI heating.
3. Dust particles can be redeposited, and since they are poorly thermally connected with the underlying material, they become very hot. They are a cause of false alarms.
4. Because of carbon erosion, thin surface layers can develop on the PFCs due to redeposition. They show as high-temperature hot spots due to their low thermal capacity and their poor thermal connectivity to the underlying material and the cooling system. They do not suppose a risk to the PFCs integrity and may also be a source of false alarms. Fig. 7. The hot-spot detection and classification process. The pixels are thresholded, and a pixel classification is performed according to the τ parameter. Then, a region is formed by pixel clustering using a connected components algorithm, and the risk of the hot spot is evaluated taking into account the scene model. Finally, an event is generated.

122
PUIG SITJES et al. · W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION 5. The delamination of a tile decreases the thermal connectivity of the CFC with the cooling system, and the tile can get very hot. This will in turn further damage the tile, and at the end it may fail completely. Because of the extreme difficulties of replacing the damaged elements in W7-X, delaminations have to be detected in time to avoid the complete failure of the tile.
A method has been developed to distinguish the cause of a hot spot by modulating a power source with a train of pulses in order to measure the time evolution of the surface temperature. Because of their different thermal capacities and conductivities, the different types of hot spots respond differently. The normalized temperature decay time τ defined in Eq. (1) is a discriminative feature that it is used to classify the origin of a hot spot with an heuristic classification tree 15 :

V.D. Strike-Line Analysis
The strike line is detected and segmented by heatflux ϕ thresholding: The strike line is then projected onto the CAD model using the geometrical calibration of the cameras. After the projection, its position, width, length, and mean and maximum heat fluxes are evaluated, and the corresponding metadata are generated. The mapped image is converted into polar coordinates, and its shape is characterized with two-dimensional (2-D) Fourier descriptors. These features are saved into the database for posterior analysis.

VI. THERMAL EVENTS
When the image analysis detects a thermal event, it generates a metadata structure that is stored in JSON format (see Fig. 8). A thermal event is identified by a unique identifier (ID) and a time stamp. It can be classified as hot spot, surface layer, delamination, unidentified flying object (UFO), reflection, strike line, or bright spot. It can have parent events and child events. These two fields are used, for instance, to track a hot spot that splits or merges. A thermal event is associated with several event views, which is an instance of an event for a given frame. In general, a thermal event spans along different frames, and it may show different features in each frame. An event view is described by its unique ID, its time stamp, its position in world and image coordinates, its bounding box, its pixel and physical size, and its maximum and mean temperatures (or brightness). Each event view is assigned a "criticality" value, depending on its position, size, and temperature. The same thermal event can be observed by one or more cameras from different diagnostics.
The System is connected to the interlock system, and a transistor-transistor logic alarm is generated when a thermal event reaches a dangerous condition. The interlock system notifies the central safety system, which is then responsible for taking the proper action to protect the integrity of the device.
The thermal events are stored in a SQL database that is updated in real time. The database can be queried offline to replay a given thermal event with its corresponding video stream.

VI.A. Thermal Map
The thermal map is a 2-D representation of the PFCs. It is generated by unfolding the 3-D helical shape of the device into a 2-D surface. The generated metadata are mapped in real time onto the thermal map providing a Fig. 8. The thermal event metadata structure. A thermal event consists of a unique ID and a time stamp. An event can be observed by one or more cameras from different diagnostics, and each event can have one or more event views, one for each frame in which it is observable.
W7-X NEAR REAL-TIME IMAGE DIAGNOSTIC SYSTEM FOR PFC PROTECTION · PUIG SITJES et al. 123 centralized overview of all the thermal events occurring in the device during the discharge in the control room.

VII. CONCLUSIONS
In this work, the System for the PFCs protection of W7-X has been presented. The System will be responsible for the protection of the water-cooled PFCs and, in particular, the HHF divertor that will be installed by 2020. The developed prototype is being tested during OP1.2 (2017 to 2018) with an inertially cooled divertor in order to validate the overall design and the image processing algorithms. In the following years the work will focus on porting the System to a real-time operating system and integrating it into the safety control system of W7-X.
To truly achieve steady-state operation, further work will have to follow to develop an automatic decisionmaking algorithm that given a real time risk analysis of the PFCs, takes the proper actions to protect the device without stopping the entire experiment unnecessarily. Some possible actions could be reducing the heating power, moving the strike line position or changing other plasma parameters.