Browser-based interactive simulator demonstrating cascade PID control advantages over single-loop control for pasteurization processes.
Live Demo: https://arthurkax.github.io/pid-cascade/
Simply open the simulator in your browser - no installation required. The simulation starts automatically.
- Click Manual button
- Use Valve Position slider (0-100%) or click valve in diagram
- Observe temperature changes on HMI and charts
- Click 1 PID button
- Set SP (Setpoint) temperature (default: 72°C)
- Adjust PID parameters to tune response
- Watch the PID maintain setpoint by controlling the valve
- Click Cascade PID button
- The system uses two nested PID loops:
- Outer Loop (Master): Controls milk temperature by setting steam pressure
- Inner Loop (Slave): Controls steam pressure for faster disturbance rejection
- Compare response with Single Loop mode when applying disturbances
Click Run Test to start a standardized evaluation of your PID tuning.
-
Warmup (max 360s)
- All temperatures reset to 20°C (room temperature)
- Waits for PV to reach SP (Setpoint)
- After first touch, waits 15s for stabilization
- IAE scoring starts ONLY after PV first reaches SP
- This tests startup transient and overshoot
-
Cold Product (5°C) (max 360s)
- Inlet temperature drops to 5°C
- Tests disturbance rejection capability
- Waits for inlet to reach 5°C ±0.5°C
- Then waits 15s with |PV-SP| < 1°C for stabilization
-
Stabilization (max 180s)
- Maintains at 5°C inlet temperature
- Tests steady-state performance
- 15s stabilization with |PV-SP| < 1°C required
-
Water (15°C) (max 300s)
- Inlet temperature rises to 15°C
- Tests response to positive temperature step
- Waits for inlet to reach 15°C ±0.5°C
- Then waits 15s with |PV-SP| < 1°C for stabilization
-
Boiler Failure (max 90s)
- Simulates gradual steam pressure loss
- Boiler pressure drops to 0.5 BAR
- Maintains for 15s at 0.5 BAR
- Tests robustness to equipment failure
The test runs at accelerated simulation speeds:
- Fast (5x): Default speed for efficient testing
- Turbo (10x): For quicker results
- Ludicrous (20x): For rapid iteration
You can adjust speed during test using the speed selector.
- IAE (Integral Absolute Error): Accumulated absolute error
- Scoring starts ONLY after temperature first touches setpoint during warmup
- Errors within ±1.0°C don't increase score (deadband)
- Lower score = better control performance
- Score reflects: startup transient, overshoot, disturbance rejection, steady-state error
After completing the test:
- Score Modal shows your final IAE score, mode (Cascade/Single), and duration
- Enter your name (max 20 characters)
- Click Save Score to submit to Firebase leaderboard
- View leaderboard to compare your tuning with others
- Leaderboard shows: rank, name, score, mode, and date
- Chart Tooltip: Hold ALT over chart to see all values at a specific time
- Variable Selection: Toggle variables on/off using color-matched buttons
- Technical Hints: Hold ALT while hovering over any control parameter (Kp, Ti, Td, etc.) to see its technical explanation
- Direct Input: Click sensors or valves in SVG diagram to interact directly
- Pause (0x): Freezes simulation
- Normal (1x): Standard speed
- Quick (2x) to Ludicrous (20x): Faster speeds for long-term testing
Test control system's robustness:
- Boiler Failure: Gradual steam pressure drop from 3 BAR to 0 BAR over 30 seconds
- Valve Wear (Deadband): Adds mechanical deadband (0-5%) where small valve commands are ignored
- Pressure Noise: Random pressure fluctuations (0-1 BAR) simulating other plant loads
- Reset Scene: Resets physics and time, keeps your PID tuning parameters
Master PID (Temperature Control):
- Kp: Proportional gain (0.1-10)
- Ti (s): Integral time (0.1-1000s)
- Td (s): Derivative time (0-100s)
- Deadband (°C): Range around SP where controller freezes output
- SP (°C): Temperature setpoint (60-85°C)
Slave PID (Steam Control):
- Kp: Proportional gain (0.1-20)
- Ti (s): Integral time (0.1-500s)
- Td (s): Derivative time (0-50s)
MIT License - see LICENSE file.
Created by ArthurkaX for PLC engineers and automation specialists.
