Software Engineering 3DX3 Slides 2: Modelling in The Frequency Domain
Software Engineering 3DX3 Slides 2: Modelling in The Frequency Domain
Material based on lecture notes by P. Taylor and M. Lawford, Control Systems Engineering (4th ed.) by N.
Nise, and Calculus with Analytic Geometry (3rd ed.) by Larson et al.
c
°2006 R.J. Leduc 1
Block Diagram Representation of a System
I Differential equations can be used to represent relationship
between input and output of a system.
I Problem: system parameters, and input (r(t)) and output
(c(t)) appear throughout equation.
I Prefer to represent system as in Fig. 2.1(a) below where input
and output are separate.
Figure 2.1
c
°2006 R.J. Leduc 3
Laplace Transform Definition
Z ∞
L{f (t)} = f (t)e−st dt = F (s)
0
Table 2.1
c
°2006 R.J. Leduc 5
Important Properties of Laplace Transform
Differentiation:
df (t)
L{ } = sF (s) − f (0−)
dt
d2 f (t)
L{ } = s2 F (s) − sf (0−) − f 0 (0−)
dt2
Frequency Shifting: L{e−at f (t)} = F (s + a)
c
°2006 R.J. Leduc 6
Laplace Transform Theorems
Table 2.2
Commonly
used theorems.
c
°2006 R.J. Leduc 7
The Transfer Function
I We are now ready to represent system in the form of the
diagram below.
c
°2006 R.J. Leduc 10
Partial Fraction Expansion
I The Laplace transform model of a system will typically be of
form:
N (s)
F (s) =
D(s)
I where N (s) is an nth order polynomial in s and D(s) is an
mth order polynomial in s.
I For example:
s2 + 2s − 3
F (s) =
s5 + s4 − s − 1
I We know from algebra that all polynomials that have real
coefficients can be factored into linear and irreducible
quadratic factors.
c
°2006 R.J. Leduc 12
N (s)
Steps for Decomposing D(s) into Partial Fractions
N (s) N1 (s)
= (a polynomial) +
D(s) D(s)
N1 (s)
where D(s) is not an improper fraction. We would then apply
N1 (s)
the following steps to D(s) .
3. Linear Factors: For factor (ps + q)m , include the sum below:
A1 A2 Am
+ 2
+ ··· +
(ps + q) (ps + q) (ps + q)m
c
°2006 R.J. Leduc 14
Quadratic Factors e.g.
3
Find: L−1 { s(s2 +2s+5) }
3 A Bs + C
= + 2
s(s2 + 2s + 5) s s + 2s + 5
c
°2006 R.J. Leduc 15
Quadratic Factors e.g. - II
Basic Equation:
We thus have:
3
3 5 − 35 s + − 65 3
5 3 s+2
2
= + 2
= + (− ) 2
s(s + 2s + 5) s s + 2s + 5 s 5 s + 2s + 5
c
°2006 R.J. Leduc 16
Quadratic Factors e.g. - III
The quadratic term is the sum of the Laplace transforms of
frequency shifted sine and cosine.
This gives:
K1 (s+a) K2 ω
L{K1 e−at cosωt} = (s+a)2 +ω 2
L{K2 e−at sinωt} = (s+a)2 +ω 2
.
K1 (s + a) + K2 ω
L{K1 e−at cosωt + K2 e−at sinωt} =
(s + a)2 + ω 2
We thus have:
s+2 (s + 1) + ( 12 )2
=
s2 + 2s + 5 (s + 1)2 + 22
N (s) N (s)
G(s) = =
D(s) (s + p1 )(s + p2 ) · · · (s + pn )
A1 A2 An
= + + ··· +
(s + p1 ) (s + p2 ) (s + pn )
A1 A2 An
g(t) = L−1 { } + L−1 { } + · · · + L−1 { }
(s + p1 ) (s + p2 ) (s + pn )
= A1 e−p1 t + A2 e−p2 t + · · · + An e−pn t
c
°2006 R.J. Leduc 19
Stability Analysis: Real Roots
Considering: g(t) = A1 e−p1 t + A2 e−p2 t + · · · + An e−pn t
c
°2006 R.J. Leduc 20
Stability Analysis: Real and Imaginary Roots
I If ωi = 0 and σi < 0, then pole in right side of imaginary
plane, and response increases over time and system is
unstable. i.e. σi = −1, then we get s = 1, pi = −1 and
response Ai e−σi t = Ai et .
I If σi = 0 and ωi 6= 0, then we have two pure imaginary roots.
This corresponds to a sinusoidal response with no damping,
technically considered stable.
c
°2006 R.J. Leduc 21
Stability Analysis: Complex Roots
If we have σi 6= 0 and ωi 6= 0, we have complex roots.
I For poles at s = −σi ± jωi we get the partial fraction
expansion below:
α + jβ α − jβ
+
s + σi + jωi s + σi − jωi
I This results in the time domain response of the form:
i.e. σi = −2 and ωi = 3,
then we get s = 2 ± 3j,
pi = −2 ± 3j and response
e−σi t [2α cosωi t + 2β sinωi t]
= e2t [2α cos3t + 2β sin3t].
c
°2006 R.J. Leduc 22
Time Functions Associated with s-plane
Figure 2.5 from Dorf and Bishop, Modern Control Systems (10th Edition), Prentice-Hall, 2004.
c
°2006 R.J. Leduc 23
PID Controller Intro
I Transfer function for a proportional-plus-integral-plus-
derivative (PID) controller is:
K2 K1 s + K2 + K3 s2 K3 (s2 + K
K3 s +
1 K2
K3 )
Gc (s) = K1 + +K3 s = =
s s s
I(s) 1
I We also define the admittance to be: Y (s) = V (s) = R =G
c
°2006 R.J. Leduc 25
Impedance of Inductor
V (s) = LsI(s)
V (s)
I The impedance is thus Z(s) = I(s) = Ls
c
°2006 R.J. Leduc 26
Impedance of Capacitor
I The voltage-current relation for a capacitor is:
Z
1 t
v(t) = i(τ )dτ
C 0
I Taking derivative of both sides gives:
dv(t) 1
= i(t)
dt C
I Taking Laplace transform (assuming zero initial conditions)
gives:
1
sV (s) = I(s)
C
V (s) 1
I The impedance is thus Z(s) = I(s) = Cs
c
°2006 R.J. Leduc 27
Summary of Circuit Elements.
I Table 2.3 below shows for each element type the
voltage-current, current-voltage, and voltage-charge
relationship, as well as the elements impedance and
admittance.
c
°2006 R.J. Leduc 28
Equivalent Resistance and Impedance.
I It can be shown that resistance in serial can be replaced by an
equivalent resistor with resistance Rs calculated as follows:
Rs = R1 + R2 + · · · + RN
I This can be generalized to impedance as follows:
Zs = Z1 + Z2 + · · · + ZN
I The equivalent resistance (Rp ) and impedance (Zp ) when
elements are connected in parallel is:
1 1 1 1 1 1 1 1
Rp = R1 + R2 + · · · + RN Zp = Z1 + Z2 + · · · + ZN
Figures 2.16 and 2.18 from Electric Circuit Analysis, D.E. Jounson et al., 1989.
c
°2006 R.J. Leduc 29
Equivalent Resistance Example
Figure (a) to (b): Rs1 = 1 + 5 = 6Ω
1 1 1
Figure (b) to (c): Rp = 12 + 6 ⇒ Rp = 4Ω
Figure 2.19 from Electric Circuit Analysis, D.E. Jounson et al., 1989.
c
°2006 R.J. Leduc 30
Kirchhoff’s Current Law
I A point of connection between two or more circuit elements is
referred to as a node.
I Circuit show in Fig. (a) contains three nodes and is electrically
equivalent to that of Figure (b).
I Kirchoff’s current law (KCL) says that the algebraic sum of
the currents entering any node is zero.
I Currents flowing into the node are considered positive, and
those leaving negative.
I For node on right, this would give: 5 + i − (−3) − 2 = 0
Figures 2.8 and 2.9 from Electric Circuit Analysis, D.E. Jounson et al., 1989.
c
°2006 R.J. Leduc 31
Kirchhoff’s Voltage Law
I Kirchoff’s voltage law (KVL) says that the algebraic sum of
voltages around any closed path is zero.
Figure 2.11 from Electric Circuit Analysis, D.E. Jounson et al., 1989.
c
°2006 R.J. Leduc 32
Kirchhoff’s Voltage Law eg.
VC (s)
I Find transfer function relation V (s) .
c
°2006 R.J. Leduc 33
Mesh Analysis
I Replace passive elements with their impedances, and all
sources and time variables with their Laplace transform.
c
°2006 R.J. Leduc Figures 2.6. 35
Cramer’s Rule
Definition taken from Elementary Linear Algebra with Applications by H. Anton et al. , 1987.
c
°2006 R.J. Leduc 36
Matrix Determinant
The formula of a determinant for a 2 × 2 and a 3 × 3 matrix:
Definition taken from Elementary Linear Algebra with Applications by H. Anton et al. , 1987.
Figure 2.2 from Elementary Linear Algebra with Applications by H. Anton et al. , 1987.
c
°2006 R.J. Leduc 37
Nodal Analysis
I Transform circuit into Laplace Domain.
I Assume for each element a voltage polarity.
I Determine nodes for circuit. Choose one (treat like ground) -
others relative to it.
I Assume transform currents and directions entering and leaving
each node.
c
°2006 R.J. Leduc 39
Operational Amplifiers
I So far we have only used passive elements for transfer
functions.
Figure 2.10.
c
°2006 R.J. Leduc 40
Inverting Op Amps
I If we tie v2 (t) to ground, we get an inverting op amp, with
output vo (t) = −Av1 (t).
I Usually use with feedback in form of figure on the right.
I As input impedance very large, Ia (s) ≈ 0.
I Using nodal analysis at v1 , we find I1 (s) = −I2 (s).
I If gain A very large, feedback forces v1 (t) ≈ 0.
Figure2.10.
c
°2006 R.J. Leduc 41
Inverting Op Amps - II
Vi (s) Vo (s)
I With v1 (t) ≈ 0, we thus have I1 (s) = Z1 (s) and I2 (s) = Z2 (s) .
Figure2.10.
c
°2006 R.J. Leduc 42
Inverting Op Amp eg.
Vo (s)
I Find transfer function Vi (s) .
Figure 2.11.
c
°2006 R.J. Leduc 45
Mass Component
I Newton’s Second Law of Motion: Σf = M a
F (s)
I We wish to find the transfer function Zm (s) = X(s) .
2
I We have: f (t) = M a(t) = M ddtx2 .
I Taking the Laplace transform of both
sides gives: F (s) = M s2 X(s).
F (s)
I Thus Zm (s) = X(s) = M s2 .
0 (s) = F (s)
I Similarly, Zm V (s) = Ms
Table 2.4
c
°2006 R.J. Leduc 46
Viscous Damper
I Middle part is typically moving through some sort of fluid.
I Frictional force generated is proportional to object’s velocity:
f (t) = fv v(t)
where fv is called coefficient of viscous friction.
I Substituting v(t) = dx
dt gives
dx
f (t) = fv
dt
I Taking the Laplace transform of both sides gives:
F (s) = fv sX(s).
F (s)
I Thus Zm (s) = X(s) = fv s.
0 (s) = F (s)
I Similarly, Zm V (s) = fv
c
°2006 R.J. Leduc Table 2.4. 47
Spring Component
I The spring constant is denoted K.
I With zero
R t initial conditions, we have:
x(t) = 0 v(τ )dτ
K
I Thus F (s) = sV (s)
0 (s) = F (s) K
I This gives: Zm V (s) = s
Table 2.4.
c
°2006 R.J. Leduc 48
Summary of Translational Elements
I Table gives Force-velocity, force-displacement, and impedance
translational relationships for springs, viscous dampers, and
mass.
Table 2.4.
c
°2006 R.J. Leduc 49
Translational eg. - one equation of motion
X(s)
I Find transfer function F (s)
Figure 2.15.
c
°2006 R.J. Leduc 50
Translational eg. - one equation of motion - II
I We assume the mass is travelling to the right.
I This means only the applied force (f (t)) points to the right.
I The spring and viscous damping forces impede the motion,
thus act to oppose it.
2
I Newton’s second law: M ddtx2 = f (t) − fv dx
dt − Kx(t)
d2 x
I Rearranging this gives: f (t) = M dt2 + fv dx
dt + Kx(t)
I (b) Transformed
free-body diagram.
Figure 2.16.
c
°2006 R.J. Leduc 52
Translational eg. - two degrees of freedom
I Number of equations of motion needed = number of linearly
independent motions.
c
°2006 R.J. Leduc 53
Translational eg. - two degrees of freedom - II
X2 (s)
I Find transfer function F (s)
c
°2006 R.J. Leduc Figure 2.17 (a). 54
Translational eg. - two degrees of freedom - III
Figure 2.18.
c
°2006 R.J. Leduc 55
Translational eg. - two degrees of freedom - IV
Figure 2.19.
c
°2006 R.J. Leduc 56
Rotational Mechanical Systems
c
°2006 R.J. Leduc 57
Summary of Rotational Components
I Same symbols for components, but undergoing rotation.
I We are interested in the relation: T (s) = Zm (s)θ(s)
Table 2.5.
0 (s) T (s) K
Would have for Zm = ω(s) the values s, D, and Js.
c
°2006 R.J. Leduc 58
Degrees of Freedom
c
°2006 R.J. Leduc 59
Writing Equations of Motion - Rotational
I Create free body diagram, but show torques and angular
displacement instead.
I We will use superposition. To find the torques action on J1 :
1. Draw the free body diagram for J1 by holding J2 still, and find
the torques acting on J1 due only to its own motion.
2. We then hold J1 still, and rotate J2 , and determine the
torques acting on J1 due to the motion of J2 .
3. The total torque acting on J1 is the superposition of the
torques found in steps 1 and 2.
I Repeat above, but for J2 .
I The sum of torques acting in direction of assumed rotation
equals the sum of the torques opposing.
c
°2006 R.J. Leduc 60
Rotational eg.
θ2 (S)
I Find the transfer function T (S) .
I (a) Physical
system.
I (b) Schematic.
Figure 2.22.
c
°2006 R.J. Leduc 61
Free body Diagrams for J1
I (a) Torques on J1
due only to motion
of J1 .
I (b) Torques on J1
due only to motion
of J2 .
c
°2006 R.J. Leduc 62
Free body Diagrams for J2
I (a) Torques on J2
due only to motion
of J2 .
I (b) Torques on J2
due only to motion
of J1 .
c
°2006 R.J. Leduc 63
Rotational Mechanical System with Gears
I Usually when rotational systems are driven by motors, we find
associated gear trains driving the load.
Figure 2.27.
c
°2006 R.J. Leduc 64
Transfer Functions for Gears
I When gears turn, distance travelled around each gear’s
circumference is equal.
θ2 r1
I We thus have: r1 θ1 = r2 θ2 ⇒ θ1 = r2
r1 N1
I It can be shown that r2 = N2
θ2 N1
I We thus have: θ1 = N2
c
°2006 R.J. Leduc 65
Transfer Functions for Gears - lossless
I If we assume the gears have negligible inertia and damping,
then the energy put into gear 1 equals energy out of gear 2.
T2 θ1
I We thus have: T1 θ1 = T2 θ2 ⇒ T1 = θ2
θ2 N1
I Substituting in transfer function: θ1 = N2
T2 N2
I We get: T1 = N1
c
°2006 R.J. Leduc 66
Using Transfer Function for Lossless Gears
I Our first step is to reflect T1 to the other side of output gear
giving: T1 (s) N
N1 .
2
Figure 2.29.
c
°2006 R.J. Leduc 67
Lossless Gears: reflecting impedance
I Substituting in for θ2 (s) gives
N1 N2
(Js2 + Ds + K) θ1 (s) = T1 (s)
N2 N1
I Simplifying: [J( N1 2 2 N1 2 N1 2
N2 ) s + D( N2 ) s + K( N2 ) ]θ1 (s) = T1 (s)
Figure 2.29.
c
°2006 R.J. Leduc 68
Generalizing Reflecting Impedance
c
°2006 R.J. Leduc 69
Lossless Gears eg.
θ2 (s)
I Find transfer function: T1 (s)
Figure 2.30.
c
°2006 R.J. Leduc 70
Gear Trains
100
I What if you wanted a high ratio, say 1 ?
I The total equivalent gear ratio for the gear train, is the
product of the gear ratios for each step.
Figure 2.31.
T4 N2 N4 N6
For torques, we would have: T1 = N1 N3 N5
c
°2006 R.J. Leduc 71
Gears With Loss eg.
I Find transfer function Tθ11(s)
(s) .
I Each gear below has its own inertia, and some shafts have
nonnegligible damping.
I Need to reflect all moments of inertial and viscous dampers to
the left of gear 1.
Figure 2.32.
c
°2006 R.J. Leduc 72
Gears With Loss eg. - II
I Equation of motion:
(Je s2 + De s)θ1 (s) = T1 (s)
I The transfer function is thus:
θ1 (s) 1
G(s) = =
T1 (s) Je s2 + De s
Figure 2.32.
c
°2006 R.J. Leduc 73
Electromechanical System Transfer System
c
°2006 R.J. Leduc 74
DC Motors
Figure 2.35.
c
°2006 R.J. Leduc 75
DC Motor Principles
From: http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/motdc.html.
c
°2006 R.J. Leduc 76
DC Motors: basics
I DC motor contains stationary magnetic field provided by
permanent or electromagnet with field strength B.
I Motor contains a rotating circuit called the armature (the
”coils“) through which a current ia (t) flows.
I Current flows perpendicular through the magnetic field and
feels a force F = Blia (t) acting on it.
I Parameter l is the length of the conductor the current is
flowing through within the field.
Figure 2.35.
c
°2006 R.J. Leduc 77
Back EMF
I When a conductor moves at right angles to a magnetic field,
it generates a voltage at terminals of the conductor (think
generator).
I Since armature is rotating in a magnetic field, it produces a
voltage proportional to its velocity.
dθm (t)
vb (t) = Kb
dt
I We refer to vb (t) as the back electromotive force (back emf),
and Kb as the back emf constant.
c
°2006 R.J. Leduc 78
Figure 2.35.
Analyzing Armature Circuit
θm (s)
I We wish to find the transfer function: Ea (s)
c
°2006 R.J. Leduc Figure 2.35. 79
Analyzing Armature Circuit - II
I Figure shows a typical mechanical loading of a motor.
Figure 2.36.
c
°2006 R.J. Leduc 80
DC Motor Transfer function
Ra
[ (Jm s + Dm ) + Kb ]sθm (s) = Ea (s)
Kt
I This gives the transfer function:
Kt
θm (s) K
= h ³Ra Jm ´i =
Ea (s) s s+ 1
Dm + Kt Kb s(s + α)
Jm Ra
c
°2006 R.J. Leduc 81
Deriving Jm and Dm
I Figure shows typical usage of motor.
I Variable Ja is the moment of inertia of armature, and Da is
the viscous damping of the armature.
I Variable JL is the load moment of inertia, and DL is the
viscous damping on the load.
I Reflecting onto the armature gives:
N1 N1
Jm = Ja + ( )2 JL and Dm = Da + ( )2 DL
N2 N2
Figure 2.37.
c
°2006 R.J. Leduc 82
Deriving Electrical Constants
I A dynamometer measues the torque and speed of a motor
under a constant applied voltage.
I Previously, we derived:
Ra
Tm (s) + Kb sθm (s) = Ea (s)
Kt
I Inverse Laplace transform gives:
Ra
Tm (t) + Kb ωm (t) = Ea (t)
Kt
I As voltage is constant, so is torque and velocity. Solving for
Tm gives
Kb Kt Kt
Tm = − ωm + ea
Ra Ra
c
°2006 R.J. Leduc 83
Deriving Electrical Constants - II
Kb Kt Kt
Tm = − ωm + ea
Ra Ra
I When ωm = 0 we get the stall torque given by:
Kt
Tstall = ea
Ra
I When Tm = 0 we get the angular velocity called no-load
ea
speed given by: ωno−load = K b
I We thus have:
Kt Tstall ea
= and Kb =
Ra ea ωno−load
c
°2006 R.J. Leduc Figure 2.38. 84
Linear Systems
I So far, we have developed models for systems that can be
approximately represented by linear, time-invariant differential
equations.
Figure 2.45.
c
°2006 R.J. Leduc 86
Nonlinear Systems
I Nonlinear systems are systems that are not linear.
I Some examples are:
I Op amps are linear over a given range, but exhibits saturation
at high input voltages.
I A motor exhibits a deadzone where it does not respond to low
input voltages because of friction.
I Backlash occurs when a pair of gears do not fit tightly. This is
when the input gear moves through a small angle before the
output gear starts to move.
c
°2006 R.J. Leduc Figure 2.46. 87
Nonlinear Systems - II
c
°2006 R.J. Leduc 88
Linearization
I If a system contains any nonlinear components, we must
linearize the system before we can apply our modelling
methods.
f (x) ≈ f (xo ) + ma (x − xo )
≈ f (xo ) + ma δx
Figure 2.47.
c
°2006 R.J. Leduc 90
Linearizing a Function - eg.
I Linearize f (x) = 5 cos x about π/2.
Figure 2.48.
c
°2006 R.J. Leduc 91
Formalizing the Linearization Method.
c
°2006 R.J. Leduc 92
Linearizing a Differential Eqn eg.
d2 x dx
+2 + cosx = 0
dt2 dt
c
°2006 R.J. Leduc 93
Transfer Function - Nonlinear Electrical System eg.
Figure 2.49.
c
°2006 R.J. Leduc 94