Anda di halaman 1dari 56

VB Technical University of Ostrava

Modelling and Simulation of


Mechatronic Systems
Prof.Ing.Petr Noskievi, CSc.
Department of Automatic Control and
Instrumentation

Modelling and Simulation of Mechatronic Systems

Noskievi, P.: Identifikace a modelovn.


Montanex a.s., Ostrava, 1999. ISBN 80-7225-030-2
Close,Charles, M., Frederick,K.: Modeling and Analysis of
Dynamic Systems. John Wiley & Sons, Inc. New York.

Modelling and Simulation of Mechatronic Systems

Mathematical modelling is an effective method for investigation of the


properties of real objects.
The realization of the mathematical models using computers the system
simulation have become a very important part of the design process of the
complex systems.
Using the computer simulation we can do experiments with the mathematical
model in the similar way like with the real system, but
without risk of the crash states,
without the real object,
with lower costs.
The development of the computers and simulation software contributed to the
wide use of the system simulation. This fact underlines the need of the new
skills methods of creating the mathematical models mathematical
modelling and system identification.

Modelling and Simulation of Mechatronic Systems

The approach for creating the mathematical model is called system


identification and can be divided into two groups of methods:
Analytical identification also called mathematical modelling is based
on the use of physical laws.
Experimental identification based on the evaluation of the data from the
realized experiment with the real system.

Summary of the identification methods


Modelling
Mechanical
System

Experimental Identification
Stochastic methods

Deterministic methods
Transfer function

Bode plot

Bode plot
computation
from Transfer
function

Electrical system

Cross-correlation function

Use of physical Laws Transfer function


Newtons law
Krchhoff law
Etc.

Parameterization of the transfer


function

Other methods of
parameterization

Bode plot measurement


and evaluation

Stochastic model of the


system

Parameterization of the transfer function


in frequence domain

Numerical deconvolution

Basic terms

Modelling is an experimental process in which the physical or


abstract model is using the specific criterion defined to the real
discovered object - the machine the modelled system.
Modelling is one of the oldest methods of discovering the real world,
which at the beginning used only the imitation of the of the phenomenon
in the nature and it was later developed into the modelling using the
principle of the geometric similarity.

Geometric similarity, physical model

Geometric similarity:
the model has the same shape, keeps the shape similarity
the created model can be touched, it is a physical model
the physical model allows to realize experiments and study the properties
of the original using the same physical processes (for example the airflow
around the model of the car in the wind tunnel).

Car (real)

Model of the car

Mathematical model

We can define also another model, abstract mathematical model of the original
mathematical model.
Mathematical model
it is not possible to realize the experiments based on the same physical
processes,
it allows to investigate the processes of the original using their
mathematical description solution of the mathematical models.
Creation of the mathematical model has the following steps:
definition of the discovered processes,
definition of the observed symptoms definition of the system on the real
object.

Car suspension

Experiment we can discover the degree


of the movement caused by the force
working on the body of the car.
This experiment can be done directly on
the car.

F,x

Car suspension mathematical model


It is possible to analyze the same phenomena using the mathematical
model of the system.
Car suspension

Mechanical model

Mathematical model

d 2 x(t )
dx(t )
m
+
b
+ kx(t ) = F (t )
dt
dt 2

Simulation model of the car suspension


Mathematical model differential equation

d 2 x(t )
dx(t )
m
+
b
+ kx(t ) = F (t )
2
dt
dt

Simulation model MATLAB - Simulink

Output of the simulation course of


the car suspension
position

The relation model original

Criterion used for the assigning of the model to the original:


Similarity
Analogy.

Similarity similarity between different systems in their structure, properties


and behaviour.
Physical similarity similarity between systems and processes from the same
physical domain geometric similarity, similarity of the parameters and state
variables.
Mathematical similarity - similarity between the systems and processes with
the same mathematical description (structure of the mathematical model).
Analogy mathematical similarity between the systems from different domains
and processes (analogous systems, analogous variables).

Cybernetic similarity

Cybernetic similarity - expresses the mathematical similarity in the


input-output description of the behaviour of the system.
We can imagine the system like the black box without any information
of the inner structure and state variables. We have only information
on the in-out system behaviour.
Grey box this term is used if we have only limited information on the
system structure.
White box we have total information on the inner structure of the
studied system.
The experimental identification is based on the principle of the
cybernetic similarity.

Basic terms from the system theory

System is a set of the elements and linkages between them which has
defined properties.
Surrounding of the system is a set of the elements, which are not
elements of the defined systems, but they have important relations to the
system.

Structure of the system, relations

The structure of the system is the


representation of the collection of the inner
elements and their interaction represented by
the links. The structure can be shown using
different methods:
Description
Using graphical method drawing, block
diagram
The links can be inner (internal) and external.
The inner links are between the system
elements, the external ones are between the
system and the environment. The system
variable corresponds to each link.
The inputs (excitations), Outputs (responses)
and inner state variables.

Surrounding
(Environment)
P2

P4

System

P6
P5
P1

P3

Separability of the system

Environment

Inputs

It is not possible to separate


the system. The system has
to be modelled with the
surrounding.

Outputs

System

The system can be separated.

Coordinate system of the car

vehicle vertical
motion
yaw

body
roll
wheel liftl

pitch

wheel
vehicle longitudinal
motion

steering
motion

rolling
motion

lateral motion

Structure of the dynamic system of the car


PORUCHY
Disturbances
Changes
of the
zmny povrchu
quality
of
the
road
vlastnosti vozu

Driver
IDI
Break
brzdov
pedal
pedl

plyn.
pedl
Gas pedal
rychl.st.
gear

Subsystm:
Subsystem:
Horizontal
HorizonzlnDynamics
dynamika
Subsystm:
Subsystem:
Longitudinal
Dynamics
Podln dynamika
Longitudinal motion
podln
pohyb
Wheel
rotation

nerovnosti
Quality
of the
vozovky
road
Longitudinal
acceleration and
podln zrychlen
deceleration

a zpodn

Subsystm:
Subsystem:
Cross
Dynamics
Pn
dynamika
lateral motion

bon pohyb

naten, naklnn

Subsystm:
Subsystem:
Vertical
Dynamics
Svisl dynamika
Vertical motion of the
pohyby karoserie
wheels

oten kol

velocity resistance
odpor in
rychlost
curve
v zatkch

Steeringvolant
wheel

psoben
wind vtru

svisl pohyb kol


sly psobc
Wheel
forces
na kolo

Lateral
acceleration
pn
zrychlen

naklpn
sklpn

Steering System Driver Car

Road
Traffic on the
road

Side wind
Surface of the road
Quality of the road

Steering:
Steering wheel,
gearshift, break
pedal

Goal of the
trip
Driver

Car position
Car

Car position, velocity, direction of the movement

Steering System Driver Car with subordinate control


system
Road
Road
Traffic on the
Trafic
road

Goal of the
trip

Side wind
Surface of the road
Quality of the road

Steering:
Steering wheel,
gearshift, break
pedal

Driver

Car position
Car
Action

Control
System
Selected state variables
Car position, velocity, direction of the movement

Subsystem of the rotating wheel


v

M
Fx
Fg

FN

Circumferential speed of the wheel

u = r
Motion equation of the car

mv! = Fx
Motion equation of the rotating wheel

m
g
v
J

M
Fx
FN
r

relative mass of the car on one wheel


gravity acceleration
velocity of the car
momentum of inertia of the wheel
angular velocity of the wheel
breaking momentum produced by the
break on the wheel
breaking force working on the contact surface
normal force on the wheel
radius of the wheel

J! = rFx M
Fx = Fz
Fz = mg
Fx = mg ,

Friction coefficient

Fx
=
Fz

Slip

The friction coefficient between the surface and the wheel (tyre) depends on
the slip .
1,2

such asfalt

dry asphalt

Friction coefficient

souinitel

brzd.
Break
moment
momentum

r
Fx
Fz

asfalt

asphalt

0,8

wet asphalt

0,6

mokr

0,4

snh
ice
led

snow

0,2
0

20

40
slip

60

skluz

80 100 %

vu
u
= 1
v
v

Simulation model of the wheel braking

Simulation model of the wheel braking in the programe MATLAB Simulink.

-1/mk

Momentum of the force Fx


deceleration

Working on the wheel

1/J

s
breaking
path

Velocity v
1

Mux

break
momentum M(t)

final

Wheel
momentum inertia

Angular
velocity w

v, u

lambda
f(u)

mk*g

s
Clock

Mux

lambda =1-u/v

mi=f(lambda)

Fx

Simulation results

Car velocity v, wheel velocity u

Breaking momentum

Constant brake momentum

Breaking path

Deceleration

Simulation results

Car velocity v, wheel velocity u

Breaking momentum

Variable brake momentum

Breaking path

Deceleration

Simulation model of the wheel breaking with ABS

-1/mk
r
deceleration

Momentumof the force Fx


On the wheeel

Model ABS

s
velocity v

0.19

0.01s+1
Slip error

valve
ABS

Hydraulic
system
dynamics

x
Mux

v, u

lambda
f(u)

mk*g

s
Angular
velocityt w

100

w lambda

s
Breaking path

1/J
final
inertia
momentu
m
On the wheel

1
s
tlak

Mux

lambda =1-u/v

mi=f(lambda)
Fx

6
break
momentum

Simulation model of the wheel breaking with ABS


simulation results
Car velocity v, wheel velocity u

The influence of the ABS is


observable:
Oscillation of the rotating
speed
Oscillation of the slip
The wheel is not blocked
during the intensive breaking.

Slip

Types and forms of the systems and their


description
System variables
x state vector, u input vector, y output vektor
x1
x
2
x =
!

x n

Static systm
description only using the
static characteristic:

y = f ( u)

u1
u
2
u =
!

ur

y1
y
2
y =
!

y l

State model of the system


Dynamic system non linear, t-invariant

x! = f (x, u)

x(0) = x 0

Initial state vector

y = g( x, u )
Dynamic system non linear, t-variant

x! = f (x, u, t ),
y = g(x, u, t ).

x(0) = x 0

Linear state models of the system


Linear, t-variant dynamic system

x! = A (t )x(t ) + B (t )u(t )

x(0) = x 0

y = C(t )x(t ) + D(t )u(t )


Linern, t-invariant dynamic system

x! = Ax(t ) + Bu(t )
y = Cx(t ) + Du(t )

x(0) = x 0

Linear, t-invariant single input single output dynamic system

x! = Ax(t ) + bu(t )
y = c T x(t ) + du(t )

x(0) = x 0

Transfer Function
Transfer function
bm s m +!+b1 s + b0
G ( s) =
a n s n +!+a 2 s 2 + a1 s + a 0

Transfer function in the frequency domain

bm ( j ) m +!+b1 j + b0
G ( j ) =
a n ( j ) n +!+a 2 ( j ) 2 + a1 ( j ) + a 0
Z-Transfer function
Y ( z ) b0 + b1 z 1 + ! + bm z m
G( z ) =
=
U ( z ) 1 + a1 z 1 + ! + a n z n
1

Creating of the state space model from differential equation


Definition of the state variables
The system is described by the ODE (Ordinary differential equation)
order n:

y (n ) + an 1 y (n 1) + ... + a1 y! + a0 y = b0u
The first state variable is equal to the output y:
The second and next variable
is defined as a derivative of
the previous:

x! i = xi +1,
x! n =

x1 = y

i = 1, 2, ..., n 1

d ny
dt n

y (n ) = a0 y a1 y! ... an 1 y (n 1) + b0u
The time derivative of the last
state variable xn can be
expressed from the given
x! n
differential equation:

()
diy

( ) = xi +1,
dt i

i = 1, 2, ..., n 1

= a 0x1 a1x2 a 2 x3 ... a n 1x n + b0u

Initial condition
The initial conditions- initial values of the state variables x1(0),
xn(0) are equal to the initial values of the output variables y(0).
This can be obtained from the definition formulas for the state
variable for t=0.
xi (0) = y (i 1) (0), i = 1,2,..., n
x1 (0) = y (0)
x2 (0) = y" (0)
!
xn (0) = y ( n 1) (0)

Definition of the state variables

x! 1
x! 2

=
=

.
.
x! i

=
=
=
=
=

.
.
x! n

The set of the state equations can


be written using the matrix form.

x2
x3

x i +1

= a 0x1 a1x 2

a 2 x3

a n 1x n + b0u

y = x1

Matrix formulation of the state model:


!
#
#
#
#
#
#
#
#
#
#
#
"

x!1 $ ! 0
& #
x!2 & # 0
& #
. & # .
. & # .
&=#
x!i & # .
. && ## .
. & # .
& #
x!n % " a0

0
.
.

a1 a2

a3

1 .

1
an1

$!
&#
&#
&#
&#
&#
&#
&#
&#
&#
&#
&#
%"

x1 $ !
& #
x2 & #
& #
. & #
. & #
&+#
xi & #
. && ##
. & #
& #
xn % "

$
0 &
0 &
&
. &
. &
& u
0 &
. &&
. &
&
b0 %

x1
x
2
.

.
y = 1 0 0 . . . 0
x i

.
.

x n

Definition of the state variables

If the derivatives of the input occur on the right side of the differential
equation:
y (n ) + an 1 y (n 1) + ... + a1 y! + a0 y = bmu (m ) + bm 1u (m 1) + ... + b1u! + b0u

We define an additional dynamic system with the state variable x and


input only u:
x (n ) + an 1 x (n 1) + ... + a1 x! + a0 x = u
x! 1 0
x! 0
2
. .
=
. .
. .

x! n a 0

x = x1

1
0

0
1

a1

0
0

x1 0
x 0
2
. . .
+ u
0 . .
1 . .

a n 1 x n 1

Definition of the state variables


The output of the original system is a linear combination of the state variables x1,
x2, ..., xn and of the coefficients on the right side of the differential equation describing the
system.

y = b0x1 + b1x2 + b2 x3 + ... + b mx m+1

The state variables x1, x2, ..., xn represent the partial outputs of the system for the input
signal u and his derivatives u,u etc.. The right side of the given differential equation is a
linear combination of the input signal u and its derivatives. The state variables represent
the outputs of the system for the inputs x1 u, x2 u, x3 u, etc.
x! 1
x! 2

=
=

.
.
x! i

=
=
=
=
=

.
.
x! n

x2
x3

xi

= a 0 x1 a1x2

y = b0x1 + b1x2

a 2 x3 . .

a n 1x n + u

+ b2 x3 +. . + b mx m+1

x1 (0) = y(0), x 2 (0) = y! (0), ..., x n (0) = y (n1) (0), u(0), u! (0), ..., u (m1) (0)

Definition of the state variables structure of the state model

!
#
#
#
#
#
#
#
#
#
#
#
"

x!1 $ ! 0
& #
x!2 & # 0
& #
. & # .
. & # .
&=#
x!i & # .
. && ## .
. & # .
& #
x!n % " a0

0
.
.

a1 a2

a3

1 .

1
an1

$!
&#
&#
&#
&#
&#
&#
&#
&#
&#
&#
&#
%"

x1 $
& !
x2 & #
& #
. & #
. & #
&+#
xi & #
. && ##
. & #
& "
xn %

0
0
.
.
0
.
.
1

$
&
&
&
&
& u
&
&
&
&
%

x1
x
2
.

.
b1 . . b m . 0 0
xi

.
.

x n

y = b0

y(0), y! (0), ..., y( n 1) (0), u(0), u! (0), ..., u( m1) (0)


y(t)

Block diagram of the state


model of the dynamic system
bm
xn0
y(t)

b2

b1

xm+10
xn

....

an-1

x20
xm+1
....

am

....

x3

a2

....

b0
x10

x2

a1

x2

x1=x

a0

Definition of the state variables calculation of the initial values of


the state variables if the derivatives of the input u occur
The initial conditions for the defined state variables x1,xn must be
calculated from the given initial conditions for y and u as follows:

Creation of the state space model from the transfer function


The system is described by the transfer function:
G( s) =

b sm + b m 1sm 1 + ... + b1s + b 0


G( s) = m n
s + a n 1sn 1 + ... + a1s + a 0

Y( s)
U( s)

Seriel programming
G( s) =

s n i

s p i
G i ( s) =
1

s p i

(s n1)(s n2 ) ... (s - n m )
(s p1)(s p2 ) ... (s - p n )

G( s) = G i ( s)
i =1

Structure of the model using the decomposition of the polynomial


u

1
p - pn

Yi ( s)
s ni
=
Yi +1( s) s p i

yn

yi+1
....

p - ni
p - pi

yi

y2
....

p - n1
p - p1

x! i = p i x i + (p i n i )y i +1
y i = x i + y i +1

y=y1

Creation of the state space model from the transfer


function

x! i = p i x i + y i +1

yi = ni xi + pi xi + yi
!#"#
$
xi

yi+1
xi0

pi - ni

yi+1

xi0

xi

yi

xi

xi

-ni

-pi

pi

Structure of the partial


model type 1

Structure of the partial


model type 2

yi

Parallel structure of the state model


n

Ai
b
+ n
s pi a n
i =1

G( s) =

The partial transfer functions are calculated from the


original transfer function, constants Ai are given:

A i = lim (s pi )G(s)
s p i

The state variables are defined x1, x2, ..., xn using the partial transfer functions:
Xi (s)
Ai
=
,
U(s) s pi

i = 1, 2, ..., n

x! i = pi xi + A i u,
Output equation:

i = 1, 2, ..., n
n

b
Y(s) = Xi (s) + n Us
an
i =1

b
y = x1 + x 2 + ... + x n + n u
an

Parallel structure

Matrix form:

p1 0
0 p
2

x! = .
.

.
0
.

.
.

.
.

.
.

.
.

.
pi
.
.

.
.

0
A1

A
0

.
.


. x + A i u
.
.


.
.
A
p n
n

b
y = 1 1 1 . . 1 . . 1 x+ n u
an

The obtained form is also called Jordan form of the state equations.

Parallel structure block diagram


x10

A1

Structure of the state


model using the
parallel programing
Jordan form

x1

x1

bn
an

p1
.
.
.

xi0
u

Ai

xi

xi

pi
.
.
.

xn0

An

xn

pn

xn

Parallel structure complex eigen values


The pair of the complex eigen values
Complex coefficients of the partial
transfer functions:
G( s) =

pi = + j,
pi +1 = j.
A i = A + Bj,
A i +1 = A Bj.

A1
A + Bj
A - Bj
A
+ ... +
+
+ ... + n
s pi
s- p n
s- ( + j) s- ( j)

x! i = xi + xi +1 + 2Au

x!i +1 = xi + xi +1 + 2Bu

y i = xi

Parallel programming

Matrix form of
the state
model with
complex eigen
values:
(all matrix
elements are
real numbers)

x! 1 p1
. .


. .


. .
x! i .

=
x! i +1 .
. .


. .
. .


x! n 0

.
.

.
.


.
.
.
.

0 x1 A1
. . .

. . .

. . .
. xi A i
.
+
u
. xi +1 A i +1
. . .

. . .
. . .

p n x n A n

x1
.

.
x i

y = 1 . . . 1 0 . . . 1
x i +1
.

.
.

x n

Series combination of the transfer funtions example


3
Using the series combination of the transfer functions G( s) =
s(s2 + 5s + 4)
you have to create the state model:

1 1
3
G( s) =

s s+1 s+ 4

Solution:
u

3
s+4

x3

1
s+1

x2

1
s

y = x1

State variables:
1
X1(s) = X2 (s)
s
1
X2 (s) =
X (s)
s+1 3
3
X3(s) =
U(s)
s+ 4

x! 1 = x2
x! 2 = x2 + x3
x! 3 =

- 4x3 + 3u

x! 1 0
1
0 x1 0


!
x
=
0

1
1
2
x2 + 0 u
x! 3 0
0 4 x3 3

Parallel combination of the transfer functions example

The system is described using the transfer function:

G(s) =

s2 + 5s + 6

You have to create the state model using the parallel combination of the
transfer functions (parallel programming).
G( s) =

Solution: Partial transfer functions:


State variables are defined as
the outputs of the partial
transfer functions.

6
1
3
+
+
5s 2( s + 1) 10( s + 5)

6
U (s )
5s
1
X 2 (s ) =
U (s )
2(s + 1)
3
X 3 (s ) =
U (s )
10(s + 5)
X 1 (s ) =

The Laplace transformation of the


output defines the output equation:

Y(s) = X1(s) + X2 (s) + X3(s)

s s2 + 6s + 5

Parallel programing
5
u
6
1
x! 2 = x2
u
2
3
x! 3 =
5x3 + u
10
x! 1 =

Solution in the time


domain:

y = x1 + x2 + x3

The matrix form:

5
x! 1 0
0
0 x1 6

1
!
0 x2 + u
x2 = 0 1
2
x! 3 0
0 3 x3 3
10

x1

y = 1 1 1 x2
x3

Creating of the state model from more differential equations

The system is described using


two equations:
The highest derivatives
are written on the left
side of each equation:

12 !y!1 + 3 y!1 + y1 + 2 y! 2 + 0,5 y2 = 1,2u!1 + u1


2,4 y1 5 y! 2 y2 = u2

1
1
1
0,5
1
1,2
y1 y!1 y! 2
y2 + u1 + u!1
12
4
6
12
12
12
2,4
1
1
y! 2 =
y1 y2 u2
5
5
5
!y!1 =

1
1
1
0,5
1
1
y!1 y10 = ( y1 y10 ) + (u1 u10 ) ( y2 y20 ) + y1
y2 + u1 d
4
10
6
12
12
12
0

x! 1 =

After substitution we obtain:


y!1 =

1
1
1
y1 + u1 y2 + x1
4
10
6

x10 =

1
0,5
1
y1
y2 + u1
12
12
12

1
1
1
y10 u10 + y20 + y!10
4
10
6

Creating of the state model from more differential equations

1
1
1

y1 y10 = y1 + u1 y2 + x1 d
4

10
6

After integration we obtain:

1
1
1
x! 2 = y1 + u1 y2 + x1
4
10
6

x20 = y10

Output equation for y1:

y1 = x 2

From the second given differential equation we obtain:


t

1
1
2,4
y2 y20 =
y1 y2 u2 d
5
5
5
0

x! 3 =

Output equation for y2:

2,4
1
1
y1 y2 u2
5
5
5

y2 = x3

x30 = y20

Creating of the state model from more differential equations

1
0,5
1
y1
y2 + u1
12
12
12
1
1
1
x! 2 = y1 + u1 y2 + x1
4
10
6
2,4
1
1
x! 3 =
y1 y2 u2
5
5
5
x! 1 =

State variables:

1
0,5
1
x2
x3 + u1
12
12
12
1
1
1
x! 2 = x1 x2 x3 + u1
4
6
10
2,4
1
1
x! 3 =
x2 x3
u2
5
5
5
x! 1 =

State equations:

Matrix form:

x! 1

x! 2 =
x! 3

0
1
0

1
12
1

4
2,4
5

x
y1 0 1 0 1
y = 0 0 1 x2
2

x3

0,5
1

12 x1
5
u1
1 1
x2 +
0
6
10
u2
1 x3
1

5
5

Initial conditions:
1
1
1
y10 + y0 u0 + y20
4
10
6
x20 = y10
x30 = y20
x10 =

-1
24

Block diagram:
-1
5

x10

x1

-1
12

u1

Structure of the created state


model.

1
x20
1
10

-1
4

12
25
u2

-1
5

-1
6

x30

-1
5

x2

x3

Creation of the state model from the non-linear differential equation

Description of the system:


y

(n )

= f y, y! , !y!, ..., y(n -1) , u, t

Initial values:

y( t 0 ) = y 0 ,
y( t 0 ) = y0 ,
.

State variable form :

.
.

x! = f ( x, u, t )

( n 1)
y( n 1) ( t 0 ) = y 0
,

y = g( x, u, t )

Definition of
the state
variables:

x1 = y ,
x2 = y! ,
.
.
.
xn = y (n 1) ,

Definition
of the
state
equations:

x!1 = x2 ,
x!2 = x3 ,
.
.
.
x!n 1 = xn .

x! n = f (x1, x2 , ..., xn , u, t )

Transfer of the non-linear differential equation into the system of


differential equations first order

Final form of the


state model state
equations:

x! 1 = x2 ,
x! 2 = x3 ,

Initial values:

x! 3 = x 4 ,
.

x1(t 0 ) = y0 ,
x2 (t 0 ) = y0 ,
.
.

.
.
x! n = f ( x1, x2 , ..., x n , u , t )

Output equation:

x n (t 0 ) = y0n 1.

y = x1

Description using the vector


functions f
(first n-1 equations have the
shown form, the last
equation has another form
which corresponds to the
right side of the given
differential equation).

fi ( x1, x2 , ..., xn , u, t) = xi +1,

i = 1, 2, ..., n -1

fn (x1, x2 , ..., x n , u, t ) = f (x1, x2 , x3 , ..., x n , u, t )

Simulation programme MATLAB - Simulink

Simulation programme AMESim

Anda mungkin juga menyukai