Part 3 - Controllers in the Laplace domain

Introduction

In this part we’ll define controllers in the Laplace domain.

Let’s firstly cover feedback again.

NNth-Order systems

In controls, we’ll often study system which can be described with differential equations. A NNth-order system means we can describe said system with a NNth-order differential equation.

We also say that the transfer function has degree NN.

Feedback system

Let’s find the general transfer function for a feedback system, from r(t)r(t) to y(t)y(t).

  • G(s)G(s) - System/Process
  • F(s)F(s) - Controller
  • R(s)R(s) - Reference value
  • U(s)U(s) - Input signal
  • Y(s)Y(s) - Output signal
  • E(s)E(s) - Control error = R(s) - Y(s)

Let Gry(s)=Y(s)R(s)G_{ry}(s) = \dfrac{Y(s)}{R(s)}

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

We know that:

U(s)=F(s)E(s)U(s) = F(s) E(s) E(s)=R(s)Y(s)E(s) = R(s) - Y(s)

Therefore:

U(s)=F(s)(R(s)Y(s))U(s) = F(s)(R(s) - Y(s)) U(s)=F(s)R(s)F(s)Y(s)U(s) = F(s)R(s) - F(s)Y(s)

Therefore:

Y(s)=G(s)(F(s)R(s)F(s)Y(s))Y(s) = G(s)(F(s)R(s) - F(s)Y(s)) Y(s)=G(s)F(s)R(s)G(s)F(s)Y(s)Y(s) = G(s)F(s)R(s) - G(s)F(s)Y(s) Y(s)+G(s)F(s)Y(s)=G(s)F(s)R(s)Y(s) + G(s)F(s)Y(s) = G(s)F(s)R(s) Y(s)(1+G(s)F(s))=G(s)F(s)R(s)Y(s)(1 + G(s)F(s)) = G(s)F(s)R(s)

Therefore:

Gry(s)=G(s)F(s)1+G(s)F(s)G_{ry}(s) = \dfrac{G(s)F(s)}{1 + G(s)F(s)}

Let’s denote G(s)F(s)G(s)F(s) as L(s)L(s).

Gry(s)=L(s)1+L(s)G_{ry}(s) = \dfrac{L(s)}{1 + L(s)}

This describes the relation between r(t)r(t) and y(t)y(t) and their stability.

Feedback system

Pros:

  • y(t)y(t) can be equal to r(t)r(t) (with the right controller).
  • Can compensate for interference

Cons:

  • Can be unstable
Definition 1 (Zeros and poles)

Gry(s)G_{ry}(s) can be written as:

Gry(s)=B(s)A(s)G_{ry}(s) = \dfrac{B(s)}{A(s)}

The zeros are given by the equation B(s)=0B(s) = 0.

The poles are given by the equation A(s)A(s).

We’ll see later on how zeros and the poles affect the stability of a system.

Controllers in Laplace

  • P-controller - u(t)=Kp e(t)u(t) = K_p\ e(t)
  • I-controller - u(t)=Ki 0te(τ) dτu(t) = K_i\ \int_0^t e(\tau)\ d\tau
  • PI-controller - u(t)=Kp e(t)+Ki0te(τ) dτu(t) = K_p\ e(t) + K_i \int_0^t e(\tau)\ d\tau

In Laplace:

  • P-controller - U(s)=Kp E(s)U(s) = K_p\ E(s)
  • I-controller - U(s)=Ki 1s E(s)U(s) = K_i\ \dfrac{1}{s}\ E(s)
  • PI-controller - U(s)=Kp E(s)+Kis E(s)U(s) = K_p\ E(s) + \dfrac{K_i}{s}\ E(s)

Let’s rewrite the PI controller a bit:

U(s)=Kp E(s)+Kis E(s)=E(s)(Kp+Kis)=E(s)(Kp(1+KiKp+1s))=E(s)(Kp(1+1Tis))=E(s)(Kp1+TisTis)\begin{align*} U(s) & = K_p\ E(s) + \dfrac{K_i}{s}\ E(s) \newline & = E(s) \left(K_p + \dfrac{K_i}{s}\right) \newline & = E(s) \left(K_p\left(1 + \dfrac{K_i}{K_p} + \dfrac{1}{s}\right)\right) \newline & = E(s) \left(K_p\left(1 + \dfrac{1}{T_i \cdot s}\right)\right) \newline & = E(s) \left(K_p \cdot \dfrac{1 + T_i \cdot s}{T_i \cdot s} \right) \end{align*}

Where Ti=KpKiT_i = \dfrac{K_p}{K_i}

Example 1 (Car with engine dynamics)

Let’s add some engine dynamics:

Fd(s)=Ku1+TuSU(s)F_d(s) = \dfrac{K_u}{1 + T_u \cdot S} \cdot U(s)

Car dynamic:

Gcar(s)=K1+sT=1ms+bG_{car}(s) = \dfrac{K}{1 + sT} = \dfrac{1}{ms + b}

From the differential equation (just like last time) we get:

Y(s)(ms+b)=Ku1+TusU(s)Y(s)(ms + b) = \dfrac{K_u}{1 + T_u \cdot s} \cdot U(s)

Let’s find transfer function from U(s)Y(s)U(s) \to Y(s).

Guy(s)=Y(s)U(s)G_{uy}(s) = \dfrac{Y(s)}{U(s)}Guy(s)=Ku(ms+b)(1+Tu s)G_{uy}(s) = \dfrac{K_u}{(ms + b)(1 + T_u\ s)}

Given some values:

  • m=103 kgm = 10^3\ kg
  • b=200 Nsmb = 200\ \dfrac{Ns}{m}
  • Ku=10k NradK_u = 10k\ \dfrac{N}{rad}
  • Tu=1 secT_u = 1\ sec
Guy(s)=103(103s+200)(1+s)==50(1+5s)(1+s)G_{uy}(s) = \dfrac{10^3}{(10^3s + 200)(1 + s)} = \ldots = \boxed{\dfrac{50}{(1 + 5s)(1 + s)}}

P-controller

Say that our controller was a P-controller.

Let’s find Gry(s)G_{ry}(s).

L(s)=KpGuy(s)L(s) = K_p \cdot G_{uy}(s)

L(s)=50Kp(1+5s)(1+s)L(s) = \dfrac{50K_p}{(1 + 5s)(1 +s)} Gry(s)=50Kp(1+5s)(1+s)1+50Kp(1+5s)(1+s)G_{ry}(s) = \dfrac{\dfrac{50K_p}{(1 + 5s)(1 +s)}}{1 + \dfrac{50K_p}{(1 + 5s)(1 +s)}} Gry(s)=50Kp(1+5s)(1+s)+50KpG_{ry}(s) = \dfrac{50K_p}{(1 + 5s)(1 + s) + 50K_p} Gry(s)=10Kps2+65s+15+10KpG_{ry}(s) = \dfrac{10K_p}{s^2 + \dfrac{6}{5}s + \dfrac{1}{5} + 10K_p}

Gradually increasing reference value

Say that we have r(t)=r0σ(t)r(t) = r_0 \cdot \sigma(t)

This means:

R(s)=r0sR(s) = \dfrac{r_0}{s}

Let’s study y()y(\infty).

limty(t)=lims0sY(s)\lim_{t \to \infty} y(t) = \lim_{s \to 0} sY(s) limty(t)=lims0sGry(s)R(s)\lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot G_{ry}(s) \cdot R(s) limty(t)=lims0s10Kps2+65s+15+10Kpr0s\lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot \dfrac{10K_p}{s^2 + \dfrac{6}{5}s + \dfrac{1}{5} + 10K_p} \cdot \dfrac{r_0}{s} limty(t)=lims010Kp15+10Kpr0\lim_{t \to \infty} y(t) = \lim_{s \to 0} \dfrac{10K_p}{\dfrac{1}{5} + 10K_p} \cdot r_0

Thus

limty(t)=lims010Kp15+10Kpr0<r0\lim_{t \to \infty} y(t) = \lim_{s \to 0} \dfrac{10K_p}{\dfrac{1}{5} + 10K_p} \cdot r_0 < r_0

This means that, a P-controller will never be enough for a system to get an output that is exactly the same as the reference value.

Let’s see how a PI-controller behaves.

Example 2 (PI-controller)

If we use the same system.

Gry(s)G_{ry}(s) is a 2nd order transfer function. (The denominator is a polynomial of degree 2).

The general formula for 2nd order transfer functions can be written as:

Gry(s)=Kωn2s2+2ζωns+ωn2G_{ry}(s) = \dfrac{K \omega^2_n}{s^2 + 2 \zeta \omega_n s + \omega^2_n}

Where:

  • ωn\omega_n - Natural frequency
  • KK- Gain
  • ζ\zeta - Damping ratio

So, in the case Gry(s)=10Kps2+65s+15+10KpG_{ry}(s) = \dfrac{10K_p}{s^2 + \dfrac{6}{5}s + \dfrac{1}{5} + 10 K_p}

We can rewrite it with:

ωn=0.2+10KpK=10Kp0.2+10Kpζ=1.22 0.2+10Kp\omega_n = \sqrt{0.2 + 10 K_p} \newline K = \dfrac{10K_p}{0.2 + 10 K_p} \newline \zeta = \dfrac{1.2}{2\ \sqrt{0.2 + 10 K_p}}

Back to the PI-controller example.

Gry(s)=L(s)1+L(s)G_{ry}(s) = \dfrac{L(s)}{1 + L(s)}

We know that:

L(s)=F(s)G(s)L(s) = F(s) G(s)

We know:

F(s)=Kp(1+TisTis)G(s)=50(1+5s)(1+s)F(s) = K_p \left(\dfrac{1 + T_i s}{T_i s} \right) \newline G(s) = \dfrac{50}{(1 + 5s)(1 + s)}

From G(s)G(s) we can see that we have two poles. One pole is “fast”, T=1 secT = 1\ sec (1+s)(1 + s). The other “slow”, T=5 secT = 5\ sec (1+5s)(1 + 5s).

If we choose Ti=5 secT_i = 5\ sec, then:

F(s)=Kp(1+5s5s)F(s) = K_p \left(\dfrac{1 + 5s}{5s} \right) \newline

Which means:

L(s)=Kp(1+5s5s)50(1+5s)(1+s)L(s) = K_p \left(\dfrac{1 + 5s}{5s} \right) \dfrac{50}{(1 + 5s)(1 + s)}L(s)=50Kp(5s)(1+s)L(s) = \dfrac{50 K_p}{(5s)(1 + s)}

Which means:

Gry(s)=L(s)1+L(s)G_{ry}(s) = \dfrac{L(s)}{1 + L(s)}Gry(s)=50Kp(5s)(1+s)1+50Kp(5s)(1+s)G_{ry}(s) = \dfrac{\dfrac{50 K_p}{(5s)(1 + s)}}{1 + \dfrac{50 K_p}{(5s)(1 + s)}}Gry(s)=50Kp(5s)(1+s)+50KpG_{ry}(s) = \dfrac{50 K_p}{(5s)(1 + s) + 50 K_p}Gry(s)=10Kps2+s+10KpG_{ry}(s) = \dfrac{10 K_p}{s^2 + s + 10 K_p}

If we now study:

limty(t)=lims0sY(s)\lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot Y(s)limty(t)=lims0sGry(s)R(s)\lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot G_{ry}(s) R(s)limty(t)=lims0s10Kps2+s+10Kpr0s\lim_{t \to \infty} y(t) = \lim_{s \to 0} s \cdot \dfrac{10 K_p}{s^2 + s + 10 K_p} \cdot \dfrac{r_0}{s}limty(t)=lims010Kps2+s+10Kpr0\lim_{t \to \infty} y(t) = \lim_{s \to 0} \dfrac{10 K_p}{s^2 + s + 10 K_p} \cdot r_0limty(t)=lims010Kp10Kpr0\lim_{t \to \infty} y(t) = \lim_{s \to 0} \dfrac{10 K_p}{10 K_p} \cdot r_0limty(t)=r0\boxed{\lim_{t \to \infty} y(t) = r_0}

So, we see that a PI-controller gets us exactly the reference value.