JP / EN
Tools / Control Engineering

PID Playground

Adjust the PID parameters and explore disturbances, noise, A/B comparison and cascade control.

Controls

Configure the PID and process

PID settings

Equation form

Standard form: the sliders cover Ti from 0 to 50 s and Td from 0 to 10 s. Enter up to 200 s and 100 s directly. Ti = 0 disables integral action in this tool.

Set point and first-order process

ProcessG(s) = K / (T s + 1)

Disturbance

Add an input disturbance

A step load disturbance \(d(t)\) is added immediately before the process. A negative value temporarily lowers the process value, and the PID acts to restore the set point.

Actuator Limits

Output limits and anti-windup

Compare the requested controller output with the output applied after limiting. Anti-windup stops integration only when it would drive the controller farther into saturation.

Measurement

Measurement noise and derivative filter

Noise is added to the sensor measurement. A larger filter time constant makes the output smoother but slows the derivative response.

Cascade Control

Add an inner PID loop

The current PID becomes the outer loop and its output becomes the set point of the inner PID loop. With Td₂ = 0, the inner loop acts as a PI controller. The inner loop should generally be tuned faster than the outer loop.

A / B Comparison

Save and compare settings

Setting A has not been saved yet.

The simulation updates as soon as a value changes. For extreme combinations, it stops updating the result to keep the calculation safe.

Block Diagram

PID control block diagram

PID feedback control block diagramThe error enters the PID controller, optional output limits are applied, an input disturbance is added, and the noisy measurement is fed back negatively.Set pointr(t) / SP+−e(t)PIDC(s)D FILTER ONu_c(t)Output limitsatAW ONu_a(t)++Disturbance d(t)ProcessG(s)Process valuey(t) / PV++Measurement noise n(t)Negative feedback of yₘ(t)

Let \(u_c(t)\) be the controller-requested output and \(u_a(t)\) the applied output. When noise is enabled, the measured value \(y_m(t)\), formed by adding \(n(t)\) to the true process value \(y(t)\), is fed back.

Response

Simulation results

Rise time
10% → 90%
Overshoot
Settling time
±2%
Steady-state error
at the end
Set Point Current PV
PID response graphSet point, true process value and noisy measurement over time
Current output
Control output and disturbance graphApplied output, saved comparison, output limits and input disturbance
Guide

What P, I and D do

P

Proportional

Changes the output in proportion to the current error. A larger value speeds up the response, but too much can increase oscillation and overshoot.

I

Integral

Accumulates error over time to remove steady-state offset. Too much integral action can increase overshoot and oscillation.

D

Derivative

Responds to the rate of error change and damps rapid motion. It can reduce overshoot, but real systems require care with measurement noise.

Equations

PID equations and variables

PID control uses the difference between the set point and the sensor measurement as the error.

1. Error definition

\[ e(t)=r(t)-y_m(t) \]

2a. Standard (ideal) form

Selected
\[ u_c(t)=K_p\left[ e(t)+\frac{1}{T_i}\int_{0}^{t}e(\tau)\,d\tau+ T_d\frac{de(t)}{dt} \right] \]

\(K_p\) multiplies all three actions, while \(T_i\) and \(T_d\) are entered as time values. In this tool, \(T_i=0\) disables integral action.

2b. Parallel form

Selected
\[ u_c(t)= \underbrace{K_p e(t)}_{\text{proportional P}}+ \underbrace{K_i\int_{0}^{t}e(\tau)\,d\tau}_{\text{integral I}}+ \underbrace{K_d\frac{de(t)}{dt}}_{\text{derivative D}} \]

\(K_p\), \(K_i\) and \(K_d\) are entered as independent coefficients. It corresponds to the standard form through \(K_i=K_p/T_i\) and \(K_d=K_pT_d\).

3. First-order process used by this tool

Transfer function\[ G(s)=\frac{K}{Ts+1},\quad Y(s)=G(s)\{U_a(s)+D(s)\} \]
Time domain\[ T\frac{dy(t)}{dt}+y(t)=K\{u_a(t)+d(t)\} \]

The sum of limited applied output \(u_a(t)\) and input disturbance \(d(t)\) enters the process, and the simulator calculates how \(y(t)\) changes over time.

\[ d(t)=\begin{cases}0&(t\lt t_{\mathrm{dist}})\\d_0&(t\ge t_{\mathrm{dist}})\end{cases} \]

4. Output limits and anti-windup

\[u_a(t)=\operatorname{clip}\!\left(u_c(t),u_{\min},u_{\max}\right)\]

When output limiting is enabled, the requested controller output \(u_c(t)\) is constrained and the applied output \(u_a(t)\) enters the process.

\[\frac{dI}{dt}=\begin{cases}0&(u_c\gt u_{\max}\land e\gt 0)\ \text{or}\ (u_c\lt u_{\min}\land e\lt 0)\\e(t)&\text{otherwise}\end{cases}\]

With anti-windup enabled, integration stops only when it would drive the controller farther into saturation. It resumes when the error acts toward leaving saturation.

5. Measurement noise and derivative filter

Sensor measurement\[y_m(t)=y(t)+n(t)\]
First-order derivative filter\[D_f(s)=\frac{s}{T_f s+1}\,Y_m(s)\]

The derivative term strongly responds to high-frequency changes in the measurement. With the filter enabled, this tool uses \(D_f\) for derivative action. A larger \(T_f\) suppresses noise more strongly but also slows the response to rapid changes.

6. Cascade control

Outer loop\[SP_2(t)=C_1(s)\{r(t)-y_m(t)\}\]
Inner PID loop\[u_c(t)=K_{p2}\left[e_2(t)+\frac{1}{T_{i2}}\int e_2(t)dt-T_{d2}\frac{dPV_2(t)}{dt}\right]\]

The outer PID output becomes the inner-loop set point \(SP_2\), and the inner PID corrects \(e_2=SP_2-PV_2\). Its derivative action uses changes in \(PV_2\), avoiding derivative kick when \(SP_2\) changes. With \(T_{d2}=0\), it acts as a PI controller.

Symbols, meanings and units

SymbolMeaningUnit / dimension
\(r(t)\)Set point (SP)\([\mathrm{Q}]\)
\(y(t)\)Process value (PV)\([\mathrm{Q}]\)
\(y_m(t)\)Sensor measurement including noise\([\mathrm{Q}]\)
\(n(t)\)Measurement noise\([\mathrm{Q}]\)
\(e(t)\)Error\([\mathrm{Q}]\)
\(u_c(t)\)Controller-requested output\([\mathrm{M}]\)
\(u_a(t)\)Limited applied output (MV)\([\mathrm{M}]\)
\(u_{\min},u_{\max}\)Minimum and maximum output\([\mathrm{M}]\)
\(I(t)\)Integrated error state\([\mathrm{Q}\cdot\mathrm{s}]\)
\(d(t),d_0\)Input disturbance and its configured magnitude\([\mathrm{M}]\)
\(t_{\mathrm{dist}}\)Disturbance start time\([\mathrm{s}]\)
\(t,\tau\)Time\([\mathrm{s}]\)
\(K_p\)Proportional gain\([\mathrm{M}/\mathrm{Q}]\)
\(T_i\)Integral time in standard form\([\mathrm{s}]\)
\(T_d\)Derivative time in standard form\([\mathrm{s}]\)
\(T_f\)Derivative-filter time constant\([\mathrm{s}]\)
\(SP_2,PV_2,e_2\)Inner-loop set point, process value and errorarbitrary unit
\(K_{p2},T_{i2},T_{d2}\)Inner PID proportional gain, integral time and derivative timegain, \([\mathrm{s}]\), \([\mathrm{s}]\)
\(K_i\)Integral gain in parallel form\([\mathrm{M}/(\mathrm{Q}\cdot\mathrm{s})]\)
\(K_d\)Derivative gain in parallel form\([\mathrm{M}\cdot\mathrm{s}/\mathrm{Q}]\)
\(K\)Steady-state process gain\([\mathrm{Q}/\mathrm{M}]\)
\(T\)Process time constant\([\mathrm{s}]\)
\(s\)Laplace variable\([\mathrm{s}^{-1}]\)

How to read the units: \(\mathrm{Q}\) denotes the unit of the process value and \(\mathrm{M}\) the unit of the manipulated value. For temperature control with \(y\) in °C and applied heater output \(u_a\) in %, \(K_p\) is in %/°C, \(K_i\) in %/(°C·s), and \(K_d\) in %·s/°C. The vertical axes in this simulator use arbitrary units because no particular physical process is specified.

A constant set point is applied at time zero and simulated numerically in your browser. The same deterministic noise waveform is used each time so settings can be compared under identical conditions.