You are on page 1of 5

SIMULATION OF IRREGULAR MULTIRATE SYSTEMS

Carlos Mario Vlez S.


Julin Salt L.

Universidad EAFIT. Departamento de Ciencias Bsicas. Cra. 49 No. 7 sur 50.


Medelln, Colombia, cmvelez@eafit.edu.co
Universidad Politcnica de Valencia. Departamento de Ingeniera de Sistemas y
Automtica. 22012. E-46071. Valencia, Espaa, jsalt@isa.upv.es

Abstract: Functions for simulation of multirate control systems in MATLAB/SIMULINK


are presented. The basis of the tool is a general model that allows the modeling and
analysis of multirate systems with general irregular sampling. The following scenario is
considered: linear time -invariant representation, SISO and MIMO systems, regular and
irregular sampling schemes, arbitrary sampling policy. Copyright IFAC
Keywords: multirate, modeling, simulation, computer simulation, sampled-data systems

1.

INTRODUCTION

Over the last 43 years (Glasson, 1983; Araki, 1993)


diverse techniques have been proposed and used for
the analysis and design of multirate systems (Kranc,
1957; Araki, and Yamamoto, 1986; Araki, and
Hagiwara, 1986; Albertos, 1990; Meyer, 1990;
Apostolakis, and Jordan, 1991). A common feature in
these approaches is the representation by means of a
discrete linear time-invariant equation with a To
sampling period (frame-period), equal to the least
common multiple of all sampling periods in the
system, and contains more inputs and outputs than
the original system. Several authors (Meyer, 1990;
Longhi, 1994) have shown that this representation
preserves many of the properties of the original
multirate system (reachability, controllability,
observability, stability). In this paper, a generalization
of these methods and an implementation by means of
MATLAB/SIMULINK 5.3 (Mathworks, 1997)
functions are presented. The tools are illustrated with

one example. The following framework is considered:


linear time -invariant representation, application to
SISO and MIMO systems, regular (although each
variable can be sampled with an arbitrary period, this
is constant) and irregular (each variable is arbitrarily
sampled in irregular intervals; however, the sequence
is repeated each frame period To) sampling schemes,
arbitrary sampling policy.

2. IRREGULAR MULTIRATE MODEL


An irregular multirate system of order n with m inputs
and p outputs is considered. The system and
sampling scheme is shown in the Fig. 1 and Fig. 2,
respectively.

N = N1 + ... + N p

(7)

{ }

~
~
~
l j = l j , where l j is the length of each sampling

interval of input u j .

T~j T~j , 1
~
~ +1
l j =
, = 1, 2, ..., N
j
T

Fig. 1. Irregular multirate system

T~j 0 = 0 , T~j , N~ j +1 = T0 ,

~
N j +1

( 8)

~
lj = N

=1

li = {l i } , where

l i is the length of each sampling


interval of output yi .
li =

Fig. 2. Multirate sampling scheme

, = 1, 2, ..., N i + 1

Ti 0 = 0 , Ti , Ni +1 = T0 ,

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


To = NT

Ti Ti, 1

(9)

Ni +1

li = N

=1

(1)
The model for the continuous system is:

m is the number of inputs.

j = 1, 2 , 3,..., m

(2)

p is the number of outputs.

x& = A px + B pu

y = Cp x + D pu
where,

u = [u1 L u m ] , y = [y1 L yp ]
T

i = 1,2 , 3,..., p

(3)

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


N
j
period To.
Ni is the number of samples of output i in the frame
period To.
T~ j = {T~j }, where T~ j is the sampling times of input

signal u j .
(4)

N is the number of all samples of inputs in the frame


period To.

~ + ... + N
~
N =N
1
m

(5)

{ }

Ti = Ti , where Ti is the sampling times of

yi .
= 1, 2 ,..., N i

(6)

N is the number of samples of outputs in the frame


period To.

The continuous system must be controllable and


observable. The discrete model of the plant with base
sampling period T is:
x(( k + 1)T ) = Ax (kT ) + Bu(kT )

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


A = A (T ) = e
T

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

output signal

x = [x1 L xn ]

( 10 )

A pT

B = B(T ) = e

A p

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

( 11 )

C1
D1


C= M ,D= M
C p
D p

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


means of progressive substitutions, it is possible to
obtain the multirate model given in (12) - (18).

~
~
x(( k + 1)To ) = A x( kTo ) + B u D ( kTo )
D
~
~
y ( kTo ) = Cx ( kTo ) + Du D ( kTo )
Where,

( 12 )

1 ~
2 ~
A 1~
~ A
N
A=
, A=A
O
O
mxn
mxm
2 ~
2 ~
2~
A = A j , A j =1 b Dj0

( 13 )

[ ]

1~
~ B ~
B = 2 ~ , 1B =
B

=A

D
j

+1

l j

=1

[ B ],
1

D
j

B Dj = 1 b Dj

X ~l j , +1 B j

= B j

~
B=
b

D
jk

B Dj , 2 B Dj =

dim(x) = (n + m ) 1

( 14 )

[ b ],
2

D
jk

k = 1,2,..., N

~ ~
C , 1C = 1 CiD

D
i

[ ]
[ ]
1

[ ]

D
i

~
D = DijD , D Dij = d ijD,

C = c , c = CiA
2 ~
C = 2 C Di , 2 C Di = d ijD, 0
1

D
i

li
=1

dim(u D ) = N 1

dim(y ) = N 1
~
dim(A ) = (n + m ) (n + m )
~
dim(B) = (n + m ) N
~
~
dim(C ) = N (n + m) dim( D ) = N N
D

~
1, if k = N
=
=1
0, in other case

~
~
C = 1C

( 18 )

The sizes of the vectors and matrices are:

~
~
~
= A (To T j, +1 ) B j (T j , +1 T j, )
2

x1 (kTo )

x
(
kT
)

n
o
x D (kT0 ) =
~

u
((
k

1
)
T
+
T
~ )
0
1 ,N1
1

u m (( k 1)T0 + Tm ,N~m )

( 15 )

( 19 )

Features of the obtained multirate model method are:


It is possible to model multirate systems with
regular and irregular sampling schemes. See (Salt,
et al., 1993).
It is not necessary that the inputs and outputs
are synchronized for each global period (see Fig.
2).
The mo del is linear time-invariant.
It is able to consider arbitrary number of inputs
and outputs (SISO and MIMO systems).
~ ).
The representation is causal (see the form of D
The system is of minimal dimension.
Particular cases are easily derived.

~
l j , +1 1

d ij, = C i ij, ( q) B j + ij ,
q=0

A r , if r = q + l +1~
i l j 0
ij, (q ) =
=1
=1
0,
in othercase
ij,

3. MULTIRATE TOOLBOX

( 16 )

~
d ij , if 0 l i - l j < l j , +1
=

=
1
=1
0,
in othercase

u ( kT + T~ )
0
j1
j

u D (kT0 ) =
M

u j (kT0 + T j , N~ j )

M
M

y (kT + T )
0
i1
i

y D (kT0 ) =
M

y
(
kT
+
T
)
0
iN i
i

The following blocks were implemented in the toolbox


(as SIMULINK S-Functions). Other tools and ideas
have been implemented and presented by different
authors (Meyer, 1988; Thompson, 1988).
Irregular
Multirate
Compensator

Regular
Multirate
Compensator

Irregular
Multirate
Operator

( 17 )

Regular
Multirate
Operator

Kranc
Operator

Fig. 3. Multirate Toolbox Blocks


The results of multirate discretization can be obtained
in MATLAB Workspace. The blocks "Regular
Multirate Operator" and "Irregular Multirate
Operator" correspond to the models described in (12)
- (18). The blocks "Regular Multirate Compensator"
and "Irregular Multirate Compensator" allow for the

simulation of any multirate sample-data controller. In


the latter blocks it is only necessary to specify the
~ ,B
~ ,C
~ ,~
matrices [A
R
R
R D R ] and the sampling periods
(for regular or irregular cases). The multirate
~ ,B
~ ,C
~ ,D
~ ] is designed by some
compensator [A
R
R
R
R
method (Araki, and Yamamoto, 1986; Araki, and
Hagiwara, 1986; Hagiwara, an Araki, 1988; Albertos,
1990; Meyer, 1990; Godbout, et al, 1990; Apostolakis,
and Jordan, 1991). The blocks above were applied in
the simulation diagrams of Fig. 4 and Fig. 5. The
simulation implementation is easy and logical and
may be used with educational purposes. The
simulation is structured in a hybrid manner, which
allows for the examination of the intersample
behavior.

4. EXAMPLE

Continuous plant:
0
0
2.5

0 x + 10 1.2u

1
5 / 6
1
0
x
1

( 20 )

( 21 )

10 / 13 12 / 65
+
e
0
0

Irregular sampling scheme:


Input 1:
Input 2:
Output 1:
Output 2:

T~1 = [0 0.15 0.2 ]


T~2 = [0 0.15]
T1 = [0 0.15 0.2 ]
T2 = [0 0.15

Scope

Plant

Fig. 4. Simulation of a SISO Multirate System

1.34
Reference 1
Mux

Regular
Multirate
Operator

x' = Ax+Bu
y = Cx+Du

Demux

Mux
Scope

Plant

3.56
Reference 2

Fig. 5. Simulation of a MIMO Multirate System

T o = 0 . 3, T = 0 . 05
~
~
l1 = [3 1 2 ] , l2 = [3
l1 = [3

2 ] , l 2 = [3

3]
2

1]

The calculated multirate compensator, using the


exposed method, is:

Dynamic continuous compensator (Araki, and


Yamamoto, 1986; Apostolakis, and Jordan, 1991):
0
0 0
1 0

xc = 0 0
0 x c + 0 1e

1 0 2.5
0 0
0
20 / 13 6 / 13
u=
x

25
/
26
10
/
13
25
/ 52 c

Mux

1
0.5s2 +1.5s+1

~
~
N 1 = 3, N 2 = 2 , N 1 = 3, N 2 = 3, N = 5, N = 6

See now a specific application example: system with 2


inputs and 2 outputs (Araki, and Yamamoto, 1986;
Apostolakis, and Jordan, 1991).

2.5 0
x& = 0
2

0
0
4 1
y=
1 / 3 0

Regular
Multirate
Compensator

1
Reference

0.25]

Obviously, input and output sampling periods are


referred to the compensator.

0
0
1
~
AR = 0
1
0

0.2111 0 0 .4724
0 .05
0 .1
0
0.15
~
BR = 0
0
0
0.15

0.0256 0 .0054 0 .0046 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
.
2308
0
.
0769
0
.
7692
~
DR =
0
0
0
0.1394
0
0

0 .1341 0 .0464 0 .0475

0
0 .15

0 .1846
0
0 .0692 0 .1846

0 .0692 0 .2077

0
0
0 .1154
0

0 .1154 0 .0769

The simulation diagram is shown in Fig. 5. The results


of simulation are presented in Fig. 6 and Fig. 7 (see
the irregular sampling).

CONCLUSIONS
Useful functions for MATLAB/SIMULINK to analyze
multirate control systems were presented. A general
irregular multirate model was used to make
implementation and generalization easier. A detailed

account of these functions was presented in this


work. This model allows for the simulation of general
multirate systems. The good results of simulation
validate all functions. The designed blocks form a
nice and intuitive tool for the teaching and studying
of multirate systems. It is easy to implement other
possible modeling methodologies.
The authors work in the development of tools for
MATLAB/SIMULINK to make the design of multirate
compensators easier.

of Non-Conventional Sampled Data Systems .


Proc. of the 2nd IEEE Conference in Control
Applications, 631-635.
Thompson, P. M. (1986). Gain and phase margin of
multirate sampled-data feedback systems . Int. J. of
Control, 44, 833-846.
Thompson, P.M. (1988). In: Program CC Version 4:
Reference Manual, 566-585. Systems Technology
Inc, Hawthorne.

SYSTEM OUTPUTS
5

REFERENCES

4.5

Albertos, P. (1990). Block Multirate Input-Output


Model for Sampled-Data Control Systems . IEEE
Trans. on Autom. Control, 35, 1085-1088.
Apostolakis , I.S. and D. Jordan (1991). A time
invariant approach to multirate optimal regulator
design. Int. J. of Control, 53, 1233-1254.
Araki, M and K. Yamamoto (1986). Multivariable
multirate sampled-data s ystems: state-space
description, transfer characteristics, and Nyquist
criterion. IEEE Trans. on Control, 31, 145-154.
Araki, M. and T. Hagiwara (1986). Pole assigment by
multirate sampled-data output feedback. Int. J. of
Control, 44, 1661-1673.
Araki, M. (1993). Recent development in digital
control theory. Proc. 12th IFAC World Congr, 9,
951-960.
Glasson, D.P.(1983). Development and Applications
of Multirate Digital Control. Control System
Magazine , 6, 2-8.
Godbout, L.F., D. Jordan and I. S. Apostolakis (1990).
Closed-loop model for general multirate digital
control systems . IEE Proceedings, 137, 326-336.
Hagiwara, T. and M. Araki (1988). Design of a stable
feedback controller based on the multirate
sampling of the plant output. IEEE Trans. on Aut.
Control, 33, 812-819.
Kranc G. M. (1957). Input-output analisys of multirate
feedback systems. IRE Trans. on Aut. Control, 3,
21-28.
Longhi, S. (1994). Structural Properties of Multirate
Sampled-Data Systems. IEEE Trans. on Aut.
Control, 39, 692-696.
Mathworks (1997). In: Using SIMULINK Version 2.
Mathworks Inc, Natick.
Mathworks (1997). In: Using MATLAB Version 5.
Mathworks Inc, Natick.
Meyer, D. G.. (1988). Toward a new CAD method for
MIMO multirate digital controllers. Proc. of 27 th
Conf. on Dec. and Cont., 889-1891.
Meyer, D. G. (1990). A new class of shift-varying
operators, the shift -invariant equivalents and
multirate digital systems . IEEE Trans. on Aut.
Control, 35, 429-433.
Salt, J., P. Albertos. and J. Tornero (1993). Modeling

3.5

3
2.5
2
1.5
1
0.5
0

5
6
Time (second)

10

1.6

1.8

Fig. 6. System outputs


CONTROL SIGNALS
4

3.5

2.5

1.5

1
0.5

0
0

0.2

0.4

0.6

0.8
1
1.2
Time (second)

1.4

Fig. 7. Control signals.