Skip to content
EN
  • Español
  • English
Advertisement

PID loop simulator: setpoint and disturbance response

Simulate a PID loop on a process with K, τ and θ: overshoot, rise and settling time, IAE and disturbance response while you move Kp, Ti and Td.

Fill in 3 of the 4 fields and the missing one is calculated. You can type in any of them.

—
Leave it empty and enter the overshoot you want for the calculator to find Kp.
—
Enter it (for example 10 %) and the calculator finds the Kp that gives it with these Ti and Td.
—
In % of the measurement range, from rest.
—
A load change that comes in once the setpoint has settled. 0 to leave it out.
—
Overshoot—
Does it settle? (1 yes, 0 no)—
Rise time (10 to 90 %)—
Time to peak—
Settling time (±2 %)—
Remaining error (without integral it does not get there)—
IAE (integral of absolute error)—
Maximum controller output—
Minimum controller output—
Maximum deviation with the disturbance—
Time to get back within ±2 % after the disturbance—
Proportional band (100 / Kp)—
Ki = Kp / Ti (parallel form)—
Kd = Kp · Td (parallel form)—
Ratio θ / τ (above 1: difficult process)—

Use this calculator for reference only, as we cannot guarantee that the results are free of errors.

Disclaimer

https://dyaii.es/en/pid-loop-simulator/

Advertisement

Before touching a controller's settings on the plant it is worth seeing what will happen. The simulator closes a PID loop on a first order plus dead time process (the model you get from the reaction curve: gain K, time constant τ and dead time θ), gives it a setpoint step and, once it has settled, a disturbance on the output. Move Kp, Ti and Td with the sliders in the drawing and watch the curve, the overshoot and the times change. The other way round, enter the overshoot you want and it finds the Kp that gives it.

The model

Process: τ · dy/dt + y = K · u(t − θ)
Controller (ideal ISA form): u = Kp · (e + 1/Ti · ∫e dt − Td · dy/dt)

e is the error (setpoint − measurement). The derivative acts on the measurement, not the error, with a Td/10 filter, as in almost every PLC: that way a setpoint change does not kick the output. If you choose the limited output (0 to 100 %), the integral stops while the output is saturated (anti-windup). K, τ and θ come from identifying the process, and a first tuning from PID tuning.

What it measures

  • Overshoot (Mp): how far the measurement goes past the final value, in %. Process loops aim for 0 to 10 %; servos accept more.
  • Rise time: from 10 to 90 % of the change.
  • Settling time (ts): from the step until the measurement enters the ±2 % band and stays there.
  • Remaining error: without integral, proportional action leaves an error of setpoint / (1 + K·Kp).
  • IAE: the integral of the absolute error, a number to compare tunings (the smaller, the better).
  • Disturbance: how far the measurement moves when a load comes in and how long it takes to get back within ±2 %.
Advertisement

Example

Process with K = 2, τ = 60 s and θ = 10 s; PI controller with Kp = 1.5 and Ti = 60 s, 50 % step. The measurement rises from 10 to 90 % in about 18 s, overshoots by around 4 % and stays within ±2 % from about 60 s. A −10 % disturbance on the output moves it about 5 points and it comes back in just over two minutes. Raising Kp to 2.6 takes the overshoot to 10 %; with Kp = 20 the loop becomes unstable.

Several ways to get each value

  • With Kp, Ti and Td: you get the full response and its times.
  • With the overshoot you want: leave Kp empty, enter for example 10 % and the calculator finds the Kp that gives it with your Ti and Td.
  • Moving the drawing: the Kp, Ti and Td sliders recalculate instantly.
  • By hand, the error without integral: e = setpoint / (1 + K·Kp). With K = 2 and Kp = 1.5, e = 50 / 4 = 12.5 %.
  • By hand, without dead time: with P only the loop is another first order with time constant τ / (1 + K·Kp); the rise time is that constant times ln 9 (2.2 times).

How to tune with the simulator

  1. Start with Ti = τ and Td = 0 (a PI) and a small Kp.
  2. Raise Kp until the overshoot is what you accept (10 % is a good point) or the disturbance response is fast enough.
  3. If it takes too long to reach the setpoint, lower Ti little by little; if it oscillates, raise it.
  4. Only on slow, noise-free processes, try Td between θ/4 and θ/2: it lets you raise Kp a little more.
  5. Look at the controller output in the chart: if it spends a long time at 0 or 100 %, the actuator is too small and no tuning will fix it.

The model is an approximation: the real process has noise, friction, backlash and non-linearities. Apply on the plant a slightly gentler tuning than the best you see here.

Advertisement

Frequently asked questions

What happens if I raise Kp?

The loop responds faster and the error with disturbances is smaller, but it overshoots more and, past a point (the ultimate gain), it oscillates without stopping. With a lot of dead time that point comes sooner.

What is the integral time Ti for?

For the measurement to reach the setpoint: without integral there is always an error left. The smaller Ti, the stronger the integral action and the faster it corrects, but it also overshoots more. A good starting point is Ti equal to the process time constant.

When should I use derivative?

On slow, noise-free processes (temperatures) it anticipates the correction and lets you raise Kp. On flow, pressure or noisy measurements leave it at 0, because it amplifies noise. Here it acts on the measurement, not the error, so changing the setpoint does not kick the output.

What is anti-windup?

When the output reaches 100 % (or 0 %) the integral keeps adding error and then takes a long time to unwind, which gives big overshoots. Anti-windup stops the integral while the output is saturated; this simulator does it if you choose the limited output.

Related calculators

Share

WhatsApp X LinkedIn Telegram Email
Advertisement

Install Diseño y automatización de instalaciones industriales on your phone

All the calculators one tap away, full screen, like an app. It takes no space and is always up to date.