con1 - DCC

advertisement
An Overview of Control Theory and
Digital Signal Processing
Luca Matone
Columbia Experimental Gravity group (GECo)
LHO Jul 18-22, 2011
LLO Aug 8-12, 2011
LIGO-G1100863
Syllabus (tentative)
Day Topic
Textbooks
1
Control theory: Physical systems, models, linear systems, block
diagrams, differential equations, feedback loops, cruise control
example, MATLAB implementation.
2
Control theory: Laplace transform and its inverse , transfer
functions, partial fraction expansion, first-order and secondorder systems, dynamic response, bode plots, stability criteria,
MATLAB implementation.
3
Control theory: robustness, typical compensators, noise
suppression, one arm cavity lock example, MATLAB
implementation and time-domain simulations with SIMULINK.
4
DSP: Discrete-time signals and systems, impulse response,
system stability, convolution and correlation, differential to
difference equations, the Z transform, the Discrete-time Fourier
Transform (DTFT), the Discrete Fourier Transform (DFT), MATLAB
implementation.
5
DSP: The Fast-Fourier Transform (FFT), power spectral density,
sampling theorem, aliasing, analog-to-digital transformations,
digital filtering, FIR filters, IIR filters, moving average filter, filter
design, ADC and DACs, MATLAB implementation.
LIGO-G1100863
Chau, Pao C. Process Control:
A First Course with MATLAB®.
Cambridge University Press,
2002. ISBN 0-521-00255-9.
Ingle, Vinay K. and John G.
Proakis. Digital Signal
Processing using Matlab®.
Brooks/Cole 2000. ISBN 0534-37174-4.
Smith, Steven W. The Scientist
and Engineer’s Guide to
Digital Signal Processing.
California Technical
Publishing 1999.
http://www.dspguide.com/
Matone: An Overview of Control Theory and Digital Signal Processing (1)
2
Objective
Control System
• Manages and regulates a set
of variables in a system
– SISO – single-input-singleoutput
– MIMO – multiple-inputmultiple-output
• A quantity is measured then
controlled
• Requirements
–
–
–
–
–
LIGO-G1100863
Bandwidth
Rise time
Overshoot
Steady state error
…
Matone: An Overview of Control Theory and Digital Signal Processing (1)
3
Objective
Digital Signal Processing
• Measure and filter an analog signal
• Digital signal
– Created by sampling an analog signal
– Can be stored
• Analog filters
– Cheap, fast and have a large dynamic
range in both amplitude and frequency
• Digital filters
– Can be designed and implemented “onthe-fly”
– Superior level of performance.
• Example: a low pass digital filter can have a
gain of 1 ± 0.0002, a frequency cutoff at
1000 Hz, and a gain of less than 0.0002
for frequencies above 1001 Hz. A
transition of 1 Hz!
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
4
Control Theory 1
• Given a physical system
– Objective: sense and control a variable in the
system
• Examples
– As basic as
• a car’s cruise control (SISO) or
– Not so basic as
• Locking the full LIGO interferometer (MIMO)
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
5
Example: Cruise Control
Direction
of motion
Normal
force (n)
Friction
force (ffr)
• Objective
Force from
engine (f)
– Car needs to maintain
a given speed
• Physical system
includes
Weight
(mg)
– car’s inertia
– friction
Force or free body diagram: allows to
analyze the forces at play
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
6
Physical model
Direction
of motion
Normal
force (n)
Friction
force (ffr)
Weight
(mg)
LIGO-G1100863
• Physical system described
by the following equation
of motion
Force from
𝑓 = 𝑓 − π‘“π‘“π‘Ÿ = π‘šπ‘Ž
engine (f) βˆ₯ π‘‘π‘œ π‘Ÿπ‘œπ‘Žπ‘‘
• Simplifying and assuming
friction force π‘“π‘“π‘Ÿ is
proportional to speed
π‘“π‘“π‘Ÿ = 𝑏𝑣
𝑑𝑣
π‘šπ‘Ž = π‘š
= 𝑓 − 𝑏𝑣
𝑑𝑑
Matone: An Overview of Control Theory and Digital Signal Processing (1)
7
First-order differential equation
Direction
of motion
• Solving for first-order
differential equation
(assuming 𝑓 is a constant)
Engine
Friction
force (ffr)
force (f)
Time
constant
𝜏 = π‘š/𝑏
LIGO-G1100863
Speed at
regime
π‘£π‘Ÿ = 𝑓/𝑏
𝑑𝑣
π‘š
= 𝑓 − 𝑏𝑣
𝑑𝑑
yields the solution
𝑣 = π‘£π‘Ÿ 1 − 𝑒 −𝑑/𝜏
Matone: An Overview of Control Theory and Digital Signal Processing (1)
8
MATLAB implementation
Direction
of motion
Friction
force (ffr)
The linear differential equation describing the
dynamics of the system
𝑑𝑣
π‘š
= 𝑓 − 𝑏𝑣
𝑑𝑑
Engine
force (f)
Using MATLAB’s Symbolic Math Toolbox
>> dsolve('m*Dy=f-b*y','y(0)=0')
ans =
(f - f/exp((b*t)/m))/b
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
9
π‘š = 1000 π‘˜π‘”
𝑏 = 50 π‘˜π‘” 𝑠
𝑓 = 500 𝑁
Results: 𝑣 = π‘£π‘Ÿ βˆ™ 1 − 𝑒 −𝑑/𝜏
𝑣 τ = 63% βˆ™ π‘£π‘Ÿ
cruise_timedomain.m
𝑓
π‘š
π‘£π‘Ÿ = = 10
𝑏
𝑠
π‘š
τ = = 20 𝑠
𝑏
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
10
Block diagram: representing the
physical system
• To illustrate a cause-and-effect relationship
• A single block represents a physical system
• Blocks are connected by lines
– Lines represent how signals flow in the system
• In general, a physical system G has signal x(t)
as input and signal y(t) as output
• G is the transfer function of the system
x(t)
LIGO-G1100863
G
y(t)
Matone: An Overview of Control Theory and Digital Signal Processing (1)
11
Car’s body
Transfer function G represents the car’s body
– G converts the force from the engine 𝑓 (input
signal, 𝑁) to the car’s actual speed 𝑣 (output
signal, π‘š/𝑠)
𝑣 =πΊβˆ™π‘“
with G =
1
(1
𝑏
– Units: 𝑠 π‘˜π‘”
LIGO-G1100863
𝑏
−𝑒
−π‘šπ‘‘
)
f(t)
G
Matone: An Overview of Control Theory and Digital Signal Processing (1)
v(t)
12
Setting the desired speed
• Second transfer function H (the controller)
– Converts the desired speed (or reference) π‘£π‘Ÿ to a
required force 𝑓
– Sets the throttle
– For simplicity, H is set to a constant
𝑓 = 𝐻 βˆ™ π‘£π‘Ÿ
→ 𝑣 = 𝐺 βˆ™ 𝐻 βˆ™ π‘£π‘Ÿ
𝑣 =πΊβˆ™π‘“
– 𝐺 βˆ™ 𝐻 must be dimensionless
vr
f
H
G
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
v
13
Plotting results
Generated force
by controller H
Resulting speed v
cruisefeedback_timedomain.m
• With 𝐻 = 𝑏 the actual speed
is the reference: 𝑣 = π‘£π‘Ÿ
• Simulate: setting desired
speed to 25 m/s (55 mph)
Desired speed vr
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
14
Introducing a disturbance – a hill
• In the presence of a hill the
equation of motion needs
to be re-visited
Force from
engine (f) • Assuming a small angle θ
𝑑𝑣
π‘š
= 𝑓 − 𝑏𝑣 − π‘šπ‘” βˆ™ θ
𝑑𝑑
Direction
of motion
Friction
force (ffr)
LIGO-G1100863
θ
Weight
(mg)
Added term
Matone: An Overview of Control Theory and Digital Signal Processing (1)
15
Introducing a disturbance – a hill
Assuming 𝑓 and πœƒ are constants
𝑑𝑣
π‘š
= 𝑓 − 𝑏𝑣 − π‘šπ‘” βˆ™ θ
𝑑𝑑
Direction
of motion
Force from
engine (f)
𝑣 = 𝐺 βˆ™ 𝑓 − π‘šπ‘” βˆ™ θ
Friction
force (ffr)
LIGO-G1100863
ϑ
Weight
(mg)
Added term
Matone: An Overview of Control Theory and Digital Signal Processing (1)
16
Modifying the block diagram
𝑣 =πΊβˆ™π‘“
θ
𝑣 =πΊβˆ™ 𝑓−πΎβˆ™πœƒ
K
vr
H
f +
𝐾 = π‘šπ‘”
G
v
Summation junction
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
17
Modifying the block diagram
𝑣 =πΊβˆ™π‘“
θ
𝑣 =πΊβˆ™ 𝑓−πΎβˆ™πœƒ
K
vr
H
f +
𝐾 = π‘šπ‘”
G
v
Summation junction
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
18
Plotting results
Setting desired speed to 25
m/s and slope of πœƒ = 5°
Resulting speed v
cruisefeedback_timedomain.m
Generated force
by controller H
Desired speed
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
19
Negative Feedback
1. Let’s measure the car’s speed and
2. Correct for it by feeding back into the system
a measure of the actual speed 𝑣
θ
K
Error signal
vre
+
-
H
f +
G
v
c
Correction signal
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
20
Negative Feedback
1. Let’s measure the car’s speed and
2. Correct for it by feeding back into the system
a measure of the actual speed 𝑣
θ
Error signal e: the difference
between the desired speed and
K
the measured speed. If null, then
𝒗 = 𝒗𝒓
f + + e
H
vr
-
G
v
c
LIGO-G1100863
Correction signal c: in this case it is
just a measure of the actual speed
Matone: An Overview of Control Theory and Digital Signal Processing (1)
21
Negative feedback
– Faster response with
feedback (compare blue
against red curves)
– Speed at regime:
23 π‘š/𝑠 (error of
~10%)
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
cruisefeedback_timedomain2.m
• Plot of force vs. time
and speed vs. time with
negative feedback
• Setting 𝐻 = 103 π‘˜π‘”/𝑠
• Result:
22
Negative feedback
• Increasing the
controller’s gain (H)
• Setting 𝐻 = 104 π‘˜π‘”/𝑠
• Result:
– Even faster response
– Speed at regime:
24.8 π‘š/𝑠 (error of
~1%)
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
cruisefeedback_timedomain3.m
– decreases the rise time
– while decreasing the
steady state error
23
Signal flow and block diagrams
𝑒 = π‘£π‘Ÿ − 𝑐
𝑣 = 𝐺 βˆ™ (𝑓 − 𝐾 βˆ™ πœƒ)
𝑓 =π»βˆ™π‘’
θ
K
vr +
-
e
H
f +
G
v
c
LIGO-G1100863
𝑐 = 𝑣Matone: An Overview of Control Theory and Digital Signal Processing (1)
24
𝑒 = π‘£π‘Ÿ − 𝑐
= π‘£π‘Ÿ − 𝑣
System’s open
loop gain
(dimensionless)
= π‘£π‘Ÿ − 𝐺 βˆ™ 𝑓 − 𝐾 βˆ™ πœƒ
= π‘£π‘Ÿ − 𝐺 βˆ™ 𝐻 βˆ™ 𝑒 − 𝐾 βˆ™ πœƒ
θ
1
πΎβˆ™πΊ
𝑒=
βˆ™ π‘£π‘Ÿ +
βˆ™πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
vr + e
H
-
LIGO-G1100863
K
f +
c
-
Matone: An Overview of Control Theory and Digital Signal Processing (1)
G
v
25
1
πΎβˆ™πΊ
𝑒=
βˆ™ π‘£π‘Ÿ +
βˆ™πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
πˆπ… 𝐺 βˆ™ 𝐻 ≫ 1 (high gain,
closed loop, with feedback)
πΎβˆ™πΊ
𝐾
𝑒 ≈ 0 βˆ™ π‘£π‘Ÿ +
βˆ™πœƒ ≈ πœƒ
πˆπ… 𝐺 βˆ™ 𝐻 β‰ͺ 1(low
πΊβˆ™π»
𝐻
gain, open loop, or no
θ Error signal in closed loop: close to
feedback)
zero, proportional to angle πœƒ
K
𝑒 ≈ 1 βˆ™ π‘£π‘Ÿ + 𝐾 βˆ™ 𝐺 βˆ™ πœƒ
vr +
-
LIGO-G1100863
e
H
f +
c
𝐾
πœƒ
𝐻
The higher the controller’s gain, the
lower e
𝑒=
-
G
v
Matone: An Overview of Control Theory and Digital Signal Processing (1)
26
𝑣 =πΊβˆ™π»βˆ™π‘’−πΎβˆ™πΊβˆ™πœƒ
= 𝐺 βˆ™ 𝐻 βˆ™ (π‘£π‘Ÿ − 𝑣) − 𝐾 βˆ™ G βˆ™ πœƒ
= 𝐺 βˆ™ 𝐻 βˆ™ π‘£π‘Ÿ − 𝐺 βˆ™ 𝐻 βˆ™ 𝑣 − 𝐾 βˆ™ 𝐺 βˆ™ πœƒ
With no feedback
𝑣 = 𝐺 βˆ™ 𝐻 βˆ™ π‘£π‘Ÿ − 𝐾 βˆ™ 𝐺 βˆ™ πœƒ
θ
πΊβˆ™π»
πΎβˆ™πΊ
𝑣=
βˆ™ π‘£π‘Ÿ − (
)βˆ™πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
K
vr +
-
LIGO-G1100863
e
H
f +
c
-
Matone: An Overview of Control Theory and Digital Signal Processing (1)
G
v
27
πΊβˆ™π»
πΎβˆ™πΊ
𝑣=
π‘£π‘Ÿ −
πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
πˆπ… 𝐺 βˆ™ 𝐻 β‰ͺ 1 (low gain, πˆπ… 𝐺 βˆ™ 𝐻 ≫ 1 (high gain, closed
loop, with feedback)
open loop or no
πΎβˆ™πΊ
𝐾
feedback)
𝑣 ≈ 1 βˆ™ π‘£π‘Ÿ −
βˆ™ πœƒ ≈ π‘£π‘Ÿ − πœƒ
𝑣 ≈ 𝐺 βˆ™ 𝐻 βˆ™ π‘£π‘Ÿ − 𝐾 βˆ™ 𝐺 βˆ™ πœƒ
πΊβˆ™π»
𝐻
θ
Actual speed 𝑣: close to π‘£π‘Ÿ with an error proportional
to πœƒ when in closed loop. The higher the controller’s
gain, the lower the speed error.
vr +
-
LIGO-G1100863
e
H
K
f +
c
-
Matone: An Overview of Control Theory and Digital Signal Processing (1)
G
v
28
𝑓 =π»βˆ™π‘’
1
πΎβˆ™πΊ
=π»βˆ™(
π‘£π‘Ÿ +
πœƒ)
1+πΊβˆ™π»
1+πΊβˆ™π»
θ
𝐻
πΎβˆ™πΊβˆ™π»
𝑓=
βˆ™ π‘£π‘Ÿ +
βˆ™πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
vr +
-
LIGO-G1100863
e
H
K
f +
c
-
Matone: An Overview of Control Theory and Digital Signal Processing (1)
G
v
29
𝐻
πΎβˆ™πΊβˆ™π»
𝑓=
βˆ™ π‘£π‘Ÿ +
βˆ™πœƒ
1+πΊβˆ™π»
1+πΊβˆ™π»
πˆπ… 𝐺 βˆ™ 𝐻 ≫ 1 (high gain,
πˆπ… 𝐺 βˆ™ 𝐻 β‰ͺ 1 (low gain,
closed loop, with feedback)
open loop, or no feedback)
1
𝑓 ≈ 𝐻 βˆ™ π‘£π‘Ÿ + 𝐾 βˆ™ 𝐺 βˆ™ 𝐻 βˆ™ πœƒ
𝑓 ≈ π‘£π‘Ÿ + 𝐾 βˆ™ πœƒ
𝐺
θ
Force 𝑓: at regime, it does not
depend on the gain in 𝐻 while
proportional to angle πœƒ
vr +
-
LIGO-G1100863
e
K
H
f +
c
-
Matone: An Overview of Control Theory and Digital Signal Processing (1)
G
v
30
Plotting 𝐺𝐻 and 𝐺𝐻 1 + 𝐺𝐻
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
cruisefeedback_timedomain2.m
• Open loop
𝑣 = 𝐺 βˆ™ 𝐻 βˆ™ π‘£π‘Ÿ
• Closed loop
πΊβˆ™π»
𝑣=
βˆ™ π‘£π‘Ÿ
1+πΊβˆ™π»
• Setting 𝐻 = 103 π‘˜π‘”/𝑠
• Plotting the open loop
transfer function vs. time
and the closed loop
transfer function vs. time
• Notice the rapid rise time
for the closed loop case
31
The error signal e
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
cruisefeedback_timedomain2.m
• Plot of error signal e vs
time
• Error signal decreases
to 3 m/s.
• Notice a ~10% steady
state error
32
Open and closed loop TF with
𝐻 = 104 π‘˜π‘”/𝑠
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
33
Error signal e with
𝐻 = 104 π‘˜π‘”/𝑠
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
34
Cruise control example
• First-order differential
equation
• Simplest controller:
simply a gain with no
time constants involved
• How to handle more
complicated problems?
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
35
Block diagram reduction
x
x
y
P2
P1
P1
+
±
x
P1P2
y
x
P1 ±P2
y
x
𝑃1
1 ± 𝑃1 𝑃2
y
P2
x
+
βˆ“
P1
y
y
P2
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
36
Practice
Determine the output C in terms of inputs U and R.
U
R +
-
LIGO-G1100863
𝐺1
+
+
𝐺2
Matone: An Overview of Control Theory and Digital Signal Processing (1)
C
37
Practice
Determine the output 𝐢 in terms of inputs
π‘ˆ1 , π‘ˆ2 and 𝑅.
U1
R +
+
𝐺1
𝐻1
+
+
+
+
𝐺2
C
𝐻2
U2
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
38
More practice
Determine C/R for the
following systems.
(c)
𝐺1
𝐻1
LIGO-G1100863
R+
+
+C
+
𝐺2
𝐺1
+
+
C
𝐻1
(b)
𝐺2
+
R +
(a)
R+
+
𝐺2
𝐺1
+
+
C
𝐻1
Matone: An Overview of Control Theory and Digital Signal Processing (1)
39
How do we MEASURE the OL TF of
a system when the loop is closed?
1. Add an injection point in a closed loop
system
2. Inject signal π‘₯ and read signal 𝑦1 (just before
the injection) and 𝑦2 (right after the
injection)
𝑦1
π‘₯
3. Solve for the ratio
𝑦2
+
+
𝑦1
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
𝑦2
40
So far…
• Control theory builds on differential equations
• Block diagrams help visualize the signal flow in a
physical system
• The cause-and-effect relationship between
variables is referred to as a transfer function (TF)
• The system’s open-loop TF is the product of
transfer functions
– cruise control example: 𝐺 βˆ™ 𝐻
– Two cases: 𝐺 βˆ™ 𝐻 β‰ͺ 1 and 𝐺 βˆ™ 𝐻 ≫ 1
• MATLAB implementation
– Functions used: dsolve
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
41
Laplace Transforms
• The technique of Laplace transform (and its
inverse) facilitates the solution of ordinary
differential equations (ODE).
• Transformation from the time-domain to the
frequency-domain.
• Functions are complex, often described in
terms of magnitude and phase
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
42
Linear systems
• To map a model to frequency space
– System must be linear
– Output proportional to input
• Given system P
x
– Input signals: π‘₯1 and π‘₯2
– Output signals (response): 𝑦1 and 𝑦2
P
y
• System P is linear
– If input signal: π‘Ž π‘₯1 + 𝑏 π‘₯2
– Then output signal: π‘Ž 𝑦1 + 𝑏 𝑦2
– Superposition principle
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
43
Example
• Is 𝑦 =
𝑑π‘₯
𝑑𝑑
a linear system?
οƒ˜Knowing that 𝑦1 =
𝑑π‘₯1
𝑑𝑑
and 𝑦2 =
𝑑π‘₯2
𝑑𝑑
οƒ˜If input is 𝑐1 π‘₯1 + 𝑐2 π‘₯2 , output is
𝑑
𝑐1 π‘₯1 + 𝑐2 π‘₯2 =
𝑑𝑑
𝑑
𝑑
𝑐1 π‘₯1 + 𝑐2 π‘₯2 =
𝑑𝑑
𝑑𝑑
𝑐1 𝑦1 + 𝑐2 𝑦2
οƒ˜System is linear
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
44
Example
• Is 𝑦 = π‘₯ 2 a linear system?
οƒ˜Knowing that 𝑦1 = π‘₯1 2 and𝑦2 = π‘₯2
οƒ˜If input is 𝑐1 π‘₯1 + 𝑐2 π‘₯2 , output is
𝑐1 π‘₯1 + 𝑐2 π‘₯2
2
2
≠ 𝑐1 𝑦1 + 𝑐2 𝑦2
οƒ˜System is not linear
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
45
In general
Output
𝑑𝑛 𝑦
𝑑 𝑛−1 𝑦
π‘Žπ‘› 𝑛 + π‘Žπ‘›−1 𝑛−1 + β‹― + π‘Ž0 𝑦
𝑑𝑑
𝑑𝑑
π‘‘π‘š π‘₯
𝑑 π‘š−1 π‘₯
= π‘π‘š π‘š + π‘π‘š−1 π‘š−1 + β‹― + 𝑏0 π‘₯
𝑑𝑑
𝑑𝑑
Input
𝑛
π‘š
π‘Žπ‘– 𝐷 𝑖 𝑦 𝑑 =
𝑖=0
LIGO-G1100863
𝑏𝑖 𝐷 𝑖 π‘₯ 𝑑
𝑖=0
Matone: An Overview of Control Theory and Digital Signal Processing (1)
𝑛≥π‘š
For a stable system
46
Laplace Transform L
• Transforms a linear differential equation into an
algebraic equation
• Tool in solving differential equations
• Laplace transform of function f
𝐹 𝑠 = L 𝑓(𝑑)
• Laplace inverse transform of function F
−1
𝑓(𝑑) = L 𝐹(𝑠)
where 𝑠 = π‘—πœ” is the transform variable
Imaginary unit
LIGO-G1100863
2πœ‹π‘“
Matone: An Overview of Control Theory and Digital Signal Processing (1)
47
Time domain ↔ Laplace domain
𝑓=
𝑑𝑦
f(𝑑)
𝑑𝑑
Input
Output
y(𝑑)
π‘Œ(𝑠)
LIGO-G1100863
𝐺(𝑠)
F(𝑠)
Matone: An Overview of Control Theory and Digital Signal Processing (1)
48
Laplace Transform L
∞
𝑓(𝑑)𝑒 −𝑠𝑑 𝑑𝑑
𝐹 𝑠 = L 𝑓(𝑑) =
0
𝑓 𝑑 =L
LIGO-G1100863
−1
1
𝐹(𝑠) =
2πœ‹π‘—
+π‘—πœ”
𝐹(𝑠)𝑒 𝑠𝑑 𝑑𝑠
−π‘—πœ”
Matone: An Overview of Control Theory and Digital Signal Processing (1)
49
(Some) Laplace transform pairs
𝒇(𝒕)
𝑭(𝒔)
Unit step
𝑒(𝑑)
1
Unit ramp
𝑑
1
sin(πœ”0 𝑑)
Sinusoid
1/π‘Ž 1 − 𝑒 −π‘Žπ‘‘
SHO
πœ”0
𝑒 −π›Ώπœ”0 𝑑 ×
1 − 𝛿2
× sin( 1 − 𝛿 2 πœ”0 𝑑)
LIGO-G1100863
1
𝑒 π‘Žπ‘‘
Exponential
πœ”
1
𝑠
𝑠2
𝑠−π‘Ž
𝑠 2 + πœ”0 2
𝑠 𝑠+π‘Ž
πœ”0 2
𝑠 2 + 2π›Ώπœ”0 𝑠 + πœ”0 2
Matone: An Overview of Control Theory and Digital Signal Processing (1)
50
Laplace transform properties
• Linearity
L 𝑐1 𝑓1 𝑑 + 𝑐2 𝑓2 𝑑
• Derivatives
– First-order: L
𝑑𝑓(𝑑)
𝑑𝑑
– Second-order: L
• Integral
= 𝑐1 𝐹1 𝑠 + 𝑐2 𝐹2 𝑠
= 𝑠𝐹(𝑠)
𝑑 2 𝑓(𝑑)
𝑑𝑑 2
= 𝑠 2 𝐹(𝑠)
𝑑
1
L
𝑓 𝑑 𝑑𝑑 = 𝐹(𝑠)
𝑠
0
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
51
Solution to ODEs
1. Laplace transform the system’s ODE
2. Solve the algebraic equation in s
3. Inverse transform back to the time domain
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
52
Transfer Function 𝐺 𝑠
𝑛
π‘š
π‘Žπ‘– 𝐷 𝑖 𝑦 𝑑 =
𝑖=0
𝑛
𝑏𝑖 𝐷 𝑖 π‘₯ 𝑑
𝑖=0
π‘š
π‘Žπ‘– 𝑠 𝑖 π‘Œ 𝑠 =
𝑖=0
π‘Œ(𝑠)
𝐺 𝑠 =
=
𝑋(𝑠)
𝑏𝑖 𝑠 𝑖 𝑋 𝑠
Using
derivative
property
𝑖=0
Algebraic equation
π‘š
𝑖 in s, the ratio of 2
𝑖=0 𝑏𝑖 𝑠 polynomials in s
𝑛
𝑖
π‘Ž
𝑠
𝑖=0 𝑖
Transfer function 𝐺 𝑠 relates input 𝑋 𝑠 to output π‘Œ 𝑠 .53
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
Transfer Function 𝐺 𝑠
The roots of the numerator are referred to as zeros.
Transfer function 𝐺 𝑠 can
π‘Œ(𝑠)
be defined by
𝐺 𝑠 =
=
• The coefficients of s or
𝑋(𝑠)
• Its poles and zeros
π‘š
𝑖
𝑏
𝑠
𝑖=0 𝑖
𝑛
𝑖
π‘Ž
𝑠
𝑖=0 𝑖
The roots of the denominator are referred to as poles.
54
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
Let’s apply it to the cruise control example:
transfer function 𝐺 (the car’s body)
Direction
of motion
Engine
force (f)
Friction
force (ffr)
f(t)
F(s)
LIGO-G1100863
G(t)
v(t)
𝑑𝑣(𝑑)
π‘š
= 𝑓(𝑑) − 𝑏𝑣(𝑑)
𝑑𝑑
π‘š 𝑠 𝑉 𝑠 = 𝐹 𝑠 − 𝑏 𝑉(𝑠)
𝑉 𝑠
V(s)
= 𝐺 𝑠 𝐹 𝑠 where 𝐺 𝑠
G(s)
1 π‘š
= at − 𝑏 π‘š
Pole
𝑠 +Signal
𝑏/π‘š
Matone: An Overview of Control Theory and Digital
Processing (1)
55
Dynamic response: using lookup
tables to inverse transform
Laplace inverse
transform using
lookup tables
1
𝑠 𝑠+π‘Ž
1
1 − 𝑒 −π‘Žπ‘‘
π‘Ž
LIGO-G1100863
Input: step function, amplitude 𝐹0
𝑓 𝑑 = 𝐹0 𝑒(𝑑)
𝐹
𝐹 𝑠 = L 𝑓(𝑑) = 0 𝑠
The response (in frequency space) is
1/π‘š
𝐹0
𝑉 𝑠 =𝐺 𝑠 βˆ™πΉ 𝑠 =
βˆ™
𝑠 + 𝑏/π‘š 𝑠
The time-domain response is
𝑣 𝑑 = L−1 𝑉(𝑠) =
1
−1 𝐹0
=L
βˆ™
π‘š 𝑠 (𝑠 + 𝑏 π‘š)
Matone: An Overview of Control Theory and Digital Signal Processing (1)
56
Dynamic response: using lookup
tables to inverse transform
Laplace inverse
transform using
lookup tables
1
𝑠 𝑠+π‘Ž
1
1 − 𝑒 −π‘Žπ‘‘
π‘Ž
LIGO-G1100863
𝐹0
1
𝑣 𝑑 =L
βˆ™
π‘š 𝑠 (𝑠 + 𝑏 π‘š)
𝐹0 −1
1
= βˆ™L
π‘š
𝑠 (𝑠 + 𝑏 π‘š)
−1
𝑏
𝐹0
−π‘š 𝑑
𝑣 𝑑 =
1−𝑒
𝑏
1
Pole π‘Ž =
𝜏
Matone: An Overview of Control Theory and Digital Signal Processing (1)
57
First-order system step response
63 %
𝑝
𝐺 𝑠 =
𝑠+𝑝
firstorder.m
𝑝 = 5 π‘Ÿπ‘Žπ‘‘/𝑠, 𝜏 = 0.2 𝑠
LIGO-G1100863
Pole p
Matone: An Overview of Control Theory and Digital Signal Processing (1)
58
MATLAB implementation
The step response of transfer function
5
𝐺 𝑠 =
𝑠+5
>> G=tf(5, [1 5]);
>> step(G);
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
59
Partial fraction expansion
1. Reduce a complex function to a collection of
simpler ones
2. Then use lookup table Order m
𝑄(𝑠)
𝛼𝑖
π‘š≤𝑛
𝐹 𝑠 =
=
𝑃(𝑠)
𝑠 + π‘Žπ‘–
Order n
𝑖
𝛼1
𝛼𝑛
−1
𝑓 𝑑 =L
+ β‹―+ L
𝑠 + π‘Ž1
𝑠 + π‘Žπ‘›
= 𝛼1 𝑒 −π‘Ž1 𝑑 + β‹― + 𝛼𝑛 𝑒 −π‘Žπ‘› 𝑑
𝑛
𝑓 𝑑 =
𝛼𝑖 𝑒 −π‘Žπ‘–π‘‘
𝑖=0
−1
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
60
Comments
𝐹 𝑠 =
𝑖
𝛼𝑖
𝑠 + π‘Žπ‘–
𝑛
𝛼𝑖 𝑒 −π‘Žπ‘–π‘‘
𝑓 𝑑 =
𝑖=0
1. Poles of F(s) determine the time evolution of
f(t)
2. Zeros of F(s) affect coefficients
3. Poles closer to origin → larger time constants
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
61
Example
Find 𝑓(𝑑) of the Laplace transform
6𝑠 2 − 12
𝐹 𝑠 = 3
𝑠 + 𝑠 2 − 4𝑠 − 4
Sol: Using MATLAB
>> [R,P,K]=residue([6 0 -12],[1 1 -4 -4])
R =
3.0000
3
1
2
1.0000
𝐹 𝑠 =
+
+
𝑠+2 𝑠−2 𝑠+1
2.0000
P =
-2.0000
2.0000
-1.0000
K =
𝑓 𝑑 = 3 𝑒 −2𝑑 + 𝑒 2𝑑 + 2 𝑒 −𝑑
[]
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
62
Example: LRC circuit
𝐿
𝑣𝑖𝑛 (𝑑)
𝑅
𝐢
𝑣𝑖𝑛 𝑑 = 𝑣𝐿 𝑑 + 𝑣𝑅 𝑑 + 𝑣𝐢 𝑑
π‘£π‘œπ‘’π‘‘ (𝑑)
𝑑
𝑑
1
= 𝐿 𝑖(𝑑) + 𝑅 𝑖(𝑑) +
𝑖 𝜏 π‘‘πœ
𝑑𝑑
𝐢
0
11
=𝐿𝐷𝑖 𝑑 +𝑅𝑖 𝑑 +
𝑖(𝑑)
𝐢𝐷
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
63
Example: LRC circuit
𝐿
𝑣𝑖𝑛 (𝑑)
𝑅
𝐢
π‘£π‘œπ‘’π‘‘ (𝑑)
11
𝑣𝑖𝑛 (𝑑) = 𝐿 𝐷 𝑖 𝑑 + 𝑅 𝑖 𝑑 +
𝑖(𝑑)
𝐢𝐷
𝑑
𝑖 𝑑 = 𝐢 π‘£π‘œπ‘’π‘‘ 𝑑 = 𝐢 𝐷 π‘£π‘œπ‘’π‘‘ 𝑑
𝑑𝑑
𝑣𝑖𝑛 𝑑 = 𝐿 𝐢 𝐷2 + 𝑅 𝐢 𝐷 + 1 π‘£π‘œπ‘’π‘‘ (𝑑)
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
64
Example: LRC circuit
𝐿
𝑣𝑖𝑛 (𝑑)
𝑅
𝐢
π‘£π‘œπ‘’π‘‘ (𝑑)
𝑣𝑖𝑛 𝑑 = 𝐿 𝐢 𝐷2 + 𝑅 𝐢 𝐷 + 1 π‘£π‘œπ‘’π‘‘ (𝑑)
L
𝑉𝑖𝑛 𝑠 = 𝐿 𝐢 𝑠 2 + 𝑅 𝐢 𝑠 + 1 π‘‰π‘œπ‘’π‘‘ (𝑠)
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
65
LRC circuit: transfer function
π‘‰π‘œπ‘’π‘‘
1
𝑠 =
βˆ™ 𝑉𝑖𝑛 𝑠
2
𝐿𝐢𝑠 +𝑅𝐢𝑠+1
Setting L = 1 H, C = 1 F and R = 1 Ω
π‘‰π‘œπ‘’π‘‘
LIGO-G1100863
1
𝑠 = 2
βˆ™ 𝑉𝑖𝑛 𝑠
𝑠 + 𝑠+1
Matone: An Overview of Control Theory and Digital Signal Processing (1)
66
LRC circuit: dynamic response to step
Setting the input to a step of amplitude 1 V
1
𝑉𝑖𝑛 𝑠 =
𝑠
The unit step response is
1
1
1
π‘‰π‘œπ‘’π‘‘ 𝑠 = 2
βˆ™ = 3
𝑠 + 𝑠 + 1 𝑠 𝑠 + 𝑠2 + 𝑠
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
67
LRC circuit: dynamic
response to step
1
π‘‰π‘œπ‘’π‘‘ (𝑠) = 3
=
2
𝑠 +𝑠 +𝑠
𝑖
𝛼𝑖
𝑠 + π‘Žπ‘–
Using MATLAB for the solution
Coefficient vector for
polynomial at numerator
Coefficient vector for
>> n = [1];
polynomial at denominator
>> d = [1 1 1 0];
>> [α, a, k] = residue(n, d);
π‘£π‘œπ‘’π‘‘ 𝑑 = 𝛼1 𝑒 π‘Ž1𝑑 + 𝛼2 𝑒 π‘Ž2𝑑 + 𝛼3 𝑒 π‘Ž3𝑑
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
68
Plotting results of two methods
>> y=α.'*exp(a*t);
>> plot(t, y, 'bo');
>> y2=step(1,[1 1 1],t);
>> plot(t, y2, ‘r.’);
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
69
Second-order system step
response
secondorder.m
Overshoot
LIGO-G1100863
Period of
oscillation
Settling time: time to
settle to ±5% of final
value (determined by
the 𝑒 −π›Ώπœ”π‘‘ term)
Note: often the
response of a highorder system is
similar to the
second-order one
Matone: An Overview of Control Theory and Digital Signal Processing (1)
70
Verify the following
6𝑠 2 − 12
𝐹 𝑠 = 3
𝑠 + 𝑠 2 − 4𝑠 − 4
𝑓 𝑑 = 2𝑒 −𝑑 + 3𝑒 −2𝑑 + 𝑒 2𝑑
6𝑠
𝐹 𝑠 = 3
𝑠 + 𝑠 2 − 4𝑠 − 4
𝑓 𝑑 = 3𝑒 −𝑑 − 6𝑒 −2𝑑 + 3𝑒 −3𝑑
𝑠+5
𝐹 𝑠 = 2
𝑠 + 4𝑠 + 13
𝑓 𝑑 = 2𝑒 −𝑑 − 3𝑒 −2𝑑 + 𝑒 2𝑑
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
71
Back to cruise control: system’s
step response
πΊβˆ™π»
𝑉(𝑠) =
βˆ™ π‘‰π‘Ÿ (𝑠)
1+πΊβˆ™π»
1 π‘š
where 𝐺 𝑠 =
and 𝐻 𝑠 = πΎπ‘”π‘Žπ‘–π‘›
𝑠 + 𝑏/π‘š
θ
K
e
+
vr
-
H
f + -
G
v
c
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
72
Step response
πΊβˆ™π»
1
𝑉 𝑠 =
βˆ™ =
1+πΊβˆ™π» 𝑠
πΎπ‘”π‘Žπ‘–π‘›
π‘š
(𝑏
+
𝐾
)
π‘”π‘Žπ‘–π‘›
𝑠2 +
𝑠
π‘š
πΎπ‘”π‘Žπ‘–π‘›
π‘š
−𝑑/𝜏
𝑣 𝑑 =
1−𝑒
with τ =
πΎπ‘”π‘Žπ‘–π‘› + π‘š
𝑏 + πΎπ‘”π‘Žπ‘–π‘›
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
73
Back to cruise control
>>
>>
>>
>>
>>
LIGO-G1100863
n = [k/m];
d = [1 (b+k)/m 0];
[α, a, k] = residue(n, d);
y=α.'*exp(a*t);
plot(t, y, 'bo');
Matone: An Overview of Control Theory and Digital Signal Processing (1)
74
Back to cruise control
>>
>>
>>
>>
>>
LIGO-G1100863
G = tf([1/m],[1 b/m]);
H = k;
CL = G * H / (1 + G * H);
[y, t] = step(CL);
plot(t, y, 'b.');
Matone: An Overview of Control Theory and Digital Signal Processing (1)
75
Transfer function, poles and zeros
• It is convenient to express a transfer function
G(s) in terms of its poles and zeros:
𝑄(𝑠)
𝐺 𝑠 =
𝑃(𝑠)
𝑠 − 𝑧1 βˆ™ 𝑠 − 𝑧2 … 𝑠 − π‘§π‘š
=π‘˜βˆ™
𝑠 − 𝑝1 βˆ™ 𝑠 − 𝑝2 … 𝑠 − 𝑝𝑛
• k is the gain of the transfer function
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
76
Summary of pole characteristics
• Real distinct poles (often negative)
𝑐𝑖
↔ 𝑐𝑖 𝑒 𝑝𝑖 𝑑
𝑠 − 𝑝𝑖
• Real poles, repeated m times (often negative)
𝑐𝑖,1
𝑐𝑖,2
+
𝑠 − 𝑝𝑖,1
𝑠 − 𝑝𝑖,2
2
+ β‹―+
𝑐𝑖,3
𝑠 − 𝑝𝑖,3
3
+
𝑐𝑖,π‘š
𝑠 − 𝑝𝑖,π‘š
π‘š
↕
1
𝑐𝑖,π‘š
2
𝑐𝑖,1 + 𝑐𝑖,2 𝑑 + 𝑐𝑖,3 𝑑 + β‹― +
𝑑 π‘š−1 βˆ™ 𝑒 𝑝𝑖 𝑑
2!
π‘š−1 !
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
77
Summary of pole characteristics
• Complex-conjugate poles
𝑐𝑖
𝑐𝑖 ∗
𝑝𝑖 𝑑
∗ 𝑝𝑖
+
↔
𝑐
𝑒
+
𝑐
𝑖
𝑖 𝑒
∗
𝑠 − 𝑝𝑖 𝑠 − 𝑝𝑖
often re-written as a second-order term
πœ”2
𝛼𝑑
↔
~
𝑒
βˆ™ sin 𝛽𝑑 + πœ‘
2
2
𝑠 + 2π›Ώπœ” 𝑠 + πœ”
• Poles on imaginary axis
∗𝑑
– Sinusoid
– Pole at zero: step function
• Poles with a positive real part
– Unstable time-domain solution
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
78
Summary
• The Laplace transform is a tool to facilitate solving for ODEs.
• Systems need to be linear
• No need to do the transform (integral)
– Use transform pairs, transform tables
– Laplace transform properties: linearity, derivatives and integrals.
• Once in the Laplace domain, a TF is simply the ratio of two polynomials
in s. Carry out algebra to solve the problem.
• No need to do the inverse transform
– Use transform pairs, transform tables
– For high-order TFs, use the partial-fraction expansion to reduce the
problem to simpler parts
• IMPORTANT:
– Poles of a transfer function determine the time evolution of the system
– Poles with a real positive part correspond to unstable and unphysical
systems
– The system TF needs to have poles with a negative real part
• MATLAB implementation
– Functions used: step, residue, tf
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
79
Solutions
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
80
Practice
Determine the output C in terms of inputs U and R.
Sol:
𝐺2
𝐢=
βˆ™ 𝐺1 𝑅 + π‘ˆ
1 + 𝐺1 𝐺2
U
R +
-
LIGO-G1100863
𝐺1
+
+
𝐺2
Matone: An Overview of Control Theory and Digital Signal Processing (1)
C
81
Practice
Determine the output 𝐢 in terms of inputs π‘ˆ1 , π‘ˆ2
and 𝑅.
Sol:
1
𝐢=
βˆ™ 𝐺1 𝐺2 𝑅 + 𝐺2 π‘ˆ1 + 𝐺1 𝐺2 𝐻1 π‘ˆ2
1 − 𝐺1 𝐺2 𝐻1 𝐻2
U
1
R +
+
𝐺1
𝐻1
LIGO-G1100863
+
+
+
+
U2
𝐺2
C
𝐻2
Matone: An Overview of Control Theory and Digital Signal Processing (1)
82
More practice
Determine C/R for the following
systems. Sol:
a)
𝐢
𝑅
=
𝐺1 +𝐺2
1−𝐺1 𝐻1 −𝐺2 𝐻2
b)
𝐢
𝑅
=
𝐺1 +𝐺2
1−𝐺1 𝐻1
c)
𝐢
𝑅
=
𝐺1 +𝐺2 1−𝐺1 𝐻1
1−𝐺1 𝐻1
𝐺1
(b)
𝐺2
𝐺1
𝐻1
LIGO-G1100863
R+
+
𝐺2
+
+
C
𝐻1
(c)
+
R +
(a)
+C
+
R+
+
𝐺2
𝐺1
+
+
C
𝐻1
Matone: An Overview of Control Theory and Digital Signal Processing (1)
83
How do we MEASURE the OL TF of
a system when the loop is closed?
1. Add an injection point in a closed loop
system
2. Inject signal π‘₯ and read signal 𝑦1 (just before
the injection) and 𝑦2 (right after the
injection)
𝑦1
π‘₯
3. Solve for the ratio
𝑦2
Sol:
LIGO-G1100863
𝑦1
𝑦2
= −𝐺𝑂𝐿
+
+
𝑦1
Matone: An Overview of Control Theory and Digital Signal Processing (1)
𝑦2
84
Partial-fraction examples
• Denominator: has distinct, real roots
– Example 2.4, 2.5, 2.6
• Denominator: complex roots
– Example 2.7, 2.8
• Denominator: repeated roots
– Example 2.9
LIGO-G1100863
Matone: An Overview of Control Theory and Digital Signal Processing (1)
85
Practice: verify the following
6
𝐹 𝑠 =
(𝑠 + 1)(𝑠 + 2)(𝑠 + 3)
𝑓 𝑑 = 3𝑒 −𝑑 − 6𝑒 −2𝑑 + 3𝑒 −3𝑑
𝑠+5
𝐹 𝑠 = 2
𝑠 + 4𝑠 + 13
πœ‹
−2𝑑
𝑓 𝑑 = 2𝑒
sin(3𝑑 + )
4
𝐹 𝑠 =
𝑓 𝑑 =2
LIGO-G1100863
2
𝑠+1 3 𝑠+2
𝑑 2 −𝑑
1−𝑑+
𝑒 − 𝑒 −2𝑑
2
Matone: An Overview of Control Theory and Digital Signal Processing (1)
86
Download