PID CONTROLLERS
Proportional | Integral | Derivative
End-Term Examination Notes | Measurements & Controls of Energy Systems | Adani University
CORE CONCEPT: Kp, Ki, Kd are the three tuning parameters of a PID controller.
Goal: Minimize error between the measured Process Variable (PV) and the desired Setpoint
(SP).
Used in: Automation, robotics, industrial energy systems (boilers, tank level control, etc.)
1. PID Controller — Overview
1.1 What is a PID Controller?
A PID controller computes a control output u(t) by combining three terms — Proportional, Integral, and
Derivative — each acting on the error e(t) = SP − PV.
e(t) = Setpoint (SP) − Process Variable (PV)
e(t) tells how far the system is from the desired value at that moment.
PID Control Law:
u(t) = Kp·e(t) + Ki·∫e(t)dt + Kd·[de(t)/dt]
u(t) = control output (e.g. valve opening, pump speed)
e(t) = error at time t | ∫e(t)dt = accumulated error over time | de(t)/dt = rate of change of error
1.2 Three Terms at a Glance
Ter Parameter Role / Function Time Analogy
m Perspecti
ve
P Kp — Proportional REACTION — responds Present Push harder when far, softer
to current error when near
I Ki — Integral CORRECTION — Past Push harder the longer it has
eliminates accumulated been off target
past error
D Kd — Derivative DAMPING — predicts Future Brake if approaching target
future error trend too quickly
2. P, I, D — Detailed Notes
P — Proportional Controller [REACTION | Reacts to: PRESENT error]
Control Action u(t) = Kp × e(t) → Output is proportional to current error
(Formula)
What it does Reacts directly to how large the error is RIGHT NOW. Large error →
large action. Small error → small action. Reduces rise time. Higher Kp =
faster response but risk of oscillation.
Analogy Pushing a car: push hard when far from destination, ease off as you get
close.
Lab Example (Water Water tank SP = 100 cm, PV = 70 cm → e = +30 cm → valve opens
Tank) wide. As level rises, error shrinks → valve opening reduces.
Key Problem / P-only always leaves a small STEADY-STATE ERROR (offset). As
Limitation error becomes small, action becomes small — not strong enough to
overcome flow resistance, friction, leakage. System stops before
reaching exact SP.
Quick Tip Too high Kp → oscillation. Too low → slow, sluggish. P-only is never
exact.
P Control — Numerical Example (Lab: Liquid Level Control):
Case 1: SP = 100 cm, PV = 70 cm → e(t) = +30 cm → Valve opens → level increases. (System
below target)
Case 2: SP = 100 cm, PV = 120 cm → e(t) = −20 cm → Pump/valve reduces → level
decreases.
Problem: Flow balances before reaching SP. System stabilises at offset (e.g. 98 cm instead of
100 cm). This is Steady-State Error.
Reason: Weak control action cannot overcome flow resistance, friction, leakage at small error
values.
I — Integral Controller [CORRECTION | Reacts to: PAST error]
Control Action u(t) = Ki × ∫e(t)dt → Output accumulates error over time
(Formula)
What it does Sums ALL past error over time. Even a tiny, persistent error keeps
accumulating → controller keeps increasing output. Eliminates steady-
state error completely. Integral does NOT react faster — it reacts
LONGER.
Analogy Interest on a debt: small amount owed, but the longer it stays unpaid,
the more you owe.
Lab Example (Water SP = 100 cm, PV = 96 cm → e = 4 cm (small). I sees: error is still there
Tank) → valve opens slightly more → level rises: 97, 98, 99, 100. Error gone.
Key Problem / Without I: small error stays as a permanent constant offset — never
Limitation corrected. Too high Ki → overshoot and instability. Also: system cannot
stop instantly when error = 0 due to inertia/delay.
Quick Tip I does not react faster — it reacts longer. As long as error ≠ 0, I keeps
increasing action.
I Control — Numerical Example:
Case 1: SP=100, PV=96 → e=4 cm (small). I keeps acting → valve slowly opens more →
97→98→99→100 cm. Error eliminated.
Case 2: SP=100, PV=120 → e=−20 cm. I accumulates negative error → valve closes gradually
→ 115→110→105→100 cm.
Key: System cannot stop instantly when error reaches 0 because real systems have inertia,
delay, and stored energy.
Without I: error of 4 cm just sits there permanently as a constant offset — never removed.
D — Derivative Controller [DAMPING | Reacts to: FUTURE error]
Control Action u(t) = Kd × de(t)/dt → Output based on RATE of change of error
(Formula)
What it does Measures how fast error is changing (the slope/trend). If error is
reducing quickly → system is moving fast toward SP → D applies a
braking action. Acts as a brake opposing sudden movements. Reduces
overshoot, improves settling.
Analogy Braking a car: if you're approaching a stop sign very fast, you brake
hard. If already slow, you barely touch the brake.
Lab Example (Water Water tank: level rising quickly toward SP → D reduces valve opening
Tank) early to prevent overshoot. Anticipates the future level.
Key Problem / High Kd makes system very sensitive to noise (any small fluctuation in
Limitation PV gets amplified). D has no effect on steady-state error.
Quick Tip D predicts the future by looking at the TREND (slope) of error. High Kd
→ noise sensitivity.
3. Tuning Effects — Summary Table
Increasing each parameter individually has these effects on a closed-loop system:
Parameter Rise Time Overshoot Settling Steady-State Stability
Increased Time Error
Increase Kp DECREASE INCREASE Small DECREASE ↓ DEGRADE ↓
↓ ↑ Change
Increase Ki DECREASE INCREASE INCREASE ELIMINATE ✓ DEGRADE ↓
↓ ↑ ↑
Increase Kd Small DECREASE DECREASE No Effect IMPROVE ↑
Change ↓ ↓
NOTE: For many systems, a PI or P-only controller is sufficient.
Derivative action (Kd) can make systems noisy and is often omitted in simple applications.
Only use D when overshoot is a critical problem and the measurement signal is clean (low
noise).
4. How to Tune a PID Controller — Step by Step
Goal: Find the right balance of Kp, Ki, Kd for optimal stability and speed.
1. Step 1 — Start with zeros: Set Kp = 0, Ki = 0, Kd = 0.
2. Step 2 — Increase Kp: Gradually increase Kp until the system reaches setpoint quickly (with
some overshoot or mild oscillation).
3. Step 3 — Add Ki: Increase Ki to eliminate the steady-state error (offset) that Kp alone cannot
remove. System now reaches exact SP.
4. Step 4 — Add Kd: Increase Kd to reduce the overshoot and oscillations introduced by Ki.
Improves settling time and dampens the system.
5. Step 5 — Fine-tune: Iteratively adjust all three until the desired response (speed + stability) is
achieved.
Tuning Order: Kp first → then Ki → then Kd
Never add Ki or Kd without first setting Kp correctly — they will amplify the existing instability.
5. Controller Behaviour — P vs PI vs PID
Controller Reaches Steady-State Overshoot Stability Best Used
Type Setpoint? Error When
P only Close but not Always present Moderate Good Simple systems;
exact (offset) setpoint
precision not
critical
PI Yes — exactly Eliminated Higher than Moderate Most industrial
P processes; good
balance of
accuracy +
speed
PID Yes — exactly Eliminated Reduced by Best Systems
D needing fast,
accurate,
smooth
response
No regulation Never stabilises Maximum Huge Unstable —
Graph Interpretation (from comparison chart):
No regulation: Output keeps rising to ~100°C — never settles. (Runaway)
P only: Settles near setpoint (40°C) but with a small offset — never exactly 40°C.
PI: Reaches exactly 40°C but with oscillation/overshoot before settling.
PID: Reaches exactly 40°C smoothest — least overshoot, fastest settling. BEST response.
6. Physical Implementation of PID Controller
What does the controller physically contain?
• Digital Controller (most common): Microcontroller or PLC (Programmable Logic Controller).
Software performs: multiplication (P action), summation (I action), rate calculation (D action).
• Block Diagram: r(t) → [Σ] → e(t) → [P: Kp·e(t)] + [I: Ki·∫e(t)dτ] + [D: Kd·de(t)/dt] → [Σ] → u(t) →
[Plant/Process] → y(t) → [feedback to Σ]
7. Exam Quick Reference — Formulas & Key Points
All Key Formulas
Error:
e(t) = SP − PV (Setpoint minus Process Variable)
PID Output:
u(t) = Kp·e(t) + Ki·∫e(t)dt + Kd·[de(t)/dt]
P-only Output:
u(t) = Kp × e(t)
I-only Output:
u(t) = Ki × ∫e(t)dt
D-only Output:
u(t) = Kd × de(t)/dt
Memory Tricks
P = PRESENT (reacts to current error — how far are we right NOW?)
I = PAST (reacts to accumulated error — how long have we been wrong?)
D = FUTURE (reacts to rate of change — where are we HEADING?)
P → Reaction | I → Correction | D → Damping
Kp → Main driver | Ki → Fixes offset | Kd → Reduces overshoot
Common Exam Traps
• P alone always leaves steady-state error: As error → small, P action → small → not enough to
overcome friction/losses.
• I eliminates steady-state error but: Too high Ki causes overshoot and instability. System can't
stop instantly (inertia).
• D has NO effect on steady-state error: D only acts on the RATE of change. When error is
constant (even non-zero), D output = 0.
• High Kd → noise sensitivity: D amplifies any rapid fluctuation in PV — avoid in noisy
environments.
• Integral does not react faster — it reacts LONGER: Even tiny error accumulates over time →
builds up to a strong correction.
• Tuning order matters: Always tune Kp first, then Ki, then Kd. Never the reverse.
• P-only vs PI: PI reaches exact setpoint. P-only leaves offset. This is the most common exam
question.
Liquid Level Tank — Summary of All Three
Controller What it does in the tank example
P Valve opens wide when level is far below SP. Valve barely opens when near SP.
Stops just below SP (offset remains).
I Even if level is 4 cm below SP for a long time, slowly keeps opening valve more until
level hits exactly 100 cm.
D If level is rising quickly toward SP, D reduces valve opening early to avoid
overshooting the target level.
PID combined Fast initial response (P) + exact final value (I) + no overshoot (D). Best overall
performance.
— End of PID Controllers Notes | Prepared for End-Term Examination —