Sie sind auf Seite 1von 31

VB Technical University of Ostrava

Modelling and Simulation of


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

Modelling of Electrical Systems


n

Analysis of the dynamic properties of the electrical


drives frequently used in the machines and
technological equipment as actuators
Analysis of the electronic circuits used for the signal
processing signal convertors, filters, controllers

Electrical circuit, active elements


n
n

Electrical circuit
Basic ideal active and passive elements

Active elements:
n Sources of electrical energy, voltage
source and current source

Passive elements
Passive elements can store or dissipate energy that is
present in the circuit. They cannot introduce additional
energy.
Ideal elements:
n Resistor - is an element with the resistance R in ohms
() ,
n Capacitor is an element with the capacitance C in
farads (F)
n Inductor is an element with the inductance L given
in units henrie (H)
n

Describtion of the electric circuits


The variables used to describe the behaviour of
electrical circuit are:
n Voltage u(t) in volts (V)
n Current i(t) in amperes (A)
The power is given by the multiplication of voltage and
current:

P(t ) = u(t ) i (t )
Characteristics of the elements:

u = f (i )

i = g (u )

F (i, u ) = 0

Ideal sources voltage source, current source


Ideal voltage source
i(t)

+ u(t)
u(t)

u
u(t1)

+
-

t1

Ideal current source


i(t)
i(t)

i
i(t1)

u(t)

t1

Ideal passive elements, element laws


Ideal Resistor
Element law:

u(t ) = R i (t )
Ideal Capacitor
Element law:
du(t )
i=C
dt
Ideal Inductor
Element law:
di
u= L
dt

2
u
(t )
2
P = u(t ) i (t ) = Ri (t ) =
R

WC =

1
C u 2 (t )
2

Wm =

1
L i 2 (t )
2

L i (t )
=
N

Analysis of the electrical circuits

The goal of the analysis of the electrical


circuits is to calculate the currents which
flow through each element and voltage
across each element.
It is important to derive a set of the
independent equations. The equations can be
derived using the Kirchhoffs laws
Kirchhoffs current low and Kirchhoffs
voltage law.

Electrical circuit - node

Node - the terminals of two or more


elements are connected together and the
common junction is called a node.

Derivation of the equation describing the


electric circuits
The Kirchhoffs laws are used for the describtion of the
electric circuits.
i k (t ) = 0
n Kirchhoffs current low:

The algebraic sum of the currents at any node is equal


zero.
n Kirchhoffs voltage low :
uk (t ) = 0
k
The algebraic sum of the voltages across
the elements
that make up the loop is equal.

In applying of the Kirchhoffs laws the direction of the current and voltages
must be taken into account. We shall use a plus sign for a current arrow
directed away from the node being considered and minus sign for a current
arrow directed toward the node. The voltage orientation is the same.

The use of the Kirchhoffs laws


It is to describe the given electric circuit using the Kirchhoffs laws:
The circuit consists of 6 passive elements
and 1 active element voltage source.
The circuit has 5 nodes and three
independents loops.
We can create 4 independent equations
for the 4 nodes using the Kirchhoffs
current low, the fifth for the node - the
junction of the resistor R1 and the voltage
source u1 can be neglected because they
have the same current flowing through
them, the elements are connected in
series.

The use of the Kirchhoffs laws


Equations for the nodes I., II. a III.:

i1 + i4 + i6 = 0
i1 i2 i3 = 0
i5 i 6 + i 3 = 0
The equations created using the
Kirchhoffs voltage law for
independent loops:

uC1 u R1 u1 u L1 = 0
u1 + u R1 u R 2 uC 2 = 0

u L1 + uC 2 u R 3 = 0

The use of the Kirchhoffs laws


Using the Kirchhoffs laws we obtain a system of linear algebraic
equations:
R1

i1 + i2 i3 = 0
u1 + R1i1 + R3i3 = 0
R2 i2 R3i3 + u2 = 0

R2

i1

i2
i3

u1

R3

u2

The equations can be expressed in the matrix form:


1

R1
0

1
0
R2

1 i1 0

R3 i2 = 12
R3 i3 6

%Kirchhoffs laws
R1=4,R2=8,R3=10
u1=12,u2=6
A=[1 1 -1 ;R1 0
b=[0; u1; -u2]
i=A\b

%Ohm
%V
R3;0 -R2 -R3] %system matrix A
%vector on the right side b
%solution

u1=R1*i(1),u2=R2*i(2),u3=R3*i(3) %voltages on the resistors


een vypoten hodnoty proud [A]:
Napt na rezistorech [V]:

i(1)= 1.0263, i(2)= -0.2368, i(3)= 0.7895


u1 = 4.1053, u2 = -1.8947, u3 = 7.8947

Loop equation method

Loop equation method it is suitable to use this method if the


number of independent loops is lower than the number of
independent nodes.
We introduce the loop currents in the independent loops.
This allows to express the current through every element in terms
of one or more loop currents.
Then we write a set of of equations using the Kirchhoffs voltage
law and the element laws.
The solution of the equations are the loop currents.

Loop equation method


It is to create a model of the circuit shown in Figure using the loop
equation method.
R1i s1 + R4 (i s1 i s3 ) + R3 (i s1 i s2 ) + u1 u3 = 0
R2 i s2 + R3 (i s2 i s1 ) + R5 (i s2 i s3 ) u2 + u3 = 0

R4 (i s3 i s1 ) + R6i s3 + R5 (i s3 i s2 ) u6 = 0

After rewriting:

(R1 + R3 + R4 ).is1 R3.is 2 R4 .is 3 = u1 + u3


R3 .is1 + (R2 + R3 + R5 ).is 2 R5 .is 3 = u 2 u3
R4 .is1 R5is 2 + (R4 + R5 + R6 ).is 3 = u6

The currents flowing through the elements can be calculated from the loop
currents using the equations:

i1 = i s1

i4 = i s1 + i s3

i 2 = i s 2

i5 = i s 2 i s 3

i3 = i s1 i s2

i6 = i s3

Loop equation method


%Loop currents
R1=1;R2=2;R3=5;R4=3;R5=5;R6=4;
u1=4;u2=3;u3=2;u6=2;
A=[R1+R3+R4 -R3 -R4;
-R3 R2+R3+R5 -R5;
-R4 -R5 R4+R5+R6]
b=[-u1+u3; u2-u3; u6]
is=A\b
i1=is(1),i2=-is(2),i3=is(1)-is(2)
is(1)+is(3),i5=is(2)-is(3),i6=is(3)

%Ohm
%V
%matrix of the systm A
%right side vector b
%solution Ax=b
%calculation of the currents i4=%from the loop currents

Solution loop currents [A]: is1 = -0.0799 is2=0.1345 is3= 0.2027


Currents[A]:
i1 = -0.0799 i2 = -0.1345 i3 = -0.2144 i4 = 0.2827 i5 = -0.0682 i6 = 0.2027

Node equation method

The node equation method is suitable to


use if the circuit has more parallel paths
connected in one junction node.
We set one node as a ground node, the
reference point and introduce the node
voltages of the other nodes to this ground
node.
Using the Kirchhoffs voltage law we
express the voltage across every element
in terms of node voltages. Then we write a
set of equations by using the Kirchhoffs
current law (for each node) and the
element laws.

Ground
node

The use of Node equation method


We define the ground node and the node voltages u1, u2 and u3 in
accordance with the nodes notation I., II., III. We obtain the voltages across
the elements using the node voltages.
Next we write the equation using the Kirchhoff's current law for the
independent nodes, we express the currents flowing through the elements
using node voltages of the elements laws.

i1 +

u1 u2 u1
+
=0
R2
R4

u2 u1 u2 u2 u3
+
+
=0
R2
R5
R3
u3 u2 u3
i1 +
+
=0
R3
R6
Ground
node

The use of Node equation method


After rewriting we obtain the set of equations for the node voltages:

1
1
1

+ u1
u = i1
R2 2
R2 R4

1
1
1
1
1
u1 +
+
+ u2
u =0
R2
R3 3
R2 R3 R5

1
1
1
u2 +
+ u3 = i1
R3
R3 R6

Ground
node

Using the element law the current flowing through the elements can be calculated.

Calculation of the node voltages


Example of the solution using MATLAB commands:
%Nodes voltages
R2=1/3;R3=0.5;R4=0.2;R5=0.25;R6=1;
%Ohm
i1=8;
%A
A=[1/R2+1/R4 -1/R2 0;
%system matrix A
-1/R2 1/R2+1/R3+1/R5 -1/R3;
0 -1/R3 +1/R3+1/R6]
b=[-i1; 0; i1]
%right side vector b
u=A\b
%solution Ax=b
ui1=u(1)-u(2),ur2=u(1)-u(2),ir2=ur2/R2,ur3=u(3)-u(2),ir3=ur3/R3,
%calculation of the voltages and currents
ur4=u(1),ir4=ur4/R4,ur5=u(2),ir5=ur5/R5,ur6=u(3),ir6=ur6/R6
%calculation of the voltages and currents

Solution nodes voltages [V] : u1= -0.8662 u2= 0.3567 u3= 2.9045
Voltages [V] and currents[A] :
ui1 = -1.2229
ur2 = -1.2229 ir2 = -3.6688 ur3 =2.5478 ir3 = 5.0955
ur4 = -0.8662 ir4 = -4.3312
ur5 = 0.3567 ir5 =1.4268
ir6 = 2.9045

ur6 = 2.9045

Mathematical model of the DC motor


Diagram of the DC motor
The electric circuit of the rotor of the DC motor
is described by the equation (sum of voltages
across the elements in the loop):

dI (t )
ua (t ) = ui (t ) + Rmia (t ) + Lm a
dt

ia(t)

Lm

Rb

ub

Lb

The circuit of the field voltage and current:

MZ

dib
dt

Mechanical part of the motor torque equation of the rotor:

d
J
= M M MZ
dt

M M = c (ib ) ia

ib(t)
+

ia (0) = 0

ui (t ) = c

ub (t ) = Rb ib + Lb (ib )

Rm

The torque is given by the multiplication of the flux and current.

Mathematical model and block diagram

Block diagram of the DC motor

dia (t )
ua (t ) = c(ib ) (t ) + Rmia (t ) + Lm
dt
ub (t ) = Rb ib + Lb (ib )
J

d
= MM MZ
dt

Rm
ia(0)

ua

1
Lm

dib
dt

MZ

MM

1
Lb

Rb

ib

1
J

ib(0)

ub

(0)

b(ib)

c
C

Armature controlled DC motor


The motor is controlled only using the armature (rotor) voltage by the constant field current
ib=const. The DC motor can be described using the following two equations:

dia (t )
ua (t ) = c (t ) + Rmia (t ) + Lm
dt
d

dt

= M M MZ

M M = c (ib ) ia

Block diagram of the armature controlled DC motor:


Rm
Lm

ia(0)
ua

1
Lm

MZ

ia

c
c

MM

(0)
1
J

State model of the DC motor


State model of the DC motor with the field current written in the
matrix form:
Ra
L
a
ia
d
i =
0
dt b

c(ib )

Rb
Lb
0

c(ib )
1
La i La
a

0
i + 0
b
0

0
u

1 a
+ 0 M
Lb ub 1 Z

0
J

The state model od the DC motor for the constant field current:
Rm

d ia Lm
=
dt c
J

c
1
0
Lm ia + u + 1 M

L
m a Z

J
0
0

Simulation of the DC motor


Simulation of the state model of the DC motor using the MATLAB
commands:
Motor rotations

%DC motor for the constant field current


ua=15
% input (control) voltage V
Rm=20
% risistance of the wiring Ohm
500
Lm=1.3
% inductance H
cFi=0.03
% value of the expretion c*Fi V/rad/s
J=1e-5
% moment of inertia kgm2
400
Mz=0.0045
% load momentum N/m
omega
A=[-Rm/Lm -cFi/Lm; % systm matrix
[s-1]
300
cFi/J 0]
B=[1/Lm 0; 0 -1/J]
% input matrix
C=[0 1]
% output matrix
200
D=[0]
% transient matrix
t=0:0.01:2;
% time vector t
u=0*t+ua;
% input vector voltage ue=15 V has the same
100
lenght like vector t
M=0*t+Mz*(t>1);
% vector of the load momentum working for t>1s
% has the same lenght like vector t
0
0
0.2
uM=[u' M']
% input vector uM has two culums vectors u, M
[y,x]=lsim(A,B,C,D,uM,t); %tion of the state model
plot(t,y);
% output plot
grid;
% grid, graph description
title('Motor rotations');
DC motor
xlabel('t'); ylabel('omega [s-1]');
600

0.4

0.6

0.8

1.2

1.4

1.6

1.8

rotations by the change of the load


momentum at t = 1 s.

Modelling of the circuits with operational


amplifiers
The operational amplifier (op-amp) is an important building block in
the electrical part of many modern control systems. It is used in
circuits for signal processing of time varying signals.
Overview of the properties of the operational amplifier
Property

Ideal op-amp

Real op-amp
-106 -108

Amplification

Input resistance

Output resistance

10 a 100

Input current

0A

10-9 a 10-7 A

Transmitted band

0 a Hz

0 105 Hz

u1u1 u+
1

106 107 (OZ s bipolrnmi tranzistory)


a 1012 (J-FET na vstupu OZ)

+u
+

u2

A
-u

u1

u2

u2 = A u1

u1 =

u2
A

Circuits with operational amplifier


Using the Kirchhoffs current law for the input node we obtain:

i
j

(t ) + i0 ( t ) = 0

u j (t )
Zj

u (t )
+ 0
=0
Z0

U j ( s)

U 0 ( s)
+
j Z ( s) Z ( s) = 0
j
0

Output voltage of the circuit is


given by:
U j ( s)
U 0 ( s) = Z 0 ( s)
j Z j ( s)

z0
i0
i1

u1

z1

uj

zj

in

un

zn

in

ig

u0

Block diagram of the circuit with the op-amp

Invertor
Invertor has a resistor in the feed back and in the input path of the op-amp.
i0

i1 + i0 = 0
u1 u0
+
=0
R1 R0

R1 i1
u1

R0

u0
u0(t)

t
t

-k.u1

The output voltage of the circuit is


proportional to the input voltage and given
R
by:
u0 (t ) = 0 u1 (t )
R1
The voltage gain of the invertor is set by the
resistors R0, R1 :
R
K= 0
R1

Circuit of the invertor, the course of


the input and output voltage

The sum of the input voltages

The resistors R0 and R1, Rn are in the feed back and input paths
of the op-amp circuit. For the input node we obtain:

R0

i0

i0 + i1 + i2 +!+in = 0
The output voltage can be expressed after
substitution for the currents:
n

u0 ( t ) =
j =1

Gain of the input j:

kj =

R0
u (t )
Ri i

u1

R1 i1

uj

Rj

un

Rn in

in

Op-amp circuit

R0
Ri

The output voltage is a weighted sum of the input voltages.

u0

Integrator
Resistor is in the input path and capacitor is
in the feed back path of the integrator
circuit. The feed back impedance depends
on the signal frequency.

i0
u1

R1 i 1

u0

U 1 ( s) U 0 ( s)
+
=0
1
R1
sC0

1
+ U 0 ( s) =
U 1 ( s)
s R1C0

C0

u2(t)
1

1
.u
R1C0 1

1
u 0 (t ) =
u1 ( )d + u 0 (0)

R1C0 0

Circuit of the integrator

The time constant T of the integrator is given by the multiplication R1C0 .

Derivative term
The derivative term has the capacity in the input path and the
resistor in the feed back path.
U 0 ( s) U 1 ( s)
+
=0
1
R0
sC1

U 0 ( s) = s C1 R0 U 1 ( s)
u0 (t ) = C1 R0

du1 (t )
dt

i0
u1 C1

i1

R0

u0

Circuit of the derivative term

The time constant T of the derivative term is given by the multiplication C1R0.
The following circuits with op-amp can be analysed and described in the same way .

Das könnte Ihnen auch gefallen