Implementing PID Controller using Backward Difference Approximation

Figure 5.9 shows Xcos diagram for implementing PID controller.
Figure 5.9: Xcos for PID controller available as pid_bda_virtual.xcos
Image pid_bda_virtual_xcos

The PID controller in continuous time is given by

$\displaystyle u(t)$ $\displaystyle =K \left\{e(t)+\frac{1}{\tau_i}\int_0^t e(t)dt+\tau_d\frac{de(t)}{dt}\right\}$ (5.37)

On taking the Laplace transform, we obtain


$\displaystyle u(t)$ $\displaystyle =K\left\{1+\frac 1{\tau_i s}+\tau_d s\right\}e(t)$ (5.38)

By mapping controller given in equation 5.38 to the discrete time domain using backward difference formula, we get


$\displaystyle u(n)$ $\displaystyle =K\left\{1+\frac{T_s}{\tau_i}\frac{z}{z-1}+\frac{\tau_d}{T_s}\frac{z-1}{z}\right\}e(n)$ (5.39)

On cross multiplying, we obtain


$\displaystyle (z^2-z)u(n)$ $\displaystyle =K\left\{(z^2-z)+\frac{T_s}{\tau_i}z^2+\frac{\tau_d}{T_s}(z-1)^2\right\}e(n)$ (5.40)

We divide by $ z^2$ and by using shifting theorem, we get


$\displaystyle u(n)-u(n-1)$ $\displaystyle =K\left\{e(n)-e(n-1)+\frac{T_s}{\tau_i}e(n)\right.$    
$\displaystyle \hspace{1cm}$ $\displaystyle + \left. \frac{\tau_d}{T_s}[e(n)-2e(n-1)+e(n-2)]\right\}$ (5.41)

The PID controller is usually written as


$\displaystyle u(n)$ $\displaystyle =u(n-1)+s_0 e(n)+s_1e(n-1)+s_2e(n-2)$ (5.42)

where


$\displaystyle s_0$ $\displaystyle =K\left[1+\frac{T_s}{\tau_i}+\frac{\tau_d}{T_s}\right]$ (5.43)
$\displaystyle s_1$ $\displaystyle =K\left[-1-2\frac{\tau_d}{T_s}\right]$ (5.44)
$\displaystyle s_2$ $\displaystyle =K\left[\frac{\tau_d}{T_s}\right]$ (5.45)



Subsections
rokade 2017-04-23