Fast elaboration of diagnostic data for real time control in FTU tokamak

The automatic controller developed for MHD instability control on FTU via the real time (RT) EC launcher [1, 2] is based on the a-priori estimate of the instabilities location and on the fast elaboration of the stream of diagnostic data. A fast data acquisition system, based on existing standard FTU diagnostics, collects thermal and magnetic signals by a 12-channels ECE polychromator [3] and by a set of 22 Mirnov coils respectively. Moreover, the EC time waveform from directional couplers along the transmission line is acquired as well. This set of signals is processed in a timescale significantly shorter than the typical time step of the controller (1ms). RT elaboration algorithms aim at supplying the controller [4] with reliable information about the existence and the spatial location of the instability and about the actual ECRH deposition layer in plasma. The main algorithms blocks are ECE-ECE, ECE-Mirnov and ECE-ECRH cross-correlation, and SVD (Singular Value Decomposition) of Mirnov signals. The capabilities of effective detection, false positive resilience, and mode discrimination will be discussed through the application to actual plasma data.


Introduction
The automatic controller developed for MHD instability control on FTU via the real time (RT) EC launcher [1,2] is based on the a-priori estimate of the instabilities location and on the fast elaboration of the stream of diagnostic data.A RT equilibrium reconstruction [5], working with a cycle time equal to the controller cycle time (0.5-1ms), provides the q-profile to the controller to evaluate the location into the plasma of the q-rational plasma surfaces.This information allows adjusting the launching angles of the antenna to follow those q-rational plasma surfaces where instability could occur (r MHD ) [4].On the other hand, a fast acquisition system collects thermal and magnetic signals by a 12-channels ECE polychromator [3] and by a set of 2x8 Mirnov coils respectively.Processing of these signals are aimed at providing an early detection of the instability growth and a further estimate of r MHD and of the spatial periodicity order number of the mode (poloidal m and toroidal n).Moreover, the EC time waveform is acquired as well from directional couplers (ECH) along the transmission line ; when modulating the EC power, an estimate of the EC absorption layer (r DEP ) can be evaluated, which is complementary to the a-priori estimate evaluated by the RT ray-tracing code [5].
ECE, ECH and Mirnov signals are acquired with a sampling rate faster than the controller cycle time and then undergo a two-stage elaboration through the control chain.In the first stage, ECE-ECE, ECE-Mirnov and ECE-ECRH cross-correlations are evaluated at the sampling rate (>20kHz) that is within a cycle time significantly shorter of 1ms.Cross-correlation coefficients are then downsampled to be sent to the second stage, which works at the controller cycle time, to provide time and space references for the ECRH/ECCD injection.In the first stage a profile of cross-correlation coefficients along the ECE channels space is evaluated and sent to the controller.The crosscorrelation profiles are then referred to the FTU major radius and to a plasma surface (labelled as r in the following) and processed to evaluate whether one or more instabilities are occurring and where instabilities are located into the plasma (r MHD ); in case of modulated injection of EC power the estimates of r DEP can also be evaluated through ECE-ECH cross-correlation.
A complete description of the control system architecture is given in [1].Present work is focused on the description of algorithms evaluating cross-correlation between different signals and processing the cross-correlation profiles to estimate r MHD and r DEP .The implementation of the algorithm evaluating an instantaneous (that is, without taking into account time delays) time varying cross-correlation between two signals is discussed in Section 2. Section 3 and Section 4 are dedicated to describe the algorithms for r DEP and r MHD , respectively.In Section 4, results of the ECE-Mirnov cross-correlations algorithm are shown and compared with those obtained by the ECE-ECE cross-correlations, SVD, and RT calculations of q-profile.

Cross-correlation algorithm
The main algorithm blocks evaluated by the acquisition system at the sampling rate (>20kHz) are the ECE-ECE, ECE-Mirnov and ECE-ECH cross-correlations.In figure 1, a logic scheme of the processing chain is shown, where differences on the computation time required to each stage is stressed.In particular Figure 1 shows the main logical blocks that are evaluated synchronously with the data acquisition: a block implementing a digital filters bank and a block evaluating the instantaneous time varying cross-correlations.All signals (ECE, ECH and Mirnov) are filtered out by a "bank" of digital filters with the aim of maximize the signal-to-noise ratio on the bandwidth related with the particular value (r MHD or r DEP ) being evaluated.In particular, each ECE signal is calibrated and multiplexed by means of a low-pass filter (data used by fast equilibrium algorithm [5]), and two band-pass filters: one to enhance the band related to thermal fluctuations induced by modulated EC power injection (to evaluate r DEP ), and the other the band covering the range of frequencies in which instabilities are expected (to evaluate r MHD ).
Evaluation of the cross-correlation between two signals s 1 and s 2 at the instant t are generally described as follows: where h(t) is the impulse response of a filter (for instance, if h(t) is a window functions eq. ( 1) describes the evaluation of cross-correlation by a moving average), and * is the usual convolution product.
In order to avoid the collection of a large amount of data, to process data at the sampling rate, and to allow changing the integration time without affecting the computation time it has been decided to use an Infinite Impulse Response filter to implement h.A further requirement on h is required for a coherent normalization of the operation shown in eq.1.This means that the autocorrelation of each signal has to be always positive (or not negative): Eq. 2 is always satisfied if h(t) ≥ 0. It has been choose to implement h(t) as a single pole low pass filter, with a easily changeable cutoff frequency f 3dB =1/T, with T related to an effective integration time.
At present, a basis version of this code has been implemented [4] and tested in RT using first order high-pass filters instead of band-pass.Under the above choice, processing is quite similar to that described in [7], unless the normalization of the cross-correlation values.Because of the low computation time (below 1µs) and the foreseen upgrade of the hardware, a further improvement replacing the high pass filter with fourth (or six) order band pass filters, implemented with a fixed design in order to allow easy tuning of the digital filters, can be achieved.
On the basis of the estimate of the norm described in eq. 2, the cross-correlations evaluated by the operation in eq. 1 can be normalized.For instance, let us consider s 1 as the i-th ECE channel (ece i ) and s 2 as a reference signal S (it can be an ECH signal or a Mirnov).Then, the following signal is a time-varying estimate of the amplitude T e (electronic temperature) fluctuations coherent with the fluctuations of the reference signal S (see fig. 2 a) and b) as examples).The measure of the coherence between fluctuations of the two signals, which could be used to evaluate the reliability of the estimate in eq. 3, is given by <ece i , S>(t)/ (⎜S⎪(t) ⋅⎜ece i ⎪(t)) Summarizing, eq. 1 is implemented on the first stage working at the sampling rate and calculating the cross-correlations and autocorrelations (with normalization purposes) of ECE with ECE, Mirnov and ECH signals, while eq. 3 and 4 are implemented in the second stage to provide (at the controller clock time) a profile of T e amplitude fluctuations (eq. 3) along the ECE channels space and/or an estimate about the coherence between the two signals being cross-correlated (eq.4).In the following sections algorithms evaluating r DEP and r MHD will be described.

Estimation of EC absorption layer
The RT evaluation of the actual plasma surface where the EC power is absorbed is performed via a lock-in technique, that is by modulating the RF power sources, and cross-correlating the thermal fluctuations (ECE) with signals (ECH) coming from two directional couplers placed along the transmission waveguides.However, local thermal fluctuations are not strictly proportional to the power injected.In fact, changes on the local value of T e due to the power locally absorbed depend on the local thermal conductivity and capacitance.In a rough way, the phenomenon can be described as folloexaws: EC-17 Workshop where a is a constant of proportionality and τ is a time constant which has been empirically evaluated as varying within 5-8ms.Eq. 5 states that the Plasma Thermal response T e (t) to power absorption can have a phase delay of π/2 to P ECH (t) when it is sinusoidal at a frequency higher than 1/τ.Then, starting from ECH signals a Plasma Thermal Image is reconstructed (PTI) by using a low pass filter with cut-off frequency f 3dB = 1/τ.The calculations involved on the first stage are: the evaluation of the PTI signals from ECH; the filtering of ECE and PTI signals (frequency band depends on the modulation frequency and can be changed shot by shot); the cross-correlations between ECE and PTI.
In the second stage, cross-correlation coefficients are normalized by eq. 3.For a given instant t, the profile of cross-correlation coefficients on the FTU major radius (R) is processed evaluating the maximum point; therefore the parabolic fit of the profile around the maximum is evaluated and the vertex is taken as the estimate R DEP of the EC deposition peak.
Present code is routinely used to evaluate the deposition location and some results are reported in [2].

MHD Instabilities detection
The main algorithms blocks devoted to detect the presence of one or more MHD instabilities are ECE-ECE and ECE-Mirnov cross-correlation in the time domain, and SVD (Single Value Decomposition) of Mirnov signals in time and space domain.
A profile of signed amplitudes of thermal fluctuations coherent with magnetic is provided to the controller logic by ECE-Mirnov cross-correlations normalized following eq.3. From that profile, the position along the ECE line of sight of one or more island O-points is evaluated between those pairs of ECE channels in which cross-correlations change sign [7,9,10] and then the position of the island is evaluated at the major radius R where the fluctuations amplitude is 0. Furthermore, the amplitudes in eV allows to give a threshold on the amplitude of the fluctuations to discriminate noise effects.The peak-to-peak amplitude of thermal fluctuations can be related, by through the local electronic temperature gradient, with the island width [8].Therefore applying a threshold on the fluctuation amplitudes sounds as posing a minimum size to the islands to be detected.In this way, ECE-Mirnov cross-correlations may provide both spatial information (on where the island is) and time information (on when a TM instability appears).
In principle, ECE-ECE cross-correlations can provide the same information than ECE-Mirnov regarding to a (N)TM instability, but they are sensitive to all phenomena producing common T e oscillations.Then, different instabilities can be hardly distinguished if the distance between qrational surfaces is comparable with the ECE channels separation.It is due to the low spatial resolution and to the superposition of fluctuations produced by different instabilities.In off-line tests it has been found that occurrence of sawteeth instability can produce a disturbance on the ECE-ECE cross-correlation results that do not allow correct evaluation of island close to q=1 surface, while ECE-Mirnov are quite insensitive to sawteeh instability.However, since their high sensitivity to sawteeth instability, ECE-ECE cross-correlations can be used instead to provide a RT estimate of r q=1 , the inversion radius at the q=1 surface [11], in experiments of sawteeth stabilization/destabilization.
Further information on MHD onset can be drawn out from a RT SVD (Singular Value Decomposition) algorithm applied to a set (8 to 22) of Mirnov coils [6].
The crosscheck between results provided by the different codes (cross-correlations, SVD and apriori q profile) will be applied in real time by the controller logic.
In Figure 2 and 3, the comparison between the different codes is reported for the FTU shot #34742.This is a complex case in which sawteeth oscillations are present and different MHD instabilities start at about t=0.6s, leading to a disruption at t=0.8s.A pre-disruptive phase starts at t=0.67s.In an early phase, a 3/2 mode appears together with a 3/1, to suddenly trigger a 2/1 mode locked with the 3/1 mode.After the sudden rising up of Mirnov fluctuations, also the estimates of thermal fluctuations given by ECE-Mirnov cross-correlation are rising up.In particular, a change of sign occurs between ECE channel 1 and 2, shown in Figure 2 a), while in the early phase channel 4 is opposite to channel 5 and then further changes sign becoming opposite with channel 3, Figure 2 b).In this case only a Mirnov signal (mhdfst.ch03) is being used, Figure 2 c).In Figure 2 d) a trigger signal generated by the SVD algorithm is shown, that quite immediately senses the modes destabilization producing the increase on the Mirnov fluctuation amplitudes in c).It provides sudden instability detection, but it seems to be affected also by other kind of magnetic fluctuations occurring during the pre-disruptive phase.
In Figure 3, the comparison with the q-profile, provided by the RT equilibrium [5], shows that in the early phase an island is detected between channels 4 and 5 and then close to the q=1.5 (3/2) surface for a few of milliseconds, and further the algorithm detects an island between channels 3 and 4 close to the q=2 (2/1) surface.The change of sign between channels 1 and 2 is near to the q=3 (3/1) surface.Estimates of island position are provided only when amplitudes exceeded a given threshold (20eV in present case); this occurs with a delay of few milliseconds with respect to the trigger signal provided by SVD and stops when likely other instability phenomena occur before the disruption.
Validation of the algorithms is also carried out by comparing their results with the time behaviour of each signal and applying off-line codes based on FFT analysis.Latter codes are based on a predefined choice of channels (both ECE and Mirnov) and on the application of FFT in short time (20ms) windows to find the common frequency peak.Then, Fourier coefficients of all ECE channels are evaluated at that frequency to verify the correspondence of π-jumps with the results provided by the ECE-Mirnov cross-correlation.
EC-17 Workshop 02015-p.5 Fig. 3. Rational q-surfaces (solid lines) by RT equilibrium reconstruction for the FTU shot # 34742 and r MHD estimates given out by the ECE-Mirnov cross-correlations.The comparison shows the early appearance of the 3/2 and 3/1 modes, and after the appearance of a 2/1 mode (locked with the 3/1).ECE channels positions (dashed lined) are also reported.

Conclusions
The suite of correlation algorithms implemented in hard RT framework synchronous with the data acquisition has been described.Present codes have been already implemented and tested, showing computational time (<1µs) below the required.Further improvements can be achieved by increasing the order of the filters involved, and using linear combination of Mirnov signals as reference signals for the ECE-Mirnov cross-correlations [10].
Cross-correlation algorithms are routinely used for off-line evaluation of the EC deposition layer [2], and with MHD analysis purposes together with other off-line codes.Next step will be to set up the various thresholds and the controller logic in order to guarantee early and reliable detection of (N)TM modes by crosscheck of results given by different codes.

Fig. 1 .
Fig. 1.Scheme of the cross-correlation algorithm.After being acquired, Mirnov, ECE and ECH signals undergo to a digital filters bank and then are cross-correlated.In the second stage, ECE-ECE and ECE-Mirnov cross-correlation profiles are processed to estimate the island location (r MHD ), while ECE-ECH profile provides an estimate of the EC absorption layer (r DEP ).

Fig. 2 .
Fig. 2. Estimates of thermal fluctuation amplitude provided by ECE-Mirnov cross-correlations for FTU shot # 34742.a) Results for ECE channels 1 and 2; b) Results for ECE channels 3, 4 and 5; c) Mirnov signal used as reference signal; d) trigger signals provided by SVD algorithm.