ECE-520: Discrete-Time Control Systems Homework 1
Due: Tuesday December 9 at the beginning of class
1) From class we have the useful sum
1 0 1 1 N k N k N k a a S a + = = − = = −
∑
. Using this sum, and possibly a change of variables, show thata)
1 1
0 ( )
k N N
k N
N k
a a
b b a
b b + + = = − ⎛ ⎞ ⎜ ⎟ − ⎝ ⎠ =
∑
b) 1 1 M N k N k k M a a a a + = = − = −∑
2) Starting from
1 0 1 1 N k N k N k a a S a + = = − = = −
∑
, take derivatives of both sides to show that2 1 2 0 ( (1 ) 1) N N k N k k
Na N a
k a a a + + = = − + − + =
∑
3) For impulse response
2 1
( ) ( 1)
3 n
h n u n
−
⎛ ⎞
= ⎜ ⎟⎝ ⎠ − and input ( ) 1
2 ( 1 n
u n x n ⎛ ⎞⎜ ⎟
⎠ −
=
⎝ ), show that
the system output is
1 1
1
( 2
3 1
( ) 9 2 n n u n y n − − ⎡ ⎛ ⎞ ⎤ ) − − ⎢ ⎜ ⎟ ⎥ ⎝ ⎛ ⎞ = ⎜ ⎟ ⎝ ⎠ ⎠ ⎢ ⎥
⎣ ⎦ by
a) evaluating the convolution sum ( ) ( ) ( ) k
y n x n k h
∞
∞ =−
=
∑
− kb) evaluating the convolution sum ( ) ( ) ( ) k
y n h n k x
∞
∞ =−
=
∑
− k4 ) For impulse response
3 1 ( ) 2 n u n h n − ⎛ ⎞
= ⎜ ⎟⎝ ⎠ ( −1) and input
1 1
( ) ( 2)
4 n
x n u n
+
⎛ ⎞
=⎜ ⎟ −
⎝ ⎠ , show
that the system output is
1
1 1
( ) ( 3)
2 4
n n
y n u n
− ⎡⎛ ⎞ ⎛ ⎞ ⎤ =⎢⎜ ⎟ −⎜ ⎟ ⎥ − ⎝ ⎠ ⎝ ⎠ ⎢ ⎥ ⎣ ⎦ by
a) evaluating the convolution sum ( ) ( ) ( ) k
y n x n k h
∞
∞ =−
=
∑
− kb) evaluating the convolution sum ( ) ( ) ( ) k
y n h n k x
∞
∞ =−
5) For impulse response 1 1 ( ) ( 3 n u n h n − ⎛ ⎞
= ⎜ ⎟⎝ ⎠ −2) and input
2 1
( ) ( 1) ( 3) 2
n
x n n u n
−
⎛ ⎞
= − ⎜ ⎟ −
⎝ ⎠ ,
show that the system output is
4 4
1 1
( ) ( 5) ( 5)
3 2
n n
y n n u n
− −
⎡⎛ ⎞ ⎛ ⎞ ⎤
=⎢⎜ ⎟ +⎜ ⎟ − ⎥
⎝ ⎠ ⎝ ⎠
⎢ ⎥
⎣ ⎦ − by
a) evaluating the convolution sum ( ) ( ) ( ) k
y n x n k h
∞
∞ =−
=
∑
− kb) evaluating the convolution sum ( ) ( ) ( ) k
y n h n k x
∞
∞ =−
=
∑
− kHint: the results from problem 2 will be helpful
6)For impulse response
2 1
( ) ( 3)
3 n
h n u n
−
⎛ ⎞
= ⎜ ⎟⎝ ⎠ − and input ( ) 1 (2 ) 2
n
x n u
−
⎛ ⎞
n
=⎜ ⎟ −
⎝ ⎠ , show that
the system output is
5 2
1 8 1
( ) 2 (5 )
5 5 3 ( 6
n n
y n u n u n
−
− − ⎛ ⎞
⎜ ⎟
⎝ ⎠ − )
= + by
a) evaluating the convolution sum ( ) ( ) ( ) k
y n x n k h
∞
∞ =−
=
∑
− kb) evaluating the convolution sum ( ) ( ) ( ) k
y n h n k x
∞
∞ =−
=
∑
− kn
7) For impulse response h( )n =δ( )n +2δ(n− +2) 3 (δ −3) and input 1
( ) 1 ( 2) 2
n n
x n u
−
⎛ ⎞ −
⎜ ⎟ ⎝ ⎠
= , determine the outputy n( ) (this should be easy).
8) Show that ( ) ( ) l n
l
u n δ l
=
=−∞
=
∑
and ( ) ( )l n
l
u n k δ l k
=
=−∞
Preparation for Lab 1
9) Consider the following one degree of freedom system we will be utilizing this term:
a) Draw a freebody diagram of the forces on the mass.
c m
k1 k2
1
1
F(t)
x (t)1
b) Show that the equations of motion can be written:
1 1( ) 1 ( ) ( 1 2) ( )1 ( )
m x t +c x t + k +k x t =F t
or
1 1
2
1 2
( ) ( ) ( ) ( )
n n
x t ζ x t x t KF t
ω +ω + =
c) What are the damping ratio ζ , the natural frequencyωn, and the static gainK in terms of m1, k1, k2, and c1?
d) Show that the transfer function for the plant is given by
1
2 2
( ) ( )
1 2
( )
1 p
n n
X s K
G s
F s
s ζ s
ω ω
= =
+ +
10) One of the methods we will be using to identify ζ and ωnis the log-decrement
method, which we will review/derive in this problem. If our system is at rest and we provide the mass with an initial displacement away from equilibrium, the response due to this displacement can be written
1( ) cos( )
nt
1( )
x t = displacement of the mass as a function of time
ζ = damping ratio
n
ω = natural frequency
d
ω = damped frequency = ωn 1−ζ2
After the mass is released, the mass will oscillate back and forth with period given by 2
d d
T π
ω
= , so if we measure the period of the oscillation (Td) we can estimate ωd.
Let's assume is the time of one peak of the cosine. Since the cosine is periodic, subsequent peaks will occur at times given by
0
t
0
n d
t = +t nT , where is an integer. n
a) Show that
1 0
1
( ) ( )
n dT n
n x t
e x t
ζω
=
b) If we define the log decrement as
1 0
1
( ) ln
( )n
x t x t
δ = ⎢⎡ ⎤⎥
⎣ ⎦
show that we can compute the damping ratio as
2 2 2
4n
δ ζ
π δ
=
+
Figure 3. Initial condition response for second order system A.
0 0.5 1 1.5 2 2.5 3
-10 -5 0 5 10 15
Time (seconds)
D
isp
la
ce
m
e
n
t (
cm
)
Figure 4. Initial condition response for second order system B.
0 0.5 1 1.5 2 2.5 3
-6 -4 -2 0 2 4 6 8 10 12
Time (seconds)
D
isp
la
ce
m
e
n
t (
c
m
)
As you undoubtedly recall, if we have a stable system with transfer function H s( ), and the input to the system isu t( )= Acos(ω θt+ ), then the steady state output is given by
[image:5.612.150.455.384.626.2]This is really nothing more than a phasor relationship
[
| ( ) | ( ) |][
( ) | ( )]
Y = H jω ∠H jω U jω ∠U jω
j or
| | | ( ) || ( ) |
( ) ( )
Y H j U j
Y H j U
ω ω
ω ω
=
∠ = ∠ + ∠
11) Assume
( )
2 s H s
s =
+
a) If the input to this system is u t( )=3 cos(2 )t determine the steady state output. b) If the input to this system is u t( )=5sin(5t+10 )o determine the steady state output. (Ans. 2.12 cos(2t+45 ), 4.64 sin(5o t+31.8 )o )
12) In addition to determining |H j( ω) | and ∠H j( ω) analytically, we can read these values from a Bode plot of the transfer function. Of course the magnitude portion of a Bode plot is in dB, and we need the actual amplitude |H j( ω) |. For the system with Bode plot given in Figure 5, determine the steady state output of this system if the input is
( ) 5sin(3 20 )o
u t = t+ and u t( )=5sin(2t+20 )o .
Figure 5: Bode plot of an unknown system.
-40 -30 -20 -10 0 10
M
a
g
ni
tud
e (
d
B
)
10-2 10-1 100 101 102
-90 -45 0 45 90
P
has
e (
d
eg
)
Bode Diagram
13) Now we want to use the Bode plot to identify the system. Let's assume the input to an unknown system is a sequence of sinusoids, u t( )= Acos(ω θt+ ) at different frequencies and different amplitudes. Once the transients have died out and the system is in steady state we measure the outputy t( ). We then have the following data:
( ) 4 cos(2 * 0.25 ) ( ) 0.089 cos(2 * 0.25 0.3 ) ( ) 4 cos(2 * 0.5 ) ( ) 0.092 cos(2 * 0.5 0.6 ) ( ) 4 cos(2 * ) ( ) 0.104 cos(2 * 1.4 ) ( ) 3cos(2 * 2 ) ( ) 0.178cos(2 * 2 6.2 ) ( ) 3cos(2 * 2.25 ) ( ) 0.32
o
o
o
o
u t t y t t
u t t y t t
u t t y t t
u t t y t t
u t t y t
π π
π π
π π
π π
π
= =
= =
= = −
= = −
= = 1cos(2 * 2.25 12.7 )
( ) 2 cos(2 * 2.4 ) ( ) 0.429 cos(2 * 2.4 28.1 ) ( ) 1cos(2 * 2.5 ) ( ) 0.424 cos(2 * 2.5 75.5 ) ( ) 1cos(2 * 2.6 ) ( ) 0.258cos(2 * 2.6 142.2 ) ( ) 2 cos(2 * 2.75 ) ( ) 0.218cos(2 * 2.75
o
o
o
o
t
u t t y t t
u t t y t t
u t t y t t
u t t y t t
π
π π
π π
π π
π π
−
= =
= =
= =
= = 164.1 )
( ) 4 cos(2 *3 ) ( ) 0.207 cos(2 *3 171.9 ) ( ) 8cos(2 * 4 ) ( ) 0.115cos(2 * 4 176.9 ) ( ) 10 cos(2 *5 ) ( ) 0.075cos(2 *5 178.0 ) ( ) 10 cos(2 * 6 ) ( ) 0.047 cos(2 * 6 178.5 ) ( ) 10 cos(2 * 7 )
o
o
o
o
o
u t t y t t
u t t y t t
u t t y t t
u t t y t t
u t t y
π π
π π
π π
π π
π
−
= = −
= = −
= = −
= = −
= ( ) 0.033cos(2 * 7 178.8 )
( ) 10 cos(2 *8 ) ( ) 0.024 cos(2 *8 180 ) o
o
t t
u t t y t t
π
π π
= −
= = −
− −
− − −
a) From this data, construct a table with theith input frequency fi (in Hz), and the corresponding magnitude of the transfer function at that frequency , |Hi| |= H j( 2π fi) |. Note that the amplitude of the input is changing. We could also utilize the phase, but we don't need that for the systems we are trying to model.
b) Now we need to try and fit a transfer function to this data, i.e., determine a transfer function that will have the same Bode plot (at least the same magnitude portion). You will need to go though the following steps (you probably want to put this in an m-file...)
%
% I won't tell you how to do this again, so pay attention! %
% Enter the measured frequency response data %
w=2 *pi*[f1 f2 " fn] % frequencies in radians/sec
H =[|H1| |H2| " |Hn |] % corresponding amplitudes of the transfer function %
% space them out logarithmically %
ww = logspace(log10(min(w)),log10(max(w)),1000); %
% next guess the parameters for a second order system, you will have to change these % to fit the data
%
omega_n = 20; zeta = 0.1; K = 0.05
HH = tf(K,[1/omega_n^2 2*zeta/omega_n 1]; %
% get the frequency response, this is one of many possible ways %
[M,P] = bode(HH,ww); M = M(:);
%
% Now plot them both on the same graph and make it look pretty %
semilogx(w,20*log10(H),'d',ww,20*log10(M),'-'); grid; legend('Measured','Estimated'); ylabel('dB'); xlabel('Frequency (rad/sec)');
title(['K = ' num2str(K) ', \omega_n = ' num2str(omega_n) ', \zeta = ' num2str(\zeta)]); %
% Note there are spaces between the single quote (') and the num2str function
If you have not screwed up, you should get the following graph:
c) Now you need to adjust the parameters of the estimated transfer function to get the best fit. Turn in your final plot with the estimates of the parameters at the top (as in the figure above.)
100 101 102
-55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5
Frequency (rad/sec)
dB
K = 0.05, ωn = 20, ζ = 0.1