Content uploaded by Volodymyr Moroz

Author content

All content in this area was uploaded by Volodymyr Moroz on Jan 01, 2016

Content may be subject to copyright.

High-Speed Precise Simulation

Using Modified Z-Transform

Volodymyr I. Moroz

Abstract – Equations for modelling of the elementary

dynamic blocks based on the modified z-transform for

the high-speed precise computer simulation are de-

scribed in this paper.

I. INTRODUCTION

The object-oriented computer simulation is based

on the principle that complete model can be con-

structed from the some simpler subsystems. That prin-

ciple can be extended in order to create a whole mod-

eled system from the simplest elementary blocks.

Similar approach is used in widely known simulation

environments such as Simulink (MathWorks, Inc.) but

applied numeric methods for simulation have more

than 30-year history [2]. This fact produces some

problems during computer simulation of impulse and

discrete systems because the traditional numeric meth-

ods used for ordinary differential equations (ODE) ap-

proximate the solving function by the limited Taylor

series and are useful only for "smooth" solutions.

The modern electric drives are constructed usually

under pulse-width modulation (PWM) principle and

uses the power semiconductor switches (such as

IGBT-transistors). Their models are unsuitable for

solving when the classic numeric methods for ODEs

are used because their solutions have singular pointes.

The other way of simulation is "semi-analytic"

methods usage that produce the sufficiently simple but

efficient model equations. For example, z-transform

can generate simple high-speed and precise model

equations [4]. This approach is rather rarely used now

because it needs additional analytic preparation before

computer simulation. The increasing computer power

and modern simulation environments, easy in usage,

don't make those methods popular too.

II. FUNDAMENTALS

The two basic principles are used in order to obtain

recurrent modelling equations based on z-transform.

1. Analytic response y(t) of the elementary dynamic

block is determined by analytic description of the

usually unknown input signal x(t). Using holds

(known from discrete systems theory) can solve

this problem by approximation of the free input

signal x(t) by the pieces of low-order polynomial

[3], [4].

Author works in the Institute of the Electrical Power Engineering

and Control Systems, Lviv Polytechnic National University, 12

Bandera str., 79013 Lviv, Ukraine, e-mail: vmoroz@polynet.lviv.ua

2. All of the real systems, that can be described by

transfer functions, have the nominator polynomial

order no greater than denominator polynomial or-

der [1], [3]. In this case we can decompose (resi-

due) those systems to the elementary particles (fig.

1) [1]:

1) zero poles (integration parts of the transfer

function);

2) simple real poles (the first order block);

3) complex conjugate of the poles (the second or-

der block).

0

Ts

1

12

1

22 +ξ+ TssT

2n

d

-order block

1

s

t-order block

I

ntegrato

r

1+TsK

Fig. 1. The types of the elementary dynamic blocks.

Those three blocks are the elementary parts for con-

struction of the whole designed computer model.

The responses of the every elementary dynamic

block can be represented as the discrete transfer func-

tions using z-transform and signal transformation by

holds. Traditionally applying of the first and third

transformation types from Table I [4] produce corre-

sponding recurrent equations for computer simulation.

The signal transformation by first-order hold allows to

obtain more accurate but more complicate model

equation for middle- and high-order systems espe-

cially.

TABLE I

SIGNAL TRANSFORMATION TYPES WITH Z-TRANSFORM

1.

s

ehs−

−1

Zero-order hold

2.

()

see s

h

hs 2

1−

−

Zero-order hold with half-period forward

compensation (modified z-transform with

m = 0.5 is using to produce discrete trans-

fer function)

3.

(

)

2

2

1

hs

ee hshs−

−First-order hold

Note: h – is the sampling period.

Proposed by author usage of the modified z-

transform (see second signal transformation type in

the Table I) for the half-period delay compensation of

zero-order hold gives the simpler recurrent modelling

equations with accuracy similar to the first-order hold.

III. DIGITAL MODELS OF THE BASIC BLOCKS

The basic principles of the equation building proc-

ess using z-transform are known [1], [3], [4]. Only the

way of modified z-transform using with the half-

period forward compensation is described below in

this article. This approach is based on the known ta-

bles of the modified z-transform ([5], for example, –

very old but still actual book) and produce the quit

simple modelling recurrent equations.

a. Integrator

Integrator is the simplest dynamic block frequently

using in the computer simulation. After one-period

forward shifting (once multiply discrete transfer func-

tion by z1) and modified z-transform with shifting m =

0.5 can be written:

1

1

2

5.0,

11

−

+

=

⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛=⋅

−

z

zh

m

Tss

e

Zsh ⇒

⇒

()

11 2++ +⋅+= iiii xx

h

yy .

The obtained digital model of the integrator is equal

to model by first-order hold (see [4]).

b. First-order block

The first-order block is other very useful block for

the computer simulation because it corresponds to the

first-order ODE. Using the described approach we ob-

tain it recurrent equation:

T

h

T

h

T

h

sh

ez

Keze

m

Ts

K

s

e

Z−

2

−

2

−

−

⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛+⋅

⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛−

=

⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛=

+

⋅

−1

5.0,

1

1 ⇒

⇒ ⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛⋅+⋅⋅

⎟

⎟

⎠

⎞

⎜

⎜

⎝

⎛−+⋅= −

+

−−

+T

h

ii

T

h

T

h

ii exxKeeyy 2

1

2

11.

c. Second-order block

Using any type of the signal transformation (see ta-

ble I) with second-order block leads to very compli-

cate expression that is not suitable in practice. The

best way is converting of the second-order differential

equation into the system of the two first-order ODEs

and usage of the described transformations for the

every part:

xyyTyT =+

′

ξ+

′′ 2

2 ⇒ ⎪

⎩

⎪

⎨

⎧

ξ

−

=+

′

ξ

=

′

.

22

;

Tyx

zz

T

zy

This way slightly reduces accuracy but simplify ob-

tained recurrent equations. The accuracy can be im-

provement by the small reducing of the step size.

IV. SIMULATION RESULTS

The obtained recurrent equations were verified us-

ing computer simulation.

a. First-order block

The analytic solution for the test sinusoidal input

signal was compared with different (see table I) com-

puter models of the first-order dynamic block with

T = 1, K = 1 with the various steps. Also the digital

model based on 4th-order Gear's formula (or BDF –

Backward Differentiation Formula) was compared.

The results for the step h = 0.2 s are presented in

fig. 2.

0 1 2 3 4 5 6 7 8 9 10

-0.4

-0.2

0

0.2

0.4

0.6

t, s

y(t)

0 1 2 3 4 5 6 7 8 9 10

0

0.02

0.04

0.06

0.08

0.1

t, s

|Errors|

Marks of digital models of the 1st order block

− + − using zero-order hold

−x− using zero-order hold with half-period compensation

−•− using first-order hold

−◊− using 4th-order Gear's formula (for comparison)

Fig. 2. Digital models' of 1st-order block responses for SIN input and

errors for step h = 0.2 s

Remark

The every recurrent equation that describes 1st-orde

r

dynamic block and is produced by z-transform consist o

f

the exp function evaluation. This fact isn't a problem in the

real-time or high-speed simulation systems because the

modern microprocessors calculate exp function very fast.

For example, there are time of calculations for exp(x) o

f

the different processors (calculated in MATLAB):

Intel Pentium-200 MMX – approx. 6 µs;

Intel Celeron-1400 MHz – approx. 0.3 µs;

AMD Sempron 2000 MHz – approx. 0.11 µs.

In the critical case (slow microcontrollers, for example)

exp function evaluation can be excluded from the main

program loop and calculate before as a constant.

b. Second-order block

The analytic solution for the test sinusoidal input

was compared with two computer models of the 2nd-

order dynamic block (based on the 2nd-order ODE and

on the system of the two 1st-order ODEs). This models

obtained by the modified z-transform with half-period

forward compensation. The models was tested for the

parameters T = 1, ξ = 0.6 with the various steps. Also

the digital model based on 4th-order Gear's formula

was compared. The results for the step h = 0.5 s are

presented in fig. 3.

0 5 10 15

-1

-0.5

0

0.5

1

t, s

y(t)

0 5 10 15

0

0.01

0.02

0.03

0.04

0.05

t, s

|Errors|

Marks of digital models of the 2nd-order block

−x− based on the traditional description as 2nd-order ODE

…x… based on the description as the system of two 1st-order

ODEs

−◊− using 4th-order Gear's formula (for comparison)

Fig. 3. Digital models' of 2nd-order block responses for SIN input

and errors for step h = 0.5 s

c. DC electric drive

The computer simulation of the simple chopper-fed

DC electric drive (fig. 4) with proposed approach was

carried out in MATLAB. The standard function for

ODEs of MATLAB was used for comparison. Load

torque for the motor changed from 5 to 20 N⋅m at

t = 0.4 s. The calculation time for AMD Sempron

processor (2000 MHz) was for:

− standard MATLAB functions for ODE with auto-

matic step size control (presented on fig. 5, a):

• ode23 – 7.14 s;

• ode45 – 11.69 s;

• ode113 – 10.19 s;

− proposed approach with fixed step h = 10-5 s (no

best variant of step selection) – 0.67 s (presented

in fig. 5, b).

M

ω

i

a

P

I-controller

ω

ref

H

ysteresis current

controller with chopper

t

Fig. 4. The diagramm of the tested chopper-fed DC electric drive

Remark

The MATLAB realizations of the numeric methods fo

r

the stiff systems of ODEs (ode15s, ode23s,

ode23t, ode23tb) produce the some wrong results

for this model with default value of the error tolerance.

For accurate results the tolerance for these methods mus

t

be increased to 10-5 and better.

00.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5

0

20

40

60

80

100

120

t, s

I

a

[A],

ω

[

1

/

s

]

a) simulation results with standard MATLAB functions for ODE

00.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5

0

20

40

60

80

100

120

t, s

I

a

[A],

ω

[

1

/

s

]

b) simulation results with proposed approach

Fig. 5. The results of simulation of the DC electric drive

The calculation speed of the proposed approach can

be improved by the increasing step size and determin-

ing it value by the current switching conditions of the

controller's model.

V. CONCLUSIONS

Using modified z-transform for producing computer

models provides high-speed simulation with accuracy

like a middle-order (3d-4th-order) classical numeric

methods for ODEs. It is easy to use and understand

these modelling equations. They are suitable for real-

time simulation or control (or other high-speed) sys-

tems using low-productive microprocessors and mi-

crocontrollers especially.

Recurrent equations, based on modified z-trans-

form, are suitable for the simulation of the impulse and

discrete systems without limitations that inherent to

the classic numeric methods for ODEs.

REFERENCES

[1] R. C. Dorf, "Modern Control Systems", Fifth Edition, Addi-

son-Wesley Publishing Company, 1990.

[2] The MathWorks, Inc., Numerical Computing with MATLAB/

By C. Moler. – 2004: http://www.mathworks.com/moler .

[3] W. Siebert, "Circuits, Signals and Systems", London: The MIT

Press, 1986.

[4] J. M. Smith, "Mathematical Modeling and Digital Simulation

for Engineers and Scientists", A Wiley-Interscience Publica-

tion John Wiley & Sons, 1977.

[5] J. T. Tou "Digital and Sampled-Data Control Systems",

McGraw-Hill, New York, 1959.