Adv Control & Robotic Lec 5
Transcript of Adv Control & Robotic Lec 5
-
8/14/2019 Adv Control & Robotic Lec 5
1/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:1
METR4202 Advanced Control & Robotics
Lecture 5
The z-DomainDiscrete Transfer Functions
Discrete Stability (Bilinear Transformation)Discrete Control Design (Tustin Transformation)
Control Course Overview
G. Hovland 2004-2006
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:2
Continuous and Discrete Systems
Controller System-
yref yu
Continuous Control System:
Discrete Control System:
Controller System-
yref
D/A A/D
-
8/14/2019 Adv Control & Robotic Lec 5
2/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:3
Digital to Analog (D/A) Converter
D/A Simple and effectively instantaneous
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:4
A/D Successive Approximation
D/A Converter
ComparatorCircuit
Analog Input Signal
Higher/Lower
Binary search from MSB to LSB
-
8/14/2019 Adv Control & Robotic Lec 5
3/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:5
Analog to Digital (A/D) Converter
Analog Signal Zero-order Sample and Hold
In general,M / 2n voltagelevels.
A/D is not instantaneous
Quantisation
Errors
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:6
Digital vs Analog Analysis
If A/D could be made instantaneous, there would be noneed to differentiate between digital and analog controlsystems.
In practice, A/D requires time (eg. comparator circuit).We will need to model the sample-and-hold process.
Note that a system that is stable with an analogcontroller, can become unstable with the same controllerbut implemented as a digital controller with a slowsampling rate.
-
8/14/2019 Adv Control & Robotic Lec 5
4/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:7
a. switch openingand closing;b. product of timewaveform and
sampling waveform
Two Views of Sampling
Constant sampling times
The waveform view b) will be usedin the following analysis
Whenever you see * in thefollowing, it refers to the sampledfunction!
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:8
Sample Pulse Function u(t) - u(t-Tw)
t
u(t)
1
0Tw
t
1
0Tw
u(t-Tw)
t
1
0Tw
u(t) - u(t-Tw)
Laplace of a step iss
1
Laplace of a delayed step is
s
esTw
Laplace of a pulse is
s
esTw1
-
8/14/2019 Adv Control & Robotic Lec 5
5/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:9
The Sampled Function f*Tw
=
=== kk wTW TkTtukTtutftstftf )()()()()()(
*
k: integer
T: pulse train period
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:10
The Sampled Function f*Tw
Assumption: Tw is small in comparison to T
f(t) is constant in sampling interval
[ ]=
==
=
k
k wTW TkTtukTtukTftf
kTftf
)()()()(
)()(
*
f(kT) moved inside the summation
-
8/14/2019 Adv Control & Robotic Lec 5
6/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:11
The Laplace Transform f*Tw F*Tw(s)
[ ]
kTsk
k
sT
k
k
sTkTskTs
Tw
k
k wTW
es
ekTf
s
e
s
ekTfsF
TkTtukTtukTftf
w
w
=
=
=
=
=
=
=
=
=
1)(
)()(
)()()()(
*
*
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:12
Taylor Series Expansion of F*Tw(s)
=
=
=
=
=
=
=
=
=
+
=
=
k
kwTw
k
k
kTs
w
kTsk
k
w
w
kTsk
k
sT
Tw
kTtkTfTtf
eTkTf
es
sT
sTkTf
es
ekTfsF
w
)()()(
)(
!2
)(
11)(
1)()(
*
2
*
Inverse Laplace Dirac delta function
Assuming Tw small
-
8/14/2019 Adv Control & Robotic Lec 5
7/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:13
Sampler Model: Uniform Rectangular Pulse Train
Ideal Sampler:
this will be used forfurther analysis
Sample waveform dependency
(in this example rectangular
pulse train)
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:14
Ideal Sample and Hold
Individual step responses with length T
s
esG
Ts
h
=1
)(
Delay T because step response
ends at T
-
8/14/2019 Adv Control & Robotic Lec 5
8/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:15
Summary so Far
Ideal Sampler
Zero-order Sample-and-Hold (z.o.h.)
We are now ready to introduce the z-transform
s
esG
kTtkTftf
Ts
h
k
k
=
=
=
=
1)(
)()()(
*
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:16
The z-Transform (Nise Chapter 13.3)
Ideal Sampler
s-domain (Continuous control systems)
z-domain (discrete control systems)
=
=
=
=
=
=
=
0
0
*
*
)()(
)()(
)()()(
kk
k
kTs
k
k
zkTfzF
ekTfsF
kTtkTftf
Tsez =1
Time delay!
-
8/14/2019 Adv Control & Robotic Lec 5
9/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:17
Simple Example z-Transform
f(kT) = u(kT) - 2u([k-1]T) - 3u([k-2]T)
F(z) = 1 - 2z-1 - 3z-2
Each further delay increases exponent of z
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:18
Example 13.1
Find the z-transform of a sampled unit ramp
Open Form
-
8/14/2019 Adv Control & Robotic Lec 5
10/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:19
Example 13.1 - cont'd
What is the Laplace transform F(s) of a ramp?
Note F(z) is closed-form while F*(s) is not. This is one reason whythe new z-transform is introduced. The Laplace F(s) is closed-form,but the sampled F*(s) is not!
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:20
Partial Table of s- and z-Transforms
These 3 are the main ones you will use in practice
-
8/14/2019 Adv Control & Robotic Lec 5
11/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:21
z-Transform Theorems
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:22
Example 13.4
Given a z.o.h. in cascade with G1(s) = (s+2) / (s+1) or
Find the sampled-data transfer function, G(z), if the sampling
time T=0.5 seconds
1
21)(
+
+=
s
s
s
esG
Ts
G1(s)Zero-order-hold
s
esG
Ts
=1
)(2
By default, assuming sampled inputs and outputs
G(s) G(z)
-
8/14/2019 Adv Control & Robotic Lec 5
12/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:23
Example 13.4 - cont'd
Again, partialfractions!
Tez
z
s
z
z
s
+
1
1
1
1
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:24
z-Domain Stability
1:01:0
1:0
)(
1
>
==
====
=
+
T
T
T
TTjTjTTs
Ts
ee
e
Teeeeez
ez
Region B (marginally stable)
Region C (unstable)
Region A (stable)
-
8/14/2019 Adv Control & Robotic Lec 5
13/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:25
z-domain stability directly from s-domain
There is no equivalent Routh-Hurwitz stability criterionfor discrete control systems
A simple transformation allows us to check discretestability by transforming to s-domain and applying theRouth-Hurwitz criterion as normal.
Bilinear transformations
1
1
1
1
+=
+=
s
sz
z
zs
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:26
Bilinear Transformations
01
01
01
)1(
)1(
)1(
)1(
22
22
==
>>
-
8/14/2019 Adv Control & Robotic Lec 5
14/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:27
Example 13.8: Discrete Stability
Closed-Loop Discrete denominator:
Use the Routh-Hurwitz criterion to determine stability
1.02.023
+ zzz
17451911 23
+= sss
ssz
How manypoles outside
the unit circlein z-domaindoes the systemhave?
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:28
s-domain design, z-domain implementation
We want to re-use all the techniques we have developedfor continuous systems.
Ideally, we want to design everything in s-domain andthen convert to z-domain as the last step beforeimplementation on the real-time controller.
The Tustin approximation will allow us to do this
This transformation yields a digital transfer functionwhose output response at the sampling instants isapproximately the same as the analog transfer function.
sT
sT
zz
z
Ts
21
21
1
12
+
=+
=
-
8/14/2019 Adv Control & Robotic Lec 5
15/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:29
s-domain to z-domain: Tustin Approximation
1
12
+
=
z
z
Ts
)1.29(
)6(1977)(
+
+
s
ssGc
746.0
16741778
9.1701.229
)194206(1977
1.291.29200200
)66200200(1977
1.291
)1(200
)61
)1(200(1977
)(
=
=
++
++=
++
++
=
z
z
z
z
zz
zz
z
zz
z
zGc
Sample time, choose T=0.01
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:30
Example 13.12 - Verification
The effects of three
different samplingtimes
-
8/14/2019 Adv Control & Robotic Lec 5
16/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:31
Matlab / Simulink Discrete Control Functions
c2d: Converts continuous to discrete transfer
functions, example Gd = c2d(G,dt,'tustin')
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:32
Discrete Control Summary
z-transform provides closed-form transfer function forsampled systems, (Laplace transform does usually not)
Stability analysis in z-domain required for sampledsystems
Bilinear transformation allows Routh-Hurwitz stabilitytest for z-domain roots
Tustin approximation allows us to design controllers asusual in s-domain and convert the final result to z-domain just prior to implementation
-
8/14/2019 Adv Control & Robotic Lec 5
17/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:33
Main Themes of METR4202/7202
FrequencyDomainAnalysis
(Nise Chapter 10.1-7)
Simple PDControl Design
(Bode Plots, 11.1-11.2)
State-SpaceControl Design(Nise Chapter 12)
State-SpaceObserver Design
(Nise Chapter 12)
DiscreteTime Domain
Analysis(Nise Chapter 13)
BilinearTransformations
Tustin
Overshoot, settling time
phase margin, bandwidth
Signal-Flow charts
Pole placement
Similarity
Transformations
Phase andGain Margins
DesiredPolynomials
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:34
Advantages / Disadvantages
Frequency Domain: (+) Easy to obtain modelsexperimentally through frequency responses. (-) Modelsdo not reveal the physical structure, only input-outputrelationships.
Continuous Time Domain: (+) Models based on naturallaws (physics, chemistry, etc). Some states are moreimportant than others and controllers can be designedaccordingly. (-) More difficult to estimate modelparameters.
Discrete Time Domain: (+) Allows analysis of sample-and-hold effects. (-) Requires controller design in z-plane. (+) Tustin approximation allows us to re-use toolsfrom Frequency Domain.
-
8/14/2019 Adv Control & Robotic Lec 5
18/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:35
Overview: Frequency Domain Analysis
Polar Plots
Asymptotic Bode Plots: 1st and 2nd order zeros and poles
The Nyquist Stability Criterion
Sketching Nyquist Diagrams: Polar Plots positive, negative jw
Gain and Phase Margins from Nyquist Plots
Stability, Gain and Phase Margins from Bode Plots
*
*
*
*
Checklist
* means that examples given in the following slides
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:36
Common Asymptotes
Figure 10.9Normalised andscaled
Bode plots fora. G(s) = s;b. G(s) = 1/s;c. G(s) = (s+ a);d. G(s) = 1/(s+ a)
-
8/14/2019 Adv Control & Robotic Lec 5
19/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:37
The Final Statement of the Nyquist Criterion
The number of closed-looppoles, Z, in the right half-planeequals the number of open-
loop poles, P, that are in theright half-plane minus thenumber of counter-clockwiserevolutions, N, around -1 ofthe mapping GH
Z = P N
Only if Z=0, the system isstable
Remember this !
Zeros of 1 + G(s) H(s) Poles of G(s) / [1 + G(s) H(s) ]
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:38
Examples
Figure 10.25Mapping examples:
a. contour doesnot encloseclosed-loop poles;b. contour doesencloseclosed-loop poles
Z = P - N
Class Question:Are the closed-loop systems a,b stable or unstable?
Frequency ResponsePolar Plots
-
8/14/2019 Adv Control & Robotic Lec 5
20/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:39
Sketching the Nyquist Diagram (10.4)
Figure 10.26a. Turbine andgenerator;b. block diagramof speed controlsystem forExample 10.4
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:40
Vector Evaluation of the Nyquist Diagram
a. vectors on contourat low frequency;b. vectors on contouraround infinity;c. Nyquist diagram
Class Question:Is the closed-loop system stable?
-
8/14/2019 Adv Control & Robotic Lec 5
21/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:41
Example 10.7
22222
22
2
)6()1(16
)6()1(4)(
)2)(22()(
www
wjwwjwG
sss
KsG
+
=
+++=
Double-check
this calculation
yourself!
Class Questions (use only positive jw axis):
a) Find the range of gain for stability and instabilityb) For marginal stability find the radian frequency of oscillation
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:42
Example 10.7 - Solution
22222
22
2
)6()1(16
)6()1(4)(
)2)(22()(
www
wjwwjwG
sss
KsG
+
=
+++=
-
8/14/2019 Adv Control & Robotic Lec 5
22/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:43
Gain and Phase Margin via Nyquist (10.6)
Figure 10.35Nyquist diagramshowing gainand phasemargins
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:44
Phase and Gain Margin in Bode Plots
PhaseMargin
GainMargin
-
8/14/2019 Adv Control & Robotic Lec 5
23/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:45
Overview: State-Space Analysis and Design
State-Space Models: ABCD Form
Controllability by Inspection: Parallel Form
The Controllability Matrix
Similarity Transformations
The Transformation Matrix P via the Controllability Matrices
Observability by Inspection: Parallel Form
The Observability Matrix
The Transformation Matrix P via the Observability Matrices
*
*
*
*
*
*
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:46
Figure 5.31State-space forms for
)(
)6)(4(
3
)(
)(
tcy
ss
s
sR
sC
=
++
+=
Summary State Space Forms
Controllability /Observability
by inspection
-
8/14/2019 Adv Control & Robotic Lec 5
24/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:47
Phase-Variable Form
u
xx
x
x
aaaxx
x
x
n
n
nn
n
+
=
10
0
0
1000
0100
0010
1
2
1
110
1
2
1
A MatrixB Vector
+++
=
)()()(
1000
0100
0010
12110 nn kakaka
BKA
Major
advantage of
the phase-variable andcontrollercanonicalforms
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:48
Phase-Variable Form
Poles of uncontrolled system:
0011
1 =++++
asasas
n
n
n
n system parameters to adjust
Poles of controlled system:
0)()()( 10211
1 =+++++++
kaskaskas
n
nn
n
-
8/14/2019 Adv Control & Robotic Lec 5
25/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:49
P from controllability matrix CM
For the original system
For the transformed system
Hence, P = CMZ * CMX-1
In Matlab: P = ctrb(Az,Bz) * inv(ctrb(Ax,Bx))
][12BABAABBC
n
MZ
=
][
])()([
121
11121111
BABAABBP
BAPPBPAPPBAPPPBPC
n
n
MX
=
=
PP-1
termsdisappear
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:50
P-matrix that gives phase-variable form
If we have the original system
and the phase-variable form
P = ctrb(Az,Bz) * inv(ctrb(Ax,Bx)) will transform anycontrollable system z to the phase-variable form x!!!!
uBzAz zz +=
uBxAu
x
x
x
x
aaax
x
x
x
xx
n
n
nn
n
+=
+
=
1
0
0
0
1000
0100
0010
1
2
1
110
1
2
1
-
8/14/2019 Adv Control & Robotic Lec 5
26/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:51
Controller Design via State-Space (Ch. 12.1-4)
State-space formulation of the uncontrolled system:
State-space formulation of the controlled system:
CxyBuAxx =+=
CxyBrxBKAKxrBAxBuAxx =+=+=+= )()(
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:52
Example 12.1: State-Space Controller Design
Given the plant
)4)(1(
)5(20)(
++
+=
sss
ssG
design the phase-variablefeedback gains to yield9.5% overshoot and asettling time Ts of 0.74 sec.
= 0.60 0.94==
sn
Tw
Desired poles:
))(2(22
pswsws nn +++
Should not
interfere withdesign requirements!
-
8/14/2019 Adv Control & Robotic Lec 5
27/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:53
Example 12.1: Desired Poles
Bode plots
)2(
20)(
)2)(1.5(
)5(20)(
222
221
nn
nn
wwssG
wwss
ssG
++=
+++
+=
and
In general:Use extra poles to cancelout zeros. If no cancellations
required, place poles far away
from 2nd
order pole.
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:54
Example 12.1: Signal-Flow Diagram
)4)(1(
)5(20)(
++
+=
sss
ssG
]020100[
540
100
010
=
=
C
A
How?
-
8/14/2019 Adv Control & Robotic Lec 5
28/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:55
Example 12.1: Controller Gains
++
=
)5()4(
100
010
321kkk
BKA
Characteristic equation:
0)4()5(12
2
3
3=+++++ ksksks
Must match design requirements:
1.41308.1369.15))(2(2322
+++=+++ ssspswsws nn
Controller gains by inspection:
k1 = 413.1, k2 = 132.08, k3 = 10.9
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:56
Controller design by transformation: Ex 12.4
Convert the signal-flow diagram above to the form
Cxy
BAxx
=
+= u
-
8/14/2019 Adv Control & Robotic Lec 5
29/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:57
Ex 12.4: Check Controllability
==
111
310
100
][2BAABBC
M
Is this system state controllable? Check by inspection
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:58
Ex 12.4: Transform to Phase-Variables
10178
1
)5)(2)(1(
123
+++=
+++ ssssss
==
==
+
=
1710
015001
*
4781
810
100
][
1
0
0
81710
100
010
1
2
3
2
1
3
2
1
MXMZ
M
CCP
BAABBC
u
x
x
x
x
x
x
Phase-variableform
-
8/14/2019 Adv Control & Robotic Lec 5
30/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:59
Ex 12.4: Desired Response
20.8% overshoot and settling time Ts=4.0
= 0.447 24.24==
sn
Tw
Desired poles:
20136)4)(52(
))(2(
232
22
+++=+++=
+++
ssssss
pswsws nn
We use the extra poleto cancel the zero
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:60
State-Feedback Controller
+++
=
)8()17()10(
100
010
321kkk
BKA
20136)4)(52(
))(2(
232
22
+++=+++=
+++
ssssss
pswsws nn
Desired:
By inspection: k1=10, k2=-4, k3=-2
-
8/14/2019 Adv Control & Robotic Lec 5
31/31
METR4202/7202AdvancedControl&Robotics,
Semester2,
2006:Page:61
State-Feedback Controller: Original
Korig = K * P-1 = [ -20 10 -2]
DBAIC +==1)(
)(
)()( s
sU
sYsT
Verify design withdesired poles
AdvancedControl&Robotics,
Semester2,
2006:Page:62
Mid-Semester Class Test
Wednesday September 6 at 10:00am - 11:50am
Two Venues: Lecture Theatre (50-2)
GP-South Room 421 (20-25 seats)
Questions and Answers Session, September 5, 12-1pm
GP South: Room 421