Simulation Control

t_end — Simulation Time (s)

Type the simulation time and press Enter to apply.

Step the product setpoint while running to watch which loop does the work.

Structure

Both structures run every step, and the switch is bumpless in both directions.

Outer PID → Tj,sp

product temperature → jacket setpoint

Kp1.80
Ki0.200
Kd0.50
T2 Setpoint (°C)80.0
β — proportional weight 2-DOF1.00
γ — derivative weight 2-DOF0.00

Inner PID → Steam Valve

jacket temperature → steam valve (%)

Kp2.50
Ki0.800
Kd0.20

Jacketed Vessel & Steam

τ2 — vessel time constant (s)8.0
τj — jacket time constant (s)3.0
Ks — steam authority2.00
θ — transport delay (s)1.0
Tsteam (°C) — disturbance140
Tin (°C) — feed disturbance25

Controller Options

τD — derivative filter (s)1.00
σ — PV sensor noise (°C)0.00

Set σ = 1 °C and raise the outer Kd to see why the filter exists.

Presets

Cascade Control Schematic

LIVE
Steam 50% Tj,sp 80.0 Jacketed Vessel 25.0 °C Product out T2 Jacket Tj 25.0 °C Product out Feed Tin T2 meas Tj meas Tj,sp — cascade setpoint valve % single-loop direct path OUTER PID (TIC) 80.0 °C INNER PID (TjC) 50 % CASCADE 0.0 s steam 50 % outer measurement inner measurement cascade signal single-loop path valve signal
Product T225.00 °C
Jacket Tj25.00 °C
Tj setpoint80.00 °C
Steam valve50.0 %
Structurecascade
Error (SP − T2)55.000 °C
PV Product temperature T2 and its setpoint
PV Jacket temperature Tj and the setpoint handed down by the TIC
Product T2
25.00 °C
Jacket Tj
25.00 °C
Steam
50.0 %
Error T2
55.00 °C
Error Tj
—
IAE since step
0.0

Parameters & Equations

Two-loop cascade control on a jacketed stirred-tank heater — everything the simulation does, written out.

Concept

Cascade structure Outer: Tj,sp = PIDouter(T2,sp − T2)
Inner: u = PIDinner(Tj,sp − Tj) The outer (master) loop never touches the valve. It only asks the inner (slave) loop for a jacket temperature. The inner loop owns the valve.

Why cascade? The inner loop is the fast one (τj < τ2), so steam-pressure and jacket disturbances are corrected inside the inner loop before they can reach the product. The outer loop then sees a much better-behaved, faster-acting plant.

The rule: cascade only pays when the inner loop is at least about three times faster than the outer one (here τ2/τj = 8/3 ≈ 2.7). Drag τj up towards τ2 and the advantage disappears — the inner loop just adds lag.

Plant Model

Two energy balances τ2 · dT2/dt = (Tj − T2) − K1(T2 − Tin)
τj · dTj/dt = (T2 − Tj) + Ks·(u/100)·(Tsteam − Tj) τ2 = m2cp/UA · τj = mjcp/UA · K1 = wcp/UA · Ks = UAs/UA

Energy conserving. The coupling term (Tj − T2) appears with opposite signs in the two equations: the heat the jacket loses is exactly the heat the vessel gains. Nothing is created, so the steady state is exact and the integral cannot drift.

Physically bounded. The jacket term is (Tsteam − Tj), so as Tj approaches Tsteam the jacket stops accepting heat. The product can never reach Tsteam — that is the authority limit which makes the single loop slow to recover from a steam upset.

Steady State — Why the TIC Needs a Wide Range

Setting both derivatives to zero Tj − T2 = K1(T2 − Tin)
Ks(u/100)(Tsteam − Tj) = K1(T2 − Tin) With K1 = 0.5, T2 = 80 °C, Tin = 25 °C the jacket must sit 27.5 °C ABOVE the product.

The outer loop must therefore be allowed to ask for any jacket temperature between Tin and Tsteam. That is exactly why the TIC's output limits are the physical window and not 0–100 %: its output is a temperature, not a valve position.

The outer integral is what supplies that 27.5 °C offset. Because the TIC biases at the product setpoint (80 °C), it starts with zero output error and the integrator winds up to about 107.5 °C at the default conditions. Watch Tj,sp on the middle chart settle there.

Parameters

SymbolMeaningDefault
τ2Vessel capacity / UA8.0 s
τjJacket capacity / UA3.0 s
K1Through-flow number wcp/UA0.5
KsSteam authority UAs/UA2.0
θSteam transport delay1.0 s
TinFeed temperature25 °C
TsteamSteam temperature140 °C
T2,spProduct setpoint80 °C
uSteam valve (actuator)0–100 %

Controller Parameters

SymbolMeaningDefault (Outer / Inner)
KpProportional gain1.80 / 2.50
KiIntegral gain0.200 / 0.800
KdDerivative gain0.50 / 0.20
τDDerivative filter time constant1.00 s
β 2-DOFProportional setpoint weight1.00
γ 2-DOFDerivative setpoint weight0.00
AW windupAnti-reset windupon

Single loop (for comparison): Kp = 0.30, Ki = 0.50, Kd = 2.50. The single structure needs a derivative gain five times larger than the cascade outer loop to reach a comparable closed-loop speed, and still loses on a steam upset. That is the whole argument for cascade.

Bumpless transfer. The two structures bias at different values (the TIC at the product setpoint, the single loop at 50 %), so switching reloads the incoming controller's bias and integral to reproduce the signal already in service. Switch back and forth mid-run and the valve does not jump.

What to Try

1 — Make the two loops race. Step Tsteam from 140 °C down to 125 °C at 20x and watch. Both settle back to exactly the same place (T2 = 80.000 °C, Tj = 107.5 °C, valve 78.6 %), but the transients differ sharply:

Steam step 140 → 125 °CCascadeSingle loop
Peak T2 deviation1.34 °C3.85 °C
Time to within 0.1 °C15 s39 s
IAE of the excursion23 °C·s92 °C·s

The cascade cuts the peak excursion by about 3x and the integral of the error by about 4x. Click Single Loop and run the identical step to see it for yourself.

2 — Load the plant. Drop Tin from 25 to 10 °C. The jacket must now sit further above the product, so Tj,sp climbs. The inner loop tracks it without ever troubling T2.

3 — Break the speed hierarchy. Raise τj from 3 s to 15 s. The inner loop is now slower than the outer one and the cascade performs no better than the single loop — sometimes worse.

4 — Attack the dead time. Push θ to 5 s. The inner loop starts to ring because the valve it commands takes 5 s to act on the jacket. This is the classic reason a cascade needs a fast secondary measurement.

5 — See the filter earn its place. Set σ = 1 °C and outer Kd = 5. Then raise τD from 1 s to 4 s: the valve stops chattering and the product trace cleans up.

6 — Remove the safety net. Untick anti-reset windup, drive the setpoint to 130 °C so the valve saturates at 100 %, then bring it back to 70 °C. The valve stays pinned at 100 % for a long time while the wound-up integral unwinds.