Real-time virtual circuits for plasma shape control via neural network emulators: integration and testing in the MAST-U PCS
Authors: Matthew J. Marshall, Edward Jones, Graham J. McArdle, Alasdair Ross, Kamran Pentland, Nicola C. Amorisco, Charles Vincent, Martin Kochan, Colin Hogben, Graham Jones, Adam Stephen, George K. Holt, Adriano Agnello
Organizations: Hartree Centre, STFC, Daresbury Laboratory, Daresbury, WA4 4AD, United Kingdom · UKAEA, Culham Campus, Abingdon, OX14 3DB, United Kingdom
The deployment of advanced, AI-enabled control algorithms in tokamak experiments requires robust integration with existing plasma control system (PCS) architectures and extensive pre-experimental validation. In this contribution, we describe the integration and testing of neural-network-emulated virtual circuits for plasma shape control within the MAST Upgrade (MAST-U) PCS environment. The neural network models predict the plasma shape using the plasma current, poloidal field coil currents, and plasma profile parameters. In this paper, we explain how they are deployed via a real-time C++ inference server that interfaces with the PCS, returning the shape prediction and its Jacobian, and how, from the latter, virtual circuit matrices and updated coil current requests are computed for real-time actuation. Emphasis is placed on the validation workflow and best practices adopted to ensure confidence in the proposed control framework prior to experimental deployment. This work demonstrates practical AI-based shape control components for fusion control systems, with direct relevance for upcoming MAST-U experiments and future devices.
Figures & tables
Figure 1: RTVC Server architecture, showing related PCS initialisation (red), RTVC Server initialisation (purple), RTVC Server ”server mode” (blue). All memory allocations occur in the red and purple phases, with the blue phase simply performing inferences and finite-differences, retrieving inputs from and sending results to a shared memory segment.
Description
Average
p90
p95
p99
ns
kHz
ns
kHz
ns
kHz
ns
kHz
No Inference
650
1500
830
1200
920
1100
1200
833
Single Model
50000
20
65000
15
65000
15
190000
5
Ensemble of 8
590000
1.7
730000
1.4
890000
1.1
930000
1.1
Table 1: Timings and frequencies of RTVC Server for end-to-end requests (average and 90th, 95th, 99th percentiles).
Figure 2: Scenarios 1-7 of PCS Simulation testing, comparing the coil current requests produced by TensorFlow emulators in FPDT (“emulator”) against the requests produced by RTVC (“PCS”).
Figure 3: Unapproved dI/dt requests in commissioning shots 53974, 53975 and 53976 from Python emulators and RTVC. Note that shot 53976 terminated at 0.38s—unrelated to RTVC.
Conventional plasma shape control in tokamaks relies on virtual circuits (VCs) that are computed offline from linearisations around a small, tailored number of reference equilibria, and deployed as expertly prepared schedules during the discharge. Here, we report on the first experimental deployment of real-time VCs. We replace pre-set look up tables with VCs updated in real time using surrogates of the plasma response. Both the existing control architecture and the interpretability of VC-based control are retained. Previous work showed that neural network emulators can produce accurate VCs, and validated their performance in closed-loop shape control simulations. Here, we report their first experimental validation on MAST Upgrade (MAST-U). Dedicated experiments spanning different scenarios, including prescribed shape perturbations, feedback-driven divertor-leg motion, and strongly evolving plasma configurations, show that real-time VCs can realise plasma shape control tasks within the MAST-U plasma control system. These results establish the experimental feasibility of real-time linearisations as a practical extension of conventional plasma shape control in tokamaks. The present implementation demonstrates a central step towards a simpler control workflow, in which manually constructed, phased VC schedules are replaced by VCs generated automatically online from a trained surrogate model, without scenario-specific retraining.
Nicola C. Amorisco, Kamran Pentland, Adriano Agnello +12
United Kingdom Atomic Energy Authority, Culham Campus, Abingdon, Oxfordshire, OX14 3DB, United Kingdom · STFC Hartree Centre, Sci-Tech Daresbury, Keckwick Lane, Daresbury, Warrington, WA4 4AD, United Kingdom
Reliable position and shape control in tokamak plasmas requires accurate real-time regulation of several strongly coupled shape parameters. The control vectors that disentangle these couplings, referred to as virtual circuits (VCs), enable independent shape parameter control for a specific Grad--Shafranov (GS) equilibrium. Numerical calculation of VCs is not currently feasible in real time, therefore VCs are usually computed prior to each experiment, using a small number of reference GS equilibria sampled along the desired scenario trajectory, with each VC used to control the plasma within a preset time interval. While effective near the reference equilibrium, this approach can lead to degraded performance as the plasma departs from the reference equilibrium and/or from the desired trajectory, and it complicates the design of robust control strategies for rapidly evolving plasma configurations. In this paper, we construct neural-network-based emulators of plasma shape parameters from which VCs can be derived, to provide the MAST Upgrade (MAST-U) plasma control system with state-aware VCs in real-time. To do this, we develop an extensive library of over a million simulated GS equilibria, covering a substantial portion of the MAST-U operational space. These emulators provide differentiable functions whose gradients can be rapidly computed, enabling the derivation of accurate VCs for real-time shape control. We perform extensive verification of the emulated VCs by testing whether they disentangle the control problem. The neural-network-based approach delivers high accuracy and orthogonality across a diverse range of equilibria. This work establishes the physical validity of emulated VCs as a scalable and general alternative to schedules of precomputed VCs.
Alasdair Ross, George K. Holt, Kamran Pentland +7
STFC Hartree Centre, Sci-Tech Daresbury, Keckwick Lane, Daresbury, Warrington, WA4 4AD, United Kingdom · United Kingdom Atomic Energy Authority, Culham Campus, Abingdon, Oxfordshire, OX14 3DB, United Kingdom
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