PID Feedback Control Loop

See proportional, integral, and derivative action inside a closed feedback loop.

animation
pid
control
feedback
automation
Interactive PID feedback-control animation showing setpoint error, P/I/D term contributions, actuator saturation, anti-windup behavior, plant response, and sensor feedback.
Feedback control PID terms IoT actuators

PID Feedback Control Loop

Compare a setpoint with a measured process value, watch the P, I, and D terms build a controller output, then see actuator limits and sensor feedback change the response.

Current diagnosis Balanced local loop
Process value 40.0 rpm
Controller output 55%
Compare Error drives action

The controller starts with error: setpoint minus measured process value.

Compute P, I, and D split the job

P reacts now, I remembers persistent error, and D damps rapid change.

Actuate Output is bounded

Real valves, heaters, motors, and pumps saturate at physical limits.

Sense Feedback closes the loop

The measured result returns to the comparator on the next sample.

Closed Loop Animation

Compare: setpoint and measurement create error.
Setpoint 120 rpm Error +80.0 rpm PID P +0 I +0 D +0 Actuator 55% Plant 40.0 rpm Sensor 40.0 rpm
Error +80.0 rpm Needs correction
Overshoot 0.0% relative to step size
2% band Outside Watch settling
Integral store 0.0 %s Anti-windup on

Response Trace

Process value follows the setpoint through the plant dynamics.
0 s 24 s 180 0 motor speed (rpm)

Term Contributions

Bars show signed contribution to controller output.
Proportional +0.0%
Integral +0.0%
Derivative +0.0%

Controls

Motor speed: moderate loop with encoder feedback.

Scenario

Tuning

120 rpm
2.20
0.35
1.20
100%
18%
1%

Current Reading

Sample time: 100 ms
40.0 rpm

Measured process value after sensor noise and plant lag.

55.0%

Raw controller output before actuator clamping.

No saturation

Shows whether the physical actuator is limiting the command.

Local control

Fast feedback loops should run near the actuator when timing matters.

Response Approaching setpoint

The measured value is below target, so controller output rises.

Saturation Actuator has authority

The command is inside the configured output limit.

Term focus P term is leading

Large present error makes the proportional term dominate early motion.

Technical accuracy notes
  • PID gains are process-specific. A gain that works for motor speed can be unstable for temperature or too weak for a water tank.
  • Integral action can reduce persistent steady-state error only when the actuator has enough authority. If the output is saturated, unchecked integral accumulation causes windup.
  • Derivative action is sensitive to measurement noise. Practical controllers often filter the derivative term or take derivative on measurement to avoid derivative kick.
  • Ziegler-Nichols is a tuning method, not a universal best setting. Safety-critical systems need bounded outputs, rate limits, validation, and domain-specific commissioning.
  • For IoT systems, a cloud dashboard can monitor or supervise, but fast control loops normally need local execution near the sensor and actuator.
Formula trace

error = setpoint - measured_value

error_pct = error / process_span * 100

P = Kp * error_pct

I = Ki * integral(error_pct dt)

D = Kd * filtered_d(error_pct) / dt

output_raw = bias + P + I + D

output = clamp(output_raw, 0, actuator_limit)

pv_next = pv + ((plant_target - pv) / tau) * dt