Date post: | 19-Jan-2018 |
Category: |
Documents |
Upload: | vivien-wilson |
View: | 245 times |
Download: | 1 times |
Chapter 11 Digital Control Systems
Topics to be covered: - Discrete-time systems - z-Transforms - State Equation models of discrete systems
(continuous differential equations)(discrete difference equations)
ECE 4923/6923 Chapter 11 Part 2 2
Digital Control Systems
Simulation Diagrams and Flow Graphs: (How to make an electrical simulation of a system.)
For a discrete-time simulation, the main operation is the delay operator. (Recall that for a continuous-time system, we work with integrators. A delay operator is simpler, and, as a result, cheaper.)
We can also represent the delay as a z-1 operator.
ECE 4923/6923 Chapter 11 Part 2 3
Digital Control Systems
Example:Draw a simulation diagram for the difference equation: m(k) = e(k) – e(k-1) – m(k-1)
Components required:2 delay elements and 1 summer(This is a special purpose computer, which can only solve the given
equation.) Alternate representation (in SFG form):
Note that the z-1 and the -1 paths can be combined in a “self-loop”
ECE 4923/6923 Chapter 11 Part 2 4
Digital Control Systems
• Consider a general nth order difference equation of the following form:
• By using the real translation theorem, we get:
• This leads to the transfer function:
• The following two pages show a simulation diagram and a flow graph for this system.
m k a m k a m k n b e k b e k b e k nn n n( ) ( ) ( ) ( ) ( ) ( ) 1 0 1 01 1
M z a z M z a z M z b E z b z E z b z E znn
n nn( ) ( ) ( ) ( ) ( ) ( )
1
10 1
10
G z M zE z
b b z b za z a z
n nn
nn( ) ( )
( )
11
0
11
01
ECE 4923/6923 Chapter 11 Part 2 5
Digital Control Systems
• For a general nth order difference equation, we can draw the following simulation diagram:
ECE 4923/6923 Chapter 11 Part 2 6
Digital Control Systems
• As we have seen before, the SFG form is generally much more compact and is easier to draw...
ECE 4923/6923 Chapter 11 Part 2 7
Digital Control Systems
• State Variables - Consider the following TF and the corresponding simulation diagram and SFG:Y zU z
a a z a zb z b z
n nn
nn
( )( )
11
0
11
01
a z a z a zz b z b zn
nn
n
nn
n1
10
0
11
00
ECE 4923/6923 Chapter 11 Part 2 8
Digital Control Systems
Alternativerepresentations:
ECE 4923/6923 Chapter 11 Part 2 9
Digital Control Systems• State Variables – Let the outputs of each delay be a state, and we
can write state variable equations as:
and
(Phase Variable form of the State Equations)
x k x kx k x kx k x k
x k b x k b x k b x k u kn n n n n
1 2
2 3
3 4
1 2 1 0 1
111
1
( ) ( )( ) ( )( ) ( )
( ) ( ) ( ) ( ) ( )
y k a x k a x k a x k a b x k b x k b x k u kn n n n n n n( ) ( ) ( ) ( ) ( ( ) ( ) ( ) ( )) 0 1 1 2 1 1 2 1 0 1
x1xn-1xn
ECE 4923/6923 Chapter 11 Part 2 10
Digital Control Systems
• Note that these state equations can be more compactly written as:
(Note that these give a linear, time-invariant discrete system description.)A somewhat more general form is the linear time-varying form of the state equations:
x k A x k B u ky k C x k D u k
( ) ( ) ( )( ) ( ) ( )
1
x k A k x k B k u ky k C k x k D k u k
( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )
1
ECE 4923/6923 Chapter 11 Part 2 11
Digital Control Systems
Example: Write State Equations for a system with the TF
(Technique: generate a SFG, label outputs of delays as states, and then write equations.)
(see board for details…)
Y zU z
a a z a zb z b z
( )( )
2 1
10
2
11
021
ECE 4923/6923 Chapter 11 Part 2 12
Digital Control Systems
• Solution of State Equations:– Plug in each value of k:x(1) = A x(0) + B u(0)x(2) = A x(1) + B u(1) = A2 x(0) + AB u(0) + B u(1)x(3) = A3 x(0) + A2B u(0) + AB u(1) + B u(2). . . x(n) = An x(0) + An-1B u(0) + An-2B u(1) + . . .
+ AB u(n-2) + B u(n-1)So,
x n A x A B u kn n k
k
n
( ) ( ) ( )
0 1
0
1
ECE 4923/6923 Chapter 11 Part 2 13
Digital Control Systems
• Solution of State Equations:– By z-Transforms:x(n+1) = A x(n) + B u(n)
The term multiplying the initial condition is the z-transform of the state transition matrix and
z X z x A X z BU zzI A X z z x BU z
X z z zI A x zI A BU z
( ) ( ) ( ) ( )( ) ( ) ( )
( ) ( ) ( )
00
01 1
( )k z Z I A A k Z 1 1
ECE 4923/6923 Chapter 11 Part 2 14
Digital Control Systems
Example: Draw a simulation diagram:
And assign states (from right to left):
G z Y z
U zz
z zz
z zzz z
( ) ( )( )
2
1
1 23 2 1 2 1 3 2
Y zU z
zz z
X zX z
Y z z X zU z X z z X z z X z
X z U z z X z z X z
( )( )
( )( )
( ) ( )( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
1
1 2
1
1 2
1 2
1 3 2
3 23 2
ECE 4923/6923 Chapter 11 Part 2 15
Digital Control Systems
• Example, continuedWith states assigned, we can then write out the
specific state equations:
In matrix form, theyend up as:
x k x kx k u k x k x k
y k x k
1 2
2 1 2
2
11 2 3
( ) ( )( ) ( ) ( ) ( )
( ) ( )
x k x k u k
y k x k
10 12 3
01
0 1
ECE 4923/6923 Chapter 11 Part 2 16
Digital Control Systems
• Example, continuedTo solve, we can use
the sequential technique:(assume that x(0)=0 and u(k)=1, for all k.
x k x k u k
y k x k
10 12 3
01
0 1
x and y( ) ,10 12 3
00
01
101
1 0 101
1
x and y( ) ,20 12 3
01
01
114
2 0 114
4
x and y( ) ,30 12 3
14
01
14
113 0 1
411
11
ECE 4923/6923 Chapter 11 Part 2 17
Digital Control Systems
• Example, continued. . .or, by z-transforms:
Recall that:
So, with x(0)=0, we get
and
Since we get
and
x k x k u k
y k x k
10 12 3
01
0 1
zI Az
zzI A z z
12 3
3 22,
X z z zI A x zI A BU z( ) ( ) ( ) 1 10
X z zI A BU zz z
zz
U zz z z
U z( ) ( ) ( ) ( )
12 2
13 2
3 12
01
13 2
1
U z u nT zz
( ) ( ) ,
Z1
Y z C X zz z
zzzz
zz z z
zz z
p fe zz
zz
zz
( ) ( )
( )
0 1 13 2
1
11 3 2
1 2 12
12
2
2 2
2
2
2
2 2
y k k u kk( ) ( ) ( ) 2 2 2
ECE 4923/6923 Chapter 11 Part 2 18
Digital Control Systems
• Transfer Functions (TF’s) and State Variables For the SISO case, we have
So, with zero IC’s (since we are looking at TF’s):and
So, we end up with
x k A x k Bu ky k C x k D u k
( ) ( ) ( )( ) ( ) ( )
1
z X z A X z BU zzI A X z BU z
X z zI A BU z
( ) ( ) ( )( ) ( )
( ) ( )
1
Y z C X z DU zC zI A BU z DU z
C zI A B D U z
( ) ( ) ( )( ) ( )
( )
1
1
Y zU z
G z C zI A B D( )( )
( ) 1
ECE 4923/6923 Chapter 11 Part 2 19
Digital Control Systems
Example:
Using a previous example setup,
we get
Since D = 0, the transfer function is:
Y zU z
G z C zI A B D( )( )
( ) 1
x k x k u k
y k x k
10 12 3
01
0 1
zI Az
z
zz
z z
1
1
2
12 3
3 123 2
G z Y zU z
C zI A B
zz
z zz
z z( ) ( )
( )
1
2 20 1
3 12
01
3 2 3 2
ECE 4923/6923 Chapter 11 Part 2 20
Digital Control Systems
Note: If you don’t really like computing matrix inverses, you can alternatively use the following:
This method allows us to compute the TF without the need to determine a matrix inverse.
For our previous example,
G z Y zU z
zI A bc zI AzI A
d( ) ( )( )
d e t d e td e t
d e t de t
d e t de t de t
( )
zI Az
zz z
zI A bcz
zz
zz z
G zz z z z
z zz
z z
12 3
3 2
12 3
0 00 1
12 2
2 2
2 2 3 2
3 2 3 2
2
2
2 2
2 2
ECE 4923/6923 Chapter 11 Part 2 21
Digital Control SystemsFinally, we can use MATLAB to automate much of the work:
Example:
num=[0 1 0.95];den=[1 -1.9 0.93];printsys(num,den,’z’)[A,B,C,D]=tf2ss(num,den)
Results:
Then, we can use:dstep(A,B,C,D) (MATLAB chooses # of points)dimpulse(A,B,C,D)
dstep(A,B,C,D,IU,50) (we specify 50 points)dimpulse(A,B,C,D,IU,50) (IU is # of input, only one in this case)
G z zz z
( ) .. .
0 95
1 9 0 9 32
A B C D
1 9 0 9 31 0
10
1 0 9 5 0. .
, , . , [ ]
ECE 4923/6923 Chapter 11 Part 2 22
Digital Control Systems
More MATLAB:Still using:
But note that if we specify:
which is different from before, we find that:[num,den]=ss2tf(A,B,C,D)gives
num=[0 1 0.95]den = [1 -1.9 0.93]
which is the SAME TF as before! What gives????
Answer: These are two different forms of the state equations, but are equivalent. Note that there are an infinite number of valid state equations for any given system.
G z zz z
( ) .. .
0 9 5
1 9 0 932
A B C D
0 10 9 3 1 9
01
0 9 5 1 0. .
, , . , [ ]