Professional Documents
Culture Documents
TE 303 Lecture 02
TE 303 Lecture 02
n n 1
d d d
n
y an1 n1 y a1 y a0 y
dt dt dt
dm d
bm m u b1 u b0u
dt dt
System models
• Time domain models
– State space model: state equation + output equation
– State equation: a set of 1st order diff eq on state
variables
– Output equation: output as function of state and input
x f ( x, u )
y g ( x, u )
– Linear systems:
x Ax Bu
y Cx Du
ODE model to State space model
dn d n1 d
n
y an1 n1 y a1 y a0 y u
dt dt dt
Let x1 y, x2 y, x3 y, ...
Then x1 x2 , x2 x3 , x3 x4 , ...
x1 0 1 0 0 x1 0
x 0 0 1
0 x2 0
d 2
u
dt
xn a0 a1 a2 an 1 xn 1
y [ 1 0 0 ... 0]x [ 0]u
ODE model to State space model
m<n
dn d n1 d
When : n y an1 n1 y a1 y a0 y
dt dt dt
dm d
bm m u b1 u b0u
dt dt
dm d
Let y bm m z b1 z b0 z
dt dt
dn d n1 d
Then : n
z an1 n1 z a1 z a0 z u
dt dt dt
ODE model to State space model
Let x1 z, x2 z, x3 z , ...
We still have the same state equation:
x1 0 1 0 0 x1 0
x 0 0 1 0 x 0
d 2 2 u
dt
xn a0 a1 a2 an 1 xn 1
But the output equation will be:
dm d
y bm m z b1 z b0 z
dt dt
bm xm1 b1 x2 b0 x1
[ b0 b1 ... bm 0 ... 0]x [ 0]u
Transfer Function
Transfer function from x to y is the gain from
X(s) to Y(s), that is, it is the ratio of
Laplace transform of y to Laplace transform of x :
Y ( s ) L y (t )
G ( s ), or H ( s ),
X ( s ) L x(t )
Then : Y ( s ) H ( s ) X ( s )
State space model to TF
x Ax Bu
State space model :
y Cx Du
sX ( s ) AX ( s ) BU ( s)
take L :
Y ( s ) CX ( s ) DU ( s )
( SI A) X ( s ) BU ( s )
X ( s ) ( SI A) 1 BU ( s)
1
Y ( s) [C ( SI A) B D]U ( s )
H (s)
A, B, C, D are matrices
Input Output System
Input Output
x(t) H(s) y(t)
– Y(s) = H(s)X(s)
– If the input x(t) = δ(t), the output is called the impulse
response.
– If the input x(t) = u(t), the output is called the step
response.
– If the input x(t) = Asin(wt), and H(s) is stable, output
steady state is A|H(jw)|sin(wt+H(jw))
– Poles: values of s at which TF infinity
– Zeros: values of s at which TF = 0
Example: controller
E(s) controller U(s)
C(s)
+
+ + CONTROLLED
CONTROLLER DEVICE
-
FEEDBACK
ELEMENT
Block Diagrams
• A line is a signal x G y
y = Gx
• A block is a gain x + s
Σ
+
• A circle is a sum -
s=x+z-y
y z
• Due to h.f. noise,
use proper blocks: num deg ≤ den deg
• Try to use just horizontal or vertical lines
– Use additional “ Σ ” to help
x + s
e.g.
+
+
z
-
y
Block Diagram Algebra
• Series:
x y x y
G1 G2 G1 G2
• Parallel:
G1
+
x y x y
G1 + G2
+
G2
• Feedback:
x + e
G1 y x G1 y
- 1 G1G2
b
G2
G1
y x
1 G1G2
G1
• Proof: e x b, b G2 y, y G1e y x
1 G1G2
e x G2G1e
1
(1 G1G2 )e x e x
1 G1G2
+
G1
+
G2
G1
1 G1G2
+ n1
-
d1 n1d 2
n2 n1n2 d1d 2
d2
>> s=tf('s')
>> G=G1*G2
Transfer function:
Transfer function:
s
5s+5
--------------
>> G1=(s+1)/(s+2)
s^2 + 7 s + 10
Transfer function:
s+1
>> H=G1+G2
-----
Transfer function:
s+2
s^2 + 11 s + 15
---------------
>> G2=5/(s+5)
s^2 + 7 s + 10
Transfer function:
5
>> HF=feedback(G1, G2)
-----
Transfer function:
s+5
s^2 + 6 s + 5
---------------
s^2 + 12 s + 15
>> delay1=tf(1,1,'inputdelay',0.05)
Transfer function: Step Response
exp(-0.05*s) * 1 0.9
0.8
s^2 + 6 s + 5 0.5
Amplitude
exp(-0.05*s) * --------------- 0.4
s^2 + 12 s + 15 0.3
0.2
Transfer function: 0
0 0.5 1 1.5 2 2.5
exp(-0.05*s) * -------------------
s^3 + 12 s^2 + 15 s
>> step(H2)
Quarter car suspension
Series
R(s) + 1 1
bs k 1
s s
y
- m
R(s) + bs k y
Feedback
- ms 2
R(s) bs k y
ms 2 bs k bs k
TF H ( s )
ms bs k
2
>> b=sym('b');
>> m=sym('m'); >> Gcl=G/(1+G)
>> k=sym('k');
>> s=sym('s'); Gcl =
>> G1=b*s+k
G1 = (b*s+k)/m/s^2/(1+(b*s+k)/m/s^2)
b*s+k
x y x G1 G2 y
G1 G2
z G3 no change G1
along arrow
along arrow
z G3
against, against
x G1 G2 x G1 G2
y y
against
along
z G3 z G3 1/G2
x G1 G2 x G1 G3 1/G3 G2
y y
z G3 z
I2
1 I1 - 1 Vc
U + 1 y
R2
-
L1s R1 + Cs L2 s R2
I2 L1s R1
- 1 1 Vc
U + 1 y
R2
-
+ L1s R1 Cs L2 s R2
L1s R1
- 1
U + 1 y
R2
+ - Cs( L1s R1 ) L2 s R2
L1s R1
U + - 1 1 y
R2
Cs( L1s R1 ) 1 L2 s R2
L1s R1
U + - 1 y
R2
Cs( L1s R1 )( L2 s R2 ) L2 s R2
U 1 y
R2
Cs( L1s R1 )( L2 s R2 ) L2 s R2 L1s R1
R2
T .F .
Cs( L1s R1 )( L2 s R2 ) L2 s R2 L1s R1
Find TF from U to Y:
2
s5
s 1 +
U + + 10 Y
100
s2 s ( s 20) +
- -
• No pure series/parallel/feedback
• Needs to move a block, but which one?
Key: move one block to create pure series or
parallel or feedback!
10
So move either left or right.
s ( s 20)
s ( s 20) 2
10 s5
s 1 +
U+ + 10 Y
100
s2 s ( s 20) +
- -
+
U+ + 10( s 1) s( s 20)
100 1 Y
- -
s( s 2)( s 20) 5( s 5) +
+
U+ 10( s 1) s( s 20)
100 1 Y
s( s 2)( s 20) 10( s 1) 5( s 5) +
-
Can use superposition:
First set D=0, find Y due to R
Then set R=0, find Y due to D
Finally, add the two component to get the overall Y
First set D=0, find Y due to R
G1G2
Y1 ( s ) R( s)
1 G1G2 H1
Then set R=0, find Y due to D
G2
Y2 ( s ) D( s )
1 G1G2 H1
G2
Finally, add the two components to get the overall Y
G1G2 G2
Y ( s) R( s) D( s )
1 G1G2 H1 1 G1G2 H1