SCPN Control — The Fastest Open-Source Fusion Controller¶
The Problem¶
Fusion energy is within reach, but real-time plasma control remains the bottleneck. Today's tokamak control systems are:
- Slow — physics loops at 4--10 kHz, limited by Fortran/C legacy code
- Fragile — no formal verification, no disruption prediction
- Monolithic — tightly coupled to specific machines (DIII-D, ITER)
- GPU-locked — P-EFIT needs CUDA for sub-ms reconstruction
scpn-control solves all four.
The Solution¶
A standalone neuro-symbolic control engine that compiles Stochastic Petri Nets into spiking neural network controllers — with formal verification, sub-ms latency, and zero GPU dependency.
11.9 microsecond control loop¶
Faster than any open-source fusion code. Faster than the DIII-D PCS physics loops. On commodity hardware. No FPGA. No InfiniBand.
| Metric | scpn-control | DIII-D PCS | TORAX | ITER PCS |
|---|---|---|---|---|
| Control frequency | 10--30 kHz | 4--10 kHz | Offline | ~100 Hz |
| Step latency (P50) | 11.9 us | 100--250 us | ~ms | 5--10 ms |
| Language | Rust + Python | C/Fortran | JAX | TBD |
| GPU required | No | No | Yes | TBD |
0.39 ms neural equilibrium — without GPU¶
P-EFIT achieves <1 ms on GPU hardware. scpn-control matches this on CPU only using a PCA + MLP surrogate trained on SPARC geometries.
Full-stack control in one package¶
| Capability | Status |
|---|---|
| Grad-Shafranov equilibrium solver | Production |
| 1.5D coupled transport | Production |
| PID controller | Production |
| H-infinity controller (Riccati) | Production |
| MPC (gradient-based, surrogate dynamics) | Production |
| Spiking neural network controller (Nengo) | Production |
| Phase dynamics (Kuramoto/UPDE) | Production |
| WebSocket live telemetry | Production |
| Formal contract verification | Production |
| ML disruption prediction (Transformer) | Experimental |
| SPI ablation mitigation | Experimental |
| Real-time digital twin | Experimental |
| Neuro-cybernetic controller | Experimental |
Why It Matters¶
For Fusion Startups¶
You need real-time control now, not after a 3-year bespoke development cycle. scpn-control gives you:
- Drop-in controller with 1969 tests and CI-gated RMSE validation
- Runs on edge hardware (no data center required)
- MIT/Apache-2.0 dual-licensed — no copyleft restrictions
For National Labs¶
Your PCS is decades old. scpn-control offers:
- Modern Rust + Python stack replacing legacy Fortran
- Formal verification via contract-based pre/post-condition checking
- Digital twin for offline commissioning and operator training
For ITER / DEMO¶
The 100 Hz diagnostic cycle won't cut it for disruption mitigation. scpn-control's 30 kHz loop gives you the headroom for:
- Real-time disruption prediction (ML-based, <1 ms inference)
- SPI pellet injection with halo current / runaway electron physics
- Closed-loop SNN feedback replacing hardwired interlock logic
Architecture¶
src/scpn_control/
+-- scpn/ Petri Net -> SNN compiler (formal contracts)
+-- core/ GS solver, transport, scaling laws
+-- control/ PID, MPC, H-inf, SNN, digital twin
+-- phase/ Paper 27 Kuramoto/UPDE engine (7 modules)
scpn-control-rs/
+-- control-types/ PlasmaState, EquilibriumConfig
+-- control-math/ LIF neurons, Boris pusher, Kuramoto
+-- control-core/ GS solver, transport, scaling
+-- control-control/ PID, MPC, H-inf, SNN
+-- control-python/ PyO3 bindings
Live Demo¶
Streamlit Dashboard: scpn-control.streamlit.app
Real-time 16-layer Kuramoto-Sakaguchi phase sync with global field driver. Interactive controls for coupling strength, oscillator count, and Psi driver.
Phase sync convergence (500 ticks, 16 layers x 50 oscillators):
Validation¶
Every claim is CI-verified. Every benchmark is reproducible.
| Validation | Method | Result |
|---|---|---|
| DIII-D shot replay | 16 reference shots, RMSE gated | < 15% Te RMSE |
| SPARC equilibrium | 8 EFIT reference equilibria | < 5% flux error |
| IPB98(y,2) scaling | ITPA multi-machine database | 26.6% RMSE |
| Kuramoto convergence | R -> 0.92, V -> 0, lambda < 0 | 500-tick verified |
| Control latency | Criterion benchmark (P50/P99) | 11.9 / 23.9 us |
| Neural equilibrium | PCA + MLP vs Picard ground truth | 0.39 ms mean |
Getting Started¶
pip install scpn-control # From PyPI (v0.2.0)
scpn-control demo --steps 1000 # Closed-loop control demo
scpn-control benchmark # PID vs SNN timing
scpn-control live --zeta 0.5 # Real-time WS phase sync
# Rust acceleration (optional)
cd scpn-control-rs
cargo test --workspace
cd crates/control-python && maturin develop --release
Publications¶
- Paper 27: "The Knm Matrix" — 16-layer Kuramoto-Sakaguchi phase dynamics with exogenous global field driver. arXiv:2004.06344
- Competitive Analysis: Full benchmark comparison against DIII-D PCS, TORAX, FUSE, GENE, JINTRAC, P-EFIT
Licensing¶
| Open Source | MIT OR Apache-2.0 — permissive, no copyleft |
| Contact | protoscience@anulum.li |
| Organization | ANULUM CH & LI |
| Authors | Miroslav Sotek (ORCID), Michal Reiprich |
Next Steps¶
- Try it:
pip install scpn-control - See benchmarks: Competitive Analysis
- Live demo: scpn-control.streamlit.app
- Talk to us: protoscience@anulum.li