Sei sulla pagina 1di 7

SIMULATION OF MULTIRATE CONTROL SYSTEMS IN

MATLAB/SIMULINK
Carlos M. Vlez S.
Universidad EAFIT. Departamento de Ciencias Bsicas. Cra. 49 No. 7 sur 50. Medelln, Colombia.
E- mail: cmvelez@eafit.edu.co
Julin Salt
Universidad Politcnica de Valencia. Departamento de Ingeniera de Sistemas y Automtica. 22012. E46071. Valencia, Espaa. E- mail: jsalt@isa.upv.es

Abstract - In the work are presented some tools for


simulation of SISO and MIMO multirate control
systems in MATLAB/SIMULINK 5.2. The tools are
illustrated with an example. In the toolbox are
designed functions to Kranc (cases SISO and MIMO)
and Araki-Yamamoto modeling methodologies.
Nevertheless, the functions can be extended to other
cases. It is consider the following cases: linear time invariant representation, SISO and MIMO systems,
regular and irregular sampling schemes, arbitrary
sampling policy.
Index Terms - Matlab/Simulink Toolbox, multirate
modeling, sampled-data systems.

Yamamoto modeling methodologies. Nevertheless, the


functions can be extended to other cases. It is consider the
following cases: linear time-invariant representation,
application to SISO and MIMO systems, regular (that is,
although each variable can be sampled with an arbitrary
period, this is constant) and irregular (that is, each
variable is arbitrary sampled in irregular intervals;
however, the sequence is repeated each frame period To )
sampling schemes, arbitrary sampling policy. It is
presented a generalization of the previously mentioned
results to the case of MIMO MR systems with irregular
sampling periods. From this model can be deduced other
models and cases.

2.
1.

MULTIRATE MODEL

INTRODUCTION

Over the last 40 years diverse techniques have been


proposed (see [7], [8]) and used for the analysis and
design of multirate systems (MR). Frequencial and
temporal methods were proposed: Kranc ([12], [19], [20]),
Araki et al ([4], [5], [6], [10], [11]), Godbout et al
([3],[9]), Meyer ([13], [14]), Longhi [21], Salt ([15], [16],
[17]), Albertos ([1], [2]). A common fact in these
approaches is the representation by means of a linear
time-invariant state equation of the MR system. The
equation is given to a To period (frame-period), even to
the least common multiple of all sampling periods in the
system and contains more inputs and outputs that the
original system. Several authors have shown that this
representation preserves many of the properties of the
original MR system (reachability, controllability,
observability, stability).
In this work are presented some tools for simulation of
SISO and MIMO multirate control systems in
MATLAB/SIMULINK 5.2. ([18], [22]). The tools are
illustrated with examples. In the toolbox are designed
functions to Kranc (cases SISO and MIMO) and Araki-

An irregular multirate system of order n with m inputs and


p outputs will be considered. The sampling scheme is
shown in the Figure 1.

Figure 1 Irregular multirate sample

T is the base period and To is the frame period.

T o = NT

(1)

~
T j are the sampling instants of input signal j. For the

x( k + 1)T ) = Ax(kT ) + Bu ( kT )

y( kT) = Cx( kT) + Du( kT)

case of regular sample:

A = A(T ) = e

~
T~j = ( 1)T~j , = 1,2,..., N j

(2)

B = B (T ) = e

~
N j is the number of samples of input j in the frame period

C1

C= M ,D=
C p

(3)

Ti are the sampling instants of output signal i. For the


case of regular sample:

Ti = ( 1)Ti , = 1,2,..., N i

Where
(5)

(Figure1).
~
Nj

~l
=1

=N

(6)

~
A = AN
~
B = B 1D
~ = CD
C

D
2

D
m

D
2

D T
p

D
ij

D
ij

b
(7)

The model of continuous system is:

(8)

u = [u1 L um ] , y = y1 L y p , x = [x1 L xn ]
T

D
i

( 11 )

D
i

D
ij ,

D
j

=A

l j
~

=1

l i
X~l j B j , c = Ci A =1
D
i

l j 1

dijD, = Ci ij , ( q) B j + ij ,
q =0

1
1
r
~ ~
A , if r = q + li l j lj 0
ij , (q) =
=1
=1
0
in other cases

1
1

~
~
dij , if 0 li lj < l j
ij , =
=1
=1
0
in other cases

l i .

x& = A p x + B pu

y = Cp x + D pu
where,

D
j

~
~
~
~ T j ( 1)T j T j ~
l j =
=
= lj
T
T
Even is defined

D
j

Definition of factors in the equation (11):

For the regular sample:

( 10 )

[ B L B ], B = [b ]
[ C L C ] , C = [c ]
~
D = [D ] , D = [d
]

~
l j is the dimension of each sampling interval of input j
~
~
T j , + 1 T j
~
,
l j =
T

(9)

D1

M
D p

~
~
x((k + 1)To ) = A
x( kTo ) + Bu D ( kTo )
D
~
~
y ( kTo ) = Cx( kTo ) + Du D ( kTo )

Ni is the number of samples of output i in the frame period


To .

Ti1 = 0 , Ti , N i +1

B p d , B = [B1 L B m ],

These matrices A, B, C, D have the proper dimensions. By


mean of progressive substitutions, it is possible to obtain
the following MR model:

(4)

= To , N = N1 + ... + N p

Ap

To .

~
~
T j 1 = 0 , T j , N~ +1 = To , N = N~1 + ... + N~ m

ApT

( 12 )

The matrices in (10) have the following form:

x(kT) = [ x1(kTo ) x2(kTo) L xn(kTo)]


T
~
~
~
uD(kTo) = u1(kTo + T11) u1(kTo +T12) L u1(kTo + T1N~1 ) | L (13 )
T

It is considered that the continuous system is controllable


and observable. The discrete model of the plant to base
period T is:

[
y (kT) = [ y (kT +T )
D

~
T11 = T11 = 0

11

y1(kTo + T12) L y1(kTo + T1N1 )

]
| L]

To ~
T
, N j = ~o
Ti
Tj
~
~
N = l.c.m.( N1,...,N m , N1 ,...,N p )

The dimensions of the vectors and matrices are:

dim(x) = n 1
dim(u D ) = N 1
dim(y D ) = N 1

~
dim(A ) = n n
~
dim(B) = n N
~
dim(C) = N n
~
dim(D) = N N

To = NT , N i =

( 14 )

N ~
N
~
, l j = ~ , Ti = liTo , T~j = l jTo
Ni
Nj
N = N1 + ... + N p , N = N~1 + ... + N~m

li =

i = 1, 2,..., p , j = 1, 2,...,m

Features of obtained multirate model methodology:

~
= 1, 2,...,N i , = 1, 2,...,N j

It is possible to model multirate systems with regular


and irregular sampled schemes.
Linear time-invariant representation.
It is able to consider arbitrary number of inputs and
outputs (SISO and MIMO systems).
~
Causal representation (see the form of D ).
System of minimal dimension.
Easy deduction of particular cases.

Actually a methodology for modeling systems with


different sampling sequences has been exposed. It is
possible to connect subsystems with different sampling
policies in order to get a proper simulation model in these
difficult cases.

4.

DEDUCTION OF OTHER PARTICULAR CASES

4.1. ZOH Kranc SISO Model


The following case is considered:

~
~
m = p = 1 , n = N1 = To /T1 , N1 = To /T1
~)
k = N = l.c.m.( N , N
1

~
A = Ak ,
b =A

DEDUCTION OF REGULAR MULTIRATE CASE

From general model (10) it is possible to obtain particular


cases easily (MRIC, MROC, Kranc). For the case of
regular multirate sample the matrices in model (10) take
the following form:

bDj = A

~
N l j

ciD = Ci A

X ~l j B j , X ~l j = I + ...+ A

( 1) li
~

(15)

D
ij ,

See Thompson [19], Meyer [14], Longhi [21] for similar


expressions.
Definition of parameters in the equation (15):

[ ] [ ]

~
B = B1D = b 1D , = 1, 2,...,m

( m 1) k / m

XB,

X = I + ...+ A k / m1

k / m1
~
D
D = D11
= d11D, = C
q =0

[ ] [

( 17 )

(q) B +

4.2. MRIC (Multirate Input Control) Model


A more general case that the model is the following: all
the outputs are measured to the same To period, but each
~
~
input is sampled to a period T j = To / N j . Here,

~
l j 1

l j 1

d
= Ci ij , (q) B j + ij ,
q= 0

~
A r if r = q + ( 1)li ( 1)~
l j lj 0
ij , (q) =
in othercases
0
~ ~
d if 0 ( 1)li ( 1) l j < l j
ij , = ij
in othercases
0

The model is:

D
1

3.

( 16 )

~
~ , = 1,2,..., N~
N i = 1, li = N , N~ j = T o / T~j , l j = N / N
j
j
~
~
N = p, N = N 1 + ... + N m
The model is:

Nj m

x
((
k
+
1
)
T
)
=
A
(
T
)
x
(
kT
)
+
Bj (T~j )u j ( kTo + ( 1)T~j )

o
o
o

=1 j =1
y (kT ) = Cx(kT )

o
o

5.

MULTIRATE TOOLBOX

In the toolbox was implemented the following blocks (as


SIMULINK S-Functions):

(increment
s of B)

Nj m

x
((
k
+
1
)
T
)
=
A
(
T
)
x
(
kT
)
+

Bj (To ( 1)T~j )uj (kTo )


o
o
o

=1 j =1
(18)
y (kT ) = Cx(kT )

o
o

(increment
s of inputs)
with
Bij (T~j ) = A(T~j ) N B j (T~j ) = B j (To ( 1)T~j ) B j (To T~j )
and
u j (kTo) , if = 1
uj =
~
~
u j (kTo ( 1)Tj ) u j (kTo ( 2)Tj ), in othercases

Kranc
Operator

Araki-Yamamoto
Operator

Regular Compact
Operator

Irregular Compact
Operator

Regular Multirate
System

Irregular
Multirate System

Figure 2 Multirate Toolbox Blocks

4.3. MROC (Multirate Output Control) Model


The results of multirate discretization can be obtained too
in MATLAB Workspace. The blocks "Regular Compact
Operator" and "Irregular Compact Operator" correspond
to the models described in (10) - (15). The blocks
"Regular Multirate System" and "Irregular Multirate
System" allow the simulation of any multirate controller.
In they only is necessary specify the matrixes
~ ,B
~ ,C
~ ,D
~ ] and the sampling periods (for regular
[A
R
R
R
R
or irregular cases). In the following simulation diagrams
are applied the above blocks. The implementation of
simulation is easy and logical . The simulation is
structured in an hybrid manner, that allow examine the
intersample behavior.

Now, the following case is considered:

~
Ti = To /N i , T j = To
~
~
N i = To /Ti , N j = 1 , li = N / N i , l j = N
= 1,2,..., N , = 1
The model is:

x(( k + 1)To ) = A(T o ) x( kTo ) + B(To )u (kTo )


D
~
~
y ( kTo ) = Cx( kTo ) + (L 1CB + L 2 D)u (kTo )
where,

L1

and

0
X
li
= diag block
M
i = 1 , 2 ,..., p

X l i

1
1

1
= 0

0
M

0
M

0
0
M

0
0
M

0
1
1

0
0
0

M
1
M

M
0
M

0
0
M
X li
L
L
L
L
L
L
M

L
O
L

0
M
X li

0
0
M

Reference

+ ... + N

) (N

dim( L 2 ) = ( N

+ ... + N

) p

+ ... + N

s 2+2s+0.75

Regulator

Plant

Scope

Figure 3 Simulation Diagram of a SISO Multirate


System

0
0
M

0
0

0
M

0
M

dim( L 1 ) = ( N

Kranc
Operator

Figure 4 Simulation Diagram of a MIMO Multirate System


Some dialog boxes:

6.

EXAMPLE

See now a specific application example: system with 2


inputs and 2 outputs ([4], [9]).
Model of continuous plant:

0
0
2.5 0
2.5
4 1 0

x= 0
2 0 x + 10 1.2 y =
x

1 / 3 0 1
0

0 1
1
5 / 6

Dynamic continuous compensator:

0
0 0
1 0

xc = 0 0
0 x c + 0 1 e

1 0 2. 5
0 0
6 / 13
0
20 / 13
10 / 13 12 / 65
u =
xc +
e

0
25 / 26 10 / 13 25 / 52
0

Sampling scheme:
Input 1:
Input 2:
Output 1:
Output 2:

T~1 = [0
T~2 = [0
T1 = [0
T 2 = [0

Figure 5 Diagram of simulation

0. 15 0.2]
0.15]
0. 15 0.2]
0.15 0.25]

In Figure 6 the results of simulation are shown (see the


irregular sampling).

SYSTEM OUTPUTS

Obviously, input and output sampling periods are referred


to the compensator.

5
4.5

~ = 3, N~ = 2, N = 3, N = 3, N = 5, N = 6
N
1
2
1
2
T o = 0. 3, T = 0.05
~
l1 = [3 1 2], ~
l2 = [3 3], l1 = [3 1 2], l 2 = [3 2 1]
Using (10-(12) the calculate multirate compensator is:

4
3.5
3
2.5
2
1.5

0
0
1
~

AR =
0
1
0

0. 2111 0 0.4724

1
0.5
0

0. 05
0.1
0
0
0. 15
~

BR =
0
0
0
0. 15 0. 15

0. 0256 0. 0054 0. 0046 0


0
0
1. 5385 0. 4615
1. 5385 0. 4615
0

1. 5385 0. 4615
0
~
CR =

0. 9615 0.7692 0.4808


0.9014 0.7692 0.3304

0.8722 0.7692 0. 2573


0
0
0.7692
0. 2308
0. 7692
0

0. 0769
0. 7692
~ = 0. 2308
D

R
0
0
0

0. 1394
0
0

0.1341 0. 0464 0. 0475

0. 1846
0
0. 0692 0. 1846

0. 0692 0.2077

0
0
0. 1154
0

0. 1154 0. 0769

5
6
Time (second)

1.4

1.6

1.8

10

CONTROL SIGNAL
4
3.5
3
2.5

2
1.5
1
0.5
0

0.2

0.4

0.6

0.8
1
1.2
Time (second)

Figure 6 Results of simulation

CONCLUSIONS
Useful functions for MATLAB/SIMULINK to analysis of
multirate control systems were presented. Particularly, the
toolbox contain functions that implement Kranc Operator,
Araki-Yamamoto Operator, Regular Compact Operator
and Irregular Compact Operator. To facility the design, a
general irregular multirate model were used, which was
detailed presented in work. This model allow the
simulation of other cases exposed in the literature.
The good results of simulation validate all functions.
The tool represent a nice and intuitive path to study
multirate systems. It is easy to implement other possible
modeling methodologies.
The authors work in the development of tools to
MATLAB/SIMULINK to facility the design of multirate
compensators.

REFERENCES
[1] Albertos, P., "Block Multirate Input-Output Model
for Sampled-Data Control Systems", IEEE Trans. on
Autom. Control, vol. 35, No. 9, pp. 1085-1088, 1990.
[2] Albertos P., Salt J. ,Tornero J., Dual-rate adaptive
control, Automatica, vol. 32, 1996.
[3] Apostolakis I.S., Jordan D., A time invariant
approach to multirate optimal regulator design, Int. J.
of Control, vol. 53, pp. 1233-1254, 1991.
[4] Araki M, Yamamoto K., Multivariable multirate
sampled-data systems: state-space description,
transfer characteristics, and Nyquist criterion,. IEEE
Trans. on Control, vol. 31, pp. 145-154, 1986.
[5] Araki M., Hagiwara T., Pole assigment by multirate
sampled-data output feedback, International Journal
of Control, No. 44, pp. 1661-1673, 1986.
[6] Araki M., Hagiwara T., Soma H., Application of
multilevel sampled-data controllers to simultaneous
pole assigment problem, Proc. of 31th Conf. on Dec.
And Cont., pp. 1762-1767, 1992.
[7] Araki, M., Recent development in digital control
theory, Proc. 12th IFAC World Congr., vol. .9, pp.
951-960, 1993.
[8] Glasson D. P., Development and Applications of
Multirate Digital Control, Control System Magazine,
pp. 2-8, 1983.
[9] Godbout L.F., Jordan D., Apostolakis I.S., Closedloop model for general multirate digital control
systems, IEE Proceedings, vol. 137, pp. 326-336,
1990.
[10] Hagiwara T., Araki M.,Design of a stable feedback
controller based on the multirate sampling of the plant

output, IEEE Trans. on Aut. Contr. Vol. 33, pp. 812819, 1988.
[11] Hagiwara T., Fujimura T., Araki M., Generalized
multirate-output controllers, Int. J. Control, vol. 52,
No.3, pp. 597-612, 1990.
[12] Kranc G.M., "Input-output analisys of multirate
feedback systems", IRE Trans. On Aut. Cont., PGAC3, Vol 3, pp. 21-28, 1957.
[13] Meyer D., Toward a new CAD method for MIMO
multirate digital controllers, Proc. Of 27th Conf. On
Dec. And Cont., pp. 889-1891, 1988.
[14] Meyer D.G., A new class of shift-varying operators,
the shift-invariant equivalents and multirate digital
systems, IEEE Trans. On Aut. Cont., vol. 35, pp.
429-433, 1990.
[15] Salt J., Control de Procesos con Muestreo NoConvencional, Tesis Doctoral, DISCA, Universidad
Politcnica de Valencia, 1992.
[16] Salt J., Albertos P., Tornero J., Modeling of NonConventional Sampled Data Systems, Proceedings of
the 2nd IEEE Conference in Control Applications, pp.
631-635, 1993.
[17] Salt J., Albertos P., Tornero J., Digital Control
Improvement by Multirate Control, Proceedings of
the 3rd IEEE Conference in Control Applications,
Glasgow (U.K.), vol. 2, pp. 1459-1464, 1994.
[18] "Using SIMULINK Version 2", Mathworks Inc,
1997.
[19] Thompson P.M., Gain and phase margin of multirate
sampled-data feedback systems, Int. J. Control, vol.
44, pp. 833-846, 1986.
[20] Thompson P.M. (1988), Program CC Version 4:
Reference
Manual,
Hawthorne,
Systems
Technology, Inc. , Vol. II, pp. 566-585, 1988.
[21] Longhi S., "Structural Properties of Multirate
Sampled-Data Systems", IEEE Trans. on Control,
vol.39, No.3, March 1994
[22] "Using MATLAB Version 5", Mathworks Inc, 1997.

Potrebbero piacerti anche