Real-time dispersion interferometry for density feedback in fusion devices

Interferometry as one of the most common core fusion diagnostics has traditionally suffered from incomplete vibration compensation. Dispersion interferometry promises a more complete compensation of vibrations. For this reason it is being employed in an increasing number of experiments. However, thus far none of them have shown reliable real-time low-latency processing of dispersion interferometry data. Nonetheless this is a necessity for most machines when trying to do density feedback control, most notably in long discharges like the ones planned at the W7-X stellarator and ITER. In this paper we report the development of a new phase extraction method specifically developed for real-time evaluation using field programmable gate arrays (FPGA). It has been shown to operate reliably during the operation phase OP1.2a at W7-X and is now routinely being used by the W7-X density feedback system up to very high densities above 1.4×1020 m-2 without showing 2π-wraps and exhibits increased wrap stability by double-data-rate sampling. A rigorous error analysis has been conducted shedding insights into the signal composition of a dispersion interferometer have been gained. This includes the environmental effects, most notably air humidity, on the phase measurement and the correction thereof.


Introduction
Interferometry, as a means to measure the line integrated plasma density, is one of the fundamental plasma diagnostics found on almost any fusion device. Its main benefit is its simplicity, since the only other parameter it is sensitive to is the probing wavelength, which can be controlled with relative ease. For this reason it is also the diagnostic of choice for density feedback in many fusion experiments such as AUG or JET [7,14].
The implementations of such interferometers varies between highly sensitive RF interferometers, which frequently suffer from signal loss due to refraction, and infra-red/visible (IR/VIS) -1 -two-color interferometers, which offer a very good balance between sensitivity and refraction susceptibility. However, the latter type has the disadvantage of giving an incomplete vibration compensation, since the beampath can never be fully co-linear. A solution here is the dispersion interferometry (DI). This interferometric technique has a shorter history in fusion applications. One of the first to employ DI was the gas dynamic trap (GDT), which still employed a homodyne interferometer [9].
Around the same time developments were conducted at the TEXTOR tokamak [5]. Based on this the development of compact modules was conducted, which also first employed frequency modulation to circumvent the limitations of a homodyne system [6,12]. During later stages of the evaluation method was ported to an FPGA and for the first time used as a feed-back system for TEXTOR [10].
At LHD the dispersion interferometer has been in operation next to the already installed far-IR interferometer and a new off-line phase extraction method was developed based on phase-lockedloops [2,3]. This is also the first extraction method essentially employing a true quadrature detection scheme capable of operating in a fusion environment. Recently a heterodyne dispersion interferometer has been tested at DIII-D, which attempts to circumvent the limited modulation frequency by using an acousto-optical modulator (AOM), with the drawback of requiring separation of the two laser colors [4]. However, this system remedies the main benefit of the dispersion interferometry, namely the co-linearity of the two colors.
The ITER experiment uses the tangential interferometer and polarimeter (TIP), which is a two-color system, for primary density feedback control [16]. As redundancy safety measure a central sightline dispersion interferometer is envisioned, which can act as a back-up density control diagnostic. This system continuously gains importance as the TIP system may fail to get ready in time for the first ITER experimental campaign. While in particular the TEXTOR systems were employing DI as a feed-back system, no medium to large scale fusion machine with long shot length has yet used DI for real-time feed-back purposes.
At Wendelstein 7-X the single channel integral electron density dispersion interferometer (IEDDI) has been the sole interferometer in operation since the begin of plasma operations in 2016 [11]. For the initial experimental campaign real-time evaluation of the density signal was developed using a field-programmable gate array (FPGA) based evaluation scheme [15]. The method was based on trigonometric inversion of the diode signal and the subsequent reconstruction of the modulation sinusoid based on the signal's shape. The offset of the resulting sinusoid would then denote the phase.
However, this evaluation scheme had several short comings. Most prominently the evaluation scheme failed at high densities, since it was in essence a homodyne phase detection method. For the first operation phase this was acceptable since no density feedback was being conducted and the data exhibiting phase inversion could be corrected in post-processing. For the second operation phase, which was running during the second half of 2017, density feedback was a requirement, such that the employed algorithm needed to be changed. Secondly the used algorithm was highly tuned to the signal level and gradients. This made required optical adjustments (be it just due to ambient temperature changes) highly difficult as a change in the signal immediately required re-tuning of the FPGA algorithm. Lastly the nature of the algorithm made it very difficult to detect a problem in the fine-tuning, since the reconstructed phase showed no discontinuities to the naked eye. These changes necessitated the development of a new quadrature phase reconstruction method for dispersion interferometry, which is capable of real-time density feedback control. It can be implemented with very little resources on a small FPGA and thus scales easily to a multi-chord DI for tomographic reconstruction. This method will be described in section 2. This will be followed by a description of the implementation on an FPGA in section 3, since the method was specifically designed with this in mind. In section 4 we will describe the W7-X optical systems and go in detail over the calibration procedure. Afterwards a detailed error analysis will be conducted for the W7-X IEDDI system, showing the limitations of the system in a real environment. This is followed by a presentation of results from the 2017 operation campaign at W7-X. The final section will give conclusions and evisaged improvements.

Dispersion interferometry
Dispersion interferometry utilizes the dispersive properties of the plasma to compensate phase shifts caused by vibrations. The base principle employs a continuous wave laser, such as a Nd:YAG or CO 2 , emitting light at a ω. Its beam is passed through a frequency doubling crystal (FDC) to generate the first harmonic (see figure 1). The resulting co-linear laser beam containing two colors (ω and 2ω) is first passed through a phase modulator and then through the plasma. Having traversed the plasma the beam is passed through a second FDC. Finally ω is filtered out and the interference signal of the doubled laser light passed onto a detector. Information on the plasma density is "encoded" in the propagation delay due to the difference in the plasma's refractive index between the fundamental and the first harmonic laser frequency. The benefit of this method is that the contribution of vibrations to the phase shift, which are omni-present along the optical beam path, cancel out after the second doubling.
The diode signal of a modulated DI has a significantly more complex composition than a two-color interferometer's and is given by with the plasma induced phase shift as In this equation I 1 and I 2 denote the intensities of the second harmonic signals generated by FDC 1 and 2 respectively. It should be noted that due to losses in the optical beam path I 2 < I 1 . The modulation frequency is denoted by ω m and the modulation depth by ρ. The plasma induced phase shift is indicated by φ p . A measured example for the diode signal described by equation (2.1a) is shown in figure 2. Since the signal is made up of nested trigonometric functions, a direct inversion of the signal, as attempted in the initial operation phase, cannot robustly recover the phase.

Quadrature generation
For an effective and robust evaluation quadrature detection has proven to be a robust tool, which can easily be implemented on an FPGA. To generate the necessary information one may first look at the integral of the dynamic component I AC in equation (2.1a): In this equation J 0 and H 0 denote the Bessel and Struve function of zeroth order. As indicated by the coloring the Struve-contribution's sign depends on the integration boundaries, i.e. whether we integrate over the first or the second half of the modulation period. This behaviour can be used to generate an in-phase (i) and a quadrature (q) signal by proper summation: Here T m = 2π ω m is the modulation period. In the equation above the components required for a quadrature phase detection are marked in blue.   This finally enables the calculation of the plasma phase φ p by dividing both components calculated in equation (2.3) and taking the multi valued inverse tangent of the result thus yielding a true quadrature detection method for the plasma phase shift. However, although the arcus-tangent is easily calculated on a CPU, the implementation on an FPGA requires calibration, since the components marked in orange are not necessarily equal.
The calibration will be detailed in section 4.2, however for a better understanding of the calibration the FPGA implementation of the method described in this section is necessary.

FPGA implementation
The benefit of the method described in section 2 is that it is easily implemented on a Field Programmable Gate Array (FPGA). An FPGA is a digital device that can freely be reprogrammed to conduct arbitrary tasks. The technology is becoming increasingly common in high performance diagnostics, since in recent years particularly the hardware capabilities have dramatically increased, while the process of developing FPGA firmware has been significantly eased due to the development of more advanced software tools. The particular strength of FPGAs is streamed digital signal processing (DSP), which is exactly what a real-time phase evaluation technique is.
At W7-X a Xilinx Virtex-6 xc6vlx130t-2ff1156 FPGA placed on a Struck SIS8300-L carrier is being used for the data acquisition and real-time DSP. While this generation of FPGAs is by now several years old, the capabilities are far beyond what is necessary from a DSP point of view. The top level firmware can be seen in figure 3.
The top level firmware is comprised of three main components. The communication cores shown in green, the acquisition and control cores in orange and finally the DSP cores in blue. The majority of communication with the FPGA is conducted via a Xillybus IPcore. This core is responsible  for streaming the raw data supplied by the ADCs directly to the carrier PC's memory as well as exchanging command and status messages with it. This is conducted via the FPGA's PCIe 4× interface.
The two other communication cores are "dumb-fire" cores used to supply control signals to the W7-X communication, data acquisition and control (CoDaC) systems. The primary density control signal is supplied via Ethernet (green core to the bottom right in figure 3). It is taking the density data from the DSP core at a decimated rate of roughly 1 kHz and supplies it as a continuous one-way stream of floating point values to the CoDaC network. The reduced data rate is necessary to not overload the receiving control PC. A second digital to analog conversion (DAC) core supplies a 50 kHz low-latency signal as a voltage-proportional output, which will in future be used for secondary density feedback, e.g. to control edge density gradients.
All of the central components of the top level firmware are controlled by a central register core, which translates commands from the PCIe communications core to control signals for the firmware and in return supplies status messages for most firmware components to the PCIe endpoint on request. The central component however is the IEDDI DSP core.

IEDDI DSP implementation
As has been mentioned before the method described in section 2 is easily implemented on an FPGA. The total processing of the diode signal is conducted in a continuous stream manner and will be described in a logical order denoting the flow of information. This is shown in figure 4. It is to be noted though that all logic on the FPGA operates in parallel and thus all described processes happen at the same time in a pipelined manner.

Phase calculation
The first logical block calculates the phase in the following manner.
At first the modulation reference signal, which is digitized along with the diode signal is being converted into a single bit signal and subsequently delayed. This delay is variable and can be set -6 -externally via the PCIe interface. The purpose is to match the modulation reference signal to have a zero phase shift to the diode signal. Figure 2 shows already an example for a correct reference alignment. The alignment has to be done manually, but since the phase mismatch is primarily defined by the electronics hardware it only needs to be done once after a major hardware change. The delay match is conducted with the help of a Xilinx Chipscope core which acts as a basic live oscilloscope for signals on the FPGA.
The generated modulation bit (gray signal lines in figure 4) is then used to remove the offset from the diode signal by looking at the previous period's maximum and minimum. This assumes that the laser intensities do not drift on timescales of the order of the modulation period. In principle using the same period's amplitude is no difficulty, but will induce a processing latency of one modulation period. After the offset removal the signal is being passed into two accumulators. One sums always, the other sums only if the modulation bit is high and subtracts otherwise. At each rising edge the results are added and subtracted respectively as described by equation (2.3), thus generating the quadrature information. For calibration purposes these signals are also forked to the aforementioned Xilinx Chipscope core.
These two signals can then be passed into a coarse-rotation CORDIC evaluation core to calculate the phase [18]. CORDIC is a well-established method in signal processing and has the benefit of very low resource usage. It calculates the arcus-tangent and amplitude via a series of decreasing rotations of the input vector around the unit circle. Even though the algorithm expects the input to act on a unit circle scaling of the input signals is not necessary, as long as the calibration of the modulation depth is done to ensure circularity. This should be kept in mind for the calibration method described in section 4.2.
The final result of this section is the 4-quadrant phase as well as a signal proportional to the signal intensities I 1 I 2 . Since the quadrature signals are generated on the edge of the modulation bit, the data rate is the frequency of the modulation reference, i.e. 50 kHz for the W7-X system. This rate is kept for all subsequent processors. There is, however, an option for a double-data-rate (DDR) described in section 6.

Unwrapping & offset correction
The previously generated phase signal is wrapping at 2π, i.e. jumping from +π to −π for a continuously increasing phase (and vice versa). It is therefore necessary to "unwrap" the phase signal, which is done directly after the CORDIC algorithm as indicated in figure 4. The corresponding methods are well established in previous FPGA-based interferometers [8].
Subsequently logic has been put into place to acquire and remove a phase offset by means of a fixed sample-count accumulator that can be triggered on request. The offset acquisition is necessary before every shot, since the null phase tends to drift over time and cannot be predicted (see a thorough investigation in section 5). It is also for this reason that the null phase must be acquired after the phase unwrapping, since it is also possible to have the null phase sit directly at the wrap boundary, in which case the offset cannot be accurately determined.
The core yields an unwrapped and offset-corrected 32.25 fix-point phase. The phase can be tracked from 0 to ±8 × 2π, which is more than sufficient for the achievable densities at W7-X. It should be noted that this limitation is willingly chosen based on expected W7-X parameters -7 -

JINST 13 P09002
to conserve resources. There is nothing preventing the firmware from tracking even hundreds of wraps, if one so desires.

Density calculation
The final calculation of the density is conducted via a simple scaler using equation (2.1b). The wavelength is supplied as a hard-coded constant, since small changes to the wavelength tend to have negligible effects on the density result. However, the usage of an externally supplied signal could be easily implemented. The density is being calculated in units of 10 16 m −2 to conserve resources.
This signal can now be used for control purposes and for the low latency option is passed directly to the analog output of the DAC feedback system.

System latency
To correctly propagate the latency information of the system through the processing firmware the trigger gate supplied by the W7-X systems is run parallel to the data signals with identical latency, taking any form of rate change into account. This allows correct time base matching between the FPGA, which digitizes data on the basis of a clock physically different from the W7-X clock, and the W7-X time.
An advantage of developing FPGA based diagnostics is that the system delays are generally well known and can be measured by logic simulation. Although some mapping algorithms tend to change the timing of the logic during optimization, these are disabled for the W7-X firmware. The Xilinx ISE internal logic simulator ISIM was used for the timing analysis.
For this dummy data was generated in software and fed into a VHDL testbench of the top level design shown at the start of this section. After ensuring proper propagation of all relevant signals though the logic (generally no more than 50 µs) the system is run through the acquisition preparation and calibration procedure, as it would be in a normal acquisition cycle. The relevant control signals are generated by the testbench. The signal latency is then measured by supplying a virtual hardware trigger and looking at the time it takes for the first valid sample to arrive at the output of the processing core.
Using Isim this time could be measured as 30.4 µs. The time is predominantly determined by the act of integrating over the modulation period taking 20 µs. The follow-up processing, i.e. CORDIC, phase offset correction etc., is measured at 2.7 µs. The rest of the measured time is the result of trigger jitter (which in case of the simulation can be measured). More specifically the integrator can only start integrating on the first rising edge of the modulation reference after the trigger has been raised. Hence the trigger recognition is always delayed up to one modulation period (so on average measures 10 µs). In the simulation this delay was 7.7 µs. However, this time is only a "first-edge" recognition delay and does not contribute to the processing latency.
The final processing latency can therefore be fixed at about 23 µs, which is close to the theoretical minimum of 20 µs, and can be considered "real-time" with the predominant limitation given by the modulation frequency. Although this low-latency signal can be used for feedbackcontrol when used in an analog manner, the W7-X systems require a digital ethernet-stream at a 1 kHz rate as indicated in figure 3. As a consequence an additional 7.95 ms delay is introduced by the two stacked 7-fold decimation filters. This additional delay however is specific to the W7-X infrastructure and not mandated by the processing routine or the FPGA's capabilities.  . The optical setup of the W7-X IEDDI diagnostic (rotated by 90°clock-wise). The CO 2 laser is combined with a visible laser at a beam combiner (BC) just after the initial FDC. The movable wedge (green) is added before the second FDC for calibration purposes. During a pause of operations a retractable mirror can be used to divert the beam to a "test path" mimicking the W7-X path for testing purposes.
To put these numbers into perspective it should be noted that for W7-X the reaction time of the gas valve system is of the order of 100 ms. However, this scales exponentially with size, and for large machines such as ITER the reaction time of the entire control chain can be estimated to be of the order of a second. Hence a low latency is mandatory.

The W7-X IEDDI diagnostic calibration
In this section we will describe the optical setup of the W7-X IEDDI system as well as the calibration scheme employed for the new evaluation method.

Optical setup
The W7-X dispersion interferometer's optical setup is shown in figure 5. The system employs a 20 W 10.6 µm CO 2 laser which is frequency doubled using a AgGaSe 2 FDC. The beam is then passed through a photo elastic modulator (PEM) and passed through the plasma twice using a corner cube reflector (CCR), which is placed inside the central torus duct outside the vacuum vessel. The vacuum windows are made of ZnSe to allow the visible calibration laser to propagate. The beam path through the plasma is chosen to be nearly co-linear to the thomson scattering (TS) system, to enable easy cross-calibration. The interferometer beam returning from the CCR is passed through the PEM again and is then immediately separated from the outgoing beam (BS). Although not shown in the graph the beam going into the plasma and returning from it are spatially separated by the CCR (so that beam separation can be done with a simple mirror). After the beam splitter the beam is passed through a ZnSe double wedge (indicated in green in figure 5). One of the wedges is motorized to be able to artificially induce a phase shift mimicking the plasma via the dispersion of the ZnSe. This was done to calibrate the system, as described in section 4.2. The beam then passed through a second FDC before being focused onto a 5 µm detector through a 10 µm filter.

Diagnostic calibration
As indicated in section 3.1 the arcus-tangent of equation (2.3) is calculated using the CORDIC algorithm. As noted earlier, this algorithm requires the i and q components to move on a circle around the origin, which is not given ab initio due to the orange terms in equation (2.3).
A solution to this problem can be found by plotting J 0 and H 0 as a function of the modulation depth ρ. This is done in figure 6. As can be seen the functions have a periodic nature and cross each other repeatedly as marked in the figure. This indicates that by setting ρ to an appropriate value ρ c one can ensure that CORDIC operates correctly. Due to the periodic nature of the functions there are multiple crossing points, of which the one at lowest ρ was chosen.
Although an analytic value for the optimum ρ can be easily calculated and ρ is easily controlled via the modulator's amplitude it turned out that this did not yield the correct ρ value, such that a manual calibration was necessary. The reason is likely that in the W7-X setup the laser beam passes the modulator twice at different radial positions and thus different ρ.
As has been mentioned in section 3.1 the firmware has been fitted with a Chipscope core for calibration. It samples the output of the summation cores shown in figure 4 and thus the quantities in equation (2.3). To calibrate the ZnSe wedge is used to scan the phase while plotting the components of equation (2.3) against each other. With this plot the retardation ρ is varied until the plot most closely resembles a circle. The right of figure 7 shows the measurement for a retardation of ρ = 0.336 rad, which appeared to be most circular during calibration measurements. The blue data is from a single linear ramp of the wedge, i.e. from minimum to maximum phase shift. Since the installed wedge does not provide a scan of the full unit circle, the raw data from shot #20171107.25 is plotted in orange for comparison. This shot exhibited a long quasi-linear ramp of the density.
As can be seen the chosen retardation still exhibits significant deviations from the path of a perfect circle centered at the origin (see grey over-plot). On the right hand side the individual components of the wedge scan separately over time (samples are taken at a constant rate). As can be seen from this plot the distortions originate solely from the q component. This is an interesting result as it indicates that the source for the distortions is periodic to the modulation frequency. It should also be noted, that the distortions appear to be maximized during extrema of the i component. This will be further elaborated on in section 7.1.
A next step on this calibration would be a correction of the residual CORDIC offset and ellipticity by fitting sinusoids to the calibration data. However, as the plasma shot scan of the unit circle shows, this would not yield the correct results, since the distortions appear to be asymmetric and can thus far not be compensated.

Error estimation
Since the asymmetries in the CORDIC ellipse shown in figure 7 appear to be significant an error estimation was conducted to evaluate the effect. In general the error on the final density measurement is comprised of three major error contributions: the error introduced by the limited precision available for calculations on the FPGA, the statistical error introduced by the optics and electronics and the error introduced by the non-circularity of the CORDIC input shown in the previous section.

Numeric precision
The error introduced by the FPGA precision can be mostly ignored. The initial precision is set by the 16 bit fix-point precision of the ADC. However, this precision is enhanced by the fact that the data is integrated over the modulation period, which in essence amounts to averaging over multiple samples. Therefor the precision is increased over the ADC precision by a factor of about √ 1000, which is kept by conducting full precision fix-point operations on the FPGA. The CORDIC precision is determined by the number of iterations only, and can therefore be taken to the single-bit accuracy, which was done here, as it does not significantly increases the system latency. The final bit accuracy can thus be calculated at about 1 µrad, which for the W7-X system corresponds to a density error of under 2 × 10 13 m −2 , which can safely be neglected.

Optical/electrical errors
A significant error contribution comes from the optical/electrical errors, which cannot be separated. The error has been measured by calculating the phase using the method described in this paper through the empty W7-X vessel, i.e. without a plasma. It appears that the error can be separated into several timescales, as can be seen in figure 8. The standard deviation of the short timescale statistical noise can be measured at 1.6 × 10 17 m −2 , albeit the measurement is indistinguishable from the previously calculated bitnoise. At intermediate time scales the phase exhibits an oscillation with a period of the order of 20 ms and an amplitude of 5 × 10 17 m −2 (see the left plot in figure 8). Although this suggests an electrical influence, possibly introduced through the reference signal into the phase evaluation algorithm, the features do not appear regular enough for 50 Hz noise. Lastly, on longer timescales of several 100 ms the average phase appears to be drifting by 5 × 10 17 m −2 , as seen in the right of figure 8. This will be discussed further in section 5.4.

Non-circularity error
The error induced by the non-circularity of the CORDIC inputs described in section 4.2 can be measured using the movable wedges. Figure 9 shows the phase measured by the CORDIC core while setting the wedge motor to move at a constant pace. In the ideal case the phase should linearly in-/decrease as the motor moves. By doing a linear regression fit to the data (orange line on the left) and then looking at the deviation from the fitted line one can estimate the error introduced by the non-circularity. On the right of figure 9 the deviation from the linear regression fit is calculated. The phase error equates to roughly 1 × 10 18 m −2 for the section of the circle measured using the wedge. This can be seen as the best guess error and should be added to the result of the previous section, however it should be noted that the linearity of the motor movement and manufacturing accuracy of the wedge are assumed perfect. The former is already doubtful when looking at the bump in the phase measurement around sample #7500 on the left of figure 9. Nonetheless we assume this value as an upper boundary for the error. For comparison: this level of nonlinearity error has been seen in other DI evaluation methods [2].

Phase drift
A final error contributions are from slow-scale phase drifts, which slowly change the phase over the course of a shot. They originate in the refractive index of optical transmission components, the primary one is simply the air along the beam path. This effect is not compensated by the DI approach [1]. While all environmental properties play a role the effect of air humidity is the primary contributor. Its effect on interferometric measurements was previously known, but has recently gained increasing attention, since it is assumed to be problematic for interferometer systems with long optical path length such as the ITER TIP system [17]. Figure 10 shows the phase measured by the IEDDI system over several hours (φ meas ) without a plasma (blue in the top left). As can be seen the phase drifts significantly over the course of a day, which would render interferometry measurements unreliable when going to hour-long shot-lengths.   On the right hand side of figure 10 the top plot shows the temperature of the FDCs as well as the optical table as a whole. The wobble on the FDC temperature are the result of the compressor based cooling circuit used to control their temperature. But, as evident from the phase measurement, this does not have any significant effect on the phase. The bottom right plot shows the air pressure measured in Greifswald during the measurement in orange. This was assumed to be identical to the pressure in the torus hall (TH), where the IEDDI system is located, since the large radiation protection doors were open during the time and the pressure difference likely in equilibrium with the outside air. In the same graph the average air humidity in the TH measured by 3 different sensors is shown in blue.
As can be seen the measured phase drifts significantly over the period of a day. To the plain eye, the air humidity is the primary contributor. To correct the drift the primary approach was therefore to attempt a simple linear correction, i.e.
The fitted correction function is plotted in orange on the top left of figure 10 and the corrected phase φ corr as described by equation (5.1) at the bottom left. As can be seen the drift error can be reduced by an order of magnitude using this simple approach. However, Fourier analysis of the atomic transitions suggests that a non-linear correction is more appropriate [13]: In consequence a first order Fourier correction as described by equation (5.2) was conducted, using the temperature of the optical table for a temperature reference. The result is plotted in green on the left of figure 10. As can be seen the error be reduced by another factor of 2 to 3, where the nonlinear cross terms, e.g. s Tp * T table * p air , only offer a slight improvement over the quadratic terms.
The analysis conducted here employs very rough estimates for the environmental parameters which are not measured at the source of the perturbation. Nonetheless the correction reduces the long timescale phase drift error to 1 × 10 18 m −2 using a simple measurement, which can probably be further reduced. This is an important result for any kind of long-time interferometric measurement.

Amplitude sensitivity
In combination of the humidity consideration done in section 5.4 it has been pointed out that the DI wavelength combination obtained by a 10.6 µm fundamental wavelength from a CO 2 laser may lead to significant errors due to water absorption [17]. The 5.3 µm wavelength is very close to a water absorption line, thus significantly reducing the signal level when going to very long optical beam paths.
The method described in this paper is relatively insensitive to changes in the amplitude. Both, the analytical arcus-tangent of the components in equation (2.3) as well as the CORDIC implementation on the FPGA cancel the amplitude contribution perfectly, as there are no operations involved that distort the amplitude information. As such water absorption will increase the noise only via the signal to noise ratio, i.e. the error described in section 5.2.

Wrap-free density-feedback-control
The W7-X experiment, similar to many other fusion experiments, requires a real-time density feedback system to maintain stable plasma density parameters. Such systems exist in many forms at many experiments, however to the authors' knowledge, no dispersion interferometer has thus far been used for density feedback-control at a fusion experiment, since the real-time phase evaluation algorithms were thus far missing.
During OP1.2a the algorithm described in this paper was used at W7-X for exactly this purpose. Figure 11 shows W7-X shot #20171207.06 an example discharge in feed-back mode. The top depicts the applied ECRH heating power and the middle plot the gas puff rate. Wendelstein 7-X is equipped with 11 valves placed around the torus, which can be fed with a variety of fuelling gases. The bottom plot shows the plasma density as measured by the IEDDI system.
The shot is started with a He-gas pre-fill using valve BG11 (blue) for the initial density step. The feed-back system was enabled 500 ms into the shot, even though a desired density was set before that point in time. Using this the He-density is increased until about 1300 ms into the shot, where the target density is first reached. At this point the plasma is hit with H-pellets at a frequency of 30 Hz to increase the density. The inlay shows a time-zoom of a pellet ablation event. The density spike, is presumed to be a plasmoid extending through the IEDDI view cord. After the pellet magazine has been used up, density control is recovered just before the end of the discharge around 3500 ms.
- 15 - Figure 11. Example shot with density feed-back enabled. The top shows the total ECRH power applied to the plasma. The middle plot is the feed-back controlled gas puff rate. The bottom shows the IEDDI measurement used for feed-back control with the set density rate over-plotted.
A second interferometer is not available at W7-X for a verification measurement, however the measurements qualitatively match the Thomson and Bremsstrahlung-emission measurements. The shot shown in figure 11 is a high-performance scenario for W7-X. As can be seen the interferometer tracks the density reliably through-out the shot. Neither refraction, nor the steep density rise due to pellets results in disturbance of the density measurement.

Double data-rate evaluation
As mentioned in section 3.1 the phase evaluation algorithm can be modified to acquire data in a double data rate (DDR) mode. Instead of updating the elements of the sums in equation (2.3) on every rising edge only, one may also update them alternating on the rising and falling edge. Since the modulation signal is anti-symmetric around the modulation signal's falling edge, a phase measurement will still yield a qualitatively correct result for changes faster than the nominal 25 kHz Nyquist frequency. The absolute density change for a component changing faster than 25 kHz is incorrect, however looking at such high-frequency components rarely requires absolute accuracy.
For plasma control purposes this DDR mode has a more important benefit, namely phase-wrap stability. Figure 12 shows a measurement of plasma density for W7-X shot #20171025.43 during a The SDR and DDR measurements match perfectly up to the highly dynamic phase at the peak of the density curve. In the region marked a 2π-wrap occurs in the SDR signal, but not in the DDR signal, which leads to the density not returning to 0 at the end of the discharge.
density spike at the end of the discharge. This type of "shut-off" behaviour is quite commonly be observed during discharges with moderate and high energy content. Both the conventional single data rate (SDR) mode normally employed as well as the data acquired using the DDR mode are shown. The calculation was done in post processing using the raw data acquired by the FPGA, however the evaluation was conducted using algorithms employed by the FPGA, such that the same results are obtained. As can be seen in the figure the SDR and DDR traces match perfectly up the roughly 713 ms, where they suddenly are separated by roughly 7.5 × 10 19 m −2 , the equivalent density of a 2π phase mismatch at 10.6 µm laser wavelength. After this point both traces simultaneously descend to the null density, but while the DDR trace returns to the 0 line, the SDR trace goes negative. During the highly variable phase the SDR algorithm experienced a phase wrap due to the limited sampling frequency, where the DDR trace did not.
While stellarator plasmas tend to be rather stable and such extreme events are only expected during the end of a discharge ending in a radiative collapse, the interest for the tokamak community is significantly higher. Here violent MHD activity is more common, e.g. sawteeth and disruptions, and tend to upset interferometer traces. A higher phase wrap stability is therefore of great value.

Final remarks
In this paper we have presented a novel phase evaluation measurement technique for dispersion interferometers. The algorithm is real-time capable, robust and can easily be implemented on a field programmable gate array (FPGA). The resource usage is minimal, such that even low-cost hardware can be employed. The method has been implemented for the Wendelstein 7-X (W7-X) integral electron density dispersion interferometer (IEDDI) and was the only reliable interferometer -17 -measurement during the OP1.2a operation campaign. The measurement accuracy of the W7-X IEDDI system in combination with the developed algorithm was shown to be around 2 × 10 18 m −2 at any given time, with a continuous increase in measurement uncertainty around 4 × 10 17 m −2 /min from the time of taking the offset.
The method has the ability to provide a double data rate mode (DDR), acquiring samples at twice the modulation frequency, which was shown to be useful during highly dynamic plasma activity, such as a radiative collapse, significantly increasing the 2π-wrap stability.

Outlook
Currently there are several improvement development underway to increase the measurement accuracy of the system. First it is planned to exchange the wedges, such that the full CORDIC circle shown in figure 7 can be scanned accurately. This could provide a means to compensate the distortions. Preliminary tests have shown that the nonlinearity error described in section 5.3 can be reduced by 50 % this way.
The second modification is the measurement and compensation of the asymmetries seen in figure 2. We have seen that the 10.6 µm laser power is modulated by the photo elastic modulator (PEM) before being frequency doubled a second time. This modulation is slightly phase shifted against the diode signal and could therefore contribute to the asymmetries. As has been shown in section 4.2 we have a distorted i component, while the q component is essentially sinusoidal. Since the modulation is also symmetric, it will compensate itself for the addition of the half-integrals in equation (2.3), but enhance itself for the subtraction. Therefore a measurement of the modulation may provide the ability to compensate it on-the-fly and further reduce the non-circularity error.
A final modification is a dedicated environmental monitoring system for the IEDDI optical beam path, which feeds its data directly into the FPGA system. This will enable a real-time correction of the phase based on equation (5.2) as a significantly cheaper alternative to an environmental control system using dry-air or nitrogen puffing.