Skip to main content

Discrete PID realization and roles of P, I, D

Short answer

A digital PID replaces the integral with a trapezoidal sum and the derivative with a backward difference. The velocity (recursive) form uses only the last two errors and last output. P responds to present error, I removes steady-state error by accumulating past error, and D anticipates future error by reacting to rate of change.

Explain how PID controller is realized in discrete time domain. Discuss the role of P, I and D parts.

A digital PID controller is obtained by replacing the integral and derivative of the analog PID law with sums and differences of the sampled error e(kT)e(kT).

Analog PID law

m(t)=K[e(t)+1Ti∫0te(t) dt+Tdde(t)dt]m(t) = K\left[e(t) + \frac{1}{T_i}\int_0^t e(t)\,dt + T_d\frac{de(t)}{dt}\right]

Discretization

  • Integral by the trapezoidal rule, derivative by the backward difference:
m(kT)=K{e(kT)+TTi∑h=1ke((h−1)T)+e(hT)2+TdT[e(kT)−e((k−1)T)]}m(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:
M(z)E(z)=GD(z)=KP+KI1−z−1+KD(1−z−1)KP=K−KT2Ti,KI=KTTi,KD=KTdT\begin{aligned} \frac{M(z)}{E(z)} = G_D(z) &= K_P + \frac{K_I}{1-z^{-1}} + K_D(1-z^{-1})\\ K_P = K - \frac{KT}{2T_i},\quad K_I &= \frac{KT}{T_i},\quad K_D = \frac{KT_d}{T} \end{aligned}

Realization (velocity / recursive form)

Multiplying by (1−z−1)(1-z^{-1}) gives an algorithm that needs only the last two errors and the last output:

m(k)=m(k−1)+(KP+KI+KD)e(k)−(KP+2KD)e(k−1)+KDe(k−2)m(k) = m(k-1) + (K_P+K_I+K_D)e(k) - (K_P+2K_D)e(k-1) + K_De(k-2)
          +--> [ KP ] -----------------+
          |                            v
 e(k) ----+--> [ KI/(1-z^-1) ] ---->( + )---> m(k)
          |                            ^
          +--> [ KD(1-z^-1) ] ---------+

The computer runs this equation once every sampling period, and the D/A converter with a zero-order hold applies m(k)m(k) to the plant.

Role of each part

  • P (proportional): gives an output proportional to the present error. A larger KPK_P makes the response faster and reduces steady-state error, but too much gain causes overshoot and instability.
  • I (integral): adds a pole at z=1z=1 and accumulates past error. It removes steady-state error to a step (raises the system type by one) but adds phase lag, so it can make the response more oscillatory. Anti-windup is needed when the actuator saturates.
  • D (derivative): responds to the rate of change of error, so it anticipates future error. It adds damping, reduces overshoot and improves stability, but it amplifies high-frequency measurement noise. It is often applied to the measured output instead of the error, with a filter.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Control System chapter 4 questions →