› PID Controller Simulator Back

PID Simulator | Gain Tuning and Step Response

Adjust proportional gain Kp, integral time Ti and derivative time Td. Compare step responses, controller output, overshoot, time to 90% and IAE for first-order, delayed, second-order and integrating plants.

PID Gains
Proportional Gain Kp
Integral Time Ti (s)
s
Larger Ti = weaker integral. Use the checkbox below to disable I.

Derivative Time Td (s)
s
Setpoint SP
Simulation Time (s)
s
Presets
Performance Metrics
Results
—
90% arrival time (s)
—
Settling time ts (s)
—
Overshoot %
—
End-of-run error %
—
IAE
—
ITAE
Process Variable y(t) and Setpoint
Controller Output u(t)
U
Process variable y(t) Setpoint SP Control output u(t)
Theory & Key Formulas
$$u(t)=K_p\!\left[e(t)+\frac{1}{T_i}\!\int_0^t\!e\,d\tau+T_d\frac{de}{dt}\right]$$
ZN step response tuning:
$K_p=1.2\,\tau/(K\cdot L),\quad T_i=2L,\quad T_d=0.5L$
Results
0.70
Setpoint SP
0.000
Current value PV
0.700
Error e
0.00
Control output u
0.0%
Overshoot
—
Rise time
—
Settling time
0.700
Steady-state error
0.000
Ki=Kp/Ti
0.00
Kd=Kp·Td
PV (liquid level) SP (setpoint) e (error) u (inflow = control output)
Proportional Gain Kp1.50
Integral time Ti (s)8.0
Derivative time Td (s)0.00
Target liquid level SP0.70
Process time constant τ (s)5.0
Changing Kp/Ki/Kd visibly shifts the closed-loop response from sluggish → responsive → oscillatory → unstable. For a first-order plant, P-only control leaves a steady-state error = 1/(1+Kp·K); adding the I term drives the error → 0.

TRY THE SAME CONDITIONS

Worked example

Start with the default first-order plant: process gain 1, time constant 5s, Kp=1, Ti=5s, Td=0s, setpoint 1 and duration 50s. Time to 90% is about 11.5s and IAE about 4.99. Change only Kp first and compare both response and controller output.

Calculator ↑

Model and scope

The basic form is u=Kp(e+∫e dt/Ti+Td·de/dt); parallel gains are Ki=Kp/Ti and Kd=Kp·Td. The implementation uses a 0.02s time step, derivative filtering and output limits of ±10. The tank demonstration has independent controls.

Questions and answers

Does a larger Ti mean stronger integral action?

For fixed Kp, Ki=Kp/Ti decreases as Ti increases. Use the explicit Disable integral action checkbox to turn I off completely; the P preset checks it. The independent tank illustration disables I at its maximum Ti of 40s.

How are the response metrics defined?

Rise time means first arrival at 90% of the target, not 10–90%. Settling time is the first sample after the last excursion outside ±2%, provided every remaining sample stays inside. A final sample outside gives —. End-of-run error is a finite-time value, not necessarily steady-state error.

Does Ziegler–Nichols find the optimal gains?

It proposes starting values, with assumed delay for some models and limits to the input ranges. It does not guarantee optimality or physical-plant stability. Check saturation, controller output and response.

Can I copy these gains to real equipment?

Not directly. PID form, units, sample time, noise and actuator constraints must match. This page compares simplified models and cannot write settings to equipment.

Theory reference (not certification of this tool)

MathWorks: PID forms

Explanation updated: 6 September 2026