Lecture Notes Modelling Simulation Dynamic Systems 1
Lecture Notes Modelling Simulation Dynamic Systems 1
Helmut Scherf
System dynamics is dealing with the value of states in a system over time.
Set up of differential equation(s) of a dynamic system
Static systems are described by algebraic equations
•Mass balance
•Flow and heat balance
•laws of thermodynamics,
•Principle of energy conservation
•Newton’ s law Model (white box)
•Principle of linear momentum Opposite: black box
•Lagrange equations
•Kirchhoff’s voltage law
•Kirchhoff’s current law
•etc.
(Shannon, 1975)
Set up Differential
Equations
Determine System
Parameters
Simulation
Comparison
Simulation no Model
Measurement adaptation
ok?
yes
Stop
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-6-
Oscillator: Real Model
Leaf spring
Ultra sonic
sensor
coil spring
mass
k
m
d
damper
frictionless
m
d
mass deflected
k x spring extended
FS Fi
m
d FD
spring force FS = k ⋅ x
damping force FD = d ⋅ x&
inertial force Fi = m ⋅ &x&
•ordinary
•homogeneous (free oscillation) <-> forced oscillation, inhomogeneous diff. eq.
•second order (2 energy storages)
m d
m ⋅ &x& + d ⋅ x& + k ⋅ x = 0 → ⋅ &x& + ⋅ x& + x = 0
k k
Alternative form: T 2 ⋅ &x& + 2 ⋅ D ⋅ T ⋅ x& + x = 0
Equating the corresponding coefficients results:
m d
T = , 2 ⋅ D ⋅T =
2
k k
1
T= time constant [sec]
ω0
2π
ω0 = angular frequency of the undamped system [rad/sec]
TC TC period (cycle duration) [sec]
D dimensionless damping coefficient [-]
T T
quadratic equation ⇒ two solutions
D D2 1 D D2 −1
λ1/ 2 =− ± 2
− 2 =− ±
T T T T T
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-12-
Solution of the Differential Equation
Four cases: overdamped D >1
critically damped D =1
underdamped 0 < D <1
(undamped) D=0
D D2 1 D 1− D2
λ1/ 2 =− ± − = − ± j ⋅ = − D ⋅ ω ± j ⋅ ω ⋅ 1 − D 2
T T2 T2 T T 1
424 30 10 4243
α β
x(0) = x0 = C1
(
x& (t ) = − D ⋅ ω0 ⋅ e − D⋅ω0 ⋅t ⋅ C1 ⋅ cos ω0 ⋅ 1 − D 2 ⋅ t + C2 ⋅ sin ω0 ⋅ 1 − D 2 ⋅ t )
(
+ e − D⋅ω0 ⋅t ⋅ − C1 ⋅ ω0 ⋅ 1 − D 2 ⋅ sin ω0 ⋅ 1 − D 2 ⋅ t + C2 ⋅ ω0 ⋅ 1 − D 2 ⋅ cos ω0 ⋅ 1 − D 2 ⋅ t )
x& (0) = 0 = − D ⋅ ω0 ⋅ C1 + C2 ⋅ ω0 ⋅ 1 − D 2 = − D ⋅ x0 + C2 ⋅ 1 − D 2
D ⋅ x0
⇒ C2 =
1− D2
General solution of the homogeneous differential equation:
− D⋅ω0 ⋅t D ⋅ x0
x(t ) = e ⋅ x0 ⋅ cos ω0 ⋅ 1 − D ⋅ t +
2
⋅ sin ω0 ⋅ 1 − D ⋅ t
2
1− D 2
-1
0 5 10 15 20 25 30 35 40 45 50
time in sec
friction damping
1
Linear decrease
0
-1
0 5 10 15 20 25 30 35 40 45 50
time in sec
air damping
1
Strong decrease weak decrease
0
-1
0 5 10 15 20 25 30 35 40 45 50
time in sec
0.1
k spring constant
friction damping
x '' x' x
1 1
1
s s
0 . 05
k spring constant 1
sgn (u )* 0 . 4 * u ^2
k spring constant 2
First method: rotate through 90° and measure the displacement of the mass
x = 11 mm
F
k = = 831 N/m
x
F = m⋅ g
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-23-
How to determine the System Parameters
x̂1 x̂n
x̂2
0
-1
0 5 10 15 20 25 30 35 40 45 50
time in sec
magnetic damping
x'' x' x
1 1
1/m s s
Gain
Gain 1
Remark:
different methods calculating the spring constant lead to different results
S=dsolve('D2x/27.6006^2+2*0.0234/27.6006*Dx+x=0','x(0)=-0.97','Dx(0)=0')
t=0:0.01:6;
y=eval(S);
plot(t,y)
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-28-
Comparison of Simulation and Measurement
1
measurement
simulation
0.8
0.6
0.4
0.2
displacement
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6
time in sec
friction damping
x'' 1 x' 1 x
1/m
s s
26
k spring constant
-K-
2
measurement
simulation
1.5
0.5
displacement
-0.5
-1
-1.5
-2
0 0.5 1 1.5 2 2.5 3 3.5
time in sec
sgn(u)*0.015 *u^2
k spring constant 2
-K-
1.5
measurement
simulation
0.5
displacement
-0.5
-1
-1.5
0 5 10 15 20 25 30 35 40
time in sec
Tacho
DC-Motor
generator
Banana jack
carbon armature
commutator armature winding permanent
brushes
magnet
N S
uM
F = B ⋅l ⋅i
current
N length
Magnetic flux density
i •Torque M = F ⋅ r = kG ⋅ i
•uM motor voltage
•i armature current
brush
S
i commutator
uM
+ -
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-38-
Equivalent Circuit Diagram of a DC-Motor
i
R R ⋅i voltage drop across
the resistor
motor voltage uM
di
L L⋅ voltage drop across
the inductor
dt
= eM = kG ⋅ ω
Induced voltage is
proportional to angular
speed
ϕ J ⋅ ϕ&&
MR
ML
MM
di
Kirchhoff‘s voltage law: u M = R ⋅ i + L ⋅ + kG ⋅ ω
dt
Newton‘s law:
equilibrium of moments : M M − M R − M L = J ⋅ ϕ&&
Motor torque: M M = kG ⋅ i
MM : motor torque [Nm] kG : electromotive force constant [Vs],
torque constant [Nm/A]
ML : load torque [Nm]
1
MLoad in Nm
angular speed
i in A M in Nm rad/sec
1
2 1/R KG 1/J 60/2/pi 1/KGT 1
s
uM in V uTacho in V
Integrator
Gain 4 Gain 1 Gain Gain 5 Gain 3
MR Constant
Gain 2
KG
dϕ
eM = kG ⋅
dt
t
t ϕ ∫e M dt
∫ eM dt = kG ⋅ ∫ dϕ ⇒ kG =
0 0
0
ϕ
Connect the banana jack of the DC-motor with the analog input
Turn the motor shaft e. g. 10 times 2 π t
Calculate the constant with above equation eM dt ∫
kG = 0
Analog 1 ϕ
Input s
0.999Vsec
Analog Input Integrator Display
= = 0.0159 Vsec
0.015
Offset 10 ⋅ 2 ⋅ π
correction
CI
RI -
t
uin = eM +
uout =−
1
⋅ ∫ em dt
RI ⋅ C I 0
RI = 100 kΩ
C I = 1µF
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-44-
Determination of the System Parameters
…..or acquire the induced voltage with a storage scope and evaluation with MATLAB
0.7
0.6
0.5
0.4
induced voltage in V
0.3
0.2
0.1
-0.1
-20 -15 -10 -5 0 5 10 15 20
time in sec
load [Link]
m=10; %number of turns
sum(kgMeasuring(1:2047,2).*diff(kgMeasuring(:,1)))/(2*pi*m)
di
u M = R ⋅ i + L ⋅ + kG ⋅ ω
dt
1
ω = 2 ⋅ π ⋅ n = 2 ⋅ π ⋅ kT ⋅ uT ⋅ = 2 ⋅ π ⋅1419/60 ⋅1.77 V = 263 rad/sec
60
rad
4.9V − 0.0159Vsec ⋅ 263
u M − kG ⋅ ω sec = 4.64 Ω
⇒R= =
i 0.155A
torque
3
2.5
1.5
0.5
0
0 500 1000 1500 2000 2500 3000
− M R − 2.4 ⋅10 −3 Nm
J≈ = = 8.5 ⋅10 −7 kgm 2
∆ω rad
− 267
∆t sec
94 ⋅10 −3 sec
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-49-
Run Down Experiment
2
1.8 V
1.5
0.63*1.8 V=1.14 V
1
uT [V]
0.5
TM = 14 ⋅10−3 sec
-0.5
-0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18
time [sec]
1.8
1.6 measurement
simulation
1.4
1.2
uT [V]
0.8
0.6
0.4
0.2
0
-0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18
time [sec]
•Looking at the step response: we can approximate the DC-motor by a first order system
U T ( s) K
•Transfer function: G(s) = =
U M (s) T ⋅ s + 1
)
output signal Input signal u M = u M ⋅ sin(ω ⋅ t )
(green) (blue)
)
uT = uT ⋅ sin(ω ⋅ t + ϕ ) frequency
tϕ
1
u M (t )
0.5
u T (t ) û M
û T
0
-0.5
-1
settling process TP
-1.5
0 1 2 3 4 5 6 7 8 9 10
Time in sec
%Plot commands
%--------------
subplot(2,1,1)
semilogx(w,FdB,w,GdB,'r')
grid
xlabel('frequency [rad/sec]')
ylabel('magnitude [dB]')
subplot(2,1,2)
semilogx(w,phi,w,psi,'r')
grid
xlabel('frequency [rad/sec]')
ylabel('phase [°]')
[dB]
-10
magnitude
-15
measurement
-20 simulation: first order system
-25
0 1 2 3
10 10 10 10
frequency [rad/sec]
-20
-40
phase [°]
-60
-80
-100
0 1 2 3
10 10 10 10
frequency [rad/sec]
L R
uC
uT = C
Tachogenerator
di
Kirchhoff‘s voltage law: uT = R ⋅ i + L ⋅ + uC
dt
di
i = C ⋅ u&C ⇒ = C ⋅ u&&C
dt
Tachogenerator constant
inductance
1.8
1.6 measurement
simulation
1.4
1.2
uC [V]
0.8
0.6
0.4
0.2
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45
time [sec]
Plexiglas tube
pressure A
sensor AV
(4 to 20 mA
0 to 100 mbar p Ball valve
500 Ω Shunt) V&out
Volume balance:
In words:
dV
V&in − V&out = The volume flow rate in – volume flow rate out =
dt The time rate of change of fluid volume inside the tube
= AT ⋅ h&
AT : Cross sectional area of the tube
AV : Cross sectional area of the ball valve
g : Acceleration due to gravity
h : Water level
V&out = AV ⋅ 2 ⋅ g ⋅ h
1424 3 volume flow rate out
Torricelli
− AV ⋅ 2 ⋅ g
k ⋅ h = h with k =
&
AT
1
−
k ⋅ dt = h dh 2 Separation of variables
t h 1 Integration
−
∫ k ⋅ dt = ∫ h
0 h0
2
dh
h
1
k ⋅ t = 2 ⋅ h 2 Antiderivative
h0
k2 2
h(t ) = ⋅ t + k ⋅ h0 ⋅ t + h0 Solution (parabola)
4
k=-AV*sqrt(2*g)/AT; %abbreviation
0.25
0.2
level [m]
0.15
0.1
0.05
-0.05
-5 0 5 10 15 20
time [sec]
Banana jack
Voltage Supply
12 V
PWM
5V
0V
Problem: delivering power to a load (motor, heater, etc.) leads to power loss
and heat dissipation in the output stage.
A conventional linear output stage applies a continuous voltage to a load.
Solution: PWM
Just two system components are needed: a saw tooth wave generator and a
comparator
When should you use PWM? If the pulse period is much shorter than the
time-constant of the load, then PWM has a potential application. The time-
constants are defined, for example, by the thermal mass of a resistive heater
or the mechanical inertia of a motor. And it's the long time-constants that
average the pulses to a desired value set by the PWM's input voltage (low
pass character).
uc
Control signal uc
uS
High frequency saw tooth uS
uc ≥ u S ⇒ u0 switched on
uc < u S ⇒ u0 switched off
t
u0
Average value of u0 is
proportional to control signal uc
Cycle duration
TP
u(t) ton
u0
_
u
t
T t on
1 P 1 ton
TP ∫0 ∫ u0 dt = u0 ⋅
u= u (t ) dt =
TP 0
TP
T t
1 P 2 1 on 2 t
u rms = ⋅ ∫ u dt = ⋅ ∫ u0 dt = on ⋅ u0
TP 0 TP 0 TP u2
u R P=
u 2
t on u ton 2 R
P= = rms
⋅ = ⋅ P0
0
R TP R TP
• With PWM: linear relationship between heating power and duty cycle ton !
40.05
40
temperature [°C]
39.95
39.9
39.85
39.8
39.75
39.7
39.65
44 46 48 50 52 54 56 58
time [sec]
60
55
50
45
temperature [°C]
40
35
30
25
20
0 50 100 150 200 250 300 350 400 450 500
time [sec]
Block Diagram
K 1
0 .4
T 1 .s+ 1 T 2 .s+ 1
Step input [-] Transfer Fcn Transfer Fcn 1 Scope
initial
42 .6 temperature
[°C ]
real system
Step +
(…)2 Σ min
input -
model
K 1
T 1 .s+ 1 T 2 .s+ 1
Transfer Fcn Transfer Fcn 1
IdentifyHeater.m
call
SumSquaresErrors.m
call
[Link]
system identification
60
p=
58
2 1
56
54
Temperature in °C
52
p=
50
24.3422 0.0127
48
46
44
42
0 50 100 150 200 250
time [sec]
1.8
1.6
1.4
sum of squared errors
1.2
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70
iteration steps [-]
Aluminium rod
Electric
heating
device
LM 395 transistor
operating
in saturation mode
Lustre terminal
(power supply )
dx L
PHeater Px Px + dx H
x Pconv B
We want to simulate the temperature T(x, t) which is a function of location x and time t.
P Heating power[W)]
Heater
∂Ethermal
Px − Px + dx − Pconv = (1)
∂t
Fourier’s law of heat conduction: ∂T
Heat conducted through cross sectional area Is Px = −k ⋅ Ac ⋅ (2)
proportional to the temperature gradient (minus ∂x
sign denotes heat flux always from high to low
temperature!) Radiation is neglected!
k Thermal conductivity [W/(mK)]
A c = B ⋅ H cross sectional area [m2]
∂T temperature gradient [K/m]
∂x
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-93-
Set-up of the Differential Equation
∂P
Taylor series expansion: Px + dx = Px + ⋅ dx
∂x
∂ 2T
= Px − k ⋅ Ac ⋅ 2 ⋅ dx (3)
∂x
Thermal power loss due to convection is proportional to the heat
exchanging surface area and the temperature difference
h Convection coefficient[W/(m2K)]
dA ≈ 2 ⋅ H ⋅ dx surface area [m2] (face surface neglected)
T Amb Ambient temperature [°C]
∂ 2T ∂T
k ⋅ B ⋅ H ⋅ 2 ⋅ dx − h ⋅ 2 ⋅ H ⋅ dx ⋅ (T − TAmb ) = c ⋅ ρ ⋅ B ⋅ H ⋅ dx ⋅
∂x ∂t
Rearranging the equation:
∂T k ∂ 2T 2⋅h 2⋅h
= ⋅ 2 − ⋅T + ⋅ TAmb
∂t c ⋅ ρ ∂x c⋅ρ ⋅B c⋅ρ ⋅B
∂ 2T
= K1 ⋅ 2 − K 2 ⋅ T + K 2 ⋅ TAmb (6)
∂x
Second order partial differential equation
Initial conditions:
At the beginning the whole aluminium rod has the same temperature TAmb
T ( x, t = 0) = TAmb
Boundary conditions:
Left boundary: we can calculate the temperature gradient at x=0 with Fourier’s law
∂T ∂T PHeater
PHeater = −k ⋅ B ⋅ H ⋅ ⇒ =− (7)
∂x x =0 ∂x x =0 k ⋅B⋅H
Right boundary: we have no heat transfer over right border at x=L
∂T
=0 (8)
∂x x =L
0 1 2 3 4 5
From2
[T0] T0 [°C ]
[T3] Scope
From
T1 [°C ] [T 1]
From5
[T2] T2 [°C ] Goto 1
Simulink Block Diagram
[T4]
From 6
segment 1 From 11
[T5]
[T1] T1 [°C ]
From 15
From 4
T2 [°C ] [T 2]
From 8
segment 2
[T 2] T2 [°C ]
From7
T3 [°C ] [T3]
[T 4] T4 [°C ] Goto 3
From 10
segment 3
[T 3] T3 [°C ]
1 k*A/LS
T0 [°C]
Gain 3
T1' T1
1
2 k*A/LS 1/c/mS 1
s
T2 [°C] T1 [°C]
Gain 2 Gain Integrator
h*ASurf
Gain 1
Subtract
TAmb Constant
120
T0
T1
110
T2
T3
100 T4
T5
90
80
temperature in °C
70
60
50
40
30
20
0 500 1000 1500
time in sec
120
110
100
90
80
temperature in °C
70
60
50
40
30
20
0 50 100 150 200 250
distance in mm
100
T1
T2
90 T3
T4
T1sim
80 T2sim
T3sim
T4sim
70
temperature in °C
60
50
40
30
20
-200 0 200 400 600 800 1000 1200 1400 1600
time in sec
∂T ∂ 2T
= K1 ⋅ 2 − K 2 ⋅ T + K 2 ⋅ TAmb
∂t ∂x
∂T T ( x, t + ∆t ) − T ( x, t ) Ti , j +1 − Ti , j
≈ = (9)
∂t ∆t ∆t
∂T T ( x + ∆x, t ) − T ( x, t )
≈
∂x ∆x
T ( x + ∆x, t ) − T ( x, t ) T ( x, t ) − T ( x − ∆x, t )
−
∂ 2T ∆x ∆x
≈ = ...
∂x 2
∆x
T ( x + ∆x, t ) − 2 ⋅ T ( x, t ) + T ( x − ∆x, t )
=
∆x 2
Ti +1, j − 2 ⋅ Ti , j + Ti −1, j
= (10)
∆x 2
Ti , j +1 − Ti , j Ti +1, j − 2 ⋅ Ti , j + Ti −1, j
= K1 ⋅ − K 2 ⋅ Ti , j + K 2 ⋅ TAmb
∆t ∆x 2
K1 ⋅ ∆t
Ti , j +1 = ⋅ (Ti +1, j − 2 ⋅ Ti , j + Ti −1, j ) − K 2 ⋅ ∆t ⋅ (Ti , j − TAmb ) + Ti , j
∆x 2
K1 ⋅ ∆t
Ti , j +1 = ⋅ (Ti +1, j − 2 ⋅ Ti , j + Ti −1, j ) − K 2 ⋅ ∆t ⋅ (Ti , j − TAmb ) + Ti , j
∆x 2
110
100
80
temperature in °C
70
60
50
40
30
20
0 50 100 150 200 250
Initial temperature distance in mm
90
80
temperature in °C
70
60
50
40
30
20
0 100 200 300 400 500 600 700 800
time in sec
60
100
50
200
40
300
time in sec
400 30
500 20
600
10
700
∂T ∂ 2T
= K1 ⋅ 2 − K 2 ⋅ T + K 2 ⋅ TAmb = 0
∂t ∂x
∂ 2T
− K 3 ⋅ T = − K 3 ⋅ TAmb
∂x 2
exp(K3^(1/2)*x)*C2+exp(-K3^(1/2)*x)*C1+TAmb
− K3 ⋅x K3 ⋅x
T ( x) = C1 ⋅ e + C2 ⋅ e + TAmb
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-115-
Determination of arbitrary Constants
Boundary conditions:
∂T PHeater ∂T
=− =0
∂x x =0 k ⋅B⋅H ∂x x =L
∂T − K3 ⋅x K3 ⋅x
= −C1 ⋅ K 3 ⋅ e + C2 ⋅ K 3 ⋅ e
∂x
PHeater
x = 0 : −C1 ⋅ K 3 + C2 ⋅ K 3 = −
k ⋅B⋅H
− K 3 ⋅L K 3 ⋅L
x = L : −C1 ⋅ K 3 ⋅ e + C2 ⋅ K 3 ⋅ e =0
− K 3 ⋅L K 3 ⋅L K 3 ⋅2⋅ L
− C1 ⋅ e + C2 ⋅ e = 0 ⇒ C1 = C2 ⋅ e
K 3 ⋅2⋅ L PHeater
− C2 ⋅ e ⋅ K 3 + C2 ⋅ K 3 = −
k ⋅B⋅H
− PHeater
⇒ C2 =
k ⋅ B ⋅ H ⋅ K3 ⋅ 1 − e ( K 3 ⋅2⋅ L
)
− K 3 ⋅L K 3 ⋅L
x = L : −C1 ⋅ K 3 ⋅ e + C2 ⋅ K 3 ⋅ e =0
− K 3 ⋅L K 3 ⋅L K 3 ⋅2⋅ L
− C1 ⋅ e + C2 ⋅ e = 0 ⇒ C1 = C2 ⋅ e
L
PHeater = ∫ h ⋅ (T ( x) − TAmb ) ⋅ dA
0
L
= ∫ 2 ⋅ H ⋅ h ⋅ (T ( x) − TAmb ) ⋅ dx
0
Nx
≈ ∑ 2 ⋅ H ⋅ h ⋅ (Ti − TAmb ) ⋅ ∆x
i =1
contacts
Armature off
Armature on
coil
connections
i Current [A]
k spring
R Resistance [Ω]
l
x x0 L Inductance [H]
Air gap
H Magnetic field intensity [A/m]
µr Permeability [-]
u = R ⋅ i + (L ( x ) ⋅ i )
Kirchhoff‘s voltage law:
d
dt
di dL
= R ⋅ i + L( x) ⋅ + ⋅i
dt dt
with
dL dL dx dL
= ⋅ = ⋅ x&
dt dx dt dx
Velocity of armature
Ampere‘s law: ⋅ n = ∫ H ⋅ ds ≈ H1 ⋅ l1 + H 2 ⋅ l2
i{ 1: iron
2: air
ampere-turn l Length of the field line
Φ
Neglecting leakage flux: B1 = B2 = B = = µ r ⋅ µ 0 ⋅ H1 = µ 0 ⋅ H 2
A
B1 B2
⇒ H1 = , H2 =
µ r ⋅ µ0 µ0
l1 l2 Φ l1 x
i ⋅ n = B ⋅ + = ⋅ +
µ r ⋅ µ0 µ0 A µ r ⋅ µ0 µ0
i ⋅ n ⋅ A ⋅ µr ⋅ µ0
Solving this equation for Φ: Φ =
l1 + µ r ⋅ x
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-122-
Calculating the Inductance
Φ n 2 ⋅ A ⋅ µr ⋅ µ0
Inductance of a coil : L = n⋅ =
i l1 + µ r ⋅ x
Plug in Φ
1
Stored energy in a coil
W = ⋅ L ⋅ i2
2
Magnetic force F:
dW = F ⋅ dx
dW 1 dL 2 n 2 ⋅ A ⋅ µ r2 ⋅ µ0 2
⇒F= = ⋅ ⋅i = ⋅i
2 ⋅ (l1 + µ r ⋅ x )
2
dx 2 dx
Remark: i does not depend on x! See measured steady state values of current
With no air gap, with constant air gap, with variable air gap
− F ⋅ l + (Fpreload + k ⋅ ( x0 − x ))⋅ l = J ⋅
&x&
l
Fpreload + k ⋅ ( x0 − x )
l FSpring
x ϕ
Fpreload
F
0 x0 x
Fakultät für Maschinenbau und Mechatronik
Modelling and Simulation of Dynamic Systems Prof. Helmut Scherf
Mechatronik u. Fahrzeugtechnologie
-125-
From 1 [F ]
Block Diagram x'
[xdot ] Goto 2
[F]
From 4
[I]
F_preload
x''
1 1 From 5
Constant l^2/J [x]
s s
u<0 [x]
Gain 1 Integrator
Integrator Goto
Product 2
Gain if FM <Fspring Product initial conditon :x0 From 7
k noacceleration
Fcn4 [xdot ]
u>0 From 8
x0 if gap is closed (x=0) Scope 2
== >xdot =0
Constant 1 [I]
From 6 Scope 5
From
[x]
u=12 V 12
Product 1
di /dt i
1
R
s
Integrator 2 Gain 2
Goto 1
Fcn3 Goto 3
From 2
dL /dx *xdot *i
[xdot ]
nW^2*A*myr *my 0/(L1+myr *u(2))
From 3
L(x)
0.045
0.04
0.035
measurement
0.03 simulation
0.025
current in A
0.02
0.015
0.01
0.005
-0.005
-0.01 0 0.01 0.02 0.03 0.04 0.05
time in sec
pause
sim('Relay')
plot(withvarAirGap(:,1),withvarAirGap(:,2)/22,I(:,1),I(:,2),'r')
grid
xlabel('time in sec')
ylabel('current in A')
legend('measurement','simulation')