Beruflich Dokumente
Kultur Dokumente
K. Minh Vu
Introduction
e(2-l)
Yr+r+i -- 6 ( z - 1 ) ur + 7
ar+f+l
&- 1
(1)
=kp(Yr-yr-l)+kiYr
+ k A Y r - ~ r - l
= (kp
p Y r - 1
+Y,-z)
+ ki + k d ) y t
+(-kp
- 2kd)Yt-l
+ kdyt-Z
or
(1 - Z - ' ) u , = ( k p
+ +
ki
kd)y,
+(-kp-2kd)yt-l
= l1Yr
+l
+ kdyr-Z
~ ~ t - 1I 3 Y r - z
= l(z - 1 ) y ,
--o ( 2 - I )
- qZ-i)
I &-')
$(z-i)
(z - 1) I(z - 1 ) z - f --o&-')
(1 - z - l )
-
ar+f+l
e(z - 1)
Yt+f+'
+& - l ) %+f+l
or
0,"
=
a(z - ')
B(Z-1) - y(z-l)z-f-ll(z-l)
cT[(A - HGk[l
O])V(A- HGk[l
01)'
where
=cT AVAT-
+ HGk[l
- HGk[[l
AV
[:I
+ ( q - p ) a : kTGTHT
O]V[:]k'cTHT
01 VAT + (4 - P)~cT,']
A V A T + [q - p ] [ q - p y a :
=[-a x -;][;I
1
k,
= Gk
+ bat
+ a,
y, = CTX,
with
A] +
A v[
zn01] - H G k [ l
A* = [ q
0 ... 0)
HGk -
(4 - P)d
=o
+ c1 01v[:]
0,'
= A
HGk[l
[q - p
HGk]
0 ... 01 = [l
c T = [l
01
01
v = E{x,xT}
= A*
VA*T + bbTo,'
.,"
+ 0:
and therefore
(7,"
32
= CT[A*VA*T
+ bb=a:]c + 6,'
(3)
vo = c4
PIC4 - P I T d
+ (q -p)o,']
C-'[HTH]'HTpV,,[i]
k,
YSP, = (1 - z-1)2
r.1
YSPr = (1 - z -
"[Av,[i] +
G- 1 [ H T - ~
k, =
0,'
+ c1
a,
1 - bz-')
Examples
(4- p).:]
(6)
;]
'
01vt[
y,
0.168
1 - 0.9082-
+ (1 - z-')(1
Vr+, = Vr
=v
1
- 0.32-' - 0 . 1 7 ~ - ~")
4 z - l ) = 0.168
6(z-') = 1 - 0 . 9 0 8 ~ ~ '
e(z-1) = 1
$(z-') = 1 - 1.3z-l
3
f=O
42--
+ 0.908~-'
+ 3.5184~-' - 1.25844zY3
- 0.20632~-~
+ O.15436zY5
.(z-') = 1 - 1.9082-'
@ ( z - ' ) = 1 - 3.2082-'
~ ( z - '=
) 0.168 - 0.21842-'
+ 0.02184~-~+ 0.02856~-~
Therefore
U,
and
'1
6(z-')
+ 0.13~-' + O.17zY3
+f + 1. The
3.208
- 3.5 184
P=
1.25844
0.20632
- 0.15436
- 0
0
0
0
- Y S P ~ + / +=~~ : + f + l
-4z-l)
- 6(z- 1) U, - Y S P t + f + 1
-
-0.168
0.2184
-0.02184
H=
-0.02856
0
- 0
a,
sYm
IEE PROCEEDINGS-D, Vol. 139, NO. I , J A N U A R Y 1992
0
0
-0.168
0.2184
-0.02184
-0.02856
0.0588
V=
0
-0.168
0.2184
-0.02184
- 0.02856
0
-0.0539
0.0519
-0.0022
0.0017
0.0006
-0.0016
0.0006
0.0002
0.0005
-0.0008
-0.0000
-0.0001
0.0002
0.0005
-0.0002
-0.0002
-0.ooO1
-0.oooO
0.0002
O.OOO4
33
[;I=[
I;;]
Yt =
with
0
:
= 0.168
6(z-')
6(z- ')
o(z-1) =
1 - 0.821 - 0.22-'
e(z-1) = 1 - 0.22-'
+
/3(z-') = 1 - 2.12-' + 1.34zY2 - 0 . 2 4 ~ - ~
y(z- ') = 0.25 - 0.0752- '
a(z-') = 1 - 2 . 0 ~ ~ '1.16z-' - 0 . 1 6 ~ - ~
4(z-') = 1 - 2 - 1
f=O
The minimum variance controller for this system
obtained by the method of Box and Jenkins [lo] is
= -
at
f=O
1 - 0.908~-'
(1 - . - ' ) U t
+ 1 - 0.32-'
+ ( z - ' ) = 1 - 0.32-'
O(Z-')
= 2.0.
1 - 0.22-'
Ut-1
o ( z - ') = 0.250
1 - 0.22-'
+ 1 - z - l at
't-1
0:
0.250
1 - o.*z-'
Therefore
2.000
2.100
Yt
0.8
c v t - 0.908Yt- 1)
0.168
= --
-0.250
0.075
= 1 - 2.9082-'
~ ( 2 - l )= 0.168
+ 1 . 2 8 9 6 ~ --~ 0 . 1 8 1 6 ~ - ~
+2 . 8 1 6 ~ ~0.908zY3
~
- 0.168z-'
0.1420
Therefore
2.108
0
-0.250
v=[
2.908
sym.
-0.1375
0.0219 0
0.1343 -0.0213 0
0.0036 0
0.0002
-0.168
0.168
0
-0.168
0.168
0
0
-0.1156
-0.168
1.161
Y x 1.OE10
0.0500
- 0.0956
0.1228
0.0456
-0.0871
0.04 15
sym.
with the gains and feedback output variance as
Conclusion
References
Appendix
.........................................
Module:
main( )
Description:
This module reads in the system parameters and set up the right system vectors and matrices, then it
solves the Riccati equation and calculate the PID controller gains.
Author:
K. M. Vu
9-May-91
.........................................
#include
#include
#include
#include
#include
(c:\tc\stdio.h)
(c:\tc\stdlib.h)
(c:\tc\math.h)
(c:\tc\malloc.h)
(c:\tc\nrutil.c)
#define NDIMS 20
int
i, j, 1;
int
ndelay ;
int
nomega;
int
ndelta;
int
nphi;
int
ntheta;
int
n;
int
inter;
int
mvflag;
int
maxiter = 500;
float omegamDIMS] ;
float delta[NDIMS] ;
float phi[NDIMS] ;
float theta[NDIMS];
float var;
float alpha[NDIMS] ;
float betamDIMS];
float gamma[NDIMS];
float ppD1MS-J;
float q[NDIMS];
float h[NDIMS][3];
float k[3];
float ht[3][NDIMS];
float hth[3][3];
float hthinv[3][3];
float hthinvht[3][NDIMS] ;
float ginvhthinvnt[3][NDIMS];
float hg[NDIMS][3];
float hgk[NDIMS];
float a[NDIMS][NDIMS];
float astar[NDIMS][NDIMS];
float astart[NDIMS][NDIMS];
float astarvmDIMS][NDIMS];
float vt[NDIMS][NDIMS];
float vtl[NDIMS][NDIMS];
/* Do loop counters */
/* Pure delay in the system */
/* Number of zeros of the transfer function */
/* Number of poles of the transfer function */
/* The autoregressive order */
/* The moving average order */
/* The resulting order of the time series e/
/* The iteration number */
/* The minimum variance controller flag */
/* The maximum iteration number allowable */
/* The polynomial of the zeros */
/* The polynomial of the poles */
/* The autoregressive polynomial */
/* The moving average polynomial */
/* The variance of the white noise */
/* The resulting time series polynomial */
/* The resulting time series polynomial */
/* The resulting time series polynomial */
/*The p vector */
/* The q vector */
/* The h matrix */
/* The controller gain vector */
/* Working matrix */
/* Working matrix */
/* Working matrix */
/* Working matrix */
/* Working matrix */
/* Working matrix */
/* Working matrix */
/* The Riccati equation matrix */
/* The Riccati equation matrix */
/* The Riccati equation matrix */
/* The Riccati equation matrix */
/* The Riccati equation matrix */
/* The Riccati equation matrix */
35
printf("Enter the delay period not counting the discretization one : ");
scanf("%d", &delay);
printf("Enter the autoregressive order of the disturbance : ");
scanf("%d", &nphi);
for (i=O; i c n p h i ; i + +)
gamma[i] = 0;
for ( j =O; j e i ; j + +) gamma[i]
for (i =O;
+
+
+ = delta[j]*theta[i-j];
iendelta + ntheta + 1; i + +)
alpha[i] =0;
for (j =O; j e l ; j + +) alpha[i]
+ = gamma[i-j]*difflj];
36
gamma[i] = 0;
if (iendelta + ntheta + 1) p[i] = - alpha[i
/* Form vector q */
for (i=O; irndelta+nphi; i t +)
{
gamma[i] = 0;
for (j =O; j e i ; j + +) gammaci]
I
for(i=O;iendelta+nphi+l;i+
1
beta[i] = 0;
for (j=O; j e l ; j + +) betari]
}
for (i=O; i < n ; i + +)
{
gamma[i] =O;
if (iendelta + nphi + 1) q[i]
+ = delta[j]*phi[i-j];
+)
+ = gamma[i-j]*dim];
- - beta[i
/* Form matrix h */
for (i=O; ienomega+nphi; i + +)
fI
gamma[i] = 0;
for (j =O; j e i ; j + +) gamma[i]
+ = omega[j]*phi[i-j];
for ( i = O ; i < n ; i + +)
{
h[i][O] =O;
if (i > = ndelay&&i < = n - ndelay - 2) h[i] CO] = - gamma[i - ndelay] ;
for (i=O; i t n ; i t +)
{
for (j = 1; j < 3 ; j + +)
h[i]u] =O;
if (i >0) h[i][j]
/*
*/
/* Form matrix A */
for (i=O; i < n ; i + +)
{
for ( j =O; j t n ; j +)
a[i]Q] = 0;
i f ( j = =0) a[i][j]=q[i];
i f ( j = =i+l)a[i][j]=l;
if (j ! = 0) astar[i][j] = aril[ j] ;
for (i=O;i<3;i+ +)
{
foro =O;j < 3;j +)
r
hth[i][j] = O ;
for (l=O;l<n;l+ +) hth[i][j]+
hthinv[i][j] = hth[i][j];
=ht[i][l]*h[l][j];
31
I
I/* Now compute the inverse of the Cholesky triangle */
for (1=0; k 3 ; 1+ +)
if (j = =1)
hthinv[l][j] = l,O/hthinv[l][l] ;
else
sum=0;
for (i=j; i < l ; i + +)sum- =hthinv[l][i]*hthinv[i]Cj];
hthinv[l] [j] = sum/hthinv[l] [l] ;
sum =0;
for (i=l; i < 3 ; i + + ) s u m + =hthinv[i][l]*hthinv[i][j];
hthinv[l][j] =sum;
hthinv[j][l] = hthinv[l][j];
for (i=O;i<3;i+ +)
for(j=O;j<n;j+ +)
qinvhthinvht[i][j] =0;
for (1=0;1<3;1+ +) ginvhthinvht[i][j]
+ =ginv[i][l]*hthinvht[l][j];
for (i=O;i<n;i+ +)
for(j=O;j<3;j+ +)
{
M i l [Jl= 0 ;
for (1=0;1<3;1+ +) hg[i][j]+
=h[i][l]*g[l][j];
1
*/
IEE PROCEEDINGS-D, Vol. 139, N O . 1, J A N U A R Y 1992
k[j] =O;
for (I=O;l<n;l+ +) k[j]
+ =ginvhthinvht[j][l]*(q[l]
for (i=O;i<n;i+ +)
{
hgk[i] = 0;
for (1=0;1<3;1+ +) hgk[i]
-p[I]);
+ =hg[i][I]*k[I];
mvflag = 0;
+ +) avl[j] =av[j][O]
+ +)
+(q[j] -p[j])*var;
k[j] =O;
for (1=0;l<n;l+ +) k[j]
k[j]/=var+vt[O][O];
+ =ginvhthinvht[j][l]*avl[ll;
hgk[i] =O;
for (1=0;1<3;1+ +) hgk[i]+ =hg[i][l]*k[l];
b-sq =0 ;
for(j=O;j<n;j+ +)
{
astar[j][Ol =q[J] - hgkCj1;
b[jl= qCjl - PCJI- hgkCj1;
b-sq
= b[j]*b[j];
for (l=O;l<n;l+ +)
bbtfi][l] = b[j]*b[I]*var;
astart[j][l] =astar[l][j];
39
astarv[i][j] =O;
for (1=0;l<n;l+ +) astarv[i][j]
+ =astar[i][l]*vt[l][j];
vtl-sq =o;
for (i=O;i<n;i+ +)
{
for (j =O;j < n ; j +)
vtl[i][j] = bbt[i][j];
for (1=0;l<n;l+ +) vtl[i][j] + =astarv[i][l]*astart[l][j];
vt 1-sq + = vt 1[i]fi]*vt 1[i] E] ;
I*
=fabs(vt 1-sq
vt-sq) / vt-sq;
*/
for (i=O;i<n;i+ +)
{
for (j =O;j <n;i +) printf(Y08.4f,vt[i]b]);
printf(\n) ;
printf(\n) ;
/* Update iteration parameters */
iter+ = 1;
vt-sq = vt 1-sq;
for(j=O;j<n;j+ +)
1
I
else if(mvflag)
else
{
printf(\nFail to converge after %d iterations\n,iter);