BlockWerk Documentation
⏳

Smith Predictor

Dynamics

The Smith Predictor compensates for dead time — the transport delay between acting on a

process and seeing the result, like the hot water that takes seconds to reach the shower

head. A PID controller fed the delayed measurement keeps pushing while nothing seems to

happen, overshoots, and oscillates; the usual cure is detuning it until it is slow.

The block holds an internal first-order model of the plant and runs it twice: once

without the dead time and once with it. Its output, the predicted process variable, is

the undelayed model plus whatever the measurement disagrees with the delayed model. Wire

that output to the controller's feedback and, when the model matches, the controller

sees the plant as if the dead time were not there — so it can be tuned for the plant

alone, and the response is that fast response, shifted by the dead time.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

Gm(s)=Kτs+1,y^(t)=ymeas(t)−y^m(t−θ)+y^m(t)G_m(s) = \frac{K}{\tau s + 1}, \qquad \hat{y}(t) = y_{meas}(t) - \hat{y}_m(t - \theta) + \hat{y}_m(t)

Where:

  • u (input u) is the controller output, which drives both the plant and the model
  • y_meas (input y) is the measured process variable, with the dead time in it
  • ŷ_m is the model output without dead time (output ŷ_model)
  • y_meas − ŷ_m(t − θ) is the model error (output e_model): disturbances plus mismatch
  • ŷ is the predicted process variable (output ŷ)

The model is discretised exactly for the simulation sample time (zero-order hold on

u) and advances once per sample.

Inputs & Outputs

Direction ID Label Type Status
→ In in1 u number Required
→ In in2 y number Required
← Out y_pred ŷ number Output
← Out y_model ŷ_model number Output
← Out error_model e_model number Output

Parameters

Parameters Label Type Default Description
gain Plant Gain (K) number 1 Static gain of the plant model
tau Time Constant (τ) number 10 First-order time constant of the plant model
deadTime Dead Time (θ) number 5 Transport delay to compensate; should match the plant's dead time
initialOutput Initial Output number 0 Model output at the start; set it to the plant's initial value

Usage Examples

PI Control Across a 5 s Dead Time

A PI controller tuned for the plant 1/(10s+1) alone — Kp = 2, Ki = 0.2, whose

integral time cancels the plant's time constant — drives that plant through 5 s of dead

time. Fed back through the Smith predictor the plant output rises as a smooth first-order

curve, 5 s late. Rewire the subtraction's second input to the delayed output instead and

the same controller oscillates.

Remarks & Best Practices

  • The compensation is only as good as the model. A wrong gain or time constant shows up

in e_model and is corrected there, but a wrong dead time can make the loop worse than

no predictor at all: match deadTime to the plant first.

  • The internal model is open loop, so a Smith predictor is for stable plants. An

integrating or unstable plant drifts away from its model.

  • Disturbances reach the controller only through the measurement, so they are still

rejected a dead time late — the predictor speeds up setpoint tracking, not disturbance

rejection.

Related Components