What Kp, Ki and Kd do to a step response — and what they do not

A PID controller forms its command from three terms: a proportional term, an integral term, and a derivative term. Each term has a distinct, visible effect on a step response. None of them is a gain that you should always turn up.

This lesson uses one simulated linear plant. The curves are the model, not a measurement of a motor, a valve, or any other piece of hardware. Gains that look acceptable here can be unsafe on a plant that has delay, saturation, or noise the model does not include. A simulation is not a license to tune real hardware unsafely.

What you will be able to explain

State the plant and the parallel PID law used in the figure, including that the derivative acts on the measured output through a first-order filter. For this type-0 plant, say what a finite proportional gain does to the rise and to the steady-state error when the integral gain is zero, what the integral term can do to that error if the loop stays stable, and what the derivative term can do to overshoot. Name the costs: overshoot, oscillation, and the sensitivity of the derivative term to measurement noise. Say what the model leaves out, including actuator saturation and anti-windup.

Time and the signals in the figure are dimensionless. Time is measured in units of the plant's open-loop time constant, which is 1.

The plant is

$$P(s)=\frac{1}{(s+1)^3},$$

or, written as an ordinary differential equation,

$$y”’+3y”+3y’+y=u.$$

It has DC gain 1 and three coincident poles at $-1$. There is no free integrator in the plant, so the plant is type 0. The same transfer function is a standard teaching example; it appears, for instance, in Chapter 11 of Åström and Murray, Feedback Systems. The figure in this lesson is not copied from that book. The curves are computed from the model below.

The controller is the parallel form

$$u=K_p e+K_i\xi-K_d d,$$

with $e=r-y_m$ and $\xi’=e$. The derivative is taken on the measured output and then filtered,

$$d=\frac{y_m-z}{\tau},\qquad z’=\frac{y_m-z}{\tau},\qquad \tau=0.05.$$

Putting the derivative on the measurement, rather than on the error, avoids a derivative kick when the reference steps. The optional light measurement noise, off by default, is added only to the signal the controller sees; the plant still evolves from the true $y$.

The law is integrated with a fixed-step fourth-order Runge–Kutta method at $\mathrm{d}t=0.005$, from $t=0$ to $t=20$, independently of the display's frame rate. The sliders run over $K_p\in[0,6]$, $K_i\in[0,2.5]$, and $K_d\in[0,3]$. If the closed loop is stable, the unit-step steady value is $\frac{K_p}{1+K_p}$ when $K_i=0$ and $K_p>0$, and $1$ when $K_i>0$. Those limits need not have been reached at $t=20$; the tabulated $y(20)$ is a finite-horizon value.

Predict

Under the default proportional-only gains ($K_p=2$, $K_i=0$, $K_d=0$), what happens to the steady-state error if you raise $K_p$ further?

If you raise $K_p$ far enough, the steady-state error is always removed completely. As long as $K_i$ stays 0, a finite $K_p$ cannot drive the step's steady-state error to zero; raising $K_p$ can shrink the gap, but it can also add overshoot or oscillation. This plant is already type 1, so proportional-only control already has zero steady-state error to a step.

Predict before moving the sliders. You may skip the question and come back later; nothing is locked.

Manipulate and observe

What Kp, Ki and Kd do to a step response

The figure starts paused on the default frame, with the full curve already computed. That response is simulated. Raise $K_p$ alone first, then add a moderate $K_i$ such as $0.6$, then a moderate $K_d$ such as $0.8$. Optionally turn the measurement noise on with a nonzero $K_d$ and watch the control effort $u$.

Explain

The default frame is proportional-only control at $K_p=2$. The output at $t=20$ is about $0.667$, next to the theoretical steady value $\frac{2}{3}$, and the peak stays below the reference, so a steady-state gap is visible. That is the type-0 story: with $K_i=0$, a stable unit-step response settles at $\frac{K_p}{1+K_p}$, not at $1$. Raising $K_p$ shrinks the gap and can make the rise faster. It does not remove the error at any finite gain on this plant, and in this figure $K_p=5$ already overshoots the reference and is not fully settled at $t=20$.

The integral term can remove that step error if the loop stays stable, because the controller's gain at zero frequency becomes unbounded. A moderate choice such as $K_p=2$, $K_i=0.6$, and $K_d=0$ brings $y(20)$ close to $1$, with an overshoot of about $0.22$ in this model. The same gain that closes the gap can also add overshoot or oscillation. At $K_p=2$ and $K_i=2.5$, with $K_d=0$, the response oscillates strongly, and $y(20)$ is nowhere near $1$. A theoretical $y_\infty=1$ is not a promise that the trajectory has settled, or that the loop is stable.

The derivative term, acting on the measured output, can reduce some of that overshoot. With $K_p=2$, $K_i=0.6$, and $K_d=0.8$, the overshoot in this model falls to about $0.10$, and $y(20)$ stays near $1$. That is not a cost-free improvement. Because $d$ is built from the measurement, a noisy $y_m$ produces chatter in $u$. The optional noise toggle is there to make that cost visible; it is a light, reproducible disturbance, not a model of a particular sensor.

None of the three terms is a knob that you should always turn up. The model also leaves out actuator saturation and anti-windup, so a large integral term is even less of a free lunch on hardware than it is here. A trajectory that looks acceptable on $P(s)=\frac{1}{(s+1)^3}$ is not a tuning certificate for a different plant, or for a real actuator.

Practice and transfer

A colleague says: “To kill steady-state error, turn $K_i$ up as far as it will go; $K_d$ is always helpful and has no cost.” What is wrong with that claim?

Nothing is wrong: a larger $K_i$ is always better, and $K_d$ is always a benefit. Integral action can remove this step's steady-state error if the loop stays stable, but a large $K_i$ can overshoot or oscillate; derivative action can reduce some of that overshoot, but it is sensitive to measurement noise, and this is a model, not a license to retune hardware. The claim is true in this simulation, so the same gains can be applied directly to unprotected hardware.

Assumptions and reproducibility

The plant is linear, time-invariant, and initially at rest. The reference is a unit step at $t=0$. There is no input disturbance, no actuator limit, and no anti-windup. The derivative filter time constant is fixed at $\tau=0.05$. When the noise toggle is on, the controller's measurement is $y$ plus a discrete Gaussian term with standard deviation $0.03$, held over each integrator step, from a fixed Mulberry32 seed $20261201$; the plant still sees the true $y$. Changing a slider recomputes the trajectory from the same model. The figure does not store answers or send them anywhere.

Related ideas

The Control topic collects this subject with other planned lessons on feedback. A type-0 plant has a finite nonzero DC gain and therefore, under plain proportional control, a nonzero steady-state error to a step. A step response is the output that follows a sudden change in the reference; overshoot, settling, and the remaining error are properties of that trajectory, not licenses to copy the same gains onto hardware.

References

Åström, K. J., and Murray, R. M. Feedback Systems: An Introduction for Scientists and Engineers, 2nd ed., electronic edition v3.1.5 (24 July 2020), Chapter 11, PID Control. https://www.cds.caltech.edu/~murray/books/AM08/pdf/fbs-pid_24Jul2020.pdf

FBSwiki, PID Control. https://fbswiki.org/wiki/index.php/PID_Control

Concept connections

Feedback
A command formed from a measured output and a reference, rather than from an open-loop prescription alone.
PID
A controller that adds a proportional term, an integral term, and a derivative term. In this lesson the derivative acts on the measured output through a first-order filter.
Step response
The output that follows a sudden change in the reference. Rise, overshoot, remaining error, and the control effort are properties of that trajectory in a stated model.

More planned lessons on feedback are listed on the Control topic page.

Leave a Comment