# Real-Time Detection of Overloads on the Plasma-Facing Components of Wendelstein 7-X
## 3 Image Analysis
### Thermal Overload Detection Algorithm
The uncertainty of the temperature calibration is then added to the thermal image resulting in the corrected image \(T^{\prime}\). 2. Following, the corrected thermal image is averaged over time \(\overline{T^{\prime}}\) with a moving average to reduce its noise. The average window size \(n\) has to be kept small (2 to 5 frames) to avoid adding too much delay to the system. 3. The temperature threshold \(T_{xy}^{th}\) [K] is computed with Equation (3) for each pixel \((x,y)\) in real-time using the model in Equation (2), the reaction time \(t_{r}=0.16\) s, the temperature limit \(T_{xy}^{limit}\) [K] of the PFC, the current heat flux \(q_{xy}\) [kW/m\({}^{2}\)], and the material constant \(C_{xy}^{m}\) [s(kW)\({}^{2}\)/(m\({}^{4}\) K\({}^{2}\))]. The scene model provides the temperature limit and material constant for each pixel. \[T_{xy}^{th}(t)=T_{xy}^{limit}-q_{xy}(t)\Big{(}\frac{t_{r}}{C_{xy}^{m}}\Big{)}^ {l}\] (3) where \(l\) is a parameter that controls the linearity of the model. In theory, \(l\) should be 0.5 (the temperature increases as a square root), but this only holds if the heat-flux is constant. In some situations, when the heat-flux is increasing quickly, the temperature increases faster and the system may react late. We have found that a linear prediction (\(l=1\)) works better in practice for safety purposes in these cases. The divertor overload case in Section 4 is an example of this: when the heating is increasing in  
Figure 9: On the divertor targets, if the algorithm triggers the interlock when it detects that the temperature breaches the limit (\(T_{limit}=1200\)\({}^{\circ}\)C), the temperature will exceeded this limit before the heating is interrupted due to delay of the system. To prevent this, it is required to stop at a lower threshold (\(T_{th}\)). At 1000 \({}^{\circ}\)C it takes 0.16 s to reach the temperature limit when the heat flux is 10 MW/m\({}^{2}\) (the maximum heat flux allowed). This provides us with a reference reaction time \(t_{r}=0.16\) s. The system, however, must stop at a lower threshold if the detected heat flux is higher than 10 MW/m\({}^{2}\) or it can stop at a higher threshold if the detected heat flux is lower. power at the beginning of the discharge, the heat flux is also increasing quickly and the temperature increases faster than the square root model. 4. Note that Equation (3) requires the computation of the heat-flux in real-time. Currently, 2-dimensional thermal calculations in real-time are not possible at W7-X, since we cannot assume toroidal symmetry [15]. The heat-flux can be estimated roughly according to Equation (1) using the increase of the averaged corrected temperature between two frames \(\Delta\overline{T^{\prime}_{xy}}\) and the frame time interval \(t_{f}=0.01\) s, resulting in Equation (4). \[q_{xy}(t)=\frac{\Delta\overline{T^{\prime}_{xy}}(t)}{\left(\frac{t}{C^{m}_{ xy}}\right)^{l}}\] (4)
5. \(\Delta\overline{T^{\prime}_{xy}}\) is then time-filtered in Equation (5) with a learning rate \(\alpha\) to avoid triggering false alarms due to fast transients. \[\Delta\overline{T^{\prime}_{xy}}(t)=(1-\alpha)\Delta\overline{T^{\prime}_{ xy}}(t-t_{f})+\alpha\Big{(}\overline{T^{\prime}_{xy}}(t)-\overline{T^{\prime}_{ xy}}(t-t_{f})\Big{)}\] (5) Fast transients refer to fast physical events with high heat flux that last for a short period of time, not enough to actually heat and damage the PFCs. However, the temperature prediction is based on the measured heat flux, and it reacts assuming that the current heat flux is sustained for 0.16 s. A short high increase of heat flux can then trigger a false alarm, even lasting just few ms. To prevent this, the heat flux has to be averaged over time to react only to sustained heat flux changes. 6. In case the heat-flux calculation under-estimates the real heat flux, we follow a conservative approach to stay on the safe side.