The Thomson scattering (TS) diagnostic on the National Spherical Tokamak eXperiment Upgrade (NSTX-U) has been an essential system for many operational campaigns due to its function of measuring plasma electron density and temperature. Constructive feedback to improve the next plasma discharge, however, has been limited because of in-between shots analysis. Plasma control, therefore, desires a diagnostic system that is real-time capable. This contribution presents the development of software that demonstrates the feasibility of a real-time TS diagnostic system for NSTX-U. The developed software is able to evaluate the electron temperature and density within 2.5 ms.

The overall system requirement is specified by a 60-Hz timing cycle, which is driven by the TS laser pulse rate. The real-time software processes the peak amplitudes of the detected photons, evaluates the electron temperature and density, and then outputs them to an analog output card that is used to interface with the NSTX-U control. The real-time software is implemented in an object-oriented architecture using C++11. C++11 software components include Abstract class, Atomic data types for synchronization, and a Hash data structure. The software application makes use of multiple threads that run concurrently: a thread to acquire the photon peak amplitude and feed a circular buffer, threads to evaluate the electron density and temperatures, and a thread that supplies corresponding output voltages and feeds the output card.

In summary, the new real-time TS system has been proven to meet the 60-Hz system requirement. For this reason, the software implementation was deemed successful. In future NSTX-U campaigns, this diagnostic will be a great asset enabling real-time plasma density and temperature control.