Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

PID Control Tuning Lab

A PID controller drives a process toward a target value using three terms. Tune the proportional, integral, and derivative gains, watch the closed-loop step response trace out, and read the overshoot, settling time, rise time, and steady-state error to learn how each term shapes the response.

Guided Experiment: Why does proportional control leave a steady-state error?

With only the proportional term, predict whether the output will reach the setpoint of 1. If not, predict what raising the proportional gain does to the leftover error.

Write your hypothesis in the Lab Report panel, then click Next.

Closed-loop step response

-0.10.20.50.81.10s5s10s15s20sTime (s)OutputSetpoint 1.0settled 1.9s

The teal curve is the output. The dashed line is the setpoint, and the shaded strip is the plus or minus 2 percent settling band. The amber dot marks the overshoot peak.

Controls

s

A larger process gain or a longer time constant makes the process harder to control, so gains that worked before may need retuning.

Performance

Overshoot
0.0
% above setpoint
Settling time
1.91
s (2% band)
Rise time
1.17
s (10% to 90%)
Steady-state error
0.000
setpoint minus final
Well tuned. Low overshoot, fast settling, and almost no steady-state error.
  • Proportional. Reacts to the current error. A steady error is needed to hold the output, so it alone leaves a droop.
  • Integral. Sums up past error to remove the lasting droop, but it can overshoot and oscillate.
  • Derivative. Anticipates the error trend and adds damping, which tames the overshoot.

Data Table

(0 rows)
#KpKiKdOvershoot (%)Settling time (s)Steady-state error
0 / 500
0 / 500
0 / 500

Reference Guide

The Three Terms

A PID controller works on the error, the gap between where the process is and the setpoint it should reach. It blends three actions.

u(t)=Kpe(t)+Kiedt+Kddedtu(t) = K_p\, e(t) + K_i \int e\,dt + K_d \frac{de}{dt}

Proportional reacts to the current error. Integral adds up past error to wipe out a lasting gap. Derivative looks at how fast the error is changing and applies a braking action. The three gains Kp, Ki, and Kd set how strong each action is.

Overshoot vs Settling Time

Proportional control alone leaves a steady-state error, a droop, because the process needs a steady error to hold its output. The droop follows a simple ratio.

ess=r1+KpKe_{ss} = \frac{r}{1 + K_p\, K}

Adding the integral term removes the droop, but it tends to overshoot the setpoint and ring. Pushing the gains for a faster rise usually buys a larger overshoot. The derivative term adds damping, which lets you keep a fast response while taming the overshoot, so the output settles sooner.

Reading a Step Response

The lab applies a step to the setpoint and traces the output over time. Four numbers summarize the result.

  • Rise time. How long the output takes to climb from 10 to 90 percent of the setpoint.
  • Overshoot. How far the peak rises above the setpoint, as a percentage.
  • Settling time. When the output stays within plus or minus 2 percent of the setpoint for good.
  • Steady-state error. The leftover gap between the final output and the setpoint.

A good tuning gives a quick rise, small overshoot, fast settling, and a steady-state error near zero.

A Simple Tuning Recipe

One common hand-tuning approach raises one gain at a time. Start with Ki and Kd at zero. Raise Kp until the output responds quickly but starts to oscillate, then back it off a little.

Add Ki to remove the leftover droop, raising it until the steady-state error is gone, but stop before the overshoot and ringing grow too large. Finally add Kd to damp the overshoot and shorten the settling time. If the response becomes twitchy, you have added too much derivative.

The process gain and time constant sliders change the plant itself. A larger gain or a longer time constant makes the process harder to control, so a tuning that worked before may need adjusting.

Related Content