Real-time simulation with animated tank schematic. Run/pause and adjust speed from 1x to 100x.
β < 1 softens the setpoint response (2-DOF). γ = 0 uses derivative-on-measurement. Turn windup off to see integral windup during saturation.
Step the setpoint while running to watch the transient response.
Everything this simulation uses, written out for study.
β (beta) is the proportional setpoint weight. β = 1 is a standard PID; β < 1 reacts more gently to setpoint changes (less overshoot) while still rejecting disturbances at full gain.
γ (gamma) is the derivative setpoint weight. γ = 0 gives derivative-on-measurement (no derivative "kick"); γ = 1 gives derivative-on-error.
| Symbol | Meaning | Default |
|---|---|---|
| A | Tank cross-section area | 2.0 m² |
| R | Outflow resistance | 1.0 |
| SP | Level setpoint | 5.0 m |
| d | Disturbance inflow | 0.0 m³/s |
| Kp | Proportional gain | 2.0 |
| Ki | Integral gain | 0.5 |
| Kd | Derivative gain | 0.0 |
| qin | Inflow (actuator, clamped) | 0–20 m³/s |
| Symbol | Meaning | Default |
|---|---|---|
| β 2-DOF | Proportional setpoint weight | 1.00 |
| γ 2-DOF | Derivative setpoint weight | 0.00 |
| α filter | Derivative filter (0 = off) | 0.00 |
| σ noise | PV sensor noise std-dev | 0.00 m |
| AW windup | Anti-reset windup (back-calculation) | on |
Anti-reset windup (back-calculation): when the inflow saturates at its limit, the integral is bled by the over-drive I ← I + (Δt/Tt)(usat − u), so it cannot "wind up". Turn it off to see the slow recovery caused by windup.
PV noise: a zero-mean Gaussian noise of standard deviation σ is added to the measured level only (the true level stays clean): hmeas = h + σ·N(0,1).
Derivative filter (α): the raw derivative is smoothed by a first-order filter Df[k] = a·Df[k−1] + (1−a)·Draw[k] with a = exp(−Δt/τ), where τ is a physical time constant set from α. α = 0 disables filtering; larger α suppresses noise amplification at the cost of a small lag.