Control Systems · tuning

PID Control

Tune the three gains, watch the closed loop chase the setpoint.
u = Kₚe + Kᵢ∫e + Kd·de/dt
—

Controller

three gains
5.0
2.0
1.00

Plant

what you control
2.0
1.0
Tune from the process

Step response

— t = 0.0 s

setpoint output
Performance
Detail
How it works

Tuning a PID controller by feel

Proportional (Kp)

Pushes in proportion to the current error. Responds fast but leaves a steady-state offset and, pushed too hard, oscillates. term = Kp·e(t).

Integral (Ki)

Accumulates past error and keeps acting until it is zero: this removes the offset, but too much makes the loop slow and overshoot-prone. term = Ki·∫e dt.

Derivative (Kd)

Responds to how fast the error is changing, braking as you approach. Damps overshoot, at the cost of amplifying noise. term = Kd·de/dt.

The trade-off

No single best tuning: speed, overshoot and robustness pull against each other. Classic methods give starting points; the real plant decides.

Worked example. With proportional control alone on a stable plant the output settles short of the target: a permanent steady-state error, because once the error shrinks so does the push. Add integral action and the offset disappears; add a touch of derivative and the overshoot on the way shrinks too. That progression, P → PI → PID, is the whole story in miniature. And on a τ = 2 s, θ = 0.5 s loop the three standard tuning rules give Kp of 4.8, 5.6 and 1.0: a factor of five that is not disagreement about the maths but about how much margin is worth buying.
Field notes

What each term does

Every tuning rule is an opinion about one ratio

Ziegler–Nichols, Cohen–Coon and lambda read the same three numbers off a process (gain, time constant, dead time) and differ only in how close to the stability edge they will sit. The whole question is set by θ/τ, how much of the response is delay. ZN targets quarter-amplitude decay, deliberately oscillatory; Cohen–Coon was built for loops where dead time is a large fraction of the time constant; lambda replaces the fixed opinion with a dial.

Without dead time there is barely a tuning problem

Dead time creates a gain ceiling. A lag reduces gain gradually and only ever approaches 90° of phase; a delay adds phase without limit, so at some frequency the correction arrives exactly out of step and the loop drives itself. Remove it and every standard formula divides by zero, because there is no phase limit to respect. When transport delay exceeds the process time constant, plain PID will disappoint: reach for feedforward, a Smith predictor, or fixing the delay.

Find the edge, then back off

Tuning by hand: raise proportional gain until the loop just oscillates, then halve it. The heart of Ziegler–Nichols: the oscillation point measures the process, and half that gain buys stability margin.

Read the oscillation

Slow rolling oscillation is too much integral; fast jitter is too much derivative amplifying noise. Each term fails with its own signature, and learning to read them turns tuning from guesswork into diagnosis.

Why P-only leaves an offset, and too much integral hurts

Proportional output is the error times a gain, so to hold any output you need some error. Too much integral keeps pushing after you have arrived, so the output sails past before the integral unwinds.

Questions

What people ask

Why does P-only leave an offset?

Proportional output is the error times a gain. To hold any output you need some error, so it settles wherever the remaining error produces just enough push. Integral action removes this.

What does too much integral do?

It makes the loop sluggish and prone to overshoot and oscillation — the accumulated term keeps pushing even after you've arrived, so the output sails past before the integral unwinds.

Why add derivative at all?

Derivative anticipates: it reacts to how fast the error is changing and applies the brakes early, damping overshoot. The downside is sensitivity to noise, so it's often used sparingly.

Is there one correct tuning?

No — it's a trade-off between speed, overshoot, and robustness. The "best" gains depend on the real plant and what you care about. This sim is for intuition, not a substitute for tuning the real system.

Results are for reference only. A teaching simulation of an idealised plant — real tuning needs the real system. Check against other sources.
Version history · 1 release
  1. v1.682026-08-07PID gains dead time and three real tuning methods — a factor of five apart on the same loop

Releases in which this page changed, newest last. Derived from the archived copy of every release, not from notes written afterwards — so it reflects what actually shipped. Site-wide passes are left out; they are in the full changelog.

Rules of thumb are approximations, offered to get you to the right order of magnitude fast. Check anything load-bearing against its source or the exact tool. Privacy · Terms

© 2026 Rules of Thumb · Runs entirely in your browser