Part 15 - Summary

Dynamic systems

u(t)u(t) - Input signal

y(t)y(t) - Output signal

We usually represent our systems with ODEs of the form:

y˙+ay=bu\dot{y} + ay = bu

Feedback systems

Using (positive or negative) feedback, meaning our input depends on the output as well!

r(t)r(t) - Reference value/Setpoint

e(t)e(t) = r(t)y(t)r(t) - y(t) - Control error

Laplace Domain

F(s)F(s) - Controller

Guy(s)G_{uy}(s) = Y(s)U(s)\dfrac{Y(s)}{U(s)} - Transfer function

L(s)=Guy(s)F(s)L(s) = G_{uy}(s) F(s) - Loop transfer function

Gry(s)G_{ry}(s) = Y(s)R(s)=L(s)1+L(s)\dfrac{Y(s)}{R(s)} = \dfrac{L(s)}{1 + L(s)} - Closed-loop transfer function

Poles & Zeroes

Poles are given by 1+L(s)=01 + L(s) = 0 - the denominator in Gry(s)G_{ry}(s) to determine the stability of a system.

Zeroes are given by L(s)=0L(s) = 0 - the numerator in Gry(s)G_{ry}(s) to determine the system’s response

Controllers

P-controller

u(t)=Kpe(t)u(t) = K_p \cdot e(t) U(s)=KpE(s)U(s) = K_p \cdot E(s)

PI-controller

u(t)=Kpe(t)+Ki0te(τ) dτu(t) = K_p \cdot e(t) + K_i \int_0^t e(\tau)\ d\tau U(s)=KpE(s)+KisE(s)U(s) = K_p \cdot E(s) + \frac{K_i}{s} \cdot E(s)

PD-controller

u(t)=Kpe(t)+Kdd(e(t))dtu(t) = K_p \cdot e(t) + K_d \cdot \dfrac{d(e(t))}{dt} U(s)=KpE(s)+sKdE(s)U(s) = K_p \cdot E(s) + sK_d \cdot E(s)

PID-controller

u(t)=Kpe(t)+Ki0te(τ) dτ+Kdd(e(t))dtu(t) = K_p \cdot e(t) + K_i \int_0^t e(\tau)\ d\tau + K_d \cdot \dfrac{d(e(t))}{dt} U(s)=KpE(s)+KisE(s)+sKdE(s)U(s) = K_p \cdot E(s) + \frac{K_i}{s} \cdot E(s) + sK_d \cdot E(s)

Feedback systems with noise/disturbance

Remaining control error, e()e(\infty) when:

r(t)=r0σ(t)r(t) = r_0 \cdot \sigma(t) R(s)=r0s  set v(t)=0R(s) = \dfrac{r_0}{s} \ | \ \text{set } v(t) = 0 limte(t)=lims0sE(s)=lims0s(R(s)L(s)1+L(s)R(s))=lims0s(R(s)(1L(s)1+L(s)))=lims0s(R(s)(1+L(s)L(s)1+L(s)))=lims0s(R(s)(11+L(s)))=lims0s(r0s11+L(s))=lims0(r01+L(0))=lims0(r01+F(0)G(0))\begin{align*} \lim_{t \to \infty} e(t) & = \lim_{s \to 0} s \cdot E(s) \newline & = \lim_{s \to 0} s \cdot \left(R(s) - \dfrac{L(s)}{1 + L(s)} R(s)\right) \newline & = \lim_{s \to 0} s \cdot \left(R(s) \cdot \left(1 - \dfrac{L(s)}{1 + L(s)}\right)\right) \newline & = \lim_{s \to 0} s \cdot \left(R(s) \cdot \left(\dfrac{1 + L(s) - L(s)}{1 + L(s)}\right)\right) \newline & = \lim_{s \to 0} s \cdot \left(R(s) \cdot \left(\dfrac{1}{1 + L(s)}\right)\right) \newline & = \lim_{s \to 0} s \cdot \left(\dfrac{r_0}{s} \cdot \dfrac{1}{1 + L(s)}\right) \newline & = \lim_{s \to 0} \left(\dfrac{r_0}{1 + L(0)}\right) \newline & = \boxed{\lim_{s \to 0} \left(\dfrac{r_0}{1 + F(0)G(0)}\right)} \end{align*}

Remaining control error, e()e(\infty) when:

v(t)=v0σ(t)v(t) = v_0 \cdot \sigma(t) V(s)=v0s  set r(t)=0V(s) = \dfrac{v_0}{s} \ | \ \text{set } r(t) = 0 E(s)=R(s)Y(s)E(s) = R(s) - Y(s) \newline E(s)=Y(s)E(s) = -Y(s) \newline E(s)=(G(s)(V(s)+F(s)E(s)))E(s) = -\left(G(s) \cdot \left(V(s) + F(s) E(s)\right)\right) \newline E(s)=G(s)V(s)L(s)E(s)E(s) = -G(s) V(s) - L(s) E(s) \newline E(s)+L(s)E(s)=G(s)V(s)E(s) + L(s) E(s) = -G(s) V(s) \newline E(s)(1+L(s))=G(s)V(s)E(s) \left(1 + L(s)\right) = -G(s) V(s) \newline E(s)=G(s)V(s)1+L(s)E(s) = -\dfrac{G(s) V(s)}{1 + L(s)} \newline E(s)=G(s)1+L(s)V(s)E(s) = -\dfrac{G(s)}{1 + L(s)} \cdot V(s) \newline limte(t)=lims0sE(s)=lims0sG(s)1+L(s)V(s)=lims0sG(s)1+L(s)v0s=lims0G(s)v01+L(s)=lims0G(0)v01+L(0)\begin{align*} \lim_{t \to \infty} e(t) & = \lim_{s \to 0} s \cdot E(s) \newline & = \lim_{s \to 0} s \cdot -\dfrac{G(s)}{1 + L(s)} \cdot V(s) \newline & = \lim_{s \to 0} s \cdot -\dfrac{G(s)}{1 + L(s)} \cdot \dfrac{v_0}{s} \newline & = \lim_{s \to 0} -\dfrac{G(s) \cdot v_0}{1 + L(s)} \newline & = \boxed{\lim_{s \to 0} -\dfrac{G(0) \cdot v_0}{1 + L(0)}} \end{align*}

To eliminate the remaining control error all together, meaning that e()=0e(\infty) = 0 it means that F(0)=F(0) = \infty. In others words, we need a 1s\frac{1}{s} component (an integral in the time domain) in our controller.

Physical models

Physical models are often model with ODEs, for example:

my¨(t)=F(t)ky(t)by˙(t)m\ddot{y}(t) = F(t) - ky(t) - b\dot{y}(t) my¨(t)+by˙(t)+ky(t)=F(t)m\ddot{y}(t) + b\dot{y}(t) + ky(t) = F(t)

Taking the Laplace transform

ms2Y(s)+bsY(s)+kY(s)=LF(s)ms^2 Y(s) + bs Y(s) + kY(s) \stackrel{\mathcal{L}}{=} F(s) Y(s)(ms2+bs+k)=F(s)Y(s) \left(ms^2 + bs + k\right) = F(s) G(s)=F(s)(ms2+bs+k)\boxed{G(s) = \dfrac{F(s)}{\left(ms^2 + bs + k\right)}}

We can also do this with state-space representation.

Rewriting our original ODE:

y¨(t)=bmy˙(t)kmy(t)+1mF(t)\ddot{y}(t) = -\frac{b}{m} \dot{y}(t) - \frac{k}{m} y(t) + \frac{1}{m} F(t)

Let x1=yx_1 = y and x2=y˙x_2 = \dot{y}.

This means that:

{x1˙=x2x2˙=bmx2kmx1+1mF\begin{cases} \dot{x_1} & = x_2 \newline \dot{x_2} & = -\dfrac{b}{m} x_2 - \dfrac{k}{m} x_1 + \dfrac{1}{m} F \end{cases}

Using Matrix notation:

x=[x1˙x2˙]=[01kmbm][x1x2]+[01m]Fx = \begin{bmatrix} \dot{x_1} \newline \dot{x_2} \end{bmatrix} = \begin{bmatrix} 0 & 1 \newline -\frac{k}{m} & -\frac{b}{m} \end{bmatrix} \begin{bmatrix} x_1 \newline x_2 \end{bmatrix} + \begin{bmatrix} 0 \newline \frac{1}{m} \end{bmatrix} F y=[10][x1x2]+[0]Fy = \begin{bmatrix} 1 & 0 \end{bmatrix} \begin{bmatrix} x_1 \newline x_2 \end{bmatrix} + \begin{bmatrix} 0 \end{bmatrix} F

Generalization

x˙=Ax+Buy=Cx+Du\dot{x} = Ax + Bu \newline y = Cx + Du Guy(s)=Y(s)U(s)=C(sIA)1B+DG_{uy}(s) = \dfrac{Y(s)}{U(s)} = C(sI - A)^{-1} B + D

Characteristics equation

To find the poles of the system in matrix notation we use the fact that the denominator of the transfer function is:

det(sIA)det(sI - A)

So, to find the poles we simply:

det(sIA)=0det(sI - A) = 0

Reminder that:

A=[abcd]A = \begin{bmatrix} a & b \newline c & d \end{bmatrix} det(A)=1adbcdet(A) = \dfrac{1}{ad - bc} A1=1adbc[dbca]A^{-1} = \dfrac{1}{ad - bc} \begin{bmatrix} d & -b \newline -c & a \end{bmatrix}

NB: This rule only applies for 2x2 matrices.

State feedback

u=KrrLxy=Cxu = K_r \cdot r - Lx \newline y = Cx x˙=Ax+Bu=Ax+B(KrrLx)sX(s)=AX(s)+B(KrR(s)LX(s))sX(s)=AX(s)+BKrR(s)BLX(s)sX(s)AX(s)+BLX(s)=BKrR(s)X(s)(sIA+BL)=BKrR(s)X(s)=(sIA+BL)1BKrR(s)\dot{x} = Ax + Bu = Ax + B(K_r r - Lx) \newline sX(s) = AX(s) + B(K_r R(s) - LX(s)) \newline sX(s) = AX(s) + BK_r R(s) - BLX(s) \newline sX(s) - AX(s) + BLX(s) = BK_r R(s) \newline X(s) (sI - A + BL) = BK_r R(s) \newline X(s) = (sI - A + BL)^{-1} BK_r R(s) \newline Y(s)=CX(s)Y(s)=C(sIA+BL)1BKrR(s)Grys=Y(s)R(s)=C(sIA+BL)1BKrY(s) = CX(s) \newline Y(s) = C (sI - A + BL)^{-1} B K_r R(s) \newline G_{ry}{s} = \dfrac{Y(s)}{R(s)} = C (sI - A + BL)^{-1} B K_r

We can determine K_r for a system with the knowledge that G(0)=1G(0) = 1

So:

Kr=1C(A+BL)1)BK_r = \dfrac{1}{C(-A + BL)^{-1}) B}

Poles are given by:

det(sIA+BL)=0det(sI - A + BL) = 0

Stability

A system is stable if and only if its characteristic equation has roots in the LHP, meaning that (s)<0\Re(s) < 0.

For systems of order 2, this means that all the coefficients are >0> 0

For systems or order 3 or higher we use Routh–Hurwitz method.

Nyquists simplified criterion

To use the Nyquists simplified criterion, L(s)L(s) can not have a pole in the RHP. If this criterion is met, plot L(jω)L(j\omega) for 0ω0 \leq \omega \leq \infty.

If L(jω)L(j\omega) passes through the negative real axis with (1,0)(-1, 0) to its left, then the system is stable.

Nyquists criterion

If L(s)L(s) has a pole in the RHP, we can still use Nyquists criterion.

Z=P+N=Number of zeroes 1+L(s) has in RHP.Z = P + N = \text{Number of zeroes } 1 + L(s) \text{ has in RHP.} P=Number of poles L(s) has in RHP.P = \text{Number of poles } L(s) \text{ has in RHP.} N=Number of turns L(jω) has around (1,0) clockwise.N = \text{Number of turns } L(j\omega) \text{ has around } (-1, 0) \text{ clockwise.}