profile pic
⌘ '
raccourcis clavier

see also some OS-related for real-time system, Control systems, or Frequency Domain

time domain versus frequency domain

use Laplace transform to convert from time domain to frequency domain

Consider the following circuit:

RCdvo(t)dt+vo(t)=vi(t)vi(t)=1\begin{aligned} \text{RC} \frac{d v_o(t)}{dt} + v_o(t) &= v_i(t) \\ v_i(t) &= 1 \end{aligned}

Laplace transform

graph LR
    Diff{{differential equations}} -- "Laplace transform" --> Algebraic{{algebraic equations}} -- "inverse Laplace transform" --> End{{time domain solution}}
L{f(t)}=0f(t)stdt=F(s)\mathcal{L} \{f(t)\} = \int_0^{\infty}f(t)^{-st}dt = F(s) Item no.f(t)F(s)1.δ(t)12.u(t)1s3.tu(t)1s24.tnu(t)n!sn+15.eatu(t)1s+a6.sin(ωt)u(t)ωs2+ω27.cos(ωt)u(t)ss2+ω2\begin{array}{c c c} \hline \text{Item no.} & f(t) & F(s) \\ \hline 1. & \delta(t) & 1 \\ 2. & u(t) & \frac{1}{s} \\ 3. & tu(t) & \frac{1}{s^2} \\ 4. & t^n u(t) & \frac{n!}{s^{n+1}} \\ 5. & e^{-at}u(t) & \frac{1}{s + a} \\ 6. & \sin(\omega t)u(t) & \frac{\omega}{s^2 + \omega^2} \\ 7. & \cos(\omega t)u(t) & \frac{s}{s^2 + \omega^2} \\ \hline \end{array} δ(t)=0,t0,0δ(t)dt=1\delta{(t)} = 0, \quad t \neq 0,\quad \int_0^{\infty}{\delta{(t)}}dt=1

example: Given a unit step function u(t)={0t<01t0u(t) = \begin{cases} 0 & t < 0 \\ 1 & t \ge 0 \end{cases}

U(s)=L{u(t)}=0u(t)estdt=1sestdtU(s)=1s(01)=1s\begin{aligned} U(s) = \mathcal{L} \{u(t)\} &= \int_{0}^{\infty} u(t) e^{-st} dt = -\frac{1}{s} e^{-st} dt \\ U(s) &= -\frac{1}{s}(0-1) = \frac{1}{s} \end{aligned}

inverse form

L1{F(s)}=12πjlimωσjωσ+jωF(s)estds\mathcal{L}^{-1} \{ F(s) \} = \frac{1}{2\pi j} \lim_{\omega \to \infty} \int_{\sigma-j\omega}^{\sigma+j\omega} F(s) e^{st} \, dsLien vers l'original

derivatives and integral

if L[f(t)]=F(s)\mathcal{L}[f(t)] = F(s) then we have

L[f(t)]=sF(s)f(0)L[0tf(t)dt]=F(s)s\begin{aligned} \mathcal{L}[f^{'}(t)] &= sF(s) -f(0) \\ \mathcal{L}[\int_0^{t}f(t) dt] &= \frac{F(s)}{s} \end{aligned}

For higher derivatives we have L[f(t)]=s2F(s)sf(0)f(0)\mathcal{L}[f^{''}(t)] = s^{2} F(s) - sf(0) - f^{'}(0)

another form of system model

we can replace ss with jwjw

ex: G(jw)=11+jwRCG(jw) = \frac{1}{1+jw \text{RC}}, so G(jw)=11+jwRC=11+(wRC2)|G(jw)| = |\frac{1}{1+jw \text{RC}}| = \frac{1}{\sqrt{1+(w \text{RC}^2)}}

reasoning: we substitute Laplace transform with Fourier transform with s=jws=jw

example for a first-order system

Y(s)=s+2s(s+5)=25s+35(s+5)y(t)=25+35e5ttotal response=forced+natural\begin{aligned} Y(s) &= \frac{s+2}{s(s+5)} = \frac{2}{5s} + \frac{3}{5(s+5)} \\ y(t) &= \frac{2}{5} + \frac{3}{5} e^{-5t} \\[8pt] \because \text{total response} &= \text{forced} + \text{natural} \end{aligned}

stability: total response = natural response + forced response

the output response of a system

  1. natural (transient) response: 35e5t\frac{3}{5} e^{-5t}
  2. forced response (steady-state) response: 25\frac{2}{5}

poles and zeros

zeros and poles generate the amplitude for both forced and natural response

Y(s)=s+2s(s+5)Y(s) = \frac{s+2}{s(s+5)}

s=0,5s=0,-5 are poles and s=2s=-2 are zeros

poles

  • at origin, generated step function
  • at -5 generate transient response e5te^{-5t}

System response

We will consider first-order and second-order system

first-order systems, time constant

"\\usepackage{tikz}\n\\usetikzlibrary{positioning}\n\n\\begin{document}\n\\begin{tikzpicture}[auto, node distance=2cm, >=latex]\n\n% Nodes\n\\node[draw, rectangle, minimum width=3cm, minimum height=1.5cm] (block) {$\\frac{a}{s + a}$};\n\\node[left=1.5cm of block] (input) {$X(s) = \\frac{1}{s}$};\n\\node[right=1.5cm of block] (output) {$Y(s)$};\n\\node[above=0.5cm of block] (G) {$G(s)$};\n\n% Arrows\n\\draw[->] (input) -- (block);\n\\draw[->] (block) -- (output);\n\n\\end{tikzpicture}\n\\end{document}"as+aX(s)=1sY(s)G(s)
source code

Output of a general first-order system is

Y(s)=X(s)G(s)=as(s+a)Y(s) = X(s)G(s) = \frac{a}{s(s+a)}

thus the time domain output is y(t)=1eaty(t) = 1 - e^{-at}

time constant

usually, t=1at=\frac{1}{a}, and y(t)=0.63y(t) = 0.63, hence 63.2% to find the rise time.

response in time domain

rise time TrT_r

TrT_r, time for the waveform to go from 0.1 to 0.8 of its final value

for first order: Tr=2.2aT_r = \frac{2.2}{a}

settling time TsT_s

TsT_s, time for response to reach and stay with 2% of its final value

for first order: Ts=4aT_s = \frac{4}{a}

second-order systems

general order system:

G(s)=bs2+as+bG(s) = \frac{b}{s^{2}+as +b}

Thus the pole for this system:

s1,s2=a+a24b2s_{1},s_{2}= \frac{-a + \sqrt{a^2 - 4b}}{2}

natural frequency

happens when a=0a=0

The transfer function is G(s)=bs2+bG(s)=\frac{b}{s^{2}+b}, and poles will only have imaginary ±jw\pm jw

wn=bw_n = \sqrt{b} is the frequency of oscillation of this system.

in a sense, this is the undamped case:

damping coefficient

complex poles has real part σ=a2\sigma = -\frac{a}{2}

definition

damping ratio is defined as:

ζ=exponential decay frequencynatural frequency=σwn\zeta = \frac{\text{exponential decay frequency}}{\text{natural frequency}} = \frac{|\sigma|}{w_n}

So that a=2ζwna = 2 \zeta w_n

general second order

G(s)=wn2s2+2ζwns+wn2s1,s2=ζwn±wnζ21\begin{aligned} G(s) &= \frac{w_n^2}{s^2 + 2 \zeta w_n s + w_n^2} \\[12pt] s_{1},s_{2} &= - \zeta w_n \pm w_n \sqrt{\zeta^2 - 1} \end{aligned}

observations

ConditionPolespole typeDamping Ratio (ζ\zeta)Natural Response c(t)c(t)
Undamped±jωn\pm j \omega_nimaginaryζ=0\zeta = 0Acos(ωntφ)A \cos (\omega_n t - \varphi)
Underdampedωd±jωd\omega_d \pm j \omega_dcomplex0<ζ<10 < \zeta < 1Ae(σd)tcos(ωdtφ)A e^{(-\sigma_d)t} \cos (\omega_d t - \varphi) where wd=wn1ζ2w_d = w_n \sqrt{1- \zeta^2}
critically dampedσ1\sigma_1realζ=1\zeta = 1Kteσ1tK t e^{\sigma_1 t}
overdampedσ1σ2\sigma_1 \quad \sigma_2realζ>1\zeta > 1K(eσ1t+eσ2t)K (e^{\sigma_1 t} + e^{\sigma_2 t})

underdamped second-order step response

Transfer function C(s)C(s) is given by

C(s)=wn2s(s2+2ζwns+wn2)C(s) = \frac{w_n^2}{s(s^2 + 2 \zeta w_n s + w_n^2)}

response in time-domain via inverse Laplace transform:

c(t)=111ζ2eζwntcos(1ζ2ωnt+φ)c(t) = 1 - \frac{1}{\sqrt{1- \zeta^2}} e^{- \zeta w_n t} \cos (\sqrt{1- \zeta^2}\omega_n t + \varphi)

where φ=tan1(ζ1ζ2)\varphi = \tan^{-1} (\frac{\zeta}{\sqrt{1-\zeta^2}})

peak time TpT_p

time required to reach the first or maximum peak

Tp=πωn1ζ2T_p = \frac{\pi}{\omega_n \sqrt{1-\zeta^2}}

percent overshoot

%OS (percent overshoot)

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

or in terms of damping ratio ζ\zeta:

ζ=ln%OS100π2+ln2(%OS100)\zeta = \frac{-\ln \frac{\text{\%OS}}{100}}{\sqrt{\pi^2 + \ln^2(\frac{\text{\%OS}}{100})}}

relations to poles

G(s)=wn2s2+2ζwns+wn2s1,s2=ζwn±wnζ21Tp=πωn1ζ2Ts4ζωn\begin{aligned} G(s) &= \frac{w_n^2}{s^2 + 2 \zeta w_n s + w_n^2} \\[12pt] s_{1},s_{2} &= - \zeta w_n \pm w_n \sqrt{\zeta^2 - 1} \\[8pt] T_p &= \frac{\pi}{\omega_n \sqrt{1-\zeta^2}} \\ T_s &\cong \frac{4}{\zeta \omega_n} \end{aligned}
poles of second-order underdamped system
poles of second-order underdamped system
location of polesresponseexamples
Same envelopesystem response
Same frequencysystem response
Same overshootsystem response

same envelope

"\\usepackage{tikz}\n\\usepackage{pgfplots}\n\\pgfplotsset{compat=1.16}\n\n\\begin{document}\n\\begin{tikzpicture}\n \\begin{axis}[\n width=12cm, height=8cm,\n xlabel={$t$ (time)},\n ylabel={Amplitude},\n grid=major,\n legend style={at={(0.5,1.1)}, anchor=north, legend columns=-1},\n xmin=0, xmax=10,\n ymin=-1.2, ymax=1.2\n ]\n % First Transfer Function (Sinusoidal)\n \\addplot[blue, thick, samples=100, domain=0:10]\n {exp(-0.1*x)*sin(deg(2*pi*0.5*x))};\n\n % Second Transfer Function (Envelope with Different Frequency)\n \\addplot[red, dashed, thick, samples=100, domain=0:10]\n {exp(-0.1*x)*sin(deg(2*pi*0.8*x))};\n\n % Envelope (Exponential Decay)\n \\addplot[black, dotted, thick, samples=100, domain=0:10]\n {exp(-0.1*x)};\n\n \\addplot[black, dotted, thick, samples=100, domain=0:10]\n {-exp(-0.1*x)};\n \\end{axis}\n\\end{tikzpicture}\n\\end{document}"012345678910¡1¡0:500:51t(time)Amplitude
source code

same frequency

"\\usepackage{tikz}\n\\usepackage{pgfplots}\n\\pgfplotsset{compat=1.16}\n\n\\begin{document}\n\\begin{tikzpicture}\n \\begin{axis}[\n width=12cm, height=8cm,\n xlabel={$t$ (time)},\n ylabel={Amplitude},\n grid=major,\n legend style={at={(0.5,1.1)}, anchor=north, legend columns=-1},\n xmin=0, xmax=10,\n ymin=-3, ymax=3\n ]\n % First Transfer Function (Higher Amplitude)\n \\addplot[blue, thick, samples=100, domain=0:10]\n {2*sin(deg(2*pi*0.5*x))};\n\n % Second Transfer Function (Lower Amplitude)\n \\addplot[red, dashed, thick, samples=100, domain=0:10]\n {1*sin(deg(2*pi*0.5*x))};\n \\end{axis}\n\\end{tikzpicture}\n\\end{document}"012345678910¡3¡2¡10123t(time)Amplitude
source code

same overshoot

"\\usepackage{tikz}\n\\usepackage{pgfplots}\n\\pgfplotsset{compat=1.16}\n\n\\begin{document}\n\\begin{tikzpicture}\n \\begin{axis}[\n width=12cm, height=8cm,\n xlabel={Time $t$},\n ylabel={Response},\n grid=major,\n legend style={at={(0.5,1.1)}, anchor=north, legend columns=-1},\n xmin=0, xmax=10,\n ymin=0, ymax=2\n ]\n % First System Response\n \\addplot[blue, thick, samples=200, domain=0:10]\n {1 - exp(-0.5*x)*(cos(deg(2*pi*0.5*x)) + 0.1*sin(deg(2*pi*0.5*x)))};\n\n % Second System Response (Same Overshoot, Different Natural Frequency)\n \\addplot[red, dashed, thick, samples=200, domain=0:10]\n {1 - exp(-1*x)*(cos(deg(2*pi*1*x)) + 0.05*sin(deg(2*pi*1*x)))};\n\n % Reference Line for Steady-State Response\n \\addplot[black, dotted, thick] coordinates {(0,1) (10,1)};\n \\end{axis}\n\\end{tikzpicture}\n\\end{document}"01234567891000:511:52TimetResponse
source code
Lien vers l'original

Root locus

reference: slides, and awesome calculator

excerpt from real-time system slides

final value theorem

If a system is stable and has a final constant value, then one can find steady state value without solving for system’s response. Formally:

limtx(t)=lims0sX(s)\lim_{t \to \infty} x(t) = \lim_{s \to 0} sX(s)

sketching root locus

RuleDescription
Number of BranchesNumber of closed-loop poles, or the number of finite open-loop poles = number of finite open-loop zeros
SymmetryAbout the real axis
Start and End PointsStarts at poles of open loop transfer function and ends at finite and infinite open loop zeros
Behaviour at \inftyReal axis: σa=Σfinite polesΣfinite zeros# finite poles - # finite zeros\sigma_a = \frac{\Sigma{\text{finite poles}} - \Sigma{\text{finite zeros}}}{\text{\# finite poles - \# finite zeros}}
Angle: θa=(2k+1)π# finite poles - # finite zeros\theta_a = \frac{(2k+1)\pi}{\text{\# finite poles - \# finite zeros}} where k=0,±1,±2,±3k = 0, \pm 1, \pm 2, \pm 3
Breakaway/Break-in PointsLocated at roots where d[G(s)H(s)]ds=0\frac{d[G(s)H(s)]}{ds} = 0
Lien vers l'original
Control TypeTransfer function T(s)T(s)Key CharacteristicsEffects
Proportional (P)KpGp1+KpGp\frac{K_p G_p}{1 + K_p G_p}Basic control action- Affects speed of response
- Cannot eliminate steady-state error
Integral (I)KIs2+s+KI\frac{K_I}{s^2 + s + K_I}Integrates error over time- Eliminates steady-state error
- Output reaches 1 at steady state
PIKI+sKps2+(1+Kp)s+KI\frac{K_I + sK_p}{s^2 + (1+K_p)s + K_I}Combines P and I- P impacts response speed
- I forces zero steady-state error
Derivative (D)KDs(1+KD)s+1\frac{K_D s}{(1+K_D)s + 1}Based on rate of change- Adds open-loop zero
- Can affect stability
- Provides damping effect