Tank Level Control Simulator — PI Loop, Inlet Valve & Gravity Outlet Interactive

Interactive PI level-control simulator around a transparent process tank — tune proportional and integral gain against a modulating inlet valve, hydrostatic transmitter and square-root gravity outlet, with a 3D model, transmitter bias and stuck-valve faults, model-verification bench and knowledge-check quiz.

← PLC / SCADA / Automation Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Tank Level Control Simulator

This simulator models a cylindrical process tank with a pneumatic inlet control valve, hydrostatic level transmitter, gravity outlet with a hand-adjustable restriction, PLC PI controller and overflow standpipe. Switch between automatic PI control and manual valve demand, tune proportional and integral gain, and inject a transmitter bias or a stuck-valve fault to see how true level, measured level and controller demand can disagree.

What the simulator shows

• A real-time 3D model of the tank shell and liquid inventory, pneumatic inlet control valve, hydrostatic level transmitter, gravity outlet/hand valve, PLC PI controller panel and overflow standpipe, with home view, focus-selected-part, toggleable full-enclosure cutaway, exploded view, auto-rotate, expand and show/hide labels controls, and tappable numbered components with callouts. • Nine live controls: level setpoint (0.3–2.7 m), initial level before start (0.2–2.8 m), automatic PI control on/off, manual inlet demand fraction, outlet restriction opening, proportional gain Kp, integral gain Ki, a "freeze current valve position" stuck-actuator fault, and level transmitter bias (−0.5 to 0.5 m). • Play/pause, single-step (0.1 s) and larger-step (1 s) time controls, plus a playback-speed selector (10× slow motion, real time, 10× faster, 1 minute per second) — useful for accelerating a slow-filling overflow scenario. • Start trial and Stop trial actions, with a live sequence narrative and per-component status. • Eight live metrics: true liquid level, measured level, setpoint, inlet flow, outlet flow, actual valve travel percentage, valve demand percentage, and overflow flow. • A Curves & measurements tab with two charts (true level/measured/setpoint vs. time, and inlet/outlet/overflow flow vs. time), the full model equations, and snapshot measurements. • An Experiments tab with four guided scenarios (automatic recovery, increased outflow, biased measurement, overflow in manual), a model-verification bench of independent automated checks, and a timestamped event log with a copyable trial report. • A Learn & assess tab with four guided lessons, a two-question knowledge-check quiz, and a written scope/reference statement.

How the PI loop, actuator lag and anti-windup interact

True level changes according to the net of inlet flow (proportional to actual valve position) minus outlet flow (proportional to the outlet restriction times the square root of liquid head, per the gravity discharge relationship) minus any overflow once the tank reaches its 3 m capacity, all divided by the fixed 1.5 m² tank area. In automatic mode the PI controller computes valve demand as Kp × error plus an accumulating integral term, clamped to 0–1, with conditional anti-windup that pauses integration once the unclamped demand has already saturated in the direction the error is pushing it.

The modeled inlet valve cannot jump to a new position instantly — it moves at a fixed 15%/s rate toward its commanded demand — so actual valve travel and valve demand are tracked as two separate metrics, and a "freeze current valve position" fault can hold the true valve open regardless of what the controller subsequently commands.

Why measured level and controller behavior can mislead you

The hydrostatic transmitter's measured level equals true level plus a configurable bias — the controller only ever sees and reacts to the measured value, so a positive bias makes the controller believe the tank is fuller than it actually is and settle true level below the numeric setpoint, exactly as the biased-measurement experiment demonstrates. The equations panel gives A dh/dt = Qin − Qout − Qoverflow, Qin = 0.03 × valve fraction, Qout = 0.025 × outlet fraction × √h, and u = clamp(Kp·e + integral, 0, 1).

This is a representative educational model of an incompressible, constant-area tank with the inlet approximated as an imposed constant-pressure flow; it does not claim a pump curve, fluid inertia, cavitation or a complete pneumatic actuator model, so treat the specific gains and time constants as generic teaching parameters rather than a sizing calculation.

Frequently asked questions

Why can the tank settle at the wrong true level even though the controller looks stable?

The PI controller only ever acts on the transmitter's measured level, which equals true level plus a configurable sensor bias. With a positive bias the controller believes the tank is fuller than it is and holds true level below the numeric setpoint — a stable-looking loop that is nonetheless controlling to the wrong physical level, which the biased-measurement experiment is built to expose.

What does the anti-windup behavior actually prevent?

The integral term stops accumulating once the unclamped PI output has already saturated (at 0 or 1) in the same direction the current error would push it further. Without this, the integral term could wind up far past the valve's physical 0–100% limits during a sustained error and then cause a large overshoot once the error reverses.

Why does the inlet valve position lag its commanded demand?

The model gives the inlet actuator a finite travel rate of 15% per second rather than instantaneous response, so actual valve travel chases valve demand rather than matching it immediately. A "freeze current valve position" fault can also decouple them entirely by holding the true valve position fixed regardless of any further commanded demand.

What does this tank level control model not include?

This is a representative educational model of an incompressible, constant-area (1.5 m²) tank with the inlet approximated as an imposed constant-pressure flow. It does not include a pump curve, fluid inertia, cavitation effects, or a complete pneumatic actuator model — the gains and time constants are generic teaching parameters.

Related tools & guides