Part 2 - Transfer functions

Posted on Oct 31, 2023
(Last updated: May 26, 2024)

Introduction

In this part we’ll define what a transfer function is for a system, and why they are important.

Let’s firstly cover feedback again.

Feedback system

As we discussed last time we’ll encounter:

  • $v(t)$ - Interference
  • $u(t)$ - Control signal/Input signal
  • $y(t)$ - Response signal/Output signal
  • $r(t)$ - Reference value
  • $e(t)$ - Control error

Let’s take a real world example

Example

Say that we have a system which controls temperature. We have an initial temperature for 19$^\circ$a.

At the time instance, $t_0$, we change $r(t)$ (via a knob) to be at 21$^\circ$.

From a time period, $t_1$ to $t_2$, we open a window which cools down the room.

From this real world example we can describe the system as:

$t < t_0$, the system is stable at 19$^\circ$

$t = t_0$, $r(t) = 21^\circ$. We will get a control error, $e(t) > 0$. The control device steps in and increases the temperature, which will stablize at 21$^\circ$.

$t = t_1$, The window is opened, which means we have $v(t) < 0$, or in other words, the temperature decreases. This means again that $e(t) > 0$. The control device needs to readjust to this change.

$t = t_2$, The window is closed, which will yield a control error, the control device will readjust to this change as well.

$t > t_2$, The system will remain stable at 21$^\circ$ again.

Controllers

But how do we actually control a control error? There are many different types of controllers, but the most common are the PID variants.

  • P-controller $$ u(t) = K_p\ e(t) $$
  • I-controller $$ u(t) = K_i \int_0^t e(\tau)\ d\tau $$
  • D-controller $$ u(t) = K_d\ \dfrac{d\ e(t)}{dt} $$

We also have the combinations:

  • PI-controller $$ u(t) = K_p\ e(t) + K_i \int_0^t e(\tau)\ d\tau $$
  • PD-controller $$ u(t) = K_p\ e(t) + K_d\ \dfrac{d\ e(t)}{dt} $$
  • PID-controller $$ u(t) = K_p\ e(t) + K_i \int_0^t e(\tau)\ d\tau + K_d\ \dfrac{d\ e(t)}{dt} $$

Laplace transform

We’ve already covered the definition and the formality of the Laplace transform so let’s quickly recover it. $$ F(s) = \int_0^{\infty} f(t)\ e^{-st}\ dt $$

Where $s = \mu + j\omega$

Transfer function

Let’s define the transfer function in words first.

The transfer function for a system is equal to the Laplace transformation of the output signal divided by the Laplace transformation of the input signal.

In other words: $$ G(s) = \dfrac{Y(s)}{U(s)} $$

$$ Y(s) = G(s) U(s) $$

Properties

We denote the Laplace transform as $\mathcal{L}$

  • $\mathcal{L} \{\dot{y}\} = sY(s) - y(0)$
  • $\mathcal{L} \{\ddot{y}\} = s^2Y(s) - sy(0) - \dot{y}(0)$
  • $\mathcal{L} \{\int_0^t y(\tau)\ d\tau \} = \dfrac{1}{s} Y(s)$

Initial value theorem

$$ y(0) = \lim_{s \to \infty} s \cdot Y(s) $$

Final Value theorem

$$ \lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot Y(s) $$

Given that, $\lim_{t \to \infty} y(t)$ exists.

Example

Say that we have a car that moves, we have $u(t)$ which is the driving force forward. $y(t)$ is the speed of the car, and of course we have friction/air resistence which we’ll denote $v(t)$.

Let’s find the transfer function of this system.

From Newtons second law of motion we know that: $$ F = ma $$

We know from high-school physics that: $$ a = \dfrac{d\ y(t)}{dt} = \dot{y}(t) $$

Now the tricky part, $v(t)$, let’s define a simple model which is that the air resistence is proportional to the speed with some constant: $$ v(t) = b \cdot y(t) $$

Therefore: $$ u(t) - b \cdot y(t) = m \cdot \dot{y}(t) $$

$$ m \cdot \dot{y}(t) + b \cdot y(t) = u(t) $$

Let’s transform into Laplace (NB: All our initial conditions are zero!).

$$ ms \cdot Y(s) + b \cdot Y(s) = U(s) $$

$$ (ms + b)Y(s) = U(s) $$

$$ G(s) = \dfrac{Y(s)}{U(s)} = \dfrac{1}{ms + b} $$

Let’s introduce $T = \dfrac{m}{b}$ and $K = \dfrac{1}{b}$. Therefore: $$ G(s) = \dfrac{K}{1 + sT} $$

Unit step function

In this series we’ll denote the unit step function with $\sigma(t)$.

The definition for the unit step is: $$ \sigma(t) = \begin{cases} 1 & t \geq 0 \\ 0 & t < 0 \end{cases} $$

Let $u(t) = \sigma(t)$ now.

$U(s) = \dfrac{1}{s}$

This means that: $$ G(s) = \dfrac{K}{s(1 + sT)} $$

Using partial fraction decomposition: $$ G(s) = \dfrac{K}{s} - \dfrac{KT}{1 + sT} $$