controller using a Motorola 6800[28]. This is an 8 bit machine. 2's complement arithmetic was performed using 16 bit integers. 12 bits were selected from the ...
STUDY OF ESTIMATION AND OPTIMIZATION TECHNIQUES
S U I T A B L E FOR MICROPROCESSOR ADAPTIVE CONTROLLERS
by
PETER SPASOV B.A.Sc.
(E.E.),
U n i v e r s i t y of Toronto,
1977
A T H E S I S SUBMITTED I N P A R T I A L FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF A P P L I E D
SCIENCE
in THE FACULTY OF GRADUATE STUDIES (Department
We a c c e p t
of E l e c t r i c a l
this thesis required
Engineering)
as c o n f o r m i n g t o standard
THE U N I V E R S I T Y OF B R I T I S H COLUMBIA May,
©
Peter
1979
Spasov,
1979
the
5E-6
In p r e s e n t i n g
t h i s t h e s i s i n p a r t i a l f u l f i l m e n t o f the r e q u i r e m e n t s f o r
an advanced d e g r e e a t the U n i v e r s i t y o f B r i t i s h C o l u m b i a , I a g r e e t h a t the L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e and I f u r t h e r agree that permission f o r s c h o l a r l y p u r p o s e s may by h i s r e p r e s e n t a t i v e s .
for extensive
study.
copying of t h i s thesis
be g r a n t e d by the Head o f my Department o r It i s understood that copying or p u b l i c a t i o n
o f t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l not be a l l o w e d w i t h o u t my written
permission.
Department o f
Electrical
Engineering
The U n i v e r s i t y o f B r i t i s h Columbia 2075 Wesbrook P l a c e V a n c o u v e r , Canada V6T 1W5 Date May 17.
B P 75-51
1 E
1979
ABSTRACT
Adaptive controllers
are
controllers
unknown o r c h a n g i n g e n v i r o m e n t s . conventional controllers the
plant
that
that perform o p t i m a l l y i n
One c l a s s
of adaptive
tune themselves.
s y s t e m p a r a m e t e r s and o p t i m i z i n g t h e
estimates.
It
is desired
to have a l g o r i t h m s
This Is
controllers done b y
a microprocessor
is
that
are
short
PID c o n t r o l o f a second o r d e r
tions.
system.
i n both
with
cubic splines
The o t h e r
to
technique,
find
of the
In general, more t h a n
plant
are
estimated
the
coefficients
o f the
input
and f i n d s
is
response equation.
the phase tangents by
w i t h Walsh F u n c t i o n s .
each o f these a l g o r i t h m s
data
b y two
Identification,
is
estimated
to
1000 l i n e s o f c o d e w i t h e x e c u t i o n t i m e s o f l e s s
once the measured
a
itera-
characteristic
c a l l e d Walsh F u n c t i o n Parameter
output
i n a few
involves curve f i t t i n g of a step
(WFPI) u s e s a s q u a r e wave t e s t correlation
to o p t i m i z e b o t h
These a l g o r i t h m s n o r m a l l y converge
One t e c h n i q u e
device
s y s t e m and l e a d - l a g compensation o f
The p a r a m e t e r s o f a s e c o n d o r d e r
techniques.
these
possible.
G e n e r a l i z e d G e o m e t r i c P r o g r a m m i n g (GGP) i s u s e d
servomotor
estimating
c o n t r o l l e r b a s e d on
p r o g r a m l e n g t h and e x e c u t i o n t i m e s o . t h a t i m p l e m e n t a t i o n i n a s u c h as
are
available.
require than
no
1 second,
TABLE OF CONTENTS Page ABSTRACT
i i
TABLE OF CONTENTS
i i i
SYMBOLS
v
ABBREVIATIONS
vi
L I S T OF ILLUSTRATIONS AND TABLES
v i i
ACKNOWLEDGEMENTS
viii
I.
INTRODUCTION - ADAPTIVE CONTROL
1
II.
OPTIMIZATION USING GENERALIZED GEOMETRIC PROGRAMMING (GGP) . . .
4
III.
IV.
V.
2.1
Introduction
to
GGP
2.2
Condensation
of PID C o n t r o l Problem
2.3
O p t i m i z a t i o n o f the
2.4
Servomotor
4
D u a l Problem - PID C o n t r o l
Lead-Lag Network Compensation
7 15 25
PARAMETER I D E N T I F I C A T I O N USING CUBIC S P L I N E S
35
3.1
The P r o b l e m o f P a r a m e t e r I d e n t i f i c a t i o n
35
3.2
Cubic Splines
36
3.3
Identifying
the
Second O r d e r
System
PARAMETER I D E N T I F I C A T I O N USING WALSH FUNCTIONS 4.1
Development
o f the
4.2
Testing
Method
4.3
Conclusion for
the
the
Method
39
51 51 54
WFPI T e c h n i q u e
IMPLEMENTATION STUDIES
61
63
5.1
F e a s i b i l i t y of Implementation
63
5.2
Test
67
o f yP Programs
iv
Page CONCLUSIONS REFERENCES
70 .
72
APPENDIX A - GGP A l g o r i t h m s
75
APPENDIX B - P a r a m e t e r E s t i m a t i o n APPENDIX C - W a l s h F u n c t i o n
Algorithms
Parameter
Identification
APPENDIX D - P I D C o n t r o l and L e a d - L a g C o m p e n s a t i o n
82 85 87
SYMBOLS
Chapter
2
g
constraint
G
i n g , f u n c t i o n f o r z = In X space
X
primal variable
6, t
dual
a
and c o s t
variables
time s c a l i n g
s
f u n c t i o n f o r GGP
factor
Y , u , C n' n' n
parameter ^
f o r 2nd o r d e r
K K
system J
c
, T . , T, 1 d
parameters
f o r PID c o n t r o l
P
, T P
parameters
for
parameters
for lead-lag
K^,
, a
Chapter C.
servomotor network
3
.
cubic spline
coefficient
S(t)
spline
function
x,
system
output
x
y
first
z
second d e r i v a t i v e of system
a
l > 2 » Yp»
a
k'
a
^k' ^k'
T
Q r
k'
d e r i v a t i v e of system
parameters for ^k'
S
k
variable for
2nd o r d e r
output output
system
identification algorithm
Chapter 4 x
sine
y
cosine type Walsh
xc,
yc
type Walsh
correlation
function
function
1^
integral
s^
sign of i n t e g r a l
Y , 12
X
where
1_ 'ii
6 -
X
1 2
Ul
ui
ui2
1
5
2
X
ui
The b a r o v e r t h e u r e f e r s
to
the
condensed v e r s i o n o f the
function.
The c o n d e n s e d f u n c t i o n a p p r o x i m a t e s
scribed
[12].
in
z=£nX s p a c e . by Bohn
It
the o r i g i n a l
f u n c t i o n as
i s a tangent hyperplane to the o r i g i n a l
de-
function i n
N o t e t h a t c o n d e n s a t i o n i s p e r f o r m e d i n t h e manner
b11
-
where
= CnXj
l
X
X
1
b i ?
b i q
2
3
X
'll
Cn
6
5
'11
described
u
= 1 +
2
x
12
_ C
2 1
c
2 1
x
l
I 1 =| —
condensation,
1
2
= 6 ,
b
1 2
1
6
3
1 2
set
x
obtain b
2
=
the
= b
n
(2.28)
b i 2
b
2
Then s i m i l a r l y
u
(2.27)
12
C o n t i n u i n g on w i t h
2
2 x
b
2
2
3
(2.29)
3
6
6 i 2
2 2
b
2 1
-b
-0,
2 3
b
2 2
'22
21
—6
1 »
=
^
t h e s e two p a r t s o f t h e 2
u
2 2
b3
&21
with
original
[12].
U
where
12
-6 12
'ii
2
f u n c t i o n condensed,
then
^22
"
=
x u 2
2
The
condensed c o s t
l1
a
g
0
= C X
l
=
L i
1
1
l?
a
X
a
%
X 2
function finally
13 i d
9 1
A
+C X 2
2
X
i
a
is
9 9
A
2
2
2
X
91
a
(2.31)
3
where c
TJ^Y
'
a
b = 7;— ,
i l
"
=
1 _ a
13»
1 2
a
=
b
22
_
b
a
12>
13 = " 13 b
(2.32A)
2
C
2
2
a
Ml
Parts
2 1
=
-bn,
o f (2.32A)
a
2
= -l-b
1
1
,
2
a 3 = -l-bi 2
(2.32B)
3
and (2.32B) c a n be r e w r i t t e n u s i n g (2.27) and
(2.29) a
= -l- 0
3
(2.80)
satisfied
positive.
then
Therefore
(2.80)
is
i n summary
also the
satisfied, conditions
thus can
insuring
be
as 3 t
0,
< b
a
> 0
2
(2.81B)
- I —J
1
equations of
for
(2.14)
C
= 0.5
g
and
(2.81C)
(2.15),
the
controller
parameters
by 1 K
C
=
(X, - b ) a t
s
33
t T, =
(Xi (X
t
In order numerical
to
b ) x
S
d
T. =
(2.82A)
2
9z
s
(
X
2
,
-
(2.82B)
2
2 " 2 ——— b
z
. b )
)
(2.82C)
d e m o n s t r a t e how r a p i d l y
example w i l l
be
the
algorithm converges,
given.
Example Data
:
Choosing
a_ = 0 . 2 5
a
C =0.5 s
t
2
s
= 0.01 =2.5
y = 1
a
X
(
0
)
= 1 .3125 = 0 .59
X x
Table 2.1 the
are
to
optimum.
close
Summaries o f t h e If
the
)
= 0 .0624
o f the
the n u m e r i c a l r e s u l t s optimum s y s t e m .
occurs very r a p i d l y .
points the
0
summarizes
step response
convergence
(
3
to
the
Note that
Other d a t a were t r i e d w i t h are
open l o o p s y s t e m has
controller settings
equations.
The d e t a i l s
the
from Table
2.1,
condensation
a step response
similar
a time d e l a y ,
convergence
the
similar rates.
same a l g o r i t h m c a n
Once X i , X 2 a n d X 3 h a v e been
may b e d e t e r m i n e d of this
initial
shows
l i s t e d i n Appendix A .
be a p p l i e d a s s u m i n g no t i m e d e l a y . the
As c a n be seen
optimum and w o u l d y i e l d
algorithms
and F i g u r e 2 . 1
method a r e
by a p a i r given i n
of
found,
non-linear
[12].
GGP Algorithm Results For PID Control Of A 2nd Order System
Iteration
D X
l
X
2
X
3
S
o
g
o
b
8
1
g
D
8„
2 2
P
1
1.217
0.710
0.0602
1.306
1.305
1.010
1.327
1..312
1.237
2
1.195
0.746
0.0597
1.309
1.309
1.000
1.310
1.310
1.310
3
1.192
0.753
0.0596
1.310
1.310
1.000
1.310
1.310
1.310
4
1.191
0.754
0.0596
1.310
1.310
1.000
1.310
1.310
1.310
Table 2.1
Output
Fig.
2.1
Step Response f o r O p t i m a l PID C o n t r o l
2.4
Servomotor Lead-Lag Network Compensation Often,
networks.
servomotor
systems
are
c o n t r o l l e d by l e a d - l a g
T h e r e a r e many c l a s s i c a l t e c h n i q u e s
such systems
based
compensation
available for
on c e r t a i n s p e c i f i c a t i o n s . . .
, It
is also
designing possible
[Zb J to d e s i g n such systems A servomotor
u s i n g the
GGP t e c h n i q u e s
i s often modelled
d e s c r i b e d i n S e c t i o n 2.
as
K 2
G ( ) S
(2.84)
S ( l +
P
The p r o b l e m i s
T
P
S )
to design a compensation network o f the
G (s)
K (1 = -£ 1
+
a x
s) ^—
+
X
S
form
(2.85)
c The f o l l o w i n g K (x X
+
x
A _ _ c
i
definitions
are
made
- K K P c
(2.86)
)t p__s
(1 (2.87A),
X
+ X
c p
X
3
3
(2.87C)
,
X
h
t & —
'(2.87D)
c p
2
—
X
(2.87B)
c p t a ^ —
,:.
X
X X
K)t
^
2
X X
Kt ^ —
a x
(2.87E)
X
c
"
P
2(ISE) g
0
^
(2.88)
t s
From e q u a t i o n s step
(2.84)
to
(2.88)
it
can be found t h a t ,
for a
unit
input, g
0
1 Xl = X X - + X
2
X2aXX X
k
1 — X /XjX 3
Xa XX 2
2
+ 2
2
3
2 4
(2.89)
Again,
a time c o n s t r a i n t
an a p p r o x i m a t i o n can be
i s necessary.
For the
transient
response,
made.
G * G G c p
(2.90)
G =
(2.91) s(l
Then t h e
+
T
s)
P
closed loop error
for
a step
input
is
s + 2?«., •E(s) =
(2.92) s
aK co = —
where
The p a r a m e t e r the
response.
m a i n l y by K a .
2
1 ,
2
T
of
+ 2cws+ a)
2
2£w = — T
P has v i r t u a l l y
The i n i t i a l
(2.93) P
no e f f e c t
p o r t i o n of the
A time c o n s t r a i n t
can be s e t
on t h e
transient
transient i n the
is
portion
determined
following
manner:
Define Yi - 2 e w t Y
2
-
(2.94)
(wt )
=
2
s
(2.95) T
P The e r r o r transform of This
at
time t
is
approximated by t a k i n g the
(2.92) a n d u s i n g t h e
d e f i n i t i o n s of
inverse Laplace
(2.94) a n d
(2.95).
yields
-? e(t
) = e
[cos6 + — s i n e ] 26
2
S
/ Y O
The a p p r o x i m a t i o n time of the
response.
-/YxV
is
(2.96B)
2
c l o s e to
Using
(2.96A)
the
(2.87) a n d
actual error
d u r i n g the
(2.95) , we h a v e
rise
Y
= X
2
2
- aXit = X
Now a t i m e c o n s t r a i n t
- aX
2
x
+
a
(2.97)
z
can be s p e c i f i e d .
= C X! + c x = 1
g l
3
where
h
(2.98)
2
-a
(2.99)
Y,
-
a
Y
-
a^
2
(2.100)
After
2
s p e c i f y i n g an e ( t ) , g
Y
2
can be found by s o l v i n g t h e
following
equation. -20 Y,
a +
=
/ Y
2
e (t 2
Y
- a
2
2
cos/ Y
2
- a
2
+ a sin/ Y
-
2
a
5
)
(2.101)
a
X
(2.102)
a =
( 2 . 1 0 1 ) was s o l v e d f o r v a r i o u s v a l u e s o f a a n d e ( t
) = 0.5.
It
s was f o u n d
that Y
2
= 1 + a/2
(2.103)
T h i s a p p r o x i m a t i o n was f o u n d t o b e w i t h i n of Y
2
i n the
r a n g e o f 1.0
Hence, s o l v i n g starting point. the
following
It
for Y
2% o f t h e a c t u a l
value
< a < 2.0. 2
c a n be s i m p l i f i e d
s h o u l d be n o t e d
that
from
by u s i n g
(2.103)
(2.101), Y
2
must
as
a
satisfy
condition.
(2.104)
After
condensation,
the
cost
becomes
/c X X X3\ l/c X X X \ 6
1
x
8
1
2
2
2
3
6 2
/c3Xi\
A a i
/c4X2V
a 2
(2.105)
= S0S1 1
;
where d i r e c t
6
/
u s e was made o f t h e X
a manner s i m i l a r to
Appendix A . 3 .
be e a s i l y
constraint
I
a
(see
\ ®2
(2.87)) (2.106)
and s o l v i n g t h e
a few d i f f e r e n c e s ,
dual variables
dual problem i s
The a l g o r i t h m i s t h a t are
have been found,
done
listed
discussed
in
below.
the p r i m a l v a r i a b l e s
can
calculated. CT
X
X
1
= —
x
C
3
o
2
(2.107)
= —
2
(2.108)
X3 c a n b e f o u n d b y t a k i n g t h e There are criterial
\ \
t h a t of PID c o n t r o l .
There are
Once t h e
2
I
= a - X±
k
The p r o c e s s o f c o n d e n s a t i o n in
1
l i m i t s for
requires X
the
derivative
of the
a l g o r i t h m to work.
uncondensed
Again,
the
function.
stability
that
3
X i1X 2
< 1
(2.109)
A
Another s t a b i l i t y conditions.
These
g
=0
0 X
3
x
from the
Kuhn T u c k e r
are
§0„
80
c o n d i t i o n c a n be d e r i v e d
= 0
(2.110A)
+ V81, = 0 x
(2.110B)
+
Y
2
u
8 l
Y
2
(2.HOC) ,
81 = 1
(2.110D)
We h a v e -X X g 2
g
0
x
l
3
=
+ (2X]X
0
*2
aX ) 2
2
k
(2.111)
lX go + x
3
(2.112) h - X!X )go + ( X : h
3
2
= X
+
l +
=
(2X g
1
h 3
0
+ 2a X X 2
3
:
- X
g
- 2aX
3
3
where
h = X^XQ, - X
and
g! gi
-
2aX ) 4
(2.113)
(2.114)
2 3
= -aC
(2.115)
= C
(2.116)
k
x S o l v i n g the
2 x
h
l
x
+ X
2
2
first
two K u h n T u c k e r e q u a t i o n s
of
(2.110)
for
u,
yields g
o
X l
+ g
a
= 0
v
X
Substituting i n gg a t
0
(2.117)
2
(2.117) by
(2.111)
the optimum, y i e l d s ^ 2X X - 2aX + 2a X Xi + a ^ g = X X + aX!X 2
X
3
3
1
and
2
+
(2.112)
+ aX
and by s o l v i n g
3
(2.118)
0
2
Assuming t h a t X X Using
2
> 0,
3
+ aX
l
(2.97) w i t h Y
2
Since X i > a, Y Though t h e
2
3
for
3
i m p l i e s a new s t a b i l i t y c o n d i t i o n .
> 0
(2.119)
(2.119), a condition for Y
is,
2
< . a ( 2 X i - a)
(2.120)
then a d e f i n i t e c o n d i t i o n i s 2X
Then from ( 2 . 1 0 4 )
_
2 X
3
stability condition. (2.123)
3
and
(2.123),
the
following
limit
for Y
2
is
obtained. a 4 This
It
2
< Y
< a
2
(2.124)
2
implies 1
1
—
< Ka < —
4x
T
P
s h o u l d be n o t e d
purposes.
It
(2.120)
satisfied.
is
(2.125) P
that these l i m i t s
i s p o s s i b l e to
exceed the
are u s e f u l
limits with Y
T h e a l g o r i t h m was t e s t e d u s i n g s e v e r a l e x a m p l e s . an example t a k e n system
from r e f e r e n c e
x t
P P s
The r e s u l t s 2
= 100 = 0.04 = 0.05625 of the
= 1.71 X]/ ) =
Obtain
X
0
ISE
C
s
1.70
= 1.6066 = 0.0430
,
= 0.5000
optimization algorithm a = 1.40625
Using
x
for
X
2
= 1.9917
2
computational
> a
2
as
are
long
as
One o f t h e m was
The p a r a m e t e r s o f t h i s
are K
Y
[26].
for
servo-
31
K
= 0.2436
c
,
x
The t i m e r e s p o n s e
is
c
= 0.2808,
a = 0.8875
'
shown i n F i g u r e 2 . 2 .
Verification
was d e t e r m i n e d b y s u b s t i t u t i n g t h e o p t i m u m s e t t i n g s equations. ventional
F i g u r e 2 . 3 shows t h e technique
543 o f r e f . control.
[26].
time response
of l a g network d e s i g n . A comparison w i l l
The r e s p o n s e
obtained
from the
The g r a p h i s
taken
a higher overshoot
Better
conventional design but
more r e a d i l y w i t h o u t g o i n g t h r o u g h a t r i a l
Note t h a t
the
same c o n s t r a i n t
i s s a t i s f i e d by b o t h
A l e a d d e s i g n was o b t a i n e d w i t h Y its
response
shown i n F i g u r e
2.4.
2
of 0.46
and e r r o r
= 1.3125,
from
and a
time constant
it
con-
slowly
seconds. GGP o f f e r s
procedure.
compensators. and t
p.
improved
decaying term w i t h a r e l a t i v e l y large c o n t r o l c o u l d be o b t a i n e d w i t h
optimum
i n t o t h e Kuhn T u c k e r
show t h a t GGP o f f e r s
i n F i g u r e 2 . 3 has
o f the
= 0.05
with
G>)=K^l+octs)
O.S
Fig.
2.4
Lead
C o m p e n s a t i o n U s i n g GGP
35 PARAMETER I D E N T I F I C A T I O N USING CUBIC S P L I N E S
3.
The
3.1
Problem of Parameter
In
the p r e v i o u s
Identification
chapters
i t h a s b e e n shown t h a t
s y s t e m p a r a m e t e r s and an a p p r o p r i a t e settings
f o r a c o n t r o l l e r can be o b t a i n e d .
procedures
requires
overview of the
a system model.
an a p p r o p r i a t e
s y s t e m b a s e d on a p r i o r i may b e c h o s e n .
to
use
done,
the
is
often
as
a parameter.
a
Identification:
equation
0
given i n reference
can be used
to
describe
plant
c o u l d be m o d e l l e d
c o u l d be used.
to
the
order
determine
the
of the
Since i t
system i s .
coefficients
as
is the
Onee
of the
+ a
l Y
as
d e s c r i b i n g s t a t e and p a r a m e t e r to what
purposes
is
of
d e f i n e d as
that
linear
this
thesis,
estimation,
a s t a t e and what the
following
T h i s i n v o l v e s d e t e r m i n i n g the
d e s c r i b i n g ( m o d e l l i n g ) an i n p u t / o u t p u t
9y + 32^- +
a
model
is
there
defined
definition
chosen:
Parameter linear
For the
An e x c e l l e n t
parameters.
literature
some d i f f e r e n c e s
be
a chemical process
choose what
i d e n t i f y the
In
design
d e s c r i b e d by l i n e a r d i f f e r e n t i a l e q u a t i o n s ,
i t w i l l be n e c e s s a r y
equations,i.e.
will
to
suitable
d y n a m i c s , i . e . an a p p r o p r i a t e
l i n e a r approximations
systems
remaining problem i s
of equation
knowledge of i t s
For example,
a n o n - l i n e a r system or convenient
To a p p l y s u c h c o n t r o l l e r
T h i s m o d e l must be i d e n t i f i e d .
'type'
plant
(specification),
p r o b l e m s i n i d e n t i f i c a t i o n and c o n t r o l a r e
Often
is
time c o n s t r a i n t
g i v e n the
y ..ang^r d
b
0
+ biu + b
2
+
coefficients
system of
b
the
of form
(3.1)
a
[2].
For
Adaptive Control,
m e t e r i d e n t i f i c a t i o n scheme algorithms of
that
have been proposed,
extended
i t w o u l d be
Kalman f i l t e r i n g
desirable
can be c a r r i e d out
the
most
techniques.
in
chapter.
this
This i s
Parameter
In identifying
equation
this
the
noisy,
t y p e o f scheme
are
the
cubic
splines.
3.2
Cubic
Many form
that w i l l
the
be
investigated
some known i n p u t i s m e a s u r e d .
f i t t e d w i t h a smooth c u r v e u s i n g
give the
technique
best
fit
to
curve
These
splines.
coefficients
of
the
curve.
smoothed
t o be s t u d i e d w i l l be t h a t
parameters o f a second o r d e r model w i t h time delay.,
a
of using
Splines
In a quotation
that w i l l
chapter,
i n real time.
t h a t make u s e o f s p l i n e
i d e n t i f i c a t i o n i s performed by f i n d i n g the
differential
para-
[27].
An output response to
measurements,typically
some
t y p i c a l o f t h e s e b e i n g some
A l t e r n a t e schemes have b e e n p r o p o s e d fitting
to have
order
to
from r e f .
obtain i n t u i t i v e i n s i g h t i n t o the [18] w i l l be
nature of
splines,
given.
"Draftsmen have l o n g used m e c h a n i c a l s p l i n e s , w h i c h a r e f l e x i b l e s t r i p s o f a n e l a s t i c m a t e r i a l . The m e c h a n i c a l s p l i n e i s s e c u r e d b y means o f w e i g h t s a t the p o i n t s of i n t e r p o l a t i o n - h i s t o r i c a l l y c a l l e d knots. The s p l i n e a s s u m e s t h a t s h a p e w h i c h m i n i m i z e s i t s p o t e n t i a l e n e r g y , a n d beam t h e o r y s t a t e s t h a t i : . . t h i s energy i s p r o p o r t i o n a l to the i n t e g r a l w i t h r e s p e c t t o a r c l e n g t h o f t h e s q u a r e o f t h e c u r v a - .:: t u r e of the s p l i n e . " Essentially, cal
curve,
function
segments
f o r each
instead
(intervals)
segment.
of f i t t i n g a l l of the of data are
d a t a w i t h one
fitted with a cubic
analyti-
spline
37 When t h e k n o t s interpolating
spline
S(t )
(x„, t~),
i=l,
i
...
L i .
a function
= x(t ),
±
such
is
(x., t.), 1 1
such
(x , t ) are n n
given,
that
n
2,
the
(3.2)
that rt
J
= J
is
( S(t)) dt
n
(3.3)
2
l
t
minimized.
The c u b i c s p l i n e h a s and s ( t )
are
continuous.
That
the
additional property
is,
at
the
knot points
that the
s(t),
s(t)
following
is
true, S._ (t ) 1
= S.(t.)
i
K ± (t
^ i - l
(
t
i
}
=
S.^a.) for
i
±
of
this
this
t
b
0 L
t.,
the
determine the
details
i
= C
x = t -
Given
order
higher
the
S (t)
with
(3
-
= S. ( t . )
higher
respective
For
will
)
4B)
(3.4C)
= 2, 3, . . . n For
their
(3.4A)
splines,
order
derivatives.
interval,
let
+ CX^.T + C , 2
t-
< t
these c o n t i n u i t y
z
(
3
1
)
N+l Using
( 3 . 1 0 B ) and
(3.17)
a,i =
— — ax+y
(3.22)
a
aa
(3.23)
2
=
1
For a v e r a g i n g ,
ai
then
= a
-
x
N+l
a
2
( d
N
=
a N +
N+l
1
l
a
+ z
i
)
(3.24)
N
(3.25)
a
N+l
N+l
where d
=
N+l
Vi -
V l V lV l +
N
I
( 3
i i+i - i+ii> = V i
(x y
x
y
+
D
N
( 3
-
-
2 6 )
2 7 )
1=1 W i t h Y> aj_, a , 2
known,
z transform techniques,
the
t i m e d e l a y T J J can be d e t e r m i n e d .
a step response w i t h
Using
discrete
a r b i t r a r y t i m e d e l a y c a n be
generated.
These generated values can be compared to measured values and
the time delay can be determined by their respective times. The c r u c i a l part of the entire estimation scheme i s the determination of a\, a
2
which depend heavily on knowing x^ and i t s derivatives y^
and z-^. In order for the equations of (3.14) to be independent, no more than two spline approximations (x,y,z) from the same spline i n t e r v a l should be used.
Because x,y,z are continuous at the knot points, then just the
knot points
can be used.
This makes the computation of x, y, z simpler. th
Then from (3.11) and (3.5) for the i x
= C
±
z
-
0 i
y. = C i 1
knot (3.28A) (3.28B)
i
= 2C .
±
(3.28C)
2j
Hence, the spline c o e f f i c i e n t s can be used d i r e c t l y for :the parameter i d e n t i f i c a t i o n equations.
Another reason for using only the i n i t i a l
knot points becomes apparent when the following i s considered. Substitute the spline approximation into
(2C
2
+ aC 1
+ a (C -Y))+(6C
l
2
0
+ (3aiC + a C 3
2
At x=0 have
2
)x
2
+ 2a C
3
x
+ a C x 2
3
3
2
(3.8)
+ a C )x 2
1
= 0
(3.29)
(note x= t-t.) x
2C = -a^i 2
- a C 2
0
+ a y 2
D i f f e r e n t i a t i n g (3.8) and substituting i n the spline approximation
(3.30)
(6C At
+ 2a1C2
3
+ a C )+(6a C 2
1
3
+
2a C 2
2
)T
+ 3a C x 2
= 0
2
3
(3.31)
T = 0 we h a v e 6C
Then t h e
= -2aiC
3
2
--3.2^1
o n l y t i m e when t h e
Similarly
(
3C
- = ~
2
a
3
to s a t i s f y
a
ai
2
(3.8)
strate solving
3C
3
t w i c e and s o l v e d f o r
that other for a
a
1 ?
x's
(3.35)
can't
into
Since i t
x's
and
is
desirable
following
euqation,
=
\
( x
*k-i
x, = s m o o t h e d k ^
= measured
+
2
x=0.
it
X
+
X m
k i
can be
for
used.
to keep the i s used to
spline
a l g o r i t h m as
smooth t h e
}
+
data data
estimation algorithm is
demon-:
a point
k The
seen
T h i s does n o t
s m o o t h i n g must be done b e f o r e
a simple averaging technique
\
(3.34),
i f x=0 i s c h o s e n a s
c a n n o t be
possible,
where
(3.33)
be u s e d , b u t
to n o i s y data,
i s used.
then (3.35)
then other
2
x=0,
34
3
c a n o n l y be d e s c r i b e d by a s p l i n e a t
Due fitting
e~
x = y ( 1 + - \ 3,
., - b t (e
z = x = ^
(ae"
a, b =
ie.
a,
b are
a t
a n a l y t i c response, b t
))
(3.37A)
£
-at.
,„ „.,„. (3.37B)
)
- be"
b t
)
(3.37C)
(3.37D)
poles.
are
to n o i s y data
i s shown i n f i g u r e
g i v e n i n T a b l e 3 . 1 . It c a n b e s e e n
differences
for
the
derivatives
at
The l i m i t a t i o n i n t h e a c c u r a c y o f s p l i n e f i t will
limit
the
accuracy of estimating
s t a t e very w e l l because i t ful
state values
U
s
o
o
n
e
that
second order determine
and
there are
transient
line.That is
could not
3.1
smaller values
The s p l i n e w i l l
a straight
because a l l s t a b l e
of Y O »
the
d u r i n g the
a i , a2-
i s almost
for e s t i m a t i o n purposes
same s t e a d y
its
ie.
2
A plot of a spline f i t
significant
function with
2 -aj±/ai-4a2
the
numerical results
o f the
on
D
Tab y = x = —^
where
- ae"
at
a
A s p l i n e a p p r o x i m a t i o n was t r i e d
a simulated system w i t h a = . 2 5 , a = . 0 1 . 1
a c u b i c s p l i n e can r e p r e s e n t
of
time.
response
fit
steady
not very systems a
some
use-
have
the
particular
system.
Increased narrower. narrowed, the
accuracy
T h i s works i f the the
can be o b t a i n e d by making t h e data
i s not n o i s y .
If
the
intervals
s p l i n e a p p r o x i m a t i o n becomes m o r e s e n s i t i v e
derivatives.
spline
to n o i s e ,
intervals are especially
T h e r e i s a r e a s o n why t h e t=0.
C o n s i d e r the
Taylor
ya t x(t)
expansion o f x about ya a t
2
2
1
= —2
fit
o n l y a v e r y s m a l l range
transient
further found
part
of the
update o c c u r s .
that
a^,
a
(
using a t h i r d order
of
4
2
+
parameter
response.
e s t i m a t i o n c a n o n l y be done
At steady
In practice,
n u m e r i c a l e r r o r when u s i n g s m a l l
state,
once s t e a d y
o c c u r when i t
i s known t h a t
estimation i s
restricted
the
the
are dependent
two o u t p u t
It
the
ISE of the
of the parameters
as
z = 0,
no it
p r o b a b l y due
was
to
estimation should
by an i n p u t .
Hence,
estimation for
ai=0.25,
S i m i l a r b e h a v i o u r was the
estimates
t h r e s h o l d and t h e number o f
other
parameters
accuracy of the
system.
i n (2.22). It
open l o o p i n t e g r a l once the
of the
for
chosen.
T i m e d e l a y c a n be e s t i m a t e d estimates
i e . x, y,
c a n be s e e n t h a t
spline interval, starting
c o u l d be done by c h e c k i n g t h e
with
the
b e i n g O . l y and 0 . 9 Y -
One c o n v e n i e n t m e t h o d o f c h e c k i n g t h e
known i n t e r m s
)
thresholds.
of parameter
overdamped s y s t e m s .
on t h e
times of smoothing
system i s a f f e c t e d
results
two t h r e s h o l d s
observed for other
8
values.
between
T a b l e 3 . 2 shows t h e 2
3
during
s t a t e i s approached,
Since there i s a time delay i n g e n e r a l ,
a =0.01 with
,
e q u a t i o n w o u l d be p o s s i b l e
k e p t on becoming i n c r e m e n t a l l y l a r g e r ,
2
3
t.
As m e n t i o n e d b e f o r e , the
2
2
approaches
t=0.
ya (a -a )t
3
2
g
An a c c u r a t e
a c c u r a c y d e c r e a s e s when o n e
estimates
The c l o s e d l o o p e r r o r c o u l d a l s o be
is
compared
time d e l a y i s known.
by s i m u l a t i n g t h e
response w i t h
a n d c o m p a r i n g them t o m e a s u r e m e n t s .
the The
a l g o r i t h m l i s t e d i n Appendix B . 2 uses the time s h i f t
of these points
delay simulation.
If
d e l a y w o u l d be f o u n d . of
a
a
1 5
2
are not
the
relative
to
the
exact values
Table 3.3
knot points appropriate
of a^,
a
2
.1 < x
m
Otherwise,
to s m a l l e r r o r s
i n the
3.2.
by t h e
For the
The c o n v e r s e for
the
is
the
time delay estimate
estimates of a
x^Ct),
Instead
,
exact
time time
estimates
hence
f o r example t
varies
the
such
that
o n l y s l i g h t l y due
2
t o s e e how t u n i n g o f a P I D c o n t r o l l e r w o u l d
the s
t,
a .
The r e s u l t s
x^(t )
t r u e f o r x^{t).
ISE i s
for
less
this than
test the
are
case based
< x - } ( t ) w h i c h i s why t h e s
Note that
the
shown i n
ISE i s
on
figure the
smaller.
same r e l a t i o n s h i p h o l d s
true
overshoot.
In general, for
the
of a zero the
for larger
to a range of o u t p u t s ,
estimates.
response
true parameters.
find
shows t i m e d e l a y e s t i m a t e s when t h e
I t w o u l d be i n t e r e s t i n g be a f f e c t e d
to
exact.
s h o u l d be r e s t r i c t e d < .6.
point
were u s e d ,
The Tp e s t i m a t e s become m o r e i n a c c u r a t e estimate
i n order
estimation but
the
cubic splines accuracy i s
offer
a considerably simpler
limited.
technique
Output
Fig.
3.1
x
Cubic Spline
Curve
Fitting
Comparison of Spline Approximation to Analytic Function (*refers to the spline approximation)
t [sec]
X
X
y
y
0
0
0
0
0.01
*
z [10-3]
' z* ' [10-3]
10
1.83 4.95
10
0.2364
0.2378
0.0314
0.0285
-0.217
20
0.5156
0.5165
0.0233
0.0242
-0.980
i
30
0.7033
0.7026
0.147
0.0143
-0.710
.' -0.615
40
0.8197
0.8175
0.009
0.0089
-0.447 - -0.456
-1.360
Table 3.1
Parameter Estimates of a 'Second Order System a^O.25,
Noise Variance
a
l
a =0.01,
TH=0.1y
2
Spline Interval [sec]
*2
# of times of smoothing
0.000
0.2397
0.00927
10
1
0.0115
0.2385
0.00970
10
1
0.0115
0.2078
0.00748
10
1
0.0115
0.2277
0.00998
5
3
0.0115
0.2320
0.00860
15
1
0.0115
0.267
0.0103
10
1
0.0115
0.341
0.0144
5
3
*1
TH=0.25y
*2
TH=0.25y,
a =0.35,
a =0.015 2
Table 3.2
Delay Time Estimation a =0.25,
a =0.01,
^=10 sec,
Knot Point
^=0.23,
X c
X .
c [sec] fc
a=o 2
Noise Variance=0.0115
0095
t [seed
D [sec] T
^=0.27, X
a =0. 0105 2
t [sec]
D [sec] T
.100
15.6
.100
5.7
9.9
.102
5.6
10.0
.407
25.6
.410
15.7
9.9
.409
15.9
9.7
.633
35.6
.634
25.1
10.5
.634
26.3
9.3
.775
45.6
.775
34.4
11.2
.775
36.7
8.9
.862
55.6
.862
43.7
11.9
.862
47.3
8.3
.914
65.6
.914
52.8
12.8
.914
57.7
7.9
Table 3 . 3
System Response
Fig.
3.2
x(t)
PID T u n i n g Based on E s t i m a t e d
P a r a m e t e r s , 2nd O r d e r
System
51
4.
PARAMETER I D E N T I F I C A T I O N USING WALSH FUNCTIONS
4.1
Development o f the Method In
the
identified
s p l i n e i d e n t i f i c a t i o n method, u s i n g the
system response
have a c h a r a c t e r i s t i c ters
frequency
spectrum,
c a l l e d Walsh f u n c t i o n s .
applications
i n f o r m a t i o n about
be i n v e s t i g a t e d h e r e .
c o r r e l a t i o n of the
hence,
due t o
the
output
c a r r i e d out
Also
tested
second order
The b a s i c system i s
on the
These
paramefunctions
it
has
use o f Walsh
involves testing
control
w i t h v a r i o u s known s q u a r e wave
the property
the
functions
functions
the
system
Identification is
estimates are
of being simple.
done
signals,
less
sensitive
T h i s method
was
systems.
t h e o r e t i c a l background can be found i n r e f .
g i v e n a s q u a r e wave i n p u t w i t h a f r e q u e n c y
correlation
the
b a s e d on c o r r e l a t i o n
Essentially i t
correlation process,
to n o i s e . for
systems
They h a v e been used i n v a r i o u s
w i t h a s q u a r e wave a n d s o i s e a s i l y i m p l e m e n t e d . by
Since
o f o r t h o n o r m a l s q u a r e wave
system i d e n t i f i c a t i o n [ T 3 ] . A procedure
will
time domain.
essentially
[15].
R e c e n t l y some w o r k h a s b e e n in
i n the
can a l s o be o b t a i n e d u s i n g a s e t
which are
the parameters were
i s performed by u s i n g v a r i o u s Walsh
o f co^.
[13]. Time
The average
functions.
are
(4.1) -N where
c(t)
=
u(t)
= known s i g n a l
T h e known s i g n a l s
output
are Walsh
functions.
Xi
- s q u a r e wave w i t h co = toi
X3 x
s q u a r e wave w i t h to = to 3 = 3toi
- s q u a r e wave w i t h to = L05 = 5toi
5
where x i i s signals
the
used
o r i g i n a l generated t e s t
input
for
the
Other
are
y\-
90° phase s h i f t e d
s q u a r e wave w i t h to = toi
y -
90° phase s h i f t e d
s q u a r e wave w i t h to = to
3
system.
Y5~ 90° phase s h i f t e d The s e c o n d o r d e r
3
= 3toi
s q u a r e wave w i t h to = 105 = 5toi
system has
the
following
transfer
function
2 (jto)
G
^Vj?
= (to
P
- to)
P
= |
|
G
+ j 2 ? to to P P
e
-
j
(4.2)
e
P
2£ to to t a n G = —2—2— to2 - to 2 P
where
z
It in
2
c a n b e shown t h a t
terms o f t h e i r
(4.3)
z
the
harmonics
correlation
of
the
xic a Aicos0i + — 3 x c 3
- A cosG 3
functions
approximated
form^^
cos6
3
+ — 5
(4.4B)
3
can be
cos0
(4.4A)
5
x^c - A c o s e 5
(4.4C)
5
and yic
y c 3
- A sin0 3
Since the
= Aisin9i
determined
signals
are
3
+ — 5
just
(4.5A)
5
5
plus
functions,
following.
sin8
y c = A sin0 o r minus l e v e l s ,
n u m e r i c a l l y from the
correlation
by the
sin0
-(4.5B^.
3
can be e a s i l y p e r f o r m e d Given the
+ — 3
5
the
(4.5C)
5
correlation
data.
then phase i n f o r m a t i o n
can
be
53
y c - y c/3 t a n G j = —— xjc - x c / 3 x
y c/5 — x c/5
3
5
3
Y3 = ——
(4.6A)
5
C
tan0
3
C
tan6
(4.6B)
x c
5
(4.6C)
x c
3
5
£^ a n d 03^ c a n t h e n b e d e t e r m i n e d b y e q u a t i n g
The p a r a m e t e r s and
Y5 = — -
(4.6)
(4.3). This y i e l d s OtanSx - 9 t a n 9 ) o j 3
03
(4.7A)
2 1
2
3tane! (45tan6
a, 2
o)
3
-
(25tan0
5
-
75tanG )o) 5
2 1 (
3tan6
4
-
7
B
)
5
5tanQ )^i
1
l
(4.7C) tanBc -
=
2
- oj • 2o)i o)
(9o3j
2
2
5tan6!
)tan9
1
(4.8A)
P
1
- OJ
=
2
)tan6
3
E
(4.8B)
6o)i0)
P
P
1
(250)!2
?
3
=
(o)!
?
-
3
5tan8
P
p
tanG
:
P
2
-
- 03
= P
2
)tan6
5
2
(4.8C)
IOOJIU)
P The g a i n y^, o f a s y s t e m c a n b e d e t e r m i n e d response
due t o a s t e p
input.
from the
steady
state
4.2
T e s t i n g the Method A typical
in
p e r i o d i c output
Figure 4.1.
the
data
response
f o r a s q u a r e wave i n p u t
The c o r r e l a t i o n f u n c t i o n s
i n lengths
The v a l u e
o f 30 e q u a l s e g m e n t s f o r
f o r each i s o b t a i n e d u~c~ = ( s j l j + s I 2
where
I
i
t
T h i s method i s correlation accuracies the
first
3 harmonics of c ( t )
the
part
3
0
)/K
(4.9)
particular
correlation
of the
too s m a l l ,
response
i e to > 0 ) 5 .
is
are
D a t a was s a m p l e d o v e r one h a l f Appendix C.
The i n a c c u r a c i e s
For low input
test
the
steady
state
is
only in
approached.
then m a i n l y determined by
i f toj i s
period. (>5%)
too l a r g e
accounted then
are
higher for,
important
shown i n T a b l e
The a l g o r i t h m u s e d
due t o
frequencies,
accuracy of the
lower harmonics.
that
neglected.
h a r m o n i c s d i m i n i s h more r a p i d l y . frequencies,
fact
Any i n -
Numerical accuracy
Since these are not
Similarly,
components
the
because
v e r y h i g h and v e r y low v a l u e s
The m e t h o d was t e s t e d a n d some r e s u l t s
the
I
are being used.
When to^ i s
components,
lower frequency
than
0
value
t a n e ' s would d i m i n i s h at
inaccuracy occurs.
circled.
3
t h a t h a d o c c u r r e d a r e due p r i m a r i l y t o
The t r a n s i e n t
then
(T/2).
found to be r e l a t i v e l y i n s e n s i t i v e to n o i s e
to a n d a t to = io .
frequency
period
i s p e r f o r m e d w i t h a d e t e r m i n i s t i c known s i g n a l .
determining the of
integrating
segment
b
s_^ = ± 1 w h i c h d e t e r m i n e s function = some c o n v e n i e n t
the h a l f
shown
by
+ ••• + s
2
= i n t e g r a l of the
K
were computed by
is
the the
frequency
higher harmonics
Inaccuracies
i s shown i n
used,
accuracy of the
Conversely, for
4.1.
the h i g h e r
are
shown
lower input
d i m i n i s h more r a p i d l y
due t o n o i s e c a n b e
minimized
by
a v e r a g i n g more d a t a
cant at
part
i n the
frequencies
functions
have the
5
=
-0.008053
y c
=
-0.001845
With a noise variance
measurement
The i n p u t noise
There i s
frequency
system i s
1
=
u
3ojg, 5 W Q .
3 times w i t h
(4.3),
This
:
case.
become the
(cotangents)
found to
tangent
property
s q u a r e waves o f
the m a t r i x i s
tan 6
1
-
2
(3co)
frequency is
sym-
be,
tan05
3
503
- 1
2
3oo
(5OJ)
2
1
-
15o)
9OJ
(4.10)
25. 2
- 1
(9oo)
- 1
2
(15o>)
(15OJ)
2
2
-
1
25o)
15a>
5OJ
5O)Q
(5(D)'
- 1
(25o))
2
-
1
A
where
0) Hence,
by
to/overcome-
accuracy o f the phase
3oo
(3o))
o)! =
of these values
the
0
3OJQ
=
errors
The m a t r i x o f p h a s e t a n g e n t s
Using equation
O J
o)!
i n the n o i s e l e s s
o f t h e WFPI t e c h n i q u e .
tested
t a n 9],
(a
function
F o r co^ = 1 ,
c o u l d be i n c r e a s e d
a way o f d e t e r m i n i n g t h e
o c c u r s when t h e
metrical.
the
signifi-
problem.
on a p r o p e r t y
= OJQ,
correlation
become v e r y s m a l l .
of 0.0115,
estimates based
oij
Noise plays a
because the
following values
x c 5
significant.
o v e r more p e r i o d s .
estimation of tanO's
lower fundamental
correlation
points
the
-
C0Q
accuracy of the
using three test
signals
phase tangent estimate
and the
By t a k i n g a d v a n t a g e o f t h e
symmetry
can be
checked
property.
p e r i o d i c waveform, n o i s e
can be
averaged
out.
Estimates
of the
shown i n T a b l e 4 . 2 .
phase tangents w i t h s i m u l a t e d n o i s y d a t a
The n o i s e was s i m u l a t e d b y g e n e r a t i n g
bers w i t h a uniform p r o b a b i l i t y d i s t r i b u t i o n . will
d i m i n i s h the noise
are
shown i n T a b l e s 4 . 3 .
dependent on e r r o r s
of the
from a t e s t
to
t h e most
phase tangent e s t i m a t e s .
inaccuracy.
(4.7B) i s
equation
improves
of w e i g h t i n g the
t h e most the
5
s i g n a l o f to^ =
A more
example of
s h o u l d be w e i g h t e d
i n f l u e n c e d by t a n 0 . 5
accuracy
equations
I n the
Those e q u a t i o n s
w h i c h a r e more d e p e n d e n t o n t a n 0 example,
averaging
Errors i n estimation
a l g o r i t h m would use w e i g h t i n g f a c t o r s . subject
random num-
errors.
The p a r a m e t e r e s t i m a t e s d e t e r m i n e d 0.903 r a d . / s
Sufficient
is
significantly.
i s beyond the
scope
are
strongly
sophisticated
shown, tan05
(4.7)
and
less.
In
is
(4.8) the
Eliminating this
A detailed of this
investigation
work.
58
Phase Tangent Actual
V a l u e s Determined from Test
System P a r a m e t e r s :
Test
y 1> P =
3
input:
u=l,
0 171
Variance=0.0115
-4.850
.4172
.2216
-4.833
.4154
.1133
-4.844
.4351
.2663
-4.810
.4297
.2688
Determing Phase Tangents by Averaging Noisy Data co =1.0, p =0.5 P P U!=0.903
* Noi. of Samples
tan 0
N/A
-4.835
.4198
.2283
0
4
-4.839
.4125
.2704
.0115
8
-4.838
.4198
.2426
.0115
12
-4.837
.4176
.2156
.0115
12
-4.838
.4154
.2021
.0231
20
-4.835
.4236
.2389
.0231
8
-4.842
.4136
.3650
.0346
15
-4.837
.4121
.2053
.0346
30
-4.834
.4227
.2246
.0346
1
tan 9
3
Table 4.2
tan 0
5
Noise Variance
Parameter Estimations Noise Variance=.0346, 30 samples
Table 4.3A Estimates Equation Used
w P
2
P * P (to =1.037) (to =.999) P P
.1.000
0.672
0.494
(4. 7A)., (4 . 8A)
1.232
0.471
0.495
(4.7B),(4.8B)
0.995
0.463
0.482
(4.7C),(4.8C)
1.075
0.553
0.490
Average
0.999
N/A
0.490
Average of A & C for U p 2
Parameter Estimations No Noise Table 4.3B Estimates - 2
Equation Used
P
p (w =1.001) P P
0.998
0.496
(4.7A),(4.8A)
1.012
0.491
(4.7B),(4.8B)
0.998
0.490
(4.7C),(4.8C)
1.003
0.492
CO
Average
4.3
C o n c l u s i o n F o r T h e WFPI T e c h n i q u e Investigation of this
been begun r e c e n t l y . promising. steady
It
type of parameter
The p r e l i m i n a r y
seems t h a t
has
only
been system before
g i v i n g enough t i m e f o r s i g n i f i c a n t
transients
adequate.
An i t e r a t i v e l e a s t fitting
i n v e s t i g a t i o n s have
any f r e q u e n c y t h a t e x c i t e s t h e
s t a t e i s reached, but
to occur i s
identification
squares
procedure for r a t i o n a l function
to determine a t r a n s f e r
function
has been p r o p o s e d [ 2 3 ] . A t r a n s f e r
from phase
function
frequency
curve response
can be w r i t t e n i n terms o f
even and odd f u n c t i o n s o f co . 2
Q(co ) + jcoP(co ) 2
H(jai)
2
=
(4.11)
— U(co ) 2
The phase
tangent
is
coP(co ) 2
tanG(co) =
Q(co )
tive
least
squares
find
P(co )/Q(co ) .
this
function.
2
control
+ Pico
q
0
+ q o
2
l t
response
+ • • • p co ^)io 2
M
2
2
data
+ • • • q co
(4.12)
N
N
t a n 6 o f a l i n e a r s y s t e m , an
itera-
r a t i o n a l a p p r o x i m a t i o n p r o c e d u r e can be used The t r a n s f e r
2
function
can t h e n be o b t a i n e d
to
from
T h i s method i s n o t v e r y a p p l i c a b l e f o r m i c r o p r o c e s s o r
systems because
and l e a s t
0
=
2
G i v e n the phase
(p
squares
curve
it
involves
extensive frequency response
tests
fitting.
A g e n e r a l i z a t i o n o f WFPI t o h i g h e r o r d e r s y s t e m s h a s b e e n p r o p o s e d . It
i s p o s s i b l e t o d e t e r m i n e more p h a s e
identify
higher order systems[13],
the output in
the
response
form o f
t a n g e n t s more a c c u r a t e l y
Instead
of using a Fourier
i s expanded i n t o a Walsh f u n c t i o n
series
to
series, expansion
c(t)
= aix! + a x 3
3
+ a x 5
+
5
••• (4.13)
+ b y
+ by 1
where x , y a r e
the
3
1
+ b y 5
5
+
•••
s i n e and c o s i n e t y p e W a l s h f u n c t i o n s
S e c t i o n 4 . 1 and a,b can be d e t e r m i n e d
are
the
expansion c o e f f i c i e n t s .
by c o r r e l a t i o n f u n c t i o n s .
t h e n be d e t e r m i n e d by u s i n g t h e a system of equations For example,
3
the
that
is
described
These
coefficients
The p h a s e t a n g e n t s
coefficients.
l i n e a r i n the
Using the
phase
p a r a m e t e r s c a n be
parameters of a t h i r d order
s y s t e m can be
in
can tangents,
derived.
found by
solving, /
-co.^tanO 1
/
-to
tan9} tan9
3
tan0
5
O J
2 3
tane
a
-coc tan9q 2
3
=
ai
3
3\ co
C O S
2
(4.14)
3 3
3
)
015
where
H(s)
Proposals
(4.15) s
3
+ a s
2
2
f o r making use
+ a^s
a l s o made
a
of magnitude
e v e n and odd p a r a m e t e r s o f a t r a n s f e r d e l a y have been
+
[13].
0
i n f o r m a t i o n to decouple
f u n c t i o n and e s t i m a t i n g
time
the
IMPLEMENTATION STUDIES
5.
The f e a s i b i l i t y o f i m p l e m e n t i n g t h e will
b e shown a n d t e s t s w i t h a l a g c o m p e n s a t i o n
t i o n program f o r
5.1
ref.
of.adaptive
Many i m p l e m e n t a t i o n s
self
tuning.
variants
have been
s u c h as
investigated
developed systems
for
the
still
or
a con-
variations
of conventional
controllers
[4,5].
A self
Digital
same q u a l i t y as a n a l o g P I D with integral
regulator-a
action
was
self-tuning
control
algorithm
discrete-time-randomly-distributed
[16,19,31]. (self-tuning)
development
having their fact
the
found
type where
E x t e n s i v e w o r k was done o n
c o n t r o l of
o f the
c o n t r o l parameter t u n i n g .
the
can be
b y many r e s e a r c h e r s .
feedback
c o n t r o l l e r c a n be i m p l e m e n t e d b a s e d
strategy o u t l i n e d i n Figure 1.1.
been
of the
i n references
on t h e minimum v a r i a n c e
setpoint
An a d a p t i v e the
attain
state vector
and i n v e s t i g a t e d [ 4 ] .
c o n t r o l l e r s based
integra-
out.
c o n t r o l systems
The e f f e c t i v e n e s s
i m p l e m e n t a t i o n o f PID does not
proposed
be c a r r i e d
have been
t u n i n g P I D c o n t r o l l e r was i n v e s t i g a t e d
and a v a r i a n t
algorithms
p r o g r a m and an
c o n t r o l l e r s u c h as P I D , l e a d - l a g c o m p e n s a t o r s
these are
and t h e i r
will
control
Implementation
of a p p l i c a t i o n s
[30].
ventional of
t h e WFPI t e c h n i q u e
F e a s i b i l i t y of A list
in
adaptive
development
techniques
in utilizing
mainly because of t h e i r
f o r parameter e s t i m a t i o n themselves
on the h i s t o r y
that d i g i t a l controllers
usefulness
The m a i n w o r k c o v e r e d s o f a r
The c o n t r o l l e r s based
the
on
c o u l d be
are
of analog
insensitivity, simplicity
and
conventional,
control.
"better" u t i l i z e d ,
conventional control
has
Despite
there
algorithms,
and f a m i l i a r i t y .
is
The e f f e c t i v e n e s s [3,5,28]
on c o n v e n t i o n a l c o n t r o l l e r s has been
Commercial success
t o d a t e , w i t h uP c o n t r o l u s i n g
a l g o r i t h m s has been demonstrated system
[ 1 1 ] and o t h e r s .
widely
used.
with
how f e a s i b l e
algorithms o n - l i n e , i n p a r t i c u l a r , The a n s w e r
been done. the it
It
algorithms
such systems
Adaptive versions
The q u e s t i o n may a r i s e ,
sor?
i s hard
to
is
(and o p t i o n s )
used
it
the
TDC-2000
them w i t h
an a c t u a l
s u c h as
a n d how t h e y
to
to implement
implement
d e p e n d s on many f a c t o r s
as
before.
conventional
o f t h e s e have y e t
to p r e d i c t before
i s p o s s i b l e to estimate
studied
be
adaptive
a microproces-
implementation
the m i c r o p r o c e s s o r are
has
used,
implemented.
Still,
e x e c u t i o n t i m e and p r o g r a m s i z e u s i n g
certain
assumptions. The t a r g e t m i c r o p r o c e s s o r i s assumed Hz c l o c k .
Table 5.1
algorithms.
These
on
times w i l l
the
this
instructions
The number o f c l o c k
register
branches
e x e c u t i o n time of the
f a c t o r was e s t i m a t e d
It
acquisition,
Self
to
s h o u l d be n o t e d operating an e n t i r e
r e q u i r e d was t o t a l l e d f r o m t h e
since other
to o b t a i n a time operations
a n d memory a c c e s s l a g compensator
extrapolated that
etc.
are
the
The flow
[32]. scaling,
required.
Based
program a c t u a l l y w r i t t e n , The l i n e s o f
e s t i m a t e s do n o t peripheral
machine
compensator
include
data
operations
system.
t u n i n g c o u l d be p e r f o r m e d
measurements have been o b t a i n e d .
s u c h as
from the w r i t t e n
i n t e r f a c i n g and o t h e r control
various
f o l l o w i n g manner.
to be a p p r o x i m a t e l y 5 . 5 .
c o d e r e q u i r e d was s i m i l a r l y
particular
estimates f o r the
c y c l e s was u s e d
n o t be p r e c i s e
tranfers,
program.
performance
These e s t i m a t e s were d e r i v e d i n the
number o f a r i t h m e t i c charts.
shows t h e
t o b e a TMS 9 9 0 0 w i t h a 3 M
i n a few s e c o n d s
after
I f d a t a were to be s t o r e d
open
loop
i n RAM,
it
Performance
Algorithm (Refer to Appendix)
A.l
A.2
A.3
B.l
B.2 C (Integral segments)
C (continued)
PID D
Compensator D
Estimates
E x e c u t i o n Time P r o b a b l e T o t a l (General) E x e c u t i o n Time [ms] [ms]
4+6.25/ iteration
28
1025
6
600
28
800
6
1.5+6.5/ iteration
4/knot +(.3/ data)N + 2/ s p l i n e inter-r val
.25+1.5/data l+30h(.15) per half period
Lines of Machine Code
358
625
1,500
175
N/A
. 50
12
920
4
Comments and Assumptions 3 iterations for convergence
One s t e p
4 . iterations for convergence N=# o f t i m e s of smoothing 10 k n o t s , 9 spline interv a l s , 1000 p t s . of d a t a , N=l 1000 d a t a
pts.
h=# o f s a m p l e s per i n t e g r a l segment test with signals
.5/data
N/A
50
done e v e r y Sample
.5/data
N/A
50
done e v e r y Sample
Table
5.1
3
c o u l d be sampled i n t i m e i n c r e m e n t s A typical so t h a t than
the
actual
short
P I D c o n t r o l l e r may u s e control part
is
assumed
that
16 b i t
attractive
a p p r o x i m a t e l y 100
is
and B . 2
integer
i n a yP.
data
i s acceptable.
a 16 b i t
Increasing
both execution time
A d m i t t a b l y u s i n g a TMS 9900 makes
because i t
ys.
o f a p r o g r a m w o u l d be s l i g h t l y l o n g e r
p r e c i s i o n would s i g n i f i c a n t l y i n c r e a s e
memory r e q u i r e m e n t .
as
algorithms A . 2 , B . l
1 K w h i c h can be e a s i l y accommodated It
the
adaptive
as
and
implementation
machine w i t h hardware
multiply
and
divide. To s e e how t h i s
has
an e f f e c t ,
a c o m p a r i s o n c a n b e made w i t h
c o n t r o l l e r using a Motorola 6800[28]. This i s complement
a r i t h m e t i c was p e r f o r m e d
were s e l e c t e d controller the in
from the
u s i n g 16 b i t
computed r e s u l t
r e q u i r e d an average
software.
very
integers.
t o be an o u t p u t
When c o m p a r i n g t h i s
TMS 9900 i t
12
2's bits
to a D / A .
This
o f 7 ms t o p e r f o r m c a l c u l a t i o n s u s e d
c a n be seen
to the that
estimated
the
in
performed
execution time
for
tuning algorithms would
be
long. When d e s i g n i n g a yP c o n t r o l l e r ,
one t o u s e .
Since c o n t r o l l e r s
Many m i c r o p r o c e s s o r s order
are
t o make a c h o i c e
c h o i c e was t h e
question
time,
is
which
t h e y must
and I / O o p e r a t i o n s
be
efficiently.
a v a i l a b l e and many t r a d e o f f s w o u l d b e
The yP c h o s e n was t h e this
one i m p o r t a n t
operate i n r e a l
capable of doing numerical algorithms
for
machine.
PID a l g o r i t h m , m a i n l y b e c a u s e m u l t i p l i c a t i o n had t o be
u s i n g the
in
an 8 b i t
a PID
required
[1,29]. Texas Instruments
fact
that
TMS 9 9 0 0 .
The m a i n
i t was r e a d i l y a v a i l a b l e a n d h a s
good m o n i t o r i n g s y s t e m
(TIBUG)
f o r d e b u g g i n g and an a s s e m b l e r
8002 y P r o c e s s o r L a b ) .
Other advantages are
its
factor a
(Tektronix
16 b i t w o r d l e n g t h
giving
greater accuracy, software
5.2
and t h e h a r d w a r e
multiply
and d i v i d e .
c o m p l e x i t y and e x e c u t i o n t i m e a s m e n t i o n e d
Test
reduces
previously.
o f uP P r o g r a m s
Two p r o g r a m s w e r e w r i t t e n a n d r u n u s i n g o f f - l i n e was t h e
This
data.
l e a d - l a g compensation network mentioned p r e v i o u s l y .
was a p r o g r a m t o
compute t h e
integral
segments
(I
One p r o g r a m The
other
of eqn.(4.9))
for
WFPI. The c o m p e n s a t o r for
implementing the
be r e q u i r e d
to
test
p r o g r a m was u s e f u l
i n estimating
other
A data
it
algorithms.
in real
time.
the
requirements
a c q u i s i t i o n system would
An o f f - l i n e
t e s t was p e r f o r m e d
r u n n i n g a s i m u l a t i o n o f a servomotor u s i n g optimum s e t t i n g s by the
GGP a l g o r i t h m .
The s e r v o m o t o r u s e d has
as
a time constant
by
determined of x
P
10 ms. A
The c o n t r o l p a r a m e t e r s u s e d x
= 0.9474
The s e r v o
,
A
2
= 0.7366
response
was
,
were A
3
=
0.3821
t h e n l o a d e d i n t o ROM.
The
compensator
program reads t h i s
data
A/D.
c o n t r o l l e r o u t p u t s w e r e l i s t e d i n RAM g i v i n g
The c o m p u t e d
results for
the
to
the
e v e r y 1 ms, i e a s i m u l a t e d s a m p l i n g from an
simulation results.
t e d by a 2nd o r d e r
tested
i n a s i m i l a r manner.
system s i m u l a t i o n w i t h n o i s e .
scaled hexadecimal integers
segments were computed by the
uP p r o g r a m .
method d e s c r i b e d data
i n Chapter 4.
since a data
It
was
D a t a was
The d a t a was
and l o a d e d i n t o ROM.
and phase t a n g e n t s were computed o f f - l i n e
cated)
responsible
differences.
The WFPI p r o g r a m was
into
T r u n c a t i o n e r r o r was
close
The
The c o r r e l a t i o n
generaconverted
integral functions
u s i n g t h e s e v a l u e s by
the
t e s t e d u s i n g 16 a n d 12 b i t
a c q u i s i t i o n s y s t e m c o u l d be t y p i c a l l y
12
(trunbits.
The
results
are
shown i n T a b l e
Truncation errors by
5.2.
due t o a p p r o x i m a t e r e p r e s e n t a t i o n
sums w e r e f o u n d t o b e s i g n i f i c a n t .
correct
for t h i s .
Given that
o b t a i n an i n t e g r a l segment, between 0 and H b e c a u s e
integrals
A s i m p l e t e c h n i q u e was u s e d
t h e r e are H samples
the
of
truncation error
each sample w i l l
t o b e summed of the
to
to
sum w i l l
h a v e a n e r r o r b e t w e e n 1.
be and
0.
S i n c e t r u n c a t i o n s h o u l d o n l y o c c u r f o r r o u n d i n g o f f d e c i m a l < O.5.,
the
average
can
b e done b y a d d i n g s H / 2 t o e a c h segment w h e r e s i s
integral One
truncation error
of the
sum w i l l
Hence, c o r r e c t i o n the
sign of
the
segment. can c o n c l u d e t h a t
it
is
feasible
and i d e n t i f i c a t i o n a l g o r i t h m s i n p r e s e n t (1979)
be H / 2 .
to
implement the
s t a t e of the
art
optimizing microprocessors.
Phase Tangents Determined w i t h the Actual
System P a r a m e t e r s :
Test input:
y =1, P
u=l,
-1,
Noise:
Case
Variance of
tan
TMS 9900
? =0.5, P 0
T , T
0.5
X,
±
2
+ b
3
(Appendix A . l )
80
A.3 GGP A l g o r i t h m F o r
Servomotor
Lead-Lag Network Compensation
For d e f i n i t i o n of v a r i a b l e s ,
g
Q
=
1 _ x
1
+
l
X
-2aX
see
+ 2a X
+ a X
2
3
2 3 X
X
Section
2
3
-
2 x
2.4
2a X_ + a + X X 3
T
l 3
x
"
1 X
Given
Y
2
, t
c
3
(Y
already
-a
=
s
Y
Choose i n i t i a l
2
2
- a
L
X
2 _ _
solved
c
2
X ^ ' ( a < X ^ < 2a)
4
for)
1
= Y
2
-
k
a
2
3
Y
X
aXi - a
+
2
+ X
2
2 x
1
2
- 2aXi+,
X
3
X
B = 2a X X 2
-B + / B = 2A
(A.3-1)
- a
l
C =
2
1
t f
-a X 2
X
2 4
2 1
X
2
- 4AC
2
(A.3-2)
X-
2a X 2
h X
= X
h
2
= -2aX
3
+
3
+ a X 2
- 2a X! + a
2
3
x
k
+ X X
Xi
1 2 X
1
'12
l
h
2aX h
2a X
a Xi 2
2
3
>22 x 2
3
'23
l 2
h
b
2a X3
X
>26
>25 »12 1 + 5
1 + 26
= 6
1
-