profile pic
⌘ '
raccourcis clavier

See also source for code and jupyter notebook

Book: ISBN: 978-1-119-47422-7 and pdf

Note

sp.Heaviside(t) is u(t)u(t)

snippets

import sympy
import sympy as sp
from symbol import symbols, apart, inverse_laplace_transform, simplify
from sympy.abc import s, t

Frequency domain

See notes

Common Laplace transform

Laplace Theorem

Transfer function

nthn^{th} order linear, time-invariant (LTI) differential equation:

andnc(t)dtn+an1dn1c(t)dtn1++a0c(t)=bmdmr(t)dtm+bm1dm1r(t)dtm1++b0r(t)a_n \frac{d^n c(t)}{dt^n} + a_{n-1} \frac{d^{n-1} c(t)}{dt^{n-1}} + \cdots + a_0 c(t) = b_m \frac{d^m r(t)}{dt^m} + b_{m-1} \frac{d^{m-1} r(t)}{dt^{m-1}} + \cdots + b_0 r(t)

takes Laplace transform from both side

ansnC(s)+an1sn1C(s)++a0C(s) and init terms for c(t)=bmsmR(s)+bm1sm1R(s)++b0R(s) and init terms for r(t)\begin{aligned} & a_n s^n C(s) + a_{n-1} s^{n-1} C(s) + \cdots + a_0 C(s) \text{ and init terms for } c(t) \\ & = b_m s^m R(s) + b_{m-1} s^{m-1} R(s) + \cdots + b_0 R(s) \text{ and init terms for } r(t) \\ \end{aligned}

assume initial conditions are zero

(ansn+an1sn1++a0)C(s)=(bmsm+bm1sm1++b0)R(s)C(s)R(s)=G(s)=bmsm+bm1sm1++b0ansn+an1sn1++a0\begin{aligned} (a_n s^n + a_{n-1} s^{n-1} + \cdots + a_0)C(s) &= (b_m s^m + b_{m-1} s^{m-1} + \cdots + b_0)R(s) \\[8pt] \frac{C(s)}{R(s)} &= G(s) = \frac{b_m s^m + b_{m-1} s^{m-1} + \cdots + b_0}{a_n s^n + a_{n-1} s^{n-1} + \cdots + a_0} \end{aligned}

Transfer function

G(s)=C(s)R(s)G(s)=\frac{C(s)}{R(s)}

Q: G(s)=1S+2G(s) = \frac{1}{S+2}. Input: u(t)u(t). What is y(t)y(t) ?

Y(s)=G(s)u(s)Y(s)=1s(s+2)=As+Bs+2=12s12(s+2)y(t)=12(1e2t)u(t)\begin{aligned} Y(s) &= G(s)\cdot u(s) \rightarrow Y(s)=\frac{1}{s(s+2)} = \frac{A}{s} + \frac{B}{s+2} = \frac{1}{2\cdot{s}} - \frac{1}{2\cdot{(s+2)}} \\ y(t) &= -\frac{1}{2}(1-e^{-2t})u(t) \end{aligned} Lien vers l'original

Transfer function with feedback is under form

G(s)1+G(s)H(s)\frac{G(s)}{1+G(s)H(s)}

Equivalent Resistance and Impedance

Block Diagrams

State space representation

x˙=Ax+Buy=Cx+Du\begin{align*} \dot{x} &= Ax + Bu \\ y &= Cx + Du \end{align*}

controller form

Given

G(s)=i=1n1bisi+b0sn+i=1n1aisi+a0=Y(s)U(s)G(s) = \frac{\sum_{i=1}^{n-1}b_is^i + b_{0}}{s^n + \sum_{i=1}^{n-1}a_is^{i} + a_{0}} = \frac{Y(s)}{U(s)}

We get controller canonical state space form:

x˙(t)=[01000 00100  00010 00001 a0a1a2an2an1]x(t)+[0 0  0 0 1]u(t) y(t)=[b0b1bn2bn1]x(t).\begin{aligned} \dot{x}(t) &= \begin{bmatrix} 0 & 1 & 0 & \cdots & 0 & 0 \\\ 0 & 0 & 1 & \cdots & 0 & 0 \\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\\ 0 & 0 & 0 & \cdots & 1 & 0 \\\ 0 & 0 & 0 & \cdots & 0 & 1 \\\ -a_0 & -a_1 & -a_2 & \cdots & -a_{n-2} & -a_{n-1} \end{bmatrix} x(t) + \begin{bmatrix} 0 \\\ 0 \\\ \vdots \\\ 0 \\\ 0 \\\ 1 \end{bmatrix} u(t) \\\ y(t) &= \begin{bmatrix} b_0 & b_1 & \cdots & b_{n-2} & b_{n-1} \end{bmatrix} x(t). \end{aligned} Lien vers l'original

observer form

We get observer canonical state space form:

x˙(t)=[an11000an20100a20010a10001a00000]x(t)+[bn1bn2b2b1b0]u(t)y(t)=[1000]x(t).\begin{aligned} \dot{x}(t) &= \begin{bmatrix} -a_{n-1} & 1 & 0 & \cdots & 0 & 0 \\ -a_{n-2} & 0 & 1 & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ -a_2 & 0 & 0 & \cdots & 1 & 0 \\ -a_1 & 0 & 0 & \cdots & 0 & 1 \\ -a_0 & 0 & 0 & \cdots & 0 & 0 \end{bmatrix} x(t) + \begin{bmatrix} b_{n-1} \\ b_{n-2} \\ \vdots \\ b_2 \\ b_1 \\ b_0 \end{bmatrix} u(t) \\ y(t) &= \begin{bmatrix} 1 & 0 & \cdots & 0 & 0 \end{bmatrix} x(t). \end{aligned}Lien vers l'original

stability

See this for applications

Necessary and sufficient condition for stability

to have all roots in open left hand plane is to have all coefficients of polynomial to be present and have same sign.

Lien vers l'original

Routh table


Time response

Tip

To find transfer function for a system given a step response graph, *look for time over around 63% of the final value$

Closed-loop transfer function

T(s)=G(s)1+G(s)T(s) = \frac{G(s)}{1+G(s)}

%OS (percent overshoot)

%OS=eζπ/1ζ2×100%\%OS = e^{\zeta \pi / \sqrt{1-\zeta^2}} \times 100 \%Lien vers l'original

steady-state error

If a unity feedback system has a feedforward transfer function G(s)G(s) then transfer function E(s)R(s)\frac{E(s)}{R(s)} can be derived as:

C(s)=E(s)G(s) E(s)=R(s)C(s)\begin{aligned} C(s) &= E(s)\cdot G(s) \\\ E(s) &= R(s) - C(s) \end{aligned}

For G(s)=KG(s) = K we get E(s)R(s)=11+G(s)\frac{E(s)}{R(s)} = \frac{1}{1+G(s)}

state space design

Pole placement with phase-variable form

Closed-loop system characteristic equation

det(SI(ABK))det(SI - (A-BK))

Gain and Phase Stability Margins

Closed loop pole exists when

1+KG(s)H(s)=01+KG(s)H(s) = 0

zero order hold

Nyqust frequency:

fN=12fsf_N = \frac{1}{2}f_s

Set the third pole to s=-2 to cancel a zero as third pole.