---
title: "Pulse transfer function of digital PID controller"
subject: "Digital Control System"
chapter: 3
key: "semester_6/digital_control_system:derive-pid-pulse-tf"
source: https://www.bctengineer.com/q/semester_6/digital_control_system/derive-pid-pulse-tf
site: BCT Engineering
---

# Pulse transfer function of digital PID controller

Digital Control System · Chapter 3: Analysis of Discrete Time Control System

- Asked in: 2077 Chaitra, 8 marks; 2070 Magh, 8 marks (asked 2 times)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/digital_control_system/derive-pid-pulse-tf
- Whole chapter: https://www.bctengineer.com/md/semester_6/digital_control_system/chapter-3

## Question

Derive the pulse transfer function of digital PID controller.

## Short answer

The digital PID pulse transfer function is G_D(z) = K_P + K_I/(1−z^{-1}) + K_D(1−z^{-1}), where K_P = K − KT/(2T_i), K_I = KT/T_i, K_D = KT_d/T. In single fraction, G_D(z) = [(K_P+K_I+K_D) − (K_P+2K_D)z^{-1} + K_D z^{-2}] / (1−z^{-1}).

## Answer

A **digital PID controller** is the discrete-time version of the analog PID law. We obtain it by replacing the integral with a numerical sum (trapezoidal rule) and the derivative with a backward difference. Its pulse transfer function is $G_D(z) = U(z)/E(z)$.

#### Analog PID law
$$
u(t) = K\left[e(t) + \frac{1}{T_i}\int_0^t e(t)\,dt + T_d\frac{de(t)}{dt}\right]
$$

Here $K$ is the proportional gain, $T_i$ the integral time and $T_d$ the derivative time.

#### Discretization (sampling period $T$)
- Integral, trapezoidal rule: $\displaystyle\int_0^{kT} e\,dt \approx T\sum_{h=1}^{k}\frac{e((h-1)T)+e(hT)}{2}$
- Derivative, backward difference: $\displaystyle\frac{de}{dt}\Big|_{kT} \approx \frac{e(kT)-e((k-1)T)}{T}$

$$
u(kT) = K\left\{e(kT) + \frac{T}{T_i}\sum_{h=1}^{k}\frac{e((h-1)T)+e(hT)}{2} + \frac{T_d}{T}\big[e(kT)-e((k-1)T)\big]\right\}
$$

#### Taking the z-transform
Let $f(h) = \tfrac12[e((h-1)T)+e(hT)]$, so $F(z) = \tfrac12(1+z^{-1})E(z)$. A running sum transforms as $\mathcal{Z}\left[\sum_{h=0}^{k} f(h)\right] = F(z)/(1-z^{-1})$. Following Ogata, we take $f(0) = 0$ (the trapezoidal sum starts at $h = 1$), so the sum from $h = 1$ and the sum from $h = 0$ have the same transform. Therefore:

$$
\begin{aligned}
\mathcal{Z}\left[\sum_{h=1}^{k}\frac{e(h-1)+e(h)}{2}\right] &= \frac{1+z^{-1}}{2(1-z^{-1})}E(z) \\
\mathcal{Z}\big[e(k)-e(k-1)\big] &= (1-z^{-1})E(z)
\end{aligned}
$$

$$
U(z) = K\left[1 + \frac{T}{2T_i}\cdot\frac{1+z^{-1}}{1-z^{-1}} + \frac{T_d}{T}(1-z^{-1})\right]E(z)
$$

#### Rearranging into the standard form
Use $\dfrac{1+z^{-1}}{2(1-z^{-1})} = \dfrac{1}{1-z^{-1}} - \dfrac{1}{2}$:

$$
\begin{aligned}
U(z) &= \left[K - \frac{KT}{2T_i} + \frac{KT}{T_i}\cdot\frac{1}{1-z^{-1}} + \frac{KT_d}{T}(1-z^{-1})\right]E(z) \\
G_D(z) &= \frac{U(z)}{E(z)} = K_P + \frac{K_I}{1-z^{-1}} + K_D(1-z^{-1})
\end{aligned}
$$

where

| Gain | Expression | Name |
|---|---|---|
| $K_P$ | $K - \dfrac{KT}{2T_i} = K - \dfrac{K_I}{2}$ | proportional gain |
| $K_I$ | $\dfrac{KT}{T_i}$ | integral gain |
| $K_D$ | $\dfrac{KT_d}{T}$ | derivative gain |

#### Single-fraction form
$$
G_D(z) = \frac{(K_P+K_I+K_D) - (K_P+2K_D)z^{-1} + K_D z^{-2}}{1-z^{-1}}
$$

**Remarks**
- The pole at $z = 1$ comes from the integral action. It makes the steady-state error to a step input zero.
- $K_D(1-z^{-1})$ adds a zero and gives phase lead (anticipation).
- Setting $K_D = 0$ gives the PI controller $K_P + K_I/(1-z^{-1})$. Setting $K_I = 0$ gives the PD controller $K_P + K_D(1-z^{-1})$.

**Example:** For $K_P = 1$, $K_I = 0.2$, $K_D = 0.2$:
$G_D(z) = (1.4 - 1.4z^{-1} + 0.2z^{-2})/(1-z^{-1})$.

## Check yourself

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

1. Which numerical approximations turn the analog PID into the digital one?
   A. Backward difference for the integral and trapezoidal rule for the derivative
   B. Trapezoidal rule for the integral and backward difference for the derivative
   C. Trapezoidal rule for both
   D. Forward difference for both
   Answer: B. The integral is replaced by a trapezoidal sum and the derivative by a backward difference over T. (Key point: Discretisation methods)

2. How is the trapezoidal sum transformed?
   A. (1 + z^-1) / [2(1 - z^-1)] times E(z)
   B. (1 - z^-1) E(z)
   C. E(z) / (1 + z^-1)
   D. z E(z)
   Answer: A. The summand has transform (1/2)(1 + z^-1)E(z), and a running sum divides by (1 - z^-1). (Key point: Running sum transform)

3. How are the digital gains related to K, Ti, Td and T?
   A. Kp = K, Ki = K Ti / T, Kd = K T / Td
   B. Kp = K - Ki/2, Ki = K T / Ti, Kd = K Td / T
   C. Kp = K + Ki/2, Ki = K Ti / T, Kd = K Td / T
   D. Kp = K - Ki, Ki = K T / Td, Kd = K Td / T
   Answer: B. Using (1+z^-1)/(2(1-z^-1)) = 1/(1-z^-1) - 1/2 moves a half of the integral gain out of the proportional term. (Key point: Gain definitions)

4. What is G_D(z), and what does the pole at z = 1 do?
   A. Kp + Ki/(1 - z^-1) + Kd(1 - z^-1); it makes the steady-state step error zero
   B. Kp + Ki(1 - z^-1) + Kd/(1 - z^-1); it adds phase lead
   C. Kp + Ki/(1 - z^-1) + Kd(1 - z^-1); it makes the system unstable
   D. Kp(1 - z^-1) + Ki + Kd; it removes derivative action
   Answer: A. The pole at z = 1 is the integrator, which drives step error to zero. Setting Kd = 0 gives PI and Ki = 0 gives PD. (Key point: Standard form and special cases)

## Related in Digital Control System

- [Pulse TF with PID controller, plant 1/(s+1)](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Apid-pulse-tf-first-order) — Digital Control System, chapter 3, asked 2×
- [Pulse TF with digital PID, plant 1/(s(s+2))](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Apid-pulse-tf-plant-s2) — Digital Control System, chapter 3
- [Pulse transfer function from state space form](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aderive-pulse-tf-state-space) — Digital Control System, chapter 5, asked 3×
- [ZOH transfer function and pulse transfer function](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Azoh-pulse-transfer-function) — Digital Control System, chapter 1
- [Pulse transfer function matrix of a general companion form](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Apulse-tf-matrix-general-companion) — Digital Control System, chapter 5, asked 7×
- [Pulse transfer function matrix (G = [−4 1; −2 −1], D = 0)](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Apulse-tf-matrix-g-4-1) — Digital Control System, chapter 5, asked 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
- [PID controller types and applications](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Apid-types-realtime-application) — Embedded System, chapter 7
- [DMA controller block diagram and transfer](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Adma-controller) — Computer Organization and Architecture, chapter 7, asked 6×
- [Excitation system with stabilizing transformer: transfer function](https://www.bctengineer.com/question.md?key=semester_7%2Fpower_plant_equipment%3Aexcitation-stabilizing-transformer-model) — Power Plant Equipment, chapter 3, asked 13×
