A packet-level digital hardware twin for commissioning megahertz diagnostic edge AI and plasma control system integration in tokamaks
Authors: Semin Joung, Abhilasha Dave, Luca Scomparin, Filipp Khabanov, Zheng Yan, Benedikt Geiger, George McKee, Ryan N. Coffee, +1 more
Organizations: Department of Nuclear Engineering and Engineering Physics, University of Wisconsin–Madison, Madison, WI, USA · SLAC National Accelerator Laboratory, Menlo Park, CA, USA
High-bandwidth plasma diagnostics increasingly provide inputs to machine learning and signal-processing algorithms intended for real-time tokamak control, but the complete path from diagnostic sampling to control-system handoff is difficult to commission because of their sampling rates. We develop a packet-level digital hardware twin for the megahertz diagnostic edge-AI architecture. The simulator represents a 64-channel, 1 MHz beam emission spectroscopy (BES) diagnostic embedded in a 96-channel dual-carrier acquisition system, two 48-channel streams with SPAD0 sample counters, 10 GbE Hardware UDP transport, packet loss and network jitter, FPGA parsing and dual-carrier alignment, causal preprocessing and edge inference, a compact Ethernet result packet, receiver-side shared state, and a 1 kHz PCS-like control cycle. Binary UDP payloads and PCAP files are generated rather than emulating transport only at the array level. With a baseline of 20 samples per packet, each carrier generates 50,000 packets s−1 and 100 MB s−1 of user payload. A 110 ms reference run produces 11,000 HUDP packets; an intentionally dropped 20-sample packet is detected by the sample-counter continuity logic and invalidates the two overlapping 128-sample inference windows without silent interpolation. For valid windows, the configured engineering latency model gives a median last-input-to-shared-memory latency of 91.6 us and a 99th percentile of 108.1 us. A separate operating-system loopback test sends binary FPGA-result datagrams through a UDP receiver into POSIX shared memory and preserves packet sequence and CRC for 20/20 packets. Interactive GUI interfaces expose timing, packetization, network faults, inference thresholds, and control-state inspection. The framework provides a reproducible environment for testing diagnostic-to-accelerator interfaces and fail-safe behavior for deployment on fusion devices.
Figures & tables
Figure 1: DIII-D-oriented full-system simulator. The modeled control-critical path begins with 64-channel BES, uses two 48-channel acquisition carriers with SPAD0 sample counters and 10 GbE HUDP transport, reconstructs a synchronized stream at an edge FPGA, and forwards a compact result packet through a PCS-facing receiver and shared state to a 1 kHz virtual controller. Recording and replay are parallel support paths. The architecture represents the proposed path.
Fixed by the baseline configuration but retained as named parameters so that the implementation can be updated with the final hardware configuration.
Configurable engineering assumptions
samples per packet, MTU, network jitter, deskew depth, causal filter band, inference latency, PCS cycle, stale timeout
User-adjustable values used for commissioning sweeps and sensitivity tests; no claim that they are measured DIII-D latencies.
Simulator-only placeholders
synthetic ELM probability model, virtual plasma/RMP response, PCS Packet v0 binary layout
Isolated behind explicit interfaces so that trained models, measured actuator behavior, and the final DIII-D PCS packet/shared-memory schema can replace them without changing the surrounding data path.
Table 1: Fidelity levels used in the digital hardware twin simulator.
Figure 2: Packet contract and fault propagation in the baseline simulation. (a) One HUDP user payload contains 20 samples, each composed of 48 16-bit ADC values and a 32-bit SPAD0 sample counter, for 2000 bytes per packet. (b) Carrier-B packet sequence 4200 is intentionally dropped. (c) The missing 20-sample interval invalidates the two 128-sample, 64-stride FPGA windows that overlap the missing counters. All results in this figure are generated by the simulator rather than measured on DIII-D hardware.
Figure 3: Configured engineering latency for valid windows. (a) Distribution of last-input-ready to shared-memory-write latency for the 110 ms baseline run. (b) Median component budget. The 1 ms line is a reference requirement, not a measured hardware comparison. All component delays in this figure are configurable simulator assumptions.
Figure 4: PCS-facing simulator behavior and process-level loopback verification. (a) Synthetic edge outputs, virtual controller request, and shared-state age in the 1 kHz PCS-like loop. Event labels and actuator response are simulator-only. (b) Generation and sequence counters observed while binary result packets cross a localhost UDP receiver and POSIX shared-memory boundary. (c) Example virtual event outcomes and CRC summary. The final state-age increase occurs after the 110 ms synthetic data stream ends and demonstrates the stale-state logic.
Figure 5: Static view of the interactive commissioning interface generated from the same synthetic HDF5 and packet traces used in the paper. The operator can inspect PELM , vturb , the virtual actuator request, stream validity, latency statistics, and the spatial BES state. The current GUI is a development tool and not the production DIII-D PCS user interface.
Plasma diagnostic models for tokamak fusion devices are almost universally evaluated on clean, complete sensor data. In practice, fusion diagnostics fail regularly: acquisition systems start late, individual sensors die, and signal dropouts cluster precisely when a plasma disruption is approaching. We present the first systematic robustness benchmark for plasma diagnostic ML using the TokaMark dataset of 11,573 MAST shots, evaluating XGBoost, LSTM, Transformer, and the TokaMark CNN baseline across six physically-grounded failure scenarios and three imputation strategies. We introduce the Robustness Score (RS) for standardized cross-architecture comparison. Our central finding is that disruption-proximate sensor failure (corruption injected in the final window timesteps) collapses sequence model performance (LSTM +212% NRMSE) while a statistical feature model remains comparatively stable (XGBoost +37%). Forward-fill imputation eliminates nearly all degradation from random dropout for sequence models (LSTM +57% to ~0%), but offers little help when the end of the window is corrupted. Shot-level alarm evaluation using ground-truth disruption timestamps reveals that LSTM alarm detection collapses to TPR=0.00 under proximate sensor failure, while mean-fill imputation recovers it to TPR=1.00, a reversal of the pattern observed in NRMSE. Plasma current emerges as the single most critical diagnostic across all architectures (+73% to +140% upon removal). Code, data, and trained checkpoints are available at https://github.com/Neerav-Gupta/tokamark-robustness.
Digital twin technologies have the potential to improve operational flexibility and responsiveness capabilities of nuclear systems. To provide decision support, cyber event characterization, state estimation, predictive control, and real-time dynamic processing of operational data, however, an efficient digital twin needs to integrate multiple models (data-driven as well as physics-based) with explainability while at the same time maintain two-way synchronization with the physical facility at a time constant less than its operational cycle. In this work, we present the Purdue University Reactor One Digital Twin (PUR-1 DT), a cyber-physical digital twin with a complete high-fidelity physics-based and AI-driven virtual model stack (neutronics, thermal-hydraulics, point kinetics) which provides closed-loop explainable diagnostics, forecasting, predictive control, and action recommendation back to the reactor via two-way communications and a cyber-physical testbed. We demonstrate real-time synchronized state estimation and short-term forecasting over a full reactor operational cycle and conduct a series of benchmarking experiments to validate accuracy and latency. Our results show good agreement with experimental results and lay the groundwork for further development and experimental demonstration of DT-enabled functionalities in real-world facilities.
Plasma shape control in tokamaks requires a real-time controller that tracks dynamically changing shape targets while tolerating diagnostic failures. Classical approaches decompose the problem into equilibrium reconstruction followed by a linear controller, and assume a fixed, fully operational sensor set. We present a reinforcement learning agent that addresses both limitations simultaneously. The agent is trained in NSFsim, a high-fidelity tokamak simulator configured for DIII-D, on a curated dataset of 120 experimental plasma shapes. The shape targets are resampled as random step changes every 0.25 s, exposing the agent to diverse transitions across the full shape envelope. At test time the agent zero-shot tracks dynamic shape sequences; on a held-out static configuration in simulation it achieves a mean shape error of 2.01 cm, and dynamic trajectory following is demonstrated qualitatively in simulation and on the physical device. Diagnostic dropout randomly masks 30% of magnetic sensors per episode, yielding a single policy robust to arbitrary sensor subsets without backup controllers or mode-switching logic. An asymmetric actor-critic architecture with privileged equilibrium information improves value estimation under partial observability; an auxiliary shape reconstruction head on the actor enables end-to-end shape reconstruction from raw diagnostics and serves as an interpretability tool for policy analysis. The policy transfers to experimental DIII-D shots, where it directly commands the coil actuators on two dynamic shape maneuvers, and to the independent GSevolve simulator.
D. Sorokin, M. Stokolesov, A. Granovskiy +7
Next Step Fusion, Bertrange, L-8070, Luxembourg · Center for Energy Research, University of California San Diego, CA 92093, USA