HomeEngineering & MaterialsAI PID Auto-Tuner (2D): SPSA Reinforcement Learning for Process Control

AI PID Auto-Tuner (2D): SPSA Reinforcement Learning for Process Control

2D strip-chart view of an SPSA reinforcement-learning agent auto-tuning a PID controller for an industrial tank-level loop with dead time — live PV/SP trace, a Kp-Ki gain-space scatter, and real ISE-plus-overshoot cost readouts.

Engineering & Materials2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-ai-topic-80 ↗ Open standalone

Hand-tuned PID loops are still the backbone of industrial control — but Industry 4.0 plants increasingly hand the tuning itself to an AI agent. This 2D simulator models a real tank-level loop as a first-order-plus-dead-time process driven by a PID valve controller, then lets an SPSA (Simultaneous Perturbation Stochastic Approximation) reinforcement-learning agent search for the gains that minimize a real ISE-plus-overshoot cost function using only two rollouts per update — no gradient of the plant model required, exactly as a model-free industrial auto-tuner would. A live strip chart shows the level step-response settle in faster, tighter, less oscillatory as training runs, while a Kp–Ki gain-space scatter plot shows the exact path the agent walked to get there.

⚙ Under the hood

A 2D strip-chart view of an SPSA reinforcement-learning agent auto-tuning a PID controller for an industrial tank-level loop with dead time: a live PV-vs-setpoint trace and a Kp-Ki gain-space scatter plot show the search converging on a real ISE-plus-overshoot cost minimum.

PID controlreinforcement learningSPSAindustrial automationprocess controlauto-tuning

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)