Solution 3.8.6.2
The rst step is to get the data into MATLAB. The followng commands do
that.
EDU>load tfid
EDU>size(tfid)
ans =
500 2
EDU>
the rst column is the time, and the second column is the step response.
Weusethe following commands to put the data in a form wecan plot the
step response versus time.
EDU>t = tfid(1:500,1);;
EDU>y = tfid(1:500,2);;
EDU>plot(t,y)
EDU>print -deps sr3862a.eps
EDU>
The time response is shown in Figure`1 As can be seen the time response,
whichwas taken o the oscilloscope shows negativetimebeforethe step is
applied and also the system does not start exactly at zero. The downward
trend just before t =0iswherethe switchwas thrown in the analog circuit
to initiate the step. So wehave some choices to make. We need to clean the
data up a bit to apply the identication technique described in this chapter.
First of all, we add 0.24 seconds to the t vector so that t(46) becomes t(40).
Then wesety(40) equal to zero and t(40) equal to zero. Then wetruncate
the t and y vectors to the entries in locations 40 through vehundred. The
commands are:
t=t+0.8999;;
t(42) = 0;;
y(42) = 0;;
t=t(42:500);;
y=y(42:500);;
plot(t,y);;
print -deps sr3862b.eps;;
1
-5 0 5 10 15 20 25 30 35 40 45
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 1: Rawstep response data
The adjusted response is shown in Figure 2. The rationale for the adjust-
ments are as follows. The response was generated bycreating a second order
comepensator on the Feedback and Control box(FAC). The system response
at steady state is almost exactly one in reponse to a 1 V input. Thus, all we
wanttodoisget zero to be the pointatwhich the switchonthe FACwas
thrown to initiate the step and the response goes down close to zero. This
turns out to be approximately t = ;0:24 s. Wearenowinaposition to
apply the identication techniques discussed in Chapter 3. As a rst step,
wecreate the function 1;y(t)asshown bytheMATLAB dialogue:
EDU>size(t)
ans =
459 1
EDU>z(1:461)=1.005;;
EDU>z=z';;
EDU>y1=1-y;;
2
0 5 10 15 20 25 30 35 40 45 50
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 2: Adjusted step response
EDU>w = log(y1);;
plot(t,w);;
The result is shown in Figure 3. The slope is roughly
;
2:25
15
= ;0:15
So there is probably a pole around s = ;0:15. Figure 4 shown the adjusted
step response obtained experimentally compated to the function
y
1
(t)=1;e
;0:15t
:
Figure 5 compares the adjusted response to
y
2
(t)=1;e
;0:18t
As can be seen the t is excellent. The other pole must haveatime constant
much smaller than 5.56s, and hence a very good estimate of the plantis
G(s)=
0:18
s +0:18
:
3
0 5 10 15 20 25 30 35 40 45 50
-7
-6
-5
-4
-3
-2
-1
0
1
Figure 3: Plot of ln(1;y(t)
Indeed the actual transfer function implemented was
G(s)=
1
(s +0:2)(s+5)
:
When the ratio of the second pole to the rst pole is this large, wecannot
see anyeect from the second pole.
4
0 5 10 15 20 25 30 35 40 45 50
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 4: Comparison of adjusted response and y
1
(t)=1;e
;0:15t
5
0 5 10 15 20 25 30 35 40 45 50
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 5: Comparison of adjusted response and y
1
(t)=1;e
;0:18t
6