Part 10 - Design of controllers

Introduction

In this part we’ll see how we can design different type of controllers to make a system behave as wanted.

PD-controller

G(s)=Ks(1+sT)G(s) = \dfrac{K}{s(1 + sT)} F(s)=Kp+KdsF(s) = K_p + K_d s

The loop transfer function is:

L(s)=F(s)G(s)=K(Kp+Kds)s(1+sT)=KT(Kp+Kds)s2+1TsL(s) = F(s)G(s) = \dfrac{K(K_p + K_d s)}{s(1 + sT)} = \dfrac{\frac{K}{T} (K_p + K_d s)}{s^2 + \frac{1}{T} s} Gry(s)=L(s)1+L(s)=KT(Kp+Kds)s2+1Ts1+KT(Kp+Kds)s2+1Ts=KT(Kp+Kds)s2+1Ts+KT(Kp+Kds)=KpKT+KdKTss2+(1+KdK)s+KpKTG_{ry}(s) = \dfrac{L(s)}{1 + L(s)} = \dfrac{\dfrac{\frac{K}{T} (K_p + K_d s)}{s^2 + \frac{1}{T} s}}{1 + \dfrac{\frac{K}{T} (K_p + K_d s)}{s^2 + \frac{1}{T} s}} = \dfrac{\frac{K}{T}(K_p + K_d s)}{s^2 + \frac{1}{T} s + \frac{K}{T}(K_p + K_d s)} = \dfrac{K_p \frac{K}{T} + K_d \frac{K}{T} s}{s^2 + (1 + K_d K) s + K_p \frac{K}{T}}

Which we can view as a second-order system where:

ωn=KpKT\omega_n = \sqrt{K_p \frac{K}{T}} \newline ζ=1+KdK2ωn=1+KdK2KpKT\zeta = \dfrac{1 + K_d K}{2 \omega_n} = \dfrac{1 + K_d K}{2\sqrt{K_p \frac{K}{T}}}

If KdK_d increases, ζ\zeta will also increase. This means that the phase margin will increase.

If KdK_d decreases, ζ\zeta will also decrease. This means that the phase margin will decrease.

Example 1 (I-controller)

In this case we have a simple I-controller.

u(t)=Ki0te(τ) dτ    F(s)=Kisu(t) = K_i \int_0^t e(\tau)\ d\tau \iff F(s) = \dfrac{K_i}{s}

Given that our process is:

G(s)=bs+aG(s) = \dfrac{b}{s + a}

Our loop transfer function is:

L(s)=F(s)G(s)=Kibs(s+a)L(s) = F(s)G(s) = \dfrac{K_i b}{s(s + a)}

What should KiK_i be if we want a phase margin of 4545^\circ, meaning ϕm=45\phi_m = 45^\circ.

L(jω)=Kibjω(jω+a)L(j\omega) = \dfrac{K_i b}{j\omega(j\omega + a)}

We defined the phase margin as:

ϕm=arg(L(jωc))+180\phi_m = arg(L(j\omega_c)) + 180^\circ45=arg(L(jωc))+18045^\circ = arg(L(j\omega_c)) + 180^\circarg(L(jωc))=135arg(L(j\omega_c)) = -135^\circ90arctan(ωca)=135-90^\circ - arctan(\dfrac{\omega_c}{a}) = -135^\circarctan(ωca)=45arctan(\dfrac{\omega_c}{a}) = 45^\circωca=1\dfrac{\omega_c}{a} = 1ωc=a\omega_c = a

Using the fact that L(jωc)=1|L(j\omega_c)| = 1:

L(jωc)=1|L(j\omega_c)| = 1Kibωcωc2+a2=1\dfrac{K_i b}{\omega_c \sqrt{\omega_c^2 + a^2}} = 1Kibaa2+a2=1\dfrac{K_i b}{a \sqrt{a^2 + a^2}} = 1Kiba2a2=1\dfrac{K_i b}{a \sqrt{2a^2}} = 1Kib2 a2=1\dfrac{K_i b}{\sqrt{2}\ a^2} = 1Kib=2 a2K_i b = \sqrt{2}\ a^2Ki=2 a2bK_i = \dfrac{\sqrt{2}\ a^2}{b}

Let’s put this into L(s)L(s)

L(s)=2 a2s(s+a)L(s) = \dfrac{\sqrt{2}\ a^2}{s(s + a)}

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

Gry(s)=L(s)1+L(s)==2 a2s(s+a)+2 a2=2 a2s2+as+2 a2G_{ry}(s) = \dfrac{L(s)}{1 + L(s)} = \ldots = \dfrac{\sqrt{2}\ a^2}{s(s + a) + \sqrt{2}\ a^2} = \dfrac{\sqrt{2}\ a^2}{s^2 + as + \sqrt{2}\ a^2}

Second-order system!

ωn=2 a2=214 aζ=a2ωn=a2(214 a)=12214=0.42\omega_n = \sqrt{\sqrt{2}\ a^2} = 2^{\frac{1}{4}}\ a \newline \zeta = \dfrac{a}{2 \omega_n} = \dfrac{a}{2(2^{\frac{1}{4}}\ a)} = \dfrac{1}{2 \cdot 2^{\frac{1}{4}}} = 0.42
Example 2 (PI-controller)

Let’s now do a PI-controller

Given the system:

G(s)=1s(s+8)2G(s) = \dfrac{1}{s(s + 8)^2}

Design a PI-controller so that the phase margin is 5050^\circ, given that ωc=0.3ωπ\omega_c = 0.3 \omega_{\pi}

NB: This notation, ωc=Cωπ\omega_c = C \cdot \omega_{\pi} means that G(jωc)=1|G(j\omega_c)| = 1 and arg(G(jωπ)=180arg(G(j\omega_{\pi}) = -180^\circ, not the loop transfer function. One can also denote it as ωcG\omega_{cG}

A general PI-controller is written as:

F(s)=Kp+Kis=Kp(1+1Tis)=Kp(1+TisTis)F(s) = K_p + \dfrac{K_i}{s} = K_p(1 + \dfrac{1}{T_i s}) = K_p(\dfrac{1 + T_i s}{T_i s})

We know that:

arg(G(jωπ))=180arg(G(j\omega_{\pi})) = -180^\circG(jω)=1jω(jω+8)2G(j\omega) = \dfrac{1}{j\omega(j\omega + 8)^2}

Which means:

arg(G(jω))=902arctan(ω8)arg(G(j\omega)) = -90^\circ - 2 arctan(\dfrac{\omega}{8})902arctan(ωπ8)=180-90^\circ - 2 arctan(\dfrac{\omega_{\pi}}{8}) = -180^\circ2arctan(ωπ8)=902 arctan(\dfrac{\omega_{\pi}}{8}) = 90^\circarctan(ωπ8)=45arctan(\dfrac{\omega_{\pi}}{8}) = 45^\circωπ8=1\dfrac{\omega_{\pi}}{8} = 1ωπ=8\omega_{\pi} = 8

From our initial condition:

ωc=0.3ωπ=2.4\omega_c = 0.3 \cdot \omega_{\pi} = 2.4

A phase margin of 5050^\circ means:

ϕm=50    arg(L(jωc))+180=50\phi_m = 50^\circ \iff arg(L(j\omega_c)) + 180^\circ = 50^\circ

We actually don’t need to calculate what the loop transfer function is here, we can use the fact that L(s)=F(s)G(s)L(s) = F(s)G(s), which means arg(L(jω))=arg(F(jω))+arg(G(jω))arg(L(j\omega)) = arg(F(j\omega)) + arg(G(j\omega)).

arg(G(jω))=902arctan(2.48)=123.4arg(G(j\omega)) = -90^\circ - 2 arctan(\dfrac{2.4}{8}) = -123.4^\circF(jω)=Kp(1+TijωTijω)F(j\omega) = K_p(\dfrac{1 + T_i j\omega}{T_i j\omega})arg(F(jω))=arctan(Tiω)90arg(F(j\omega)) = arctan(T_i \omega) - 90^\circarg(L(jωc))+180=50arg(L(j\omega_c)) + 180^\circ = 50^\circarctan(Tiωc)90123.4+180=50arctan(T_i \omega_c) - 90^\circ -123.4^\circ + 180^\circ = 50^\circarctan(Tiωc)=83.4arctan(T_i \omega_c) = 83.4^\circ2.4Ti=tan(83.4)2.4 T_i = tan(83.4^\circ)Ti=tan(83.4)2.4=3.6T_i = \dfrac{tan(83.4^\circ)}{2.4} = 3.6

Now, let’s use that L(jωc)=1|L(j\omega_c)| = 1

L(jωc)=1|L(j\omega_c)| = 1F(jω)G(jω)=1|F(j\omega)G(j\omega)| = 1F(jω)G(jω)=1|F(j\omega)| |G(j\omega)| = 1Kp12+(ωcTi)2ωcTi1ωcωc2+822=1K_p \cdot \dfrac{\sqrt{1^2 + (\omega_c \cdot T_i)^2}}{\omega_c \cdot T_i} \cdot \dfrac{1}{\omega_c \sqrt{\omega_c^2 + 8^2}^2} = 1Kp=166.31K_p = \ldots \approx 166.31