Part 13 - Discretization

Posted on Dec 6, 2023
(Last updated: May 26, 2024)

Introduction

In this part we’ll see how all of this theory will actually be represented when we need to use a computer for calculations.

Implementation

When we want to implement discrete controllers and systems we need to sample.

Sampling is when we sample points from our signal with a certain time period.

We call our sampling period for: $$ h = \dfrac{1}{f_s} $$

Where $f_s$ is the so-called sampling frequency.

To represent a system in a computer we need to sample our signals.

So $e(t)$ becomes $e(kh)$ and $y(t)$ becomes $y(kh)$

We will usually encounter differential equations.

These equations that describe $G(s)$ can be approximated as: $$ \dot{y}(t) \approx = \dfrac{y(t + h) - y(t)}{h} $$

$$ \ddot{y}(t) = \dot{(\dot{y})} = \dfrac{\dot{y}(t +h) - \dot{y}(t)}{h} = \dfrac{\dfrac{y(t + 2h) - y(t + h)}{h} - \dfrac{y(t + h) - y(t)}{h}}{h} = \dfrac{y(t + 2h) - 2y(t + h) - y(t)}{h^2} $$

Example

$$ \dot{y}(t) + ay(t) = a \cdot u(t) \ | \ t=kh,\ k = 0, 1, \ldots $$

$$ \dfrac{y(kh + h) - y(kh)}{h} + ay(kh) = a \cdot u(kh) $$

$$ y(kh + h) = (1 - ah)y(kh) + a \cdot u(kh) $$

Z-transform

We won’t that much in depth about it: $$ Y(z) = \mathcal{Z}\{y(kh)\} = \sum_{k = 0}^{\infty} y(kh) \cdot z^{-k} $$

Example

$$ y(kh) = e^{-akh} $$

$$ \begin{align*} Y(z) & = \sum_{k = 0}^{\infty} e^{-akh} \cdot z^{-k} \\ & = \sum_{k = 0}^{\infty} (e^{-ak} \cdot z^{-1})^k \\ & = \dfrac{1}{1 - e^{-ah} \cdot z^{-1}} \\ & = \boxed{\dfrac{z}{z - e^{-ah}}} \end{align*} $$

Delay Theorem

$$ \mathcal{Z}\{y(kh - lh)\} = z^{-l} \cdot Y(z) $$

Controller design based on analog $G(s)$ and $F(s)$

The discretization of $L_d(z) = F_d(z) G_d(z)$

Sensitivity function, $S_d(z) = \dfrac{1}{1 + L_d(z)}$ Inverse sensitivity function, $S_d(z) = \dfrac{L_d(z)}{1 + L_d(z)}$