Professional Documents
Culture Documents
ME 534 - 02 Modeling II (Rev. 1.3)
ME 534 - 02 Modeling II (Rev. 1.3)
– Examples
• Approximation Techniques Control
Control2
Computer
– Forward Difference Computer 2
– Backward Difference
• In practice, several analog controllers and a number of micro-
– Trapezoidal Rule
controllers / control computers (which are synchronized by the same
• First-Order Hold (FOH) clock) may be utilized as a part of a complex control scheme.
• Modeling Tools in Matlab • From the stand-point of control engineering, it is highly desirable to
develop equivalent (discrete-time) transfer functions representing
– Example the essential features of such control systems.
[ ]
Yn(s)
* * *
Y(s) Y*(s) Y*(s) Y ( s) = Y ( s) T
Y ( z ) =ˆ Gn ( z )...G2 (z ) G1 ( z ) X ( z )
Notice that Y * ( s) ≠ G * ( s) X * ( s)
Property 7: (sampled impulse response of a cascaded system)
Property 5: (sampled impulse response)
X(s) Y*(s)
Y ( s ) = G( s ) X * ( s ) G 1(s) G 2(s) G n(s)
X(s) X*(s) Y(s) Y*(s) G 1(s) G 2(s) G n(s) T
G(s) Y * ( s) = [G( s) X * ( s)]* T
G(s)
T T
Y * ( s) = [G( s)]* X * ( s) = G * ( s) X * ( s) Y * ( s) = [Gn ( s) ... G2 ( s)G1 ( s) X * ( s)]*
X ( z ) =ˆ Z { X * ( s)} G( z ) =ˆ Z {G * ( s)} Y * ( s) = [Gn ( s) ... G2 ( s)G1 ( s)]* X * ( s)
∴Y ( z ) = G ( z ) X ( z ) Y ( z ) =ˆ Z {Gn ( s) ... G2 ( s)G1 ( s)} X ( z )
Chapter 2b ME 534 6 Chapter 2b ME 534 7
• Consider the block diagram of the illustrated Similarly, the Property 7 yields
system. Obtain the following transfer functions: B * ( s) = [ H ( s)G p ( s)Gzoh ( s) M * ( s)]*
a) B(z)/R(z) B * ( s) = [ H ( s)G p ( s)Gzoh ( s)]* M * ( s) ⇒ B( z ) = G( z ) M ( z ) (3)
b) Y(z)/R(z)
where G( z ) =ˆ Z { H ( s)G p ( s)Gzoh ( s)}
Chapter 2b Next Slide ME 534 8 Chapter 2b Diagram ME 534 9
Solution – Part (a) (Cont’d) Solution – Part (b)
Combining Eqns. (1), (2), and (3) gives
R(s) + E*(s) M*(s) Y*(s)
G c(s) G zoh(s) G p(s)
[1 + G( z )Gc ( z )]B( z ) = G( z )Gc ( z )R( z ) T _ G c(s) T Gzoh(s) G p(s) T
Fictitious
Sampler
Thus,
B*(s)
B( z ) G( z )Gc ( z ) H(s)
H(s)
= T
R( z ) 1 + G( z )Gc ( z )
where To obtain the desired transfer function Y(z)/R(z), a fictitious
sampler must be added to the system.
Gc ( z ) =ˆ Z {Gc ( s)}
G( z ) =ˆ Z { H ( s)G p ( s)Gzoh ( s)}
Y * ( s) = [G p ( s)Gzoh ( s) M * ( s)]* B( z ) G ( z )
= =ˆ G2 ( z ) (8)
* *
Y ( s) = [G p ( s)Gzoh ( s)] M ( s) ⇒ *
Y ( z ) = G1 ( z ) M ( z ) (6) Y ( z ) G1 ( z )
where G1 ( z ) =ˆ Z {G p ( s)Gzoh ( s)}
Chapter 2b Diagram ME 534 12 Chapter 2b ME 534 13
Solution – Part (b) (Cont’d) Example 2
X*(s) V(s)
Combining Eqns. (4), (5), (6), and (8) gives G3(s) G4(s)
G3(s) T G4(s)
Y ( z ) = G1 ( z )Gc ( z )[ R( z ) − G2 ( z )Y ( z )] _
+ E*(s) U(s) Y*(s)
R(s) G1(s) G2(s)
Thus, Y ( z )[1 + G1 ( z )G2 ( z )Gc ( z )] = G1 ( z )Gc ( z )R( z ) T _ G1(s) G2(s) + T
14243
G( z )
Y (z) G1 ( z )Gc ( z )
= B*(s)
H(s)
R( z ) 1 + G( z )Gc ( z ) T H(s)
where Gc ( z ) =ˆ Z {Gc ( s)} • Obtain the transfer function Y(z)/R(z) for the
G1 ( z ) =ˆ Z {G p ( s)Gzoh ( s)} system shown.
G( z ) =ˆ Z { H ( s)G p ( s)Gzoh ( s)}
Chapter 2b ME 534 14 Chapter 2b Next Slide ME 534 15
Y * ( s) = [U ( s) − V ( s)]* = U * ( s) − V * ( s) Hence,
* * * * *
Y ( s) = [G1 ( s)G2 ( s)E ( s)] − [G4 ( s) X ( s)] Y ( z )[1 + G12 ( z )H ( z )] = [G12 ( z ) − G3 ( z )G4 ( z )]R( z )
14442444 3 144244 3
U * (s) V * (s)
where G12 ( z ) =ˆ Z {G1 ( s)G2 ( s)} where G12 ( z ) =ˆ Z {G1 ( s)G2 ( s)}
Chapter 2b Diagram ME 534 16 Chapter 2b ME 534 17
Discretization Methods Discretization Methods (Cont’d)
• The design of control system consists of two • In control literature, there exist various approximation
main steps: techniques to convert such equations conveniently into
– The mathematical model of the plant is obtained to discrete-time forms without utilizing z-transforms.
analyze its behaviour. • The methods discussed here approximate the time
– Using the model, an appropriate controller is derivative (d/dt) in ODE using a corresponding
designed to get the desired response from the difference equation:
controlled system.
1. Forward difference (Euler’s rule)
• In continuous-time domain, the dynamics of the 2. Backward difference
plant are represented by a set of differential 3. Trapezoidal (integration) rule
equations. • Also known as Tustin or bilinear transformation
G ′( z ) ≅ G( s = z −1
T
) G ′( z ) ≅ G( s = z −1
Tz
)
Chapter 2b ME 534 20 Chapter 2b ME 534 21
3) Trapezoidal (Tustin) Rule Alternative Derivation for Tustin
Let u(t) = dx/dt. The trapezoidal integration rule leads to
(Bilinear) Transformation
e sT / 2 xx x2
x (( k + 1)T ) = x ( kT ) + [u(( k + 1)T ) + u( kT )]
T
2 Since z =ˆ e sT
= −sT / 2 Recall that e =1+ + + ...
u(t) e 1! 2!
x (( k + 1)T ) − x ( kT ) = [u(( k + 1)T ) + u( kT )]
T
2 2
1 ⎛ sT ⎞ 1 ⎛ sT ⎞
u(kT) u((k+1)T) In terms of q: 1+ ⎜ ⎟+ ⎜ ⎟ + ...
1! ⎝ 2 ⎠ 2! ⎝ 2 ⎠
Then z≅
(q − 1)x ( k ) = T2 (q + 1)u( k ) 1 ⎛ − sT ⎞ 1 ⎛ − sT ⎞
2
1+ ⎜ ⎟+ ⎜ ⎟ + ...
dx 2 q − 1 d 2 q −1 1! ⎝ 2 ⎠ 2! ⎝ 2 ⎠
t u( k ) = ≅ ⋅ ⋅ x(k) ⇒ ≅ ⋅
kT (k+1)T
dt T q + 1 dt T q + 1
If T is small, the higher order terms of the Taylor Series can be neglected:
As d/dt corresponds to s variable while q 2 z −1 sT
s≅ ⋅ 1+
operator is equivalent to z variable, we have T z +1 2 2 z −1
z≅
sT
Solving for s leads to s≅ ⋅
Therefore, G ′( z ) ≅ G( s = 2
T
⋅ zz +−11 ) 1− T z +1
2
Chapter 2b ME 534 22 Chapter 2b ME 534 23
a) Forward Difference:
4
T2
( zz +−11 )2 + T6 ( zz +−11 ) + 2 z 2 − 1.9700 z + 0.9704
1 1
G ′( z ) ≅ = 10000
( )
z −1 2
T + 3( zT−1 ) + 2
2
z − 1.9700 z + 0.9702 Be careful when rounding numbers in these transfer
functions. Since we are dealing with relatively small
b) Backward Difference:
numbers, make sure to perform all calculations to the
1 z21
highest precision and then display at least 4 digits after
G ′( z ) ≅ = 10302
( )
z −1 2
Tz + 3( zTz−1 ) + 2
2
z − 1.9705z + 0.9707 decimal point!
Solution (Cont’d)
Solution (Cont’d)
d) ZOH: Hence,
⎛ 1 ⎞1 − e
− sT
⎛ 1 1 ⎞ 1 − e − sT B1 z −1 + B2 z −2
G( s ) = ⎜ 2 ⎟ =⎜ − ⎟ G ′( z ) =
⎝ s + 3s + 2 ⎠ s ⎝ s +1 s + 2 ⎠ s 1 − z −1 ( e −T + e −2T ) + z −2 e −3T
where
⎧⎛ 1 1 ⎞1 − e − sT
⎫ ⎧⎛ 1 1 ⎞1⎫ B1 =ˆ (1 − e −T ) − 12 (1 − e −2T )
G ′( z ) = Z ⎨⎜ − ⎟
−1
⎬ = (1 − z )Z ⎨⎜ − ⎟ ⎬
⎩⎝ s + 1 s + 2 ⎠ s ⎭ ⎩⎝ s + 1 s + 2 ⎠ s ⎭ B2 =ˆ 12 e −T (1 − e −2T ) − e −2T (1 − e −T )
From Z-transform tables:
In terms of numerical values, we have
−1 −T −1 −2T
z (1 − e ) z (1 − e ) 1
G ′( z ) = − 2
(4.9503 × 10 −5 )z + 4.9010 × 10 −5
−1 −T
1−z e 1 − z −1e −2T G ′( z ) =
z 2 − 1.9702z + 0.9704
Amplitude
0.1
Name of T.F. Final time
Matlab’s Output: 0.08
0.06
Transfer function:
0.04
4.95e-005 z + 4.901e-005 Other Matlab functions that might
0.02
------------------------ interest you at this point:
z^2 - 1.97 z + 0.9704 poly, roots, residue. 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Example Solution
%
M(z) M(s) U(s) 1 Ω(s) 1 Θ(s) % Sample Matlab code >> G
ZOH 10 %
ZOH 10 s + 12 s G1 = tf(10,[1 12]); Transfer function:
Ideal Torque
G2 = tf(1,[1 0]); 10
Modulator
H = tf(1,[1 5]); -------------------
G = G1*G2*H; s^3 + 17 s^2 + 60 s
B(z) T B(s) 1 Gd = c2d(G,0.01,'zoh')
s+5
Output:
Position
Sensor
Transfer function:
1.598e-006 z^2 + 6.126e-006 z + 1.468e-006
• If T = 0.01 s, obtain the transfer function ------------------------------------------
z^3 - 2.838 z^2 + 2.682 z - 0.8437
B(z)/M(z) for the given system using MATLAB.
Sampling time: 0.01