---
title: "PID control operation with block diagram"
subject: "Embedded System"
chapter: 7
key: "semester_6/embedded_system:pid-operation-block-diagram"
source: https://www.bctengineer.com/q/semester_6/embedded_system/pid-operation-block-diagram
site: BCT Engineering
---

# PID control operation with block diagram

Embedded System · Chapter 7: Control System

- Asked in: 2070 Bhadra, 5 marks; 2075 Bhadra, 5 marks; 2078 Baisakh, 4 marks; 2078 Poush, 4 marks (asked 4 times)
- Video: [PID Controller Explained](https://www.youtube.com/watch?v=fv6dLTEvl74) — RealPars
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/pid-operation-block-diagram
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-7

## Question

Explain the operation of a PID control with a neat block diagram (and describe PID tuning).

## Short answer

PID controller output u(t) = Kp·e + Ki·∫e dt + Kd·de/dt. P term responds to present error, I term removes steady-state offset, D term dampens oscillations. Tuning involves selecting gains, e.g., via manual adjustment or Ziegler-Nichols method.

## Answer

A **PID controller** computes its control output from the error e(t) = r(t) - y(t), the difference between the set-point and the measured output, as the sum of a proportional, an integral and a derivative term.

u(t) = Kp·e(t) + Ki·∫ e(t) dt + Kd·de(t)/dt

#### Block diagram

```text
          +--> [ Kp * e ] --------+
          |                       |
 r -->(+)-+--> [ Ki * integral ]->(+)-u-> [Plant] --+--> y
       ^ -|                       |  ^                |
       |  +--> [ Kd * d/dt ] -----+  d (disturbance)  |
       |                                              |
       +--------------[ Sensor ]<---------------------+
```

#### Operation of each term

- **Proportional (P):** output is proportional to the present error. Larger Kp gives a faster response but more overshoot, and a P-only controller leaves a steady-state offset.
- **Integral (I):** sums the past error, so it keeps increasing the output until the error is zero. It removes steady-state error but can add overshoot and slow oscillation (and integral wind-up).
- **Derivative (D):** reacts to the rate of change of error, predicting future error. It adds damping, reduces overshoot and improves stability, but amplifies sensor noise.

#### PID tuning

Tuning means choosing Kp, Ki, Kd so that the response is fast, with small overshoot and zero steady-state error.

1. **Manual method:** set Ki = Kd = 0; raise Kp until the output oscillates a little, then reduce it. Add Kd to damp overshoot. Add Ki slowly to remove the offset.
2. **Ziegler-Nichols:** raise Kp until sustained oscillation (ultimate gain Ku, period Tu), then use Kp = 0.6 Ku, Ti = Tu/2, Td = Tu/8.
3. **Software tools / auto-tuning** using a plant model or step-response test.

Check the result with rise time, overshoot, settling time and steady-state error.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How is the error e(t) used by a PID controller defined?
   A. Measured output minus set-point plus disturbance
   B. Set-point minus measured output
   C. Controller output minus set-point
   D. Sum of P, I and D terms
   Answer: B. e(t) = r(t) - y(t), the difference between set-point and measured output. (Key point: Error signal)

2. What does the integral term achieve?
   A. It keeps changing the output until steady-state error is zero
   B. It predicts future error and adds damping
   C. It makes the response faster with no side effects
   D. It filters sensor noise
   Answer: A. The integral accumulates past error, removing steady-state offset, but can add overshoot and wind-up. (Key point: Integral action)

3. What is the main drawback of the derivative term?
   A. It leaves a steady-state offset
   B. It causes integral wind-up
   C. It slows the response
   D. It amplifies sensor noise
   Answer: D. D reacts to rate of change of error, so noise is amplified, though it adds damping. (Key point: Derivative action)

4. In Ziegler-Nichols tuning, what is done first?
   A. Set Kd large and Kp zero
   B. Set Ki very large to remove offset
   C. Raise Kp until sustained oscillation to find Ku and Tu
   D. Use a step test to compute Kp = Ku
   Answer: C. Ku and Tu come from sustained oscillation, then Kp = 0.6 Ku, Ti = Tu/2, Td = Tu/8. (Key point: Ziegler-Nichols)

## Related in Embedded System

- [PID tuning and computer control issues](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Apid-tuning-practical-issues) — Embedded System, chapter 7
- [Purpose of PID tuning; computer control benefits](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Apid-tuning-purpose-benefits) — Embedded System, chapter 7
- [Closed loop diagram; P, PI, PD, PID](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Aclosed-loop-block-diagram-pid-types) — Embedded System, chapter 7

## Related in other subjects

- [PID controller block diagram, transfer function, characteristics](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Apid-bd-tf-characteristics) — Control Systems, chapter 7
- [Frequency counter operation with block diagram](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Afrequency-counter) — Digital Logic, chapter 11, asked 14×
- [Data logger block diagram and operation](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Adl-block) — Instrumentation II, chapter 5, asked 6×
- [Closed loop control system block diagram explained](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Awhat-is-cs-bd-closed-loop) — Control Systems, chapter 1, asked 4×
