Dynamical Systems
Dynamical Systems
Technology students at the University of Twente in mind. The book gives a concise description
of the physical properties of electrical, mechanical and hydraulic systems. Emphasis is placed
achterkant 18,5 cm + 1,5 mm voor de lijm = 18,65 voorkant 18,5 cm + 1,5 mm voor de lijm = 18,65
rug 15 mm
Dynamical Systems
for
Creative Technology
Job van Amerongen
© 2010
ii
All IPMs, block diagrams, bond graphs and plots in this book have been made with
20sim® .
ISBN: 9789079499076
Title: Dynamical Systems for Creative Technology
Author: Amerongen, J. van
Publisher: Controllab Products B.V., Enschede
Printed by: Asbreuk, Enschede
Contents
Preface vii
2 Dynamical Systems 13
2.1 Effects of actions only observable after some time . . . . . . . . . . . . . 13
2.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1.2 Tax measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1.3 Pig cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.4 Foxes and Rabbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.5 Bank account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.6 Water Vessel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.7 Similarities between these systems . . . . . . . . . . . . . . . . . 22
2.1.8 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 The role of feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.1 Positive feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.2 Negative feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.3 Mechanical and electrical systems . . . . . . . . . . . . . . . . . . 25
iii
iv CONTENTS
5 Numerical simulation 53
5.1 The need for numerical simulation . . . . . . . . . . . . . . . . . . . . . 53
5.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Numerical integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.2.1 Difference versus differential equations . . . . . . . . . . . . . . . 59
5.2.2 Euler integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.2.3 Tustin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.2.4 More advanced methods . . . . . . . . . . . . . . . . . . . . . . . 65
5.2.5 Sorting the equations . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.2.6 Accuracy versus efficiency . . . . . . . . . . . . . . . . . . . . . . . 66
6 Electrical Circuits 69
6.1 Elementary models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.1.2 Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.1.3 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.2 Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.2.1 Kirchhoff’s laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.2.2 Concept of impedance . . . . . . . . . . . . . . . . . . . . . . . . . 80
6.2.3 Electrical networks . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
6.3 Computations versus simulations . . . . . . . . . . . . . . . . . . . . . . 87
6.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7 Mechanical Systems 91
7.1 Elementary models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.1.2 Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.1.3 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7.2 Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.2.1 Impedances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.2.2 D’Alembert’s law . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.3 Mechanical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.3.1 Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
7.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
CONTENTS v
Dynamical Systems for Creative Technology gives a concise description of the phys
ical properties of electrical, mechanical and hydraulic systems. Emphasis is placed
on modelling the dynamical properties of these systems. By using a system’s ap
proach it is shown that a limited number of mathematical formulas suffices to de
scribe the basic properties of all of these systems. Mathematical functions such
as integration and differentiation are introduced and directly related to real world
phenomena, ranging from pure technical systems, to motions of flowers or social
systems. More abstract descriptions help to systematically analyse these systems
and support the modelling process. The cover reveals this idea by giving a num
ber of representations of the same phenomenon. In terms of a dynamical model
there is little difference between the suspension system of a car and the motions of
a flower in the wind.
The first chapters deal with describing basic systems in the hydraulic, electri
cal and mechanical domain. Mathematical and simulation tools are introduced
and used to analyse such systems. Next, it is shown that all these systems share
the same basic properties, which allows the use of analogon models. A more ab
stract domainindependent description helps to better understand the dynamic
behaviour and allows for modifications of the system in the domain that is most
easily accessible.
The last chapters deal with the role of feedback in dynamical systems. Examples
are shown by applying these concepts to electronic simulation models with oper
ational amplifiers. Feedback control systems are briefly introduced as a means to
change the dynamical properties of a system.
In the text and exercises extensive use is made of the modelling and simulation
programme 20sim. This programme supports all the models used in this course,
especially iconbased physical models. The exercises stimulate exploration of the
programme and experimenting with the models. The exercises are intended to raise
questions rather than being classroom problems with a straightforward solution.
I would like to acknowledge the comments on draft versions of this book. Sev
eral people contributed to improvements but the help of my wife Gerda, daughter
Renée and Christian Kleijn is especially acknowledged. Comments of the readers
are welcome too: feedback is a good principle to reduce errors and realise a good
result.
vii
viii PREFACE
1
The word system is regularly used in everyday life
and with many different meanings. In this chapter
we will consider several technical and
nontechnical systems and give a definition.
1.1 Introduction
The word ‘system’ has many different meanings in everyday life, although it is sel
dom well defined. This course deals with the description of systems, making a
‘model’ of a system and analysing the behaviour of systems. Special focus will be
on so called dynamical systems. These are systems where the effect of a certain ac
tion only becomes visible, or reaches a steady state, after some time. An example is,
for instance, a central heating system. If you set a higher temperature at the ther
mostat, it is only after some time that the radiators heat up and it takes even longer
before the room gets warmer and finally reaches a constant temperature (the steady
state). There are many more examples of such systems. Tax measures often only
have observable effects some time after the measures were taken. In an economi
cal crisis some of the effects only become apparent long after the crisis has started.
In electrical circuits or mechanical systems dynamical effects are also important.
If you want to create a realistic computer game, these effects should be well under
stood.
Exercise 1.1
Describe some more systems where there is a cause and effect and where the effect is only
observed after some delay.
1
2 CHAPTER 1. THE CONCEPT OF SYSTEMS
1.1.2 Modelling
It will be clear from the list above that one thing all these definitions have in com
mon, is that a system has some complexity and that it consists of several parts or
components that interact with each other. Therefore, we will use the following defi
nition of a system:
A holistic view implies that we consider all aspects that are important. This in
cludes the effects that may become relevant later in time or at other places. Con
sidering the complete life cycle of a product is an example of such an approach.
The cost and environmental impact of a product is not only related to the produc
tion and use of a product, but also to its disassembly or environmental impact (e.g.
if the product ends its life in the trash bin).
The beforementioned central heating system is an obvious example of a system.
A central heating system is a real physical system. However, as soon as we try to
describe it, we are forced to make a simplified description of the system. We often
call this a model. The process that leads to such a description is called modelling.
MP3player
Water clock
A system that shows several of the effects mentioned here is a water clock, used al
most 3500 years ago in ancient Egypt. The basic principle is illustrated in figure 1.1.
time
B
Tanks A and B together act as source of constant water pressure. Together they can
be seen as equivalent to the cistern of a toilet. Tank A is the water supply. This could
be a river, a large vessel filled with water or just a tap. This supply should never be
empty. But because the level in the vessel may vary, the pressure at the outlet in the
bottom is not constant over time. On the contrary, the level in tank B is kept con
stant by means of a floater. When the water level in tank B drops, because of water
flowing out of tank B at the bottom, the floater opens the outlet of tank A and so
automatically fills tank B to the level where the ‘valve’ is closed again. The floater,
which measures the water level and opens the valve if the water level is not at its
correct value, ‘controls’ the water level in tank B , such that it remains at a constant
value. We call such a system a ‘level control system’.
Exercise 1.2
When the level in tank B is constant, the level in tank C can be used (by means of the
floater and the scale) as a measure of time. Explain why.
causal relation This can be drawn schematically in a socalled causal relation diagram (figure 1.2).
diagram
The direction of the arrows in the diagram indicates the causeandeffect relations.
When the level in tank B decreases (the cause) the effect is that the floater comes in
a lower position. The lower position of the floater is the cause that the valve opens
(the effect). In this case the plus signs indicate that this flow increases the level in
the tank while the minus signs indicate an outgoing flow.
environment In the right part of figure 1.2 we model a part of the system as the environment,
because we are not interested in further study of the level in tank A. Only the vari
able pressure at the bottom of this tank is relevant for the rest of the system.
1.1. INTRODUCTION 5
F IGURE 1.2 Causal relation diagram of the control system implemented with
tank A and B.
Left: tank A as a part of the system.
Right: tank A not modelled because it is seen as a variable pressure
supply and part of the environment.
Exercise 1.3
The system in the right part of figure 1.2 is in fact nothing else than the ‘level control sys
tem’ of the cistern of a toilet. After flushing the toilet a floater opens the tap and closes the
tap again when the cistern is fully filled. Have a look at this system at home and identify
the different elements (if it is not a modern builtin system). The practical implementa
tion is often not as straightforward as the simple system discussed here, but in principle it
will be similar.
Because of this ‘control system’ the water level in tank B is constant and thus also
the water pressure at the outlet of tank B . This results in a constant flow of water
out of tank B into tank C . The height of the floater in tank C , which can be con
nected with a readout is proportional with time and can thus be used as a clock.
This causal relation diagram shows the relations between the different elements
of the system. It also makes clear that the behaviour of some elements depend on
the elements themselves. For instance, the level in tank B is influenced by itself
because the amount of water flowing out of tank B depends on the level in tank B .
(Although as long as the level of tank B is kept constant you probably do not realise
6 CHAPTER 1. THE CONCEPT OF SYSTEMS
feedback this dependency.) Such a dependency is called feedback. Another feedback loop is
present because the level in tank B influences the position of the floater, which by
controlling the flow of water into tank B , also influences the level of water in tank
B . This latter feedback was intentionally added in order to keep the level in tank
feedback control B constant. This results in a feedback control structure. Feedback structures are
present everywhere in nature, in biological systems and in social systems. Often
they are inherently present and not recognised as such. When we add a feedback
loop to keep certain quantities constant (e.g. the temperature in all systems with a
thermostat) or to prescribe certain motions (e.g. the movements of a robot), we talk
control system about a control system.
The change in the volume in [m 3 ] is thus the product of the constant incoming flow ϕi n
in [m 3 s −1 ] times the time in [s ]. These dimensions help to check if the formula is right:
the volume is [m 3 ]=[m 3 s −1 ] · [s]
The subsystem ‘tank B ’ is not an elementary subsystem. Because of the leakage the
volume not just depends on the incoming flow. The outgoing flow depends on the
level in the tank and thus on the volume of water in tank B . The simple eq. 1.1 is
thus not applicable. We should also ‘model’ the opening in the bottom of tank B ,
which determines the water flow out of this tank.
Forms of interaction
In a system, which consists of several subsystems, there are various forms of inter
action. Figure 1.3 gives an overview of different possibilities.
We see three subsystems separated by the dashed line from the environment.
The input signal (a) represents a known or measurable signal from the environ
ment that influences the system. The output signal ( f ) is a signal that can be ob
served in the environment. The signals (b, c, d , e) cannot be observed in the envi
ronment, otherwise these would be output signals as well. The disturbance signal
(g ) is an input signal that is not easily measurable or unknown. It represents all the
unknown or unmeasurable inputs of the system. Signals (b) and (c) are internal
interconnections, which connect the subsystems 1 and 2 and 2 and 3 respectively.
Signals (d ) and (e) are feedback signals because due to these signals, feedback loops
are created. For instance, the feedback signal (d ) indicates that the signals in sub
system 2 depend on themselves. And because of the feedback signal (e) also the
signals in subsystem 3 depend on themselves, although this is a more complex rela
tion: through subsystems 1 and 2. The same holds of course for subsystems 1 and 2
because all the subsystems are part of the feedback loop.
Exercise 1.4
When you are exercising or do some heavy work, your body gets warm. In order to prevent
that the body becomes overheated, you will start to sweat. Depending on the humidity of
the air this will cool down the body. Make a causal relation diagram that describes this
process. There are many more of such feedback mechanisms in the human body. Identify
and describe a few more.
In figure 1.3 the interaction from one subsystem to the other is realised by directed
edge edges. The arrows at the end of the edges indicate the direction of the information
flow. This implies in the example of figure 1.4 that subsystem 1 (the sound ampli
fier) influences the sound in the room through the behaviour of subsystem 2 (the
room acoustics). In general the acoustics of the room do not influence the be
haviour of the sound amplifier and certainly not the CD or the MP3player memory
itself.
There are also many systems where the action of one subsystem leads to a reaction
of the other subsystem. In that case we could use two arrows, or just a single edge
bilateral without any arrows. An example of such a system with bilateral interaction is the
interaction
mass spring system of figure 1.5. When the mass moves the length of the spring
changes and thus the force, which the spring exerts on the mass. This force changes
the acceleration, speed and position of the mass. The changing position of the mass
1.3. DYNAMICAL SYSTEMS AND CREATIVE TECHNOLOGY 9
changes again the length of the spring and thus the force, which the spring exerts
on the mass. Although the mass and the spring can be considered as elementary
subsystems or submodels, their behaviour can only be studied in combination.
We cannot decide here what is action or reaction. Therefore, we could use an edge
without any arrows to connect the two subsystems.
F IGURE 1.5 3 models showing the bilateral interaction in a system with a mass
and spring hanging on the ceiling.
a) iconic diagram,
b) causal relation diagram,
c) acausal model
Diagrams with only directed edges, such as figure 1.3 and figure 1.4 are called
causal relation diagrams, because the signals (edges) in these systems indicate a
cause and effect relation between the subsystems. Figure 1.5b also represents a
causal relation diagram, because it indicates the influence of the spring position or
spring force on the mass as well as the influence of the mass velocity on the change
in the spring position. Figure 1.5c gives the same relations but now without choos
ing what we consider as cause and effect. We call such a model an acausal model. acausal
Such models are appropriate for most physical systems.
proper use of such systems. Throughout this course we will give examples of such
systems, show how these can be computed with spreadsheets, with special sim
ulation software, or by programming these systems yourself. As such, this course
relates to the course motion and modelling, which goes into more detail on the
mathematics behind the systems we will discuss here, and courses on program
ming, where the examples of this course are used to illustrate programming.
1.3.2 Electronics
In many situations we want to make interactive games, interactive media or smart
systems that interact with the environment. This is where the virtual world and the
real world meet. Besides software, hardware is needed for telecommunication, in
terface electronics, and so on. This course is the basis for introductory courses on
electronics and wireless communications and control systems.
F IGURE 1.6
Segway
(photo: Jan Hesselink)
12 CHAPTER 1. THE CONCEPT OF SYSTEMS
2
A basic property of dynamical systems is that their
behaviour depends on what happened in the past.
We could observe the system at fixed time
intervals, e.g. every month, or in a more
continuous way. We will see examples of both
classes of systems.
Dynamical Systems
13
14 CHAPTER 2. DYNAMICAL SYSTEMS
cigarettes is so high that people really refrain from smoking, the total amount of
taxes may even be lower than it was before the tax measure.
Sometimes people just go on buying products whatever the price may be. In
economics this is referred to as the price elasticity (See e.g. wikipedia: The demand
price elasticity for a product is relatively inelastic when the change in quantity demanded is less
than change in price. Goods and services for which no substitutes exist are gener
ally inelastic.) If demand varies a lot as a function of the price the elasticity is said to
be high.
However, the reality is more complex. Because of the increase in tobacco prices
many people might decide to quit smoking. The measure seems thus to be suc
cessful. But many addicted smokers will relapse and go back to their bad habits
again after some time. In that case, the tax income will increase after some time. In
model order to predict what will happen in the long run, a good model of this economic
phenomena should be available. Depending on what the real goal is: getting more
money from smokers or increasing the health of the population, decisions of the
most adequate price increase could be made with such a model.
Exercise 2.5
Make a causal relation diagram of the system that describes the phenomena discussed
here.
We see this in many other economic systems. People tend to buy stocks when they
have performed well recently. The increasing demand leads to higher prices, at
tracting more people to the stock market. When big investors cash their profit,
prices start dropping and more and more people sell their stocks.
2.1. EFFECTS OF ACTIONS ONLY OBSERVABLE AFTER SOME TIME 15
400 pigs
300
200
100
400 price
300
200
100
400 breeding
300
200
100
0 5 10 15 20 25 30
time {months}
F IGURE 2.1 Production and prices vary periodically in the ’pig cycle’
Exercise 2.6
Think of other systems that show such a behaviour. Also try to identify the elements in
such a system. Draw a causal relation diagram.
We assume that the newborn foxes are proportional with the number of foxes
and their food supply (i.e. the number of rabbits) eR k−1 F k−1 . We will not use the
shortage of food in the mortality rate of the foxes, but simply assume that the num
ber of foxes that die is proportional to their number −d F k−1 .
Exercise 2.7
Make a causal relation diagram of the system that describes the phenomena discussed
here. Make use of the symbols in the description given so far. This will help to derive the
equations necessary to simulate the system.
From a causal relation diagram with enough detailed information, we can easily
derive the two equations that describe this system. The population of rabbits can
then be described by the equation:
2
R k = R k−1 + aR k−1 − bR k−1 − cR k−1 F k−1 (2.1)
or by computing one step ahead:
R k+1 = R k + aR k − bR k2 − cR k F k (2.2)
Similarly the population of foxes can be described as:
F k+1 = F k − d F k + eR k F k (2.3)
Exercise 2.8
Of course these results depend on the parameters used. Make a simulation model yourself
in an environment of your choice, play with the parameters and try to interpret the results.
2.1. EFFECTS OF ACTIONS ONLY OBSERVABLE AFTER SOME TIME 17
200
R
180
F
160
140
120
100
80
60
40
20
0
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61
F IGURE 2.2 Number of foxes F and rabbits R as a function of time (60 months)
foxes
100 versus
rabbits
80
60
40
30
20
10
0
0 50 100 150 200
In the example of the bank account we observe another mechanism as well: The
account can also grow because of deposits. This growth is not dependent on the
amount of money in the bank account, but only on ‘external’ factors. The same
holds for the withdrawals. This can be expressed in a causal relation diagram (See
figure 2.4)
ciepo~it{ d) +

h~
. ~ ac~~
4
F IGURE 2.4 The balance of the bank account increases due to interest and de
posits, and decreases due to withdrawals
The balance B of the bank account, depends thus on the interest α, the deposits
d and the withdrawals w, according to eq. 2.5. The terms d k and w k can be seen as
input external inputs of the system.
B k+1 = B k + αB k + d k − w k (2.5)
This can be written as
B k+1 = (1 + α)B k + d k − w k (2.6)
or
V (t ) = ϕt (2.8)
or in words: when the flow into the tank is constant, the volume V (t ) is found by
multiplying this flow (in [m 3 /s]) with the time t [s]. A more precise formulation is
V (t ) = ϕt + V (0) (2.9)
where V (0) is the volume of water in the tank at t = 0, at the start of our observa
tions..
We could consider this water tank in a similar way as the systems of the bank
account or the fox and rabbit populations, by only describing the observations at
certain time intervals ∆T e.g. every second. In that case the volume in the tank is
described as:
V (k + 1) = V (k) + ϕ ∆T (2.10)
Let us generalise this a bit and consider the situation that the net incoming flow is
not constant. Then we get the equation:
k
ϕ(i ) ∆T + V (0)
X
V (k) = (2.12)
i =0
In the case of the bank account such a description is the most appropriate. How
ever, in the case of the water vessel, we are dealing with a continuous time process.
Changes happen continuously, at infinitesimal small time intervals. Therefore a de
scription as in eq. 2.8 is more natural. But this equation is only valid if the flow ϕ is
constant. In the case of a constant flow eq. 2.12 simplifies to:
k
(ϕ ∆T ) + V (0)
X
V (k) = (2.13)
i =0
V (k + 1) = ϕ ∆T + V (k) (2.14)
In general a description for nonconstant flows (ϕ = ϕ(t )) is more interesting. This
can be obtained by considering eq. 2.12 for infinitesimal small time intervals ∆T . To
indicate that ∆T is very small, we write dt instead of ∆TR. Simultaneously we change
the sum symbol , by a stylised S, the integral symbol .
P
integral
Z T
V (T ) = (ϕ(t ) dt ) + V (0) (2.15)
t =0
20 CHAPTER 2. DYNAMICAL SYSTEMS
This can be illustrated with figure 2.5. In this figure we see at the left a causal rela
tion diagram with the input signal ϕi n and the output signal V . Because eq. 2.15
gives a more quantitative description, we can also represent this in the form of a so
block diagram called block diagram. This block diagram is drawn at the right of figure 2.5. Such a
block diagram can be directly simulated with 20sim.
tank
The block diagram of figure 2.5 is in fact a graphical representation of eq. 2.15. Or in
words: the output signal V is the integral (contents of the block) of the input signal ϕ.
Note that the initial condition (V (0)) is assumed to be zero in this block diagram.
In high school mathematics integration is often treated in a very abstract way. Mostly
integrals of the form f (x)d x are considered. Of course x can be any variable. In dy
R
namical systems we always consider systems where the behaviour as a function of time is
important. In such a system integration over a time interval (or in the case of discrete sys
tems, summation) is almost always present. This is not only true for the water vessel, but
also when we want to describe mechanical systems with masses and springs, or electrical
networks with capacitors and inductors. Integration or summation is thus not just ‘com
puting the surface under a curve’. It is directly related to phenomena like the growth of a
bank account (by adding the annual interests, deposits and withdrawals in a summation)
or the increasing volume in a tank by integrating (summing over infinitesimal small time
intervals) the net incoming flow.
So far we only considered a simple water vessel with just an incoming flow. In terms
of a system description this incoming flow is the input signal and the volume of
water in the tank the output signal. Let us now consider a tank with no input, but
with a small hole in the bottom. The amount of water that flows out of the tank,
ϕout , depends on the size of the hole and is proportional to the pressure p at the
bottom of the tank.
ϕout = c hole p (2.16)
where c depends on the size of the hole. Often we use the inverse of c hole , the resis
tance r . A small hole has a large resistance, a large hole forms a small resistance.
1
ϕout = p (2.17)
r
The water pressure p is proportional to the height of the water in the tank. This can
be expressed as:
p = c1 h (2.18)
where c 1 depends on the density of the fluid. In a cylindrical tank the height h in
[m] is equal to the volume V in [m 3 ] divided by the bottom surface of the tank A in
[m 2 ]:
V
h= (2.19)
A
2.1. EFFECTS OF ACTIONS ONLY OBSERVABLE AFTER SOME TIME 21
and thus
V
p = c1 (2.20)
A
If A is large, a large volume can be buffered with a low height and thus a low pres
sure at the bottom. Therefore, the most systematic way to represent the relation
between pressure and volume is:
c1 1
p= V= V (2.21)
A c
where c = A/c 1 is the ‘buffering capacity ’ of the tank. With eq. 2.17 and eq. 2.21 we buffering
capacity
see that the outgoing flow is proportional to the volume:
1 1
ϕout = p= V (2.22)
r rc
When we substitute eq. 2.22 into eq. 2.15 we find (taking into account that ϕout is an
outgoing flow:
Z T Z T 1
V (T ) = − ϕout (t ) dt + V (0) = − V (t ) dt + V (0) (2.23)
t =0 t =0 r c
tank
leakage
This can be illustrated with figure 2.6. In this figure we see at the left a causal rela
tion diagram. This indicates that the volume of water in the tank depends on itself
because the outgoing flow depends on the size of the hole and, via the pressure at
the bottom of the tank, also on the volume of water. The dotted input signal ϕin
indicates that also in this case there can be constant or variable flow from the ‘en
vironment’ into the tank. The block diagram at the right shows that the volume in
the tank is the integration of the sum of all flows. The − sign at the summer is due
to the fact that the outgoing flow reduces the volume. The latter representation is
probably the clearest way to indicate that leakage can be seen as negative feedback. negative
The volume in the tank is the integration of the sum of all incoming flows minus the feedback
sum of all outgoing flows.
Of course we can also make a model of the leaking water tank with the volume as
‘output’. That results in the block diagram of figure 2.7.
22 CHAPTER 2. DYNAMICAL SYSTEMS
tank
1
rc
leakage
Exercise 2.9
Try to make a graph of the volume of the tank as a function of time. Assume that the
incoming flow ϕin = 0 and let V (0) be 10 liter. The size of the hole is such that there would
be a constant outgoing flow of 10[l /s] if the volume in the tank would be a constant 10
liter.
Exercise 2.10
Simulate this system with 20sim. Instructions how to do this can be found in the tutorial
at: http://www.controllab.nl/en/books/dynsys.html Use the numerical values of exercise
2.9. Also simulate the system when there is, in addition to the leakage, a constant incom
ing flow of 5[l /s]. Always try to predict the result, before you simulate!
the water level is determined by the level at t = 0 plus the integral of the sum of the
outgoing flow, which is dependent of the water level (feedback) and the incoming
flow (input signal). Systems described in such a continuous time form, are called
continuoustime systems . continuoustime
system
A typical property of these systems is the memory function. This memory deter
mines the (timedependent) state of the system: the number of foxes and rabbits at state
a certain moment, the water level in the vessel, and the amount of money in a bank
account. In the continuous time system the memory has the form of an integrator. integrator
Output values of the integrators can be used as the state variables of a system. The
state of the integrator x(T ) at time T is completely determined by the state x(0) at
t = 0 plus the integration of all its inputs over the time interval from t = 0 to t = T :
Z T
x(T ) = u(t ) dt + x(0) (2.24) u and x are often
0 used when we do
not consider a
For a discrete system this equation can be written as: specific physical
domain. In that
iX
=k case x is the state
x(k) = u(i ) ∆T + x(0) (2.25) variable and u is
i =0 the input signal.
Exercise 2.11
The system of foxes and rabbits could also be described as a continuous time system.
Use eq. 2.1eq. 2.4 to make a block diagram of this system with integrators. Simulate the
system with 20sim.
2.1.8 Storage
There is another way of looking at the summers and integrators. The tank can be
seen as a buffer, which stores water. In a similar way we can see a bank account buffer
as a buffer of money and at the same time as a memory. When there are no inputs
to the buffer and there is no feedback, the amount of money in the bank account
or the volume of water in the tank remains constant. It depends upon the type of
system what the best view is. For physical systems there is also a direct relation to
the storage of energy. The reservoir at a hydroelectric power plant can be seen as
a large water tank. The (potential) energy in such a reservoir is proportional to the
water level and can be used to drive a water turbine to produce electrical energy.
Electrical energy can be stored in a battery. A spring and a flying wheel (rotating
mass) can be used to store mechanical energy. In the next chapters we will use this
to describe mechanical and electrical systems.
24 CHAPTER 2. DYNAMICAL SYSTEMS
Exercise 2.12
Driving a car over a bumpy road sometimes leads to annoying vibrations in the car body.
Consider these vibrations from the point of view of energy buffers.
tional to the level of the water in the tank, the feedback gain could be modelled as a
constant gain (1/r ) (figure 2.6).
The negative feedback in the foxes and rabbits model is a bit more complex. In
this model rabbits die due to lack of food and because they are eaten by foxes. The
death rate due to lack of food has a quadratic dependency of the number of rabbits.
This implies a nonlinear feedback mechanism. Also the multiplications in the nonlinear
terms R k F k lead to a nonlinear feedback.
portant role. They can be seen as buffers (storages of money or water) or as mem
ory elements. So far we have seen an example of an integrator in a tank, which
stores water (eq. 2.15). Similar processes can be observed in other physical do
mains, e.g. in mechanical and electrical systems. In this chapter we will introduce
the role of integrators in mechanical and electrical systems. Later on we will study
such systems in more detail.
This chapter also introduces you to describing dynamic systems with simple
formulas. This enables us to make compact descriptions and to do some compu
tations. In addition, simulation will remain an important tool for describing these
systems.
27
28 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
Equation 3.3 states that a water tank can be considered as an integrator that inte
grates the net water flow ϕ(t ) (the result of incoming and outgoing water flows) into
a volume of water V (t ), stored in the tank. This was even more explicitly described
in the form of the block diagram of figure 2.5, repeated in figure 3.1.
tank
In addition to storage, we have earlier seen that there can be leakage. In eq. 2.17 we
The flow is described the leakage of water from the tank (the flow ϕout ):
commonly
indicated with ϕ, 1
the Greek ϕout = p (3.4)
r
equivalent of the
roman letter f . where p was the pressure at the location of the leakage that is related to the volume
(V ) of fluid in the tank
1
p= V (3.5)
c
p is pressure, The resulting formulas for the water tank are summarised in table 3.1.
ϕ is flow,
c is a constant
TABLE 3.1 Formulas for a water tank
storage leakage
1
p= ϕ dt ϕout = r1 p
R
c
In the rest of this chapter we will see that we can find similar formulas for phe
nomena in other physical domains, e.g. in mechanical and electrical systems.
3.1. PHYSICAL MEANING OF INTEGRATION IN THE TIME DOMAIN 29
1
x= F, or: x = cF (3.7)
k
in which c = 1/k is called the compliance. compliance
Another important element in mechanical systems is the mass. The behaviour of mass
a mass is described by Newton’s law. It’s most wellknown form is: Newton’s law
F = ma (3.8)
in which a is the acceleration of the mass. Of course this can also be written as:
1
a= F (3.9)
m
In addition to the position (x) and the acceleration (a), the velocity (v) is a relevant
variable in mechanical systems. These three variables are related to each other. An
accelerating car will go faster and faster and will thus change its position increas
ingly fast.
Example
For a car that drives at a constant velocity, the position is proportional to the time
and the velocity. The relation between the position x and the velocity v is thus
given by:
x(t ) = v t (3.10)
If the velocity is not constant we need an integral to describe this relation, equiv
alent to the transfer from eq. 2.9 into eq. 2.15. Thus
Z T
x(T ) = v(t ) dt + x(0) (3.11)
t =0
or in a simplified form, disregarding the initial conditions and the boundaries of the
integration: Z
x= v dt (3.12)
30 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
In a similar way we can derive the relation between the acceleration and the ve
locity. When the acceleration is constant, the velocity increases proportional to the
time:
v(t ) = at (3.13)
If the acceleration is not constant we need an integral to describe this relation,
equivalent to the transfer from eq. 3.10 into 3.11. Thus
Z T
v(T ) = a(t ) dt + v(0) (3.14)
t =0
When we substitute eq. 3.7 into 3.12 we find an integral form of Hooke’s law:
1
Z
F= v dt (3.16)
c
Similarly, by substituting eq. 3.9 into 3.15, Newton’s law can be rewritten as:
1
Z
v= F dt (3.17)
m
This is summarised in table 3.2. The formulas in the first row are in most commonly
Compare, for used forms. Later it will become clear that the formulas in the second row, will help
instance, the to systematically describe physical phenomena in different domains.
formula for the
spring in table 3.2
with the formula TABLE 3.2 Formulas for a spring and a mass
for the storage (p )
in table 3.1. spring mass
1 1
F = kx or F = cx F = ma or a = mF
F = 1c v dt v=m 1
F dt
R R
Notice that in the case of a spring, the force F can be written as the integral of
the velocity v, and that in the case of a mass the velocity v can be written as the
integral of F . We see that the formulas for the mass and the spring are thus each
others reciprocal.
R In the case of the spring the force F is proportional to the inte
grated velocity Rv dt . In the case of the mass the velocity v is proportional to the
integrated force F dt .
In eq. 3.17 we assume that the mass is constant. In most cases this is a valid assumption. But if we
consider a rocket, this is not true. While accelerating, the rocket consumes fuel and becomes lighter. In
that case eq. 3.17 should be rewritten as:
1
Z · ¸
v= F (t ) dt (3.18)
m(t )
3.1. PHYSICAL MEANING OF INTEGRATION IN THE TIME DOMAIN 31
Exercise 3.13
Explain why we generally use eq. 3.17 instead of eq. 3.18 when we consider the acceleration of a car instead of a
rocket.
Capacitor
A capacitor can be seen as a battery. It can store electrical energy. A battery or ca capacitor
pacitor is charged by a current. Later on it can discharge when powering devices
such as a mobile phone or iPod. In its most basic form the electrical charge of the
battery q is proportional with the time that the battery is being charged and the
current i :
q = it (3.19)
Again, when i is not constant, we need an integral to properly describe the charging
process:
Z T
q(T ) = i (t ) dt (3.20)
t =0
or in the simplified form: Z
q(t ) = i dt (3.21)
Depending upon the capacity C of the battery (or capacitor), the voltage u will in capacity C
crease proportional with the electrical charge:
1 1
Z
u = q, or u = i dt (3.22)
C C
Inductance
Electrical inductance is a property that belongs to a coil, often with a core of ferro inductance
magnetic material. Such a coil can be used to create an electromagnet and as such
it is used in all kinds of electrical motors. When a current flows through this coil a
magnetic flux, Φ, builds up in the coil. When the coil has n windings the socalled magnetic flux
flux linkage, λ is equal to the product of the number of windings and the magnetic flux linkage
flux:
λ = nΦ (3.23)
The voltage over the coil is determined by variations in the magnetic flux:
∆Φ ∆λ
u=n = (3.24)
∆T ∆T
32 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
or
∆λ = u∆T (3.25)
Like in chapter 2 (see eq. 2.14 and eq. 2.15), we can write this as:
Z
λ = u dt (3.26)
The flux linkage is also proportional with the current flowing through the coil.
1
i ∝ nΦ or i = nΦ (3.27)
L
self inductance L L is the so called self inductance L of the coil.
nΦ
L= (3.28)
i
From eq. 3.28 and eq. 3.23 follows the relation between the current, i , and the flux
linkage, λ; and after substituting eq. 3.26 the relation between the current, i , through
the coil and the voltage, u, over the coil.
1 1
Z
i = λ, or i= u dt (3.29)
L L
The equations for the capacitor and inductance are summarised in table 3.3. We
see that the formulas for the capacitor and the inductor are each others reciprocal.
In
R the case of the capacitor the voltage u is proportional to the integrated current
i dt . InR the case of the inductance the current i is proportional to the integrated
voltage u dt .
u = C1 q i = L1 λ
u = C1 i dt i = L1 λ dt
R R
Z T
x(T ) = v(t ) dt + x(0) (3.30)
t =0
Similarly we could say that the charge of a battery q(0) at t = T is equal to the charge
at t = 0 plus the charge added in the interval from t = 0 to t = T :
Z T
q(T ) = i (t ) dt + q(0) (3.31)
t =0
This inverse process is called differentiation. We say that v(t ) is the derivative of differentiation
x(t ). Both equations describe the same relation, eq. 3.30 in integral form and eq. 3.36 derivative
in derivative form. In the derivative form we do not have to bother about initial
conditions. But for modelling and simulation, we prefer the integral form.
In eq. 3.15 we saw that the velocity v can be written as the integral of the acceler
ation a. This implies that we can write a as the derivative of v.
dv
a= (3.38)
dt
34 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
d ( dx
dt )
a= (3.39)
dt
which is written as
d 2x
a= (3.40)
dt 2
second derivative We say that a is the second derivative of x.
d.
s= (3.41)
dt
This notation has a good theoretical background in the form of the Laplace trans
differential formation. But for our purposes we can see s as a just a differential operator. For
operator
now it suffices to simply introduce the notation. We will later discover the advan
tages of this notation. With the Laplace operator we can write eq. 3.37 as
v = sx (3.42)
1
x= v (3.44)
s
The flow out of the box is proportional to the pressure p at the outlet. This pressure
is again proportional to the height of the wine in the box and thus also to the vol
ume of the wine. This implies that eq. 3.45 can be rewritten as
1
Z
p(t ) = −ϕout dt + p(0) (3.46)
c
For the outgoing flow we can write
1
ϕout (t ) = p(t ) (3.47)
r
We have already seen that we can represent these equations in a block diagram that
can be simulated with 20sim (figure 3.3). See figure 2.6.
wine box
leakage
Another way to represent this system, is in the form of a differential equation. As the differential
name suggest, this implies that we write eq. 3.46 in derivative form, and combine it equation
with eq. 3.47 into one single equation. The derivative form of eq. 3.46 is
dp 1
= − ϕout (3.48)
dt c
36 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
p(0)
0
0 1 2 3 4 5 6 7 8 9 10
time {s}
Exercise 3.14
Simulate the system of figure 3.3 (or eq. 3.49) in 20sim, using the following parameters
for a square box:
Now we will make a small change to the system. Instead of only an outgoing flow,
we also consider a (constant) incoming flow such that
1 1
sp + p = ϕin (3.56)
rc c
Instead of a differential equation, we now have a simple algebraic equation. One of
the consequences is that we can manipulate this equation as if s were just a simple
parameter like r or c. This implies that we can rewrite eq. 3.56 as
1 1
(s + )p = ϕi n (3.57)
rc c
or
p 1/c r
= = (3.58)
ϕin s + r1c r cs + 1
We say that
1/c r
H (s) = , or H (s) = (3.59)
s + r1c r cs + 1
is the transfer function from the incoming flow ϕin to the pressure p. With this transfer function
transfer function we can draw a block diagram of this system with only one single
block (figure 3.5). Of course we could also consider the transfer function from the
incoming flow to the volume. This yields:
V rc
H (s) = = (3.60)
ϕin r c s + 1
leakage
F IGURE 3.5 Water tank with an incoming and outgoing flow. Left, according to
eq. 3.54, right according to eq. 3.58
38 CHAPTER 3. INTEGRATORS IN DYNAMICAL SYSTEMS
Exercise 3.15
Simulate the left block diagram of figure 3.5 in 20sim, using the following parameters:
Plot the volume V as a function of time. Do also a multirun simulation where r varies in
10 steps between 10 and 500. Explain the results.
Exercise 3.16
Try to detect the missing behaviours. The symmetry in the table should be helpful to find
the right formulas and from these formulas the behaviours that they describe.
In the next chapters we will analyse the different physical domains in more detail
and consider more complex systems.
4
A complex system can be split into interacting
subsystems or interacting submodels. This
process stops when the submodels cannot be split
any further. In physical systems these elementary
submodels describe a basic physical behaviour.
From these elementary submodels we can build
more complex ‘ideal physical models’ or IPM’s.
Let us first try to find the missing entry for the mechanical domain. We reconsider
the situation of an accelerating car. In its most simple form we could model the car
as just a mass. If the motor of the car would deliver a constant force, we see that
according to the formula for the mass
1
Z
v= F dt ,
m
39
40 CHAPTER 4. IDEAL PHYSICAL MODELS
F
v= t,
m
the speed would increase constantly as a function of time. With a large mass it in
creases more slowly, but if we wait long enough, the speed will increase to infin
ity. We know that this is not true in practice. We can, therefore, conclude that our
model is too simple and needs to be extended. What we are missing is the resis
drag tance due to the air (called the drag) and the resistance due to the contact between
rolling resistance the tires and the road: the rolling resistance. In the case of air drag, the force F d
needed to overcome the drag is proportional to the frontal area of the car, A, the
drag coefficient aerodynamic shape of the car, expressed in the socalled drag coefficient C w and the
square of the speed, v 2 :
F d ∝ AC w v 2 (4.1)
Equation 4.1 explains why highspeed cars, such as sport cars and Formula 1 cars have
their typical shape. By giving the car a small frontal area, A , and rounded forms (leading
to a small C w value), the air drag is minimised. But the drag is still proportional to the
square of the speed and thus a quadratically increasing force is needed to maintain this
speed. In situations where the power source is limited, reduction of A and C w can lead to
extreme design shapes, such as those of the vehicles used in the biannual solar challenge
contest in Australia (figure 4.1).
F IGURE 4.1 21Revolution: the 2009 version of the solar car of students of the
UT and Saxion
4.1. BASIC PHYSICAL PHENOMENA 41
A more simple form of this phenomenon is viscous friction. Viscous friction is the viscous friction
drag an object experiences when it moves in a fluid at low speeds. In this case there
is a simple linear relation between the speed and the force.
F = fv v (4.2)
where f v is the viscous friction coefficient. We could have predicted this relation by
looking at the formula for the hydraulic resistance in table 4.1. This equation gave a
relation between the pressure p and the flow ϕ. Equation 4.2 gives a similar relation
between the force F and the velocity v. In general, friction is a more complex and
nonlinear relation between F and v. We could, for instance, write eq. 4.1 as
F d = f d (v)v (4.3)
where the friction coefficient f d (v) indicates that the friction is a function of v. But
in all cases there is no integrator present in the equation (in contrast with the for
mulas that give the relation between the force and the velocity for a mass and a
spring).
Next we will consider the missing formula for the electrical domain. Based on
the friction and resistance formulas for the mechanical and hydraulic domain we
can already predict that there will be a relation of the form
u = Ri (4.4)
This is the well known Ohm’s law that gives the relation between the voltage u, the Ohm’s law
current i and the electrical resistance R. Electrical resistance is present in all elec electrical
resistance
trical circuits, for instance in an incandescent lamp. Due to the resistance in the
filament of the bulb the current lets the filament heat up, until it is whitehot.
Example
Equation 4.4 can easily be verified with a simple experiment (figure 4.2). If we con
nect a small bulb to a battery, the bulb will start glowing. If we put a second, similar
bulb in series with the first one, the resistance will double and because the voltage
42 CHAPTER 4. IDEAL PHYSICAL MODELS
of the battery may be considered as being constant, the current will be half the cur
rent compared with the case of only one bulb. As a result both lamps will be less
bright.
Exercise 4.17
Suppose we have a second battery at our disposal. How should we connect the two bat
teries and lamps to let the lamps glow at full brightness again?
The last empty element in the table is the hydraulic equivalent of the mechanical
hydraulic inertia mass and the electrical inductance. This element is called the hydraulic inertia.
Hydraulic inertia is visible in the effect that is known as ‘water hammer’. Water
water hammer hammer can be observed when water is flowing through a long pipe and the flow
at the end of the pipe is suddenly cut off. Due to the inertia of the water mass the
flow tries to continue. The sudden change in the flow leads to large pressures in the
pipes and large forces on the piping. As a result you will hear a sound as if an ham
mer hits the pipe. We can express the hydraulic inertia in derivative form as
dϕ
p=I (4.5)
dt
where I has the dimension [kg m−4 ]. The same formula in integral form is
1
Z
ϕ= p dt (4.6)
I
Now that we have discussed all the missing elements, we are ready to complete ta
ble 4.1. This results in table 4.2.
From table 4.2 we can derive table 4.3 by explicitly considering the physical quan
tities represented by the integrators in table 4.2. Most of the time not all of these
domains are considered simultaneously. This allows us to use similar symbols for
different quantities, rather than choosing distinct symbols for all quantities. We
use the symbols that are most common in the different domains. Therefore, you
should always be aware of the domain you are working in: the mechanical impulse
p should not be confused with the hydraulic pressure, also denoted with the sym
bol p.
4.2. IDEAL PHYSICAL MODELS 43
domain behaviours
mechanical spring: position mass: mechanical impulse
p
F = xc x = v dt v=m p = F dt
R R
The component capacitor will always have some internal electrical resistance and induc
tance. However, the property capacitance is dominant. But a spring can hardly be made
without having a certain mass. If this mass is small compared with other relevant masses
in the system such a spring can still be modelled as an ideal spring.
This lumpedparameter approach works well for many systems but it may not be the best
approach for mechanical systems that exhibit a lot of flexibility. If, for instance, we want
to study the forces in the wing of an airplane due to bending, much more detailed models
finiteelements are needed. Such models are based on a socalled finiteelements analysis. Finiteelement
analysis models of mechanical systems consist of a very large number of interconnected mass
springdamper systems. Due to this level of detail they are able to give a detailed map of
the stresses affecting the airplane wing.
friction
FixedWorld
Spring Damper
Mass
m
F mg
to zero, while a, v and x vary constantly. This is called a dynamic equilibrium . The dynamic
equilibrium
equation, which describes this ‘equilibrium’ is called the equation of motion. In
order to find this equation we consider the forces related to the elements:
spring: F = 1c x = 1c v dt
R
damper: F = f v
mass: F = ma = m ddtv
gravity force: F = F g = mg
mon. Therefore we simplify things by using the variable x instead of v. This yields
d 2x dx 1
m 2
+f + x = Fg (4.8)
dt dt c
This is a secondorder differential equation. There are a few software packages avail secondorder
differential
able, which allow the user to draw iconbased models like the one in figure 4.4 by equation
means of a graph editor. The software then automatically derives equations and
simulates the system. One of these programs is 20sim developed at the University
of Twente. In the absence of such programming aids, we can always simulate the
system with the aid of the differential equation. Converting the differential equa
tion into a block diagram may be helpful in order to achieve this. We rewrite eq. 4.8
into
d 2 x Fg 1 dx 1
· ¸
= − f + x (4.9)
dt 2 m m dt c
46 CHAPTER 4. IDEAL PHYSICAL MODELS
We start making the block diagram by drawing two integrator blocks, which give the
d 2x dx
relation between a = ,v= and x (figure 4.5).
dt 2 dt
The last two terms in eq. 4.9 represent the friction force and the force due to the
spring, respectively. When we take the signs of eq. 4.9 into account, we can add
these forces to the blockdiagram. This results in figure 4.6.
+
_
+
+
Exercise 4.18
Simulate this system in 20sim. Use the following parameters:
m: 1 kg
f : 1 N m−1 s2
c: 0.1 m N−1
Fg 10 N
For relatively simple systems deriving a block diagram in this way is rather straight
forward. Later we will see how this can also be done for more complex systems.
Exercise 4.19
Use the graph editor of 20sim to draw the graph of the massspringdamper system of
figure 4.4. Examine the underlying equations of the icons by double clicking each icon.
The system will start moving because of the presence of the gravity force F g and comes
to rest in the static equilibrium (figure 4.7 right). When we want to study motions around
this equilibrium, we could disregard the gravity force and choose proper initial conditions
(e.g. an extension of the spring x(0) at t = 0) (figure 4.7 left). In that case eq. 4.9 changes
into
d 2x 1 dx 1
· ¸
= − f + x (4.10)
dt 2 m dt c
Simulate both systems and compare the results with the result in exercise 4.18. Use the
same parameters as in the previous example.
FixedWorld FixedWorld
Mass Mass
m m
F mg
If the simulations in exercise 4.18 and exercise 4.19 were performed correctly, both
simulations should have delivered the same response. One could ask why one of
the two representations is not enough. There are several reasons to use both and, as
we will later see, other, additional representations. First, each representation gives a
different view of the systems and by using multiple views, we see or reveal different multiple views
properties of the system. Block diagrams are more abstract than IPMs, but block
diagrams unambiguously represent the underlying equations. They are a graphical
representation of the differential equation and are, in principle, domain indepen
dent. In contrast, symbols for IPMs are less well defined and although a good IPM
models the relevant properties of the system, the underlying equations are not nec
essarily unambiguous. In general the modelling process starts with identifying the
major and relevant properties of a system and sketching a causal relation diagram
48 CHAPTER 4. IDEAL PHYSICAL MODELS
and/or an IPM. This IPM can be directly simulated and be used e.g to predict the
behaviour of the system. When we want to perform computations with the system,
or design a controller, we need to derive a differential equation (or transfer function
or block diagram).
Exercise 4.20
Massspringdamper systems, like the one in exercise 4.19 can be seen in many mechani
cal systems. Find some examples of such systems.
domain behaviours
translation spring:R friction: mass: R
F = 1c v dt F=fv v=m1
F dt
rotation springR friction momentR of inertia
T = 1c ω dt T =fω ω = 1J T dt
rotation icons In figure 4.8 icons for the mechanical rotation domain are given. They are quite
similar to the translation icons. For the spring we often use the same icon as in the
translation domain. However, an icon in the form of a spiral, which emphasises the
rotational motion is also given.
spring friction
after first converting it into a block diagram. The iconic diagram can also be simu
lated directly when it is drawn in the graph editor of 20sim. The basic icons for the
electrical domain are given in figure 4.9. Besides the capacitor, resistor and induc
tance, we introduce the elementary submodel ground, which represents a reference ground
voltage equal to zero.
As an example we consider the electrical circuit of figure 4.10. Each element in this
circuit is characterised by a voltage over the terminals of the element and a current
that flows through the elements. In the circuit of figure 4.10, the current is the same
through all the elements. In order to derive the differential equation, we must de
fine what we consider as a positive voltage. These positive voltages are defined in
figure 4.10. With these sign definitions we can see that the sum of the voltages over
the capacitor, the inductance and the resistor is equal to zero.
+ 
i Inductor +

Capacitor Resistor
+

Ground
uc + uL + uR = 0 (4.11)
or
1 di
Z
i dt + L +iR = 0 (4.12)
C dt
When we differentiate the left and righthand sides of eq. 4.12 we can rewrite this
into an equation with only differentiations:
d 2i d i 1
L + R+ i =0 (4.13)
dt 2 dt C
or
d 2i 1 di 1
· ¸
= − R + i (4.14)
dt 2 L dt C
50 CHAPTER 4. IDEAL PHYSICAL MODELS
This equation has the same form (with different symbols) as eq. 4.10 in the me
chanical domain. The behaviour of this system will thus be the same, if we observe
equivalent signals.
Exercise 4.21
Use the graph editor of 20sim to draw the graph of the electrical circuit of figure 4.10.
Examine the underlying equations of the icons by double clicking each icon. Give the
capacitor an initial condition q(0) at t = 0. Examine with the aid of table 4.2 and table 4.3
the equivalence between the mechanical and electrical domain elements and choose the
parameters for the capacitor, inductance and resistor such that both systems show the
same behaviour. (Plot the voltage over the capacitor.)
Exercise 4.22
Use the graph editor of 20sim to change the electrical circuit of figure 4.10 into the circuit
of figure 4.12. Make the initial condition of the capacitor equal to q(0) = 0. Choose the
parameters for the capacitor, inductance and resistor equal to the previous exercise and
let the voltage source have an output of 1 [V]. Simulate the system and plot the voltage
over the capacitor.
4.2. IDEAL PHYSICAL MODELS 51
Capacitor Inductor
Resistor
DC_power_supply
Ground
Numerical simulation
Scale models
Scale models are (mostly) smaller versions of constructions like a ship or an air
plane. Before ships are built, their hydrodynamic properties are investigated in
towing tanks (figure 5.1). The experiments should help to design a more fuelefficient towing tank
ship and to make it seaworthy. For similar reasons airplane models are extensively
tested in wind tunnels (figure 5.2). wind tunnel
53
54 CHAPTER 5. NUMERICAL SIMULATION
These scale models are very expensive to make. One of the reasons is that the en
vironment does not scale down with the model. Water and air flows have quite dif
ferent properties with respect to the scale model than with respect to the real ship
or aircraft. Therefore, scale models should e.g. have an extremely smooth surface.
As a result, scale models require a lot of skilled manufacturing. Once ready, they
can not easily be changed anymore. In addition, towing tanks and wind tunnels
are huge and expensive constructions. And although also the possible experiments
are limited, scale models are still frequently used, because the experiments provide
information, which cannot easily be obtained otherwise.
5.1. THE NEED FOR NUMERICAL SIMULATION 55
Not all desirable scenarios are possible. Because the space in a towing tank or wind tun
nel is limited, experiments always have to take place in a confined space. It is, for in
stance, impossible to do long experiments with a high acceleration.
Analogon models
The AD4 had a total of 288 transistorbased amplifiers and was able to simulate systems
with 64 integrators, 48 summers, 144 inverters and 256 parameters. It cost a fortune: 5
Me in euros of 1970. Today this would translate to 30 Me. Simulations were made by
hard wiring the different electrical components. Because the computer was too expensive
to be used for one simulation only, the wiring (‘programming’) was done with so called
patch boards (figure 5.4). These could be connected to the computer to carry out the patch board
simulation. The ‘programming’ could thus be done offline. For the price of the patch
board alone you could buy yourself a decent car! More information can be found e.g. at
http://www.adi.com/pdfs/Howe2June05.pdf.
Digital simulation
Because of the very high price of analogue computers and the vulnerability of the
wiring of the patch boards they became obsolete in the late 1970’s. Digital hard
ware rapidly became more powerful and less expensive. This stimulated the de
velopment of digital simulation software. One of the first simulation programmes
was THTSIM, which was developed at the Technische Hogeschool Twente, which THTSIM
later became the University of Twente. It got to be used world wide and became
known as TUTSIM. The program 20sim is more or less an uptodate successor
of TUTSIM. Another well known simulation program is Simulink, which is part of TUTSIM
56 CHAPTER 5. NUMERICAL SIMULATION
Figure 3.3, repeated in figure 5.5 showed that we can also represent the system with
a block diagram and use it to simulate the system, apparently without writing it in
the form of eq. 5.1 or eq. 5.2.
wine box
leakage
Z
V = V (0) + ϕ dt (5.3)
When we assume that u(t ) = u(T ) is constant in this time interval, the integration
simplifies into the product of u(T ) and ∆T
Equation 5.11 exactly computes the value of x(T + ∆T ). Equation 5.12 only gives an
exact solution if u(t ) is indeed constant in this time interval. If u(t ) is not constant,
this integration is best approximated if the time intervals ∆T are chosen very small.
The penalty is, of course, that many more computations have to be done.
When we integrate over more than one time interval, starting at t = 0, we find:
or
2
X
x(2) = x(0) + u(1T )∆T + u(2T )∆T = x(0) + u(nT )∆T (5.15)
i =0
dx(t ) X (s) 1
Z
x(t ) = u(t ) dt → = u(t ) → s X (s) = U (s) → = (5.17)
dt U (s) s
Note that we used lowercase symbols for the timedependent signals and capital
letters when we use the notation with s to emphasise that we applied the transfor
mation. Alternatively, if there is no risk of confusion, we simply write X instead of
X (s).
In a similar way we can describe discretetime systems by socalled difference difference
equations
equations. Equation 5.12 is an example of a difference equation. Mostly we use a
slightly alternative notation.
or shorter
x(k + 1) = x(k) + u(k)∆T (5.19)
Finally, in such equations ∆T is often replaced by T , where T = ∆T should not be
confused with T in the previous formulas.
discrete transfer We can convert eq. 5.20 into a transfer function by introducing the delay operator
function
z −1 .
delay operator
z −1
X (k − 1) → z −1 X (k) (5.21)
The inverse operation yields
X (k + 1) → z X (k) (5.22)
With this delay operator we can write eq. 5.20 as:
The operator z can, just like the Laplace operator s be handled as an ordinary coef
ficient. Equation 5.23 can thus be written as
X (k) T
(z − 1)X (k) = U (k)T → = (5.24)
U (k) z − 1
d x ∆x x(k) − x(k − 1)
≈ = (5.25)
dt ∆T ∆T
With the aid of the delay operator z −1 and again replacing ∆T with T we can write
the righthand side as
1 − z −1 z −1
X (k) = X (k) (5.26)
T zT
In the case that ddtx = u(t ) this leads to the transfer function for the discrete differen
tiation of eq. 5.27.
U (k) z − 1
= (5.27)
X (k) zT
This differentiation is referred to as the backward Euler differentiation. The inverse
backward Euler operation is called the backward Euler integration with the transfer function
integration
X (k) zT
= (5.28)
U (k) z − 1
∆x x(k + 1) − x(k)
= u(k) = (5.29)
∆T ∆T
5.2. NUMERICAL INTEGRATION 61
In this case we use in fact future information (from t = (k + 1)T ) to compute the
derivative at t = kT . Therefore, this differentiation is referred to as the forward Eu
ler differentiation. The corresponding transfer function is forward Euler
differentiation
U (k) z − 1
= (5.30)
X (k) T
The transfer function for the forward Euler integration is again the inverse forward Euler
integration
X (k) T
= (5.31)
U (k) z − 1
We will use these formulas to investigate the accuracy of the Euler integrations.
There are at least three ways of doing this.
1. Compare the ‘exact’ solution, using formulas like eq. 5.1 with the numerical
integration. This could, for instance, be done with the aid of a spreadsheet
In order to investigate option 1 and 3 we need the proper formulas and block
diagrams. The forward Euler integration according to eq. 5.31 can be written as
or
x(k + 1) = x(k) + Tu(k) (5.33)
If we only want to use previous values of x we write this equation as
The delay operator z −1 represents one time step (T ) delay. We can represent that in
a block diagram with a block with transfer function z −1 . With the aid of this block
we can draw the block diagram of figure 5.6. The output x(k) is the one step delayed
sum x(k) + Tu(k). The forward Euler integrator is thus realised by a summer in se forward Euler
integrator
ries with a ‘gain’ equal to the computation step size T .
The backward Euler integration according to eq. 5.28 can be written as
or
x(k + 1) = x(k) + Tu(k + 1) (5.36)
62 CHAPTER 5. NUMERICAL SIMULATION
backward Euler The backward Euler integrator can be represented with the block diagram of fig
integrator
ure 5.7. Note that in this case the input of the z −1 block is the output of the integra
tor. This implies that we can redraw the block diagram as in figure 5.8.
In the next exercises we will compare the accuracy of the Euler integrations. Just
an integrator is too simple a system. Therefore, we consider a simple firstorder
system, according to the block diagram of figure 5.9.
This system can be described with a differential equation
dx dx
= −x → +x =0 (5.38)
dt dt
The solution of this differential equation is
The discrete version of figure 5.9 is obtained by substituting the integrator by one
of the integrators of the figures 5.65.8. This results in figure 5.10 for the case of the
forward Euler integrator and in figure 5.11 for the backward version.
Exercise 5.23
In this exercise we apply the abovementioned method 1 to see how well the Euler inte
grations are able to compute correct values. Use eq. 5.39, eq. 5.34 and eq. 5.37 in a spread
sheet to evaluate the performance of the two Euler methods. Use different computation
intervals T . Note that from figure 5.10 and figure 5.11 it follows that u(k) = −x(k). Make a
graph of the results.
5.2. NUMERICAL INTEGRATION 63
F IGURE 5.8 Other realisation of the backward Euler integration of figure 5.7
You will have noticed that the backward integration formulas do not run without
problems in a spreadsheet. Closer examination of figure 5.11 reveals why. In this
case the signal x(k) is needed (via u(k)) to compute x(k). There is no z −1 block in
between. A closed loop without any delay element is called an algebraic loop. This algebraic loop
can be dealt with by using more complex algorithms that predict x(k), based on
older values only by means of an iteration procedure. iteration
Exercise 5.24
Next we evaluate the second method with 20sim. Draw figure 5.9 in the graph editor of
20sim. As a default 20sim uses the socalled Backward Differentiation Formula (BDF).
With the standard settings for this system the graph produced by the BDF method will
have very small errors. This graph can be used as a reference. Use a gain (K ) block to
realise the block with the time step T . Change this block, by replacing the statement
with
output = sampletime ∗ input; (5.41)
The parameter sampletime can be given a value in the discretetime tab of the simulation
properties menu (parameter: Discrete Time Interval). Change the integration method in
forward and backward Euler and compare the results. Do not clear the graphs in between!
You will see that 20sim has no problems with the algebraic loop introduced by the back
ward Euler integration. This is because 20sim has an algebraic loop solver.
We could also run the exact solution of eq. 5.39 together with the two systems based
on the Euler integration.
64 CHAPTER 5. NUMERICAL SIMULATION
+
_
+
F IGURE 5.10 Discrete version of the firstorder system with forward Euler
integration
+
_
+
F IGURE 5.11 Discrete version of the firstorder system with backward Euler
integration
Exercise 5.25
Draw the systems of figure 5.9, figure 5.10 and figure 5.11 together in the graph editor. Use
the (default) BDF method as integration method. The blocks T can be made by modifying
the gain block by replacing the gain parameter K with the 20sim system variable sample
time. Compare the responses for x(t ) and x(k) for sampletimes T of 0.5, 0.2, 0.2 and 0.01
seconds. Save the model for reuse in a next exercise.
5.2.3 Tustin
From the exercises we see that both forms of the Euler integration suffer from a
limited accuracy. One changes too fast and the other one too slow. The method of
Tustin Tustin uses this observation by taking the average of the two Euler methods. When
we add the two Euler equations (eq. 5.34 and eq. 5.37), we find
Exercise 5.26
Expand exercise 5.23exercise 5.25 with the Tustin integration. Note that the Tustin inte
gration is not in the list of integration methods of 20sim. It is available under the back
ward Euler integration by drawing a slider to the position trapezium. The Tustin integra
tion can be realised in the expanded version of exercise 5.25, by averaging the values of
the two Euler integrations.
Because the Tustin integration uses both the forward and backward Euler integra
tion, an iteration for computing x(k) from previous values only, is needed here as
well.
or directly into a block diagram. The program still will take care for converting this
input into a series of integral and algebraic equations, which can be computed dur
ing the simulation. When you want to run such a simulation outside a simulation
program, this last step requires manual work as well by combining the algebraic
equations and the integration methods into proper code. The equations must be
sorting sorted such that only old values are used to compute the values of the variables at
the next time step.
We will study the relation between step size, accuracy and computation time in a
few exercises.
Exercise 5.27
We reconsider the system of figure 4.4. We will simulate this system with the parameters
of exercise 4.18.
Compare the results of simulations with the Euler and the BDF method with respect to the
number of calculations, the computation time and the achieved accuracy.
5.2. NUMERICAL INTEGRATION 67
FixedWorld
Spring Damper
Mass
m
F mg
Exercise 5.28
In figure 4.6 this system was converted into a block diagram (figure 5.13). By replacing
the integrators in this block diagram with the discrete integrators of figure 5.6, simulation
equations can be derived. Do this and simulate this system, either in a spreadsheet or in
or a programme, e.g. Processing.
+
_
+
+
Exercise 5.29
By using the equation editor of 20sim instead of the graph editor the differential or dif
ference equations of this system can also be used as an input format. Do this for the
differential as well as for the difference equations and simulate the system.
68 CHAPTER 5. NUMERICAL SIMULATION
6
Concepts of electrical systems are useful for
understanding all dynamical systems.
Electrical Circuits
69
70 CHAPTER 6. ELECTRICAL CIRCUITS
6.1.2 Elements
Capacitor, resistor and inductance
The basic equations for elementary capacitors, resistors and inductances were first
introduced in table 4.2 and they are repeated in table 6.1. Here we will take a closer
look at these elements and discuss a number of additional properties.
q = i dt λ = u dt
R R
nΦ = u dt
R
Let us first reconsider the capacitor. We have seen that a capacitor is charged by a
current: q = i dt . A battery is in essence a capacitor as well. A capacitor is thus
R
electrical energy able to store electrical energy. Electrical energy is stored by loading the capacitor
and delivered, e.g. to a lamp, by unloading the capacitor. We have seen in figure 4.2
that a lamp gives more light when the current flowing through the lamp is larger. In
that case more energy is drawn from the battery. With a constant voltage of the bat
tery (u) and a twice as big a current (i ), the decrease of the energy stored in the bat
power tery will be twice as big. We call this change in the stored energy power. The power
in Watts, P [W] or [J s−1 ] is thus equal to
P = ui (6.1)
The total amount of energy E [W s] or [J], delivered by the battery to the lamp over
time is Z Z
E= P dt = ui dt (6.2)
A capacitor (and the related component battery) can thus store electrical energy in
the form of an electrical charge. In a similar way inductors, in the form of coils, can
flux linkage store electrical energy in the form of the flux linkage (λ). In contrast, resistors can
not store energy. They dissipate electrical energy by converting it into light (a lamp)
(ir)reversible or heat. This process is irreversible. The power flow to a capacitor and inductor is
process
reversible: a capacitor can be loaded and unloaded. For the ideal capacitor, which is
the ideal element described by the equations in table 6.1, loading and unloading is
a process without any energy loss.
6.1. ELEMENTARY MODELS 71
Transformer
u2 d Φ
= (6.4)
n2 dt
The primary coil with n 1 windings and connected to voltage u 1 (corresponding to
n and u in eq. 6.3)) results thus in a changing flux d Φ/ dt that in its turn induces a
secondary voltage u 2 . When we combine eq. 6.3 and eq. 6.4 we find
u2 d Φ u1 u2 n2
= = or = (6.5)
n2 dt n1 u1 n1
equations 6.36.5 describe the ideal physical model of the element transformer. transformer
Primary Secondary
current (i1) current (i 2 )
Primary Secondary
voltage voltage
(u 1) (u 2)
Primary Secondary
windings windings
n 1 turns n 2 turns
Transformers are used in many electric devices as well as in the power grid to trans
form high voltages (e.g. 380 kV) to lower distribution voltages and finally to the 230
V, delivered to homes. Although nowadays ‘switched power supplies’ are more com
mon, they could also be used in power supplies of computers and chargers of lap
tops and mobile phones. In that case the 230 V of the power outlet is transformed
(‘stepped down’) to a lower voltage. The DCoutput of the power supply or charger
is obtained after rectification. rectification
Real transformers may have windings with an electrical resistance R and there
may be magnetic losses as well. But for the ideal element transformer the power
72 CHAPTER 6. ELECTRICAL CIRCUITS
that goes in the transformer at the primary windings, is without losses available
at the secondary windings. When we connect the primary windings to a voltage
source and the secondary windings to a resistor a current will flow through the sec
ondary windings and the resistor. The power at the primary windings will thus be
equal to the power at the secondary windings
u2 i 1
P = u1 i 1 = u2 i 2 or = (6.6)
u1 i 2
u2 n2 i 2 n1
= and = (6.7)
u1 n1 i 1 n2
transformation The ratio n 1 /n 2 is called the transformation ratio, indicated with the symbol n. The
ratio
icon for the ideal physical element transformer is given in figure 6.2. Because the
transformer has two electrical connections with a plus and minus pole at the pri
mary windings and a plus and minus pole at the secondary windings, we say that
twoport element this element has two ports or that a transformer is a twoport element.
F IGURE 6.2 i1 i2
Icon of a transformer + +
u1 u2
_ _
Gyrator
A dual of an We could also think of another twoport electrical element, which is a kind of ‘dual’
element, is an of the transformer. This element is the gyrator. The gyrator will later be used, among
element with
reciprocal others, as a transducer between different physical domains. Although an electric
properties. gyrator is not available as a simple physical component, it could be made electroni
cally. An ideal gyrator is described by the equations
u2 = r i 1
u1 = r i 2 (6.8)
The gyrator thus relates the secondary current to the primary voltage through the
gyration ratio gyration ratio, r and vice versa. The symbol for a gyrator is given in figure 6.3
6.1.3 Sources
A ‘source’ element has already been used a few times, without extensively discussing
its properties (See section 4.2.5 and figure 4.11). Here we will take a closer look at
voltage source the voltage source and the current source. An ideal voltage source is an element
6.1. ELEMENTARY MODELS 73
F IGURE 6.3 i1 i2
Icon of a gyrator + +
u1 u2
_ _
that delivers a constant voltage. This voltage is not influenced by other elements
that may be connected to the voltage source. In other words, such an ideal voltage
source can deliver an arbitrary large current. And, because the power P = ui , it is a
source of unlimited power. A 230 V power outlet approaches such an ideal source.
Because the voltage of a power outlet is a 50 Hz alternating voltage, this is in fact a
modulated voltage source: a voltage source where the output voltage is ‘modulated’, modulated
voltage source
by an external sinusoidal signal. A 230 V power outlet approaches an ideal source
more than a battery, because when a battery is connected to a number of appli
ances or lamps, the voltage at its terminals obviously drops as we have seen in the
situation of figure 4.2. The reason that the voltage of a voltage source in the form of
a battery drops at higher loads is the internal resistance of the battery. A ‘real’ bat
tery connected to a load in the form of a resistor can be represented with the circuit
of figure 6.4.
Exercise 6.30
From a safety point of view a power outlet that can deliver unlimited power is less ideal.
Which measure is taken to prevent the risks of shortcutting the circuit. What is done to
prevent that humans become part of the electrical circuit?
F IGURE 6.4
Battery: voltage source with internal
resistance R_internal
Battery
Ground
Exercise 6.31
Simulate the system of figure 6.4 with 20sim and do a multirun experiment. Let R load be
1Ω and let R internal vary from 0.1 to 1Ω. Plot the voltage over R load .
We can verify the simulations of exercise 6.31 with some simple computations. The
resistance of two resistors in series is equal to the sum of the two resistances. There
74 CHAPTER 6. ELECTRICAL CIRCUITS
The voltage over the load is the real voltage supplied by this battery with internal
resistance
u battery = R load i (6.10)
If u source = 1.5 V, R load is 1Ω and R internal = 0.1Ω, the current is
1.5
i= [A] (6.11)
1.1
u battery is thus
1.5
u battery = 1 = 1.36 [V] (6.12)
1.1
With an internal resistance of 1Ω we find
1.5
u battery = 1 = 0.75 [V] (6.13)
2
We thus see that if the load is in the same order of magnitude as the internal re
sistance, the voltage at the terminals of the battery drops to 50% of the voltage in
the unloaded situation. If the internal resistance is negligible compared with R load ,
u battery is (almost) equal to 1.5 [V].
(modulated) The other electrical source element is a current source. An ideal current source is
current source
an element that delivers a constant current. In case of a modulated current source
this current is again determined by an external signal generator. For the ideal ele
ment the output current is not influenced by other elements that may be connected
to the current source. ‘Real’ current sources will be less ideal. This is again due to
an internal resistance. In the case of a current source, an internal resistance as in
figure 6.4 would not influence the current at the terminals of the current source.
The internal resistance would heat up, but will not influence the current, because
this is, by definition constant. This is different when we place the internal resistor in
parallel with the current source (figure 6.5).
F IGURE 6.5
Current source with internal
resistance
R_internal R_load
CurrentSource
Exercise 6.32
Simulate this system with 20sim and do a multirun experiment. Let R load be 1Ω and let
R internal vary from 1 to 10Ω. Plot the current through, and the voltage over R load . Explain
the differences between this simulation and the one in exercise 6.31.
u
R1 R2
R2 R1
i1 = i and i 2 = i (6.14)
R1 + R2 R1 + R2
The voltage over R 1 is equal to
R2
u = R1 i 1 = R1 i (6.15)
R1 + R2
The same holds of course for the voltage over R 2 , which must be equal to the volt
age over R 1 :
R1
u = R2 i 2 = R2 i (6.16)
R1 + R2
The total resistance seen by the current source is thus
u R1 R2
R tot = = (6.17)
i R1 + R2
Let us go back to the problem of exercise 6.32. If the current of the current source is
1 A, R load = 1 and R internal = 1, the voltage over the resistors is equal to
1·1
u= 1 = 0.5 [V] (6.18)
1+1
When R internal = 10 this voltage is
76 CHAPTER 6. ELECTRICAL CIRCUITS
10 · 1
u= 1 = 0.9 [V] (6.19)
10 + 1
For R internal = 1 the current through R load , and thus the current at the terminals of
the ‘real’ current source, is
R internal 1
i load = 1= 1 = 0.5 [A] (6.20)
R internal + R load 1+1
For R internal = 10 the current through R load , and thus the current at the terminals of
the ‘real’ current source, is
R internal 1
i load = 10 = 1 = 0.9 [A] (6.21)
R internal + R load 10 + 1
From these examples we can conclude that
ideal voltage – an ideal voltage source must have an internal resistance of zero
source
ideal current – an ideal current source must have an infinitely large internal resistance.
source
6.2 Computations
Although simulations can provide a quick answer in many situations, calculations
of voltages and currents in a circuit can contribute to insight in what you are doing.
Without such knowledge, simulations alone easily become trial and error with
out any notion of the direction in which you might find a solution. We have al
ready seen this in the previous section. The formulas, obtained by applying Ohm’s
law, make clear what the conditions are for real sources in order to be almost ideal
sources. Before deriving some general rules, which will enable us to perform com
putations even in complex systems, let us consider two more examples of relatively
simple electrical circuits (see figure 6.7).
a b
R R R3
+ 1 + 1
u R2 R3 u R2 R4
We use the Let us first consider the circuit on the left of figure 6.7a. It consists of a resistor
symbol  to R 1 in series with the parallel combination of R 2 and R 3 (R 2  R 3 ). In order to find the
indicate two
elements in total current delivered by the voltage source we start with computing the resistance
parallel. of this network.
6.2. COMPUTATIONS 77
R2 R3 R1 R2 + R1 R3 + R2 R3
R tot = R 1 + = (6.22)
R2 + R3 R2 + R3
The current flowing through R 1 and through the parallel combination R 2  R 3 is
thus
u R2 + R3
i= = u (6.23)
R tot R 1 R 2 + R 1 R 3 + R 2 R 3
The current flowing through R 3 is:
R2 R2 R2 + R3
i R3 = i= u (6.24)
R2 + R3 R2 + R3 R1 R2 + R1 R3 + R2 R3
and the voltage over R 3 is
R2
u R3 = R 3 i R3 = R 3 u (6.25)
R1 R2 + R1 R3 + R2 R3
We could write this as
u R3 R2 R3
= HR3 = (6.26)
u R1 R2 + R1 R3 + R2 R3
We call HR3 the transfer function from u to u R3 . transfer function
Another way of finding u R3 is by realising that the voltages over R 2 and R 3 are the same.
The parallel combination of R 2 and R 3 can be replaced by the resistance R 23
R2 R3
R 23 = (6.27)
R2 + R3
The current through R 1 and R 23 is then
u R2 + R3
i= = u (6.28)
R2 R3 R1 R2 + R1 R3 + R2 R3
R1 +
R2 + R3
with
R2 R3 R2 R3 R2 + R3
u R3 = u R23 = i= u (6.29)
R2 + R3 R2 + R3 R1 R2 + R1 R3 + R2 R3
This is equal to eq. 6.25:
R2 R3
u R3 = u (6.30)
R1 R2 + R1 R3 + R2 R3
The circuit at the right in figure 6.7b can be analysed in a similar way. The most
easy way is of course to introduce a new resistance R 5 = R 3 + R 4 . The circuit is then
again similar to the circuit on the left.
Exercise 6.33
Compute the voltage u R4 in the circuit on the right of figure 6.7.
78 CHAPTER 6. ELECTRICAL CIRCUITS
The point in an electric circuit where two or more elements are con
node nected is called a node. In figure 6.8 n 1 , n 2 and n 3 are nodes.
The definition of We redraw figure 6.5 and indicate the directions of what we call a positive cur
what we call rent. We also indicate what we call a positive voltage by means of plus and minus
positive is up to
the user. The only signs at the terminals of the elements. The result is shown in figure 6.8
important thing is
that we indeed
define what we
consider positive.
Because a node cannot store energy it is obvious that all the currents that flow to
the node, must immediately leave the node. In other words, the sum of all currents
at a node is always zero. More precisely formulated, this leads to:
Kirchhoff ’s Kirchhoff ’s current law: The algebraic sum of all the currents at any
current law
node in a circuit equals zero. See figure 6.9.
The term algebraic means that we have to take the signs of the currents into ac
count.
In the previous examples we have already seen that the voltage of the voltage source
is equal to the voltage over the load. In other words, the sum of all voltages in such a
closed loop is equal to zero. Or more precise:
6.2. COMPUTATIONS 79
F IGURE 6.9 i2
i1
Kirchhoff’s current law. Here all positive currents
flow to the node. This implies that some of the cur ij
rents must be negative for the sum to be zero.
in
Kirchhoff ’s voltage law: The algebraic sum of all the voltages at any Kirchhoff ’s
voltage law
closed path in a circuit equals zero. See figure 6.10.
Again, the term algebraic means that we have to take the orientation of the voltages orientation =
into account: if the current through a resistor flows from + to −, u = i R (e.g. R 2 in definition of what
is considered a
figure 6.8), otherwise u = −i R (e.g. R 1 in figure 6.8). positive voltage.
F IGURE 6.10 + u2 _ uj _
+
Kirchhoff’s voltage law
+ R Rj +
1
u1 Rn un
_ _
With the aid of the two laws of Kirchhoff and the law of Ohm, we can try to com
pute the transfer of eq. 6.26) again. Applying Kirchhoff’s current law to the circuit of
figure 6.8 yields:
i1 + i2 + i3 = 0 (6.31)
Applying Kirchhoff’s voltage law to the two loops in figure 6.8 yields:
u − (−i 1 R 1 ) − i 2 R 2 = 0 (6.32)
and
i 2 R2 − i 3 R3 = 0 (6.33)
From eq. 6.32 it follows
−u + i 2 R 2
i1 = (6.34)
R1
From eq. 6.33) it follows
i 3 R3
i2 = (6.35)
R2
Substituting eq. 6.35 into 6.34 yields
u R2 R3
i1 = − + i3 (6.36)
R1 R1 R2
80 CHAPTER 6. ELECTRICAL CIRCUITS
Now we have all currents written as a function of i 3 . Substituting eq. 6.35 and eq. 6.36
into eq. 6.31 yields
u R2 R3 R3
− + i3 + i3 + i3 = 0 (6.37)
R1 R1 R2 R2
or
u R2 R3 + R1 R3 + R1 R2
− + i3 = 0 (6.38)
R1 R1 R2
This can be written as:
u R2 R3 + R1 R3 + R1 R2
= i3 (6.39)
R1 R1 R2
i 3 can thus be written as
R2
i3 = u (6.40)
R2 R3 + R1 R3 + R1 R2
and
R2 R3
u3 = u (6.41)
R2 R3 + R1 R3 + R1 R2
This expression is equal to eq. 6.25. It may seem that it requires more work to find
the solution in this way than it did before. But the advantage is that now all the
currents in the circuit are written as a function of i 3 . By multiplying the currents
i 1 and i 2 with R 1 and R 2 we can now easily find u 1 and u 2 as well. In addition, we
can apply this approach to much more complex systems as well. We will always find
a number of equations equal to the number of unknowns. And because this is a sys
tematic procedure, using clearly defined laws, it can be automated as well.
d
Replacing with s yields
dt
I = C sU (6.43)
According to Ohm’s law we find
U 1
= (6.44)
I sC
The term 1/sC , the ratio between U and I , is the impedance of a capacitor denoted impedance of a
capacitor
as ZC .
1
ZC = (6.45)
sC
In a similar way we can find the impedance of an inductor
di
u=L → U = L sI (6.46)
dt
According to Ohm’s law we find
U
= sL (6.47)
I
We call this ratio the impedance of an inductor and denote this as ZL . impedance of an
inductor
ZL = sL (6.48)
ZR = R (6.49)
Calculation of transfer functions in systems with all three kinds of these electrical
elements is now easy, because they can all be described as impedances.
F IGURE 6.11
RC network R
u C
82 CHAPTER 6. ELECTRICAL CIRCUITS
Applying the voltage law of Kirchhoff and using the impedances ZR and ZC we can
write the equation for the current i in this circuit.
U U
U − ZR I − ZC I = 0 → I= = (6.50)
ZR + ZC 1
R+
sC
This can be written as
sC
I= U (6.51)
sRC + 1
The voltage UC over the capacitor is:
1 sC 1
UC = ZC I = U → UC = U (6.52)
sC sRC + 1 sRC + 1
When we consider Uin = U as the input signal and Uout = UC as the output signal
we get figure 6.12. The circuit within the dotted box can be seen as a component,
lowpass filter consisting of two ideal elements. The component can be used as a lowpass filter.
F IGURE 6.12
RC network as lowpass filter
component R
U Uin C Uout
From eq. 6.52 it follows that the transfer function of this filter is
Uout 1
Hfilter = = (6.53)
Uin sRC + 1
When we reconsider eq. 6.52 we see that we can easily write the differential equa
tion of this system by replacing s with ddt. . This leads to the equation
d uC
RC + uC = u (6.54)
dt
and when u = 0 to
d uC
RC + uC = 0 (6.55)
dt
We have already seen a differential equation like eq. 6.55 in eq. 3.50. The solution is
thus
The response of eq. 6.56 for u = 0 and uC (0) = 1 is given in figure 6.13.
6.2. COMPUTATIONS 83
UC
U_out {V}
1V
0.63 V
0.5 V
0.37 V
0
time {s}
Exercise 6.34
Simulate this system in 20sim. Use a modulated voltage source instead of an ordinary
voltage source and connect this source with a Signal generatorpulse block. The pulse
realises in fact switching on and off of the voltage source. This should lead to the diagram
of figure 6.14.
F IGURE 6.14
RC network with a pulse R
input signal u C
Pulse
Plot the output of the filter (the voltage over the capacitor) for different values of R and C .
Select a proper value for the stop time of the pulse. Explain your results. Note that both in
the case of switching the voltage source on and off, the transient is within 37% of its final
value, τ seconds after the switch. This observation can be used to find the solution for the
differential equation 6.54.
These observations are of course valid for all systems with a transfer function of the
form
Uout K
H= = (6.57)
Uin sτ + 1
84 CHAPTER 6. ELECTRICAL CIRCUITS
The solution always has the shape of an exponential function. Without an input
and an initial condition Uout (0) the response starts at Uout (0) and goes exponen
tially to the final value 0. After τ seconds the value of Uout is at 37% of its initial
value. When there is no initial value Uout (0) and Uin is switched from 0 to 1 at t = 0,
the response reaches 63% of its final value after τ seconds. The final value is in this
gain case K Uin . K is called the gain of this system. This is summarised in figure 6.15.
Note that the tangent at the start of the responses, intersects with the final value at
t = τ.
U_out {V}
U_in {V}
1K
0.63 K
0.5 K
0.37 K
0 2 4 6 8 10 12 14
time {s}
The response makes clear that quick changes, like a sudden step change at the in
put are not visible at the output of this network. More slow or ‘constant’ signals, are
completely visible at the output. Quick changes correspond to highfrequency sig
nals. Slow changes correspond to lowfrequency signals. The lowpass character of
this filter becomes even more clear when we examine the behaviour of the filter for
sinusoidal signals of different frequencies.
In figure 6.16 the response of this network to a socalled frequency sweep sig
nal is given. This is a sinusoidal signal u(t ) = sin(ωt ) where ω starts at a frequency
equal to 0 and ends with a frequency of, say, 1000 rad/s. We see that the lower fre
quencies come out of the network undisturbed, but at higher frequencies the volt
age over the capacitor becomes smaller and smaller. If we would put such a net
work in an audio signal the higher tones will be weakened or ‘filtered out’. There
lowpass filter fore, such a network acts as a lowpass filter.
Exercise 6.35
We examine this further by using a sinus as input. Choose R = 1Ω, C = 1F and select for the
frequency of ω values of 0.1, 1 and 10. Observe the reduction in amplitude of the output
signal and also the delay between the input and the output for the different frequencies.
6.2. COMPUTATIONS 85
model
1
u_C {V}
0.5
0.5
u_source {V}
0.5
0.5
1
0 50 100 150 200 250 300
time {s}
F IGURE 6.17
RLC network L R
Modulated C
Voltage
Step Source
Uin Uin
Uin − ZL − ZR I − ZC I = 0 → I= = (6.58)
ZL + ZR + ZC 1
sL + R +
sC
This can be written as:
sC
I= Uin (6.59)
s 2 LC + sRC + 1
and thus for the output voltage Uout
1 sC 1
Uout = Uin = 2 Uin (6.60)
sC s 2 LC + sRC + 1 s LC + sRC + 1
Because of the term s 2 this is a secondorder system. We can simulate the system secondorder
system
and analyse its behaviour.
86 CHAPTER 6. ELECTRICAL CIRCUITS
Exercise 6.36
Simulate the system in 20sim and plot the voltage over the capacitor. Perform a multiple
run with a parameter sweep. Let R vary between 0.1 and 10. Start with the following
parameters
L = 1H
R = 1Ω
C = 0.01F
In the next experiment set R to 1 again. Let C vary between 0.01 and 1. In the last experi
ment we use R = 1 and C = 0.01 and we let L vary between 1 and 100.
damping You will observe that one of the parameters only influences the damping of the system.
overshoot The amount of damping determines the amount of overshoot of the response and deter
mines how fast the sinusoidal component of the transient signal dies out. Another param
eter influences the frequency of the sinusoidal variations of the output signal. The third
parameter influences both, damping and frequency. Try to relate these variations to the
coefficients in eq. 6.59.
You will have observed that variations in R only influence the damping of the sys
tem. Apparently the coefficient RC in eq. 6.59 relates to the damping. Changes in
C and L influence both the damping and the frequency of the transient response.
These observations have lead to a standard form for secondorder transfer func
tions:
1 ω2n
H= 2
= (6.61)
s 2ζ s + 2ζωn s + ω2n
2
2
+ s +1
ωn ωn
From eq. 6.60 and (6.61 it follows that
1 1
ω2n = → ωn = p
LC LC
r
2ζ 1 C
= RC → ζ = R
ωn 2 L
When ζ > 1 there will be no oscillatory response or overshoot. For ζ < 1 there will
be overshoot and an oscillatory response. The damping will be smaller when ζ is
damping ratio: ζ closer to 0. For ζ = 0 the response will be a pure sinusoidal signal. ζ is called the
natural damping ratio. The parameter ωn is called the natural frequency because this is the
frequency: ωn
frequency of oscillation of the system (for ζ = 0) even if there are no external signals
exciting the system. Just an initial condition is enough.
Mechanical vibrations of the housing of a computer or in a car are also the result of
secondorder systems with a low damping ratio.
6.3. COMPUTATIONS VERSUS SIMULATIONS 87
6.4 Summary
In figure 6.18 all the electrical elements treated in this chapter are given. In addition
the formulas describing the relation between the voltage v and the current i are
given. For the capacitor and the inductance the formulas are given in integral form.
When these elements are used in a simulation the integral form is preferred. For
the resistor the relation is given as u − i R = 0. This is to emphasise that Ohm’s law,
like all the other formulas, gives a relation between u, i and R rather than indicating
that u depends on i (by writing u = i R) or vice versa (by writing i = Ru ).
In this chapter the concept of impedance was also introduced. This enables easily
deriving of the transfer functions. We saw that first and secondorder systems can
be written in a standard form. For firstorder systems the standard form is:
K
H= (6.62)
sτ + 1
where τ determines the slope of the response at t = 0 and the value where the re
sponse has changed 63%. The gain K determines (in the case of a step change at gain K
88 CHAPTER 6. ELECTRICAL CIRCUITS
i1 i2 i1 i2
+ + + +
u1 u2 u1 u2
_ _ _ _
the input) the final value of the response (the steady state value) (figure 6.19).
For a secondorder system (figure 6.20) the standard form is
K K ω2n
H= = (6.63)
s2 2ζ s 2 + 2ζωn s + ω2n
+ s +1
ω2n ωn
where K is again the system gain, ζ the damping ratio and ωn the natural frequency
of the system, i.e. the frequency of the oscillation if ζ = 0.
6.4. SUMMARY 89
0.63 K
0.5 K
0
0 1 2 3 4 5 6 7 8 9 10
time [s]
output 1
1.5 K
overshoot output 2
0.5 K
0
0 1 2 3 4 5 6 7 8 9 10
time [s]
Mechanical Systems
P = F v [W] (7.1)
91
92 CHAPTER 7. MECHANICAL SYSTEMS
T = 1c ϕ = kϕ ω = 1J p
Note that the dimension of power is always [W], irrespective of the domain. Power
is a domain independent quantity. From eq. 7.1 we can derive the energy stored in
the mechanical storage elements. By definition the energy is
Z Z
E = P dt = F v dt (7.2)
dv
Z Z
E kin is the kinetic
energy of a mass
E kin = m v dt = m v dv (7.3)
dt
kinetic energy The kinetic energy can thus be written as
1
E kin = mv 2 (7.4)
2
The equivalent formula for the rotation domain is:
1 2
E kin = Jω (7.5)
2
potential energy Besides kinetic energy which depends on the velocity, a mass can have potential
of a mass
energy due to gravity. With g being the acceleration of gravity, the (constant) gravity
force is equal to F = mg . The potential energy due to gravity is thus:
Z
E pot is the
potential energy
E pot = mg v dt = mg x (7.6)
where x is the height above a reference plane (x = 0) in which the potential energy
is 0 because this is the lowest point the mass can fall to.
k = 1/c [N/m] is A spring can also store potential energy. With F = kx the potential energy of a
the stiffness of a spring is
spring. c [m/N] is
dx
Z Z Z
the compliance. E pot = F v dt = kx dt = k x dx (7.7)
dt
7.1. ELEMENTARY MODELS 93
7.1.2 Elements
Besides masses (inertias), springs and dampers or friction, there are a few more el
ements often seen in mechanical systems. Mechanical equivalents of the electrical
transformer are a gear train and a lever. A gear train transforms torque and angular
velocity from the input axis to the output axis. A lever does the same for transla
tional motions. A gear wheelchain combination (e.g. on a bicycle) or a beltpulley beltpulley
combination transforms an angular velocity into a linear velocity or vice versa. Two
of these transformers can be combined into a pulleybeltpulley transformer (fig
ure 7.1).
The first beltpulley combination transforms an angular velocity into a linear veloc
ity of the belt, the second beltpulley combination transforms the linear velocity of
the belt back to an angular velocity. The total effect is similar to a gear train. When
the two beltpulley combinations share the same angular velocity, it can be used
as a transformer of linear velocities. Some basic realisations of gears and transmis
sions are given in figure 7.2. A gear can be realised by means of two toothed wheels gear
with different diameters. The teeth of the first gear engage with the teeth of the sec
ond one so that the rotary movement of the first gear is transmitted to the next.
94 CHAPTER 7. MECHANICAL SYSTEMS
The transmission ratio is determined by the ratio of the numbers of teeth of both
wheels. If the primary gear wheel has n 1 teeth and the secondary one has n 2 teeth,
the transmission ratio is −n 1 /n 2 . Therefore, the following relations hold:
Rotation transformers n
r1 r2
n1 1
n2
Translation transformers
l2 r1 r2
l1 l1
l2
Levers BeltPulleyBelt
n1 1
ω2 = − ω1 = − ω1
n2 n
(7.10)
n2
T2 = − T1 = −nT1
n1
When more gears are added we can get rid of the minus sign. In the 20sim library
transmission such a gear train is called a transmission, described by the equations
(rotation)
1
ω2 = ω1
n (7.11)
T2 = nT1
transmission where n is the total transmission ratio.
ratio
In the translation domain we find levers with similar properties as a twowheel
lever gear. Such a lever rotates around a pivot, anywhere between the points where the
gear is connected to other elements. Therefore, the force and velocity change sign.
l1 1
v2 = − v1 = − v1
l2 n
(7.12)
l2
F 2 = − F 1 = −nF 1
l1
where l 1 and l 2 are the distances to the turning point of the primary and secondary
connection points respectively.
Exercise 7.38
Give an example of such a system.
7.1. ELEMENTARY MODELS 95
If the pivot is at one end of the rod, the sign does not change and we obtain equa
tions equivalent to those of the rotation domain. This yields the formulas for the
transmission in the translation domain transmission
(translation)
l1 1
v2 = v1 = v1
l2 n
(7.13)
l2
F 2 = F 1 = nF 1
l1
v =rω
(7.14)
T =rF
where r is the radius of the pulley. If there is a second beltpulley combination con
nected to the first one by the belt we get the equations
1
v 1 = r 1 ω1 and ω2 = v1
r2
(7.15)
1
F1 = T1 and T2 = r 2 F 2
r1
7.1.3 Sources
In the electrical domain there were two kinds of sources i.e. (modulated) voltage
and (modulated) current sources. Therefore, in the mechanical domain we expect
similarly, two kinds of sources in the rotation domain and two kinds of sources in
the translation domain. In the translation domain there are (modulated) force and (modulated)
force and velocity
(modulated) velocity sources. Both of these sources can have the fixed world as a sources
reference (see the first two columns of figure 7.3). The fixed world represents a con
stant, mostly zero, velocity. In addition, a force or a velocity source can be placed
in between two objects. In figure 7.3 we have introduced a special IPM symbol for
these sources. See the third column of figure 7.3. An example of a force source with
respect to the fixed world is the gravity force. An example of a torque source with
respect to the fixed world is an electromotor.
96 CHAPTER 7. MECHANICAL SYSTEMS
rotation domain
T T T
translation domain
F F F
v v v
7.2 Computations
7.2.1 Impedances
Sometimes we In the mechanical domain we define the impedance of an element as the transfer
use ‘transfer’, as a Z = F /v or Z = T /ω. This implies for a spring
short form of
‘transfer function’. 1 1
Z
F= v dt → Z = (7.17)
c sc
and for a mass
dv
F =m → Z = ms (7.18)
dt
and for a friction or damper element
X d (mv) X d (mv)
F =− or F+ =0 (7.22)
dt dt
Equation 7.22 is used in d’ Alembert’s law: d’ Alembert’s law
A (constant) mass has one single velocity if connected to other objects. According
to d’ Alembert’s law:
dv X
m + F all forces = 0 (7.23)
dt
or
1 X
Z
v =− F all forces dt (7.24)
m
A spring can be connected to the fixed world and to a mass, or to two different
masses (one at both ends), having different velocities. The force on a spring is de
termined by the positions (integrated velocities) at both ends of the spring.
1 1
Z
F spring = (x 1 − x 2 ) or F spring = (v 1 − v 2 ) dt (7.25)
c c
The force on a damper is also determined by the relative velocity (i.e. the velocity
difference) between both ends of the damper.
F damper = f (v 1 − v 2 ) (7.26)
1
msv 1 + (v 1 − v 0 ) + f (v 1 − v 0 ) = 0 (7.28)
cs
98 CHAPTER 7. MECHANICAL SYSTEMS
FixedWorld
Spring Damper
+
Mass
m
and because v 0 = 0
1
msv 1 + v1 + f v1 = 0 (7.29)
cs
To write this equation in the form of a standard differential equation instead of a
mix of integral and differential elements, we use x 1 instead of v 1 as the variable of
interest. Because v 1 = dx 1 / dt we replace v 1 with sx 1 .
1
ms 2 x 1 + x 1 + f sx 1 = 0 (7.30)
c
This leads to the differential equation we have seen before, e.g. in eq. 4.8.
d 2 x1 d x1 1
m 2
+f + x1 = 0 (7.31)
dt dt c
When there is an external force acting on the mass we could rewrite eq. 7.29 as
1
ms 2 x 1 + x 1 + f sx 1 = F external (7.32)
c
This can be written in the form of a transfer function
X1 1
H= = (7.33)
F external ms 2 + f s + 1c
or
X1 c
H= = (7.34)
F external mc s 2 + f c s + 1
This is a similar form as the one we saw in eq. 6.60 that could be written in the stan
dard form (eq. 6.61)
K ω2n
H= =K (7.35)
s2 2ζ s 2 + 2ζωn s + ω2n
2
+ s +1
ωn ωn
7.3. MECHANICAL SYSTEMS 99
1 1
ω2n = → ωn = p (7.36)
mc mc
2ζ 1 c
r
= f c → ζ= f (7.37)
ωn 2 m
When ζ > 1 there will be no oscillatory response or overshoot. For ζ < 1 there damping ratio: ζ
will be overshoot and an oscillatory response. The damping will be smaller when
ζ is closer to 0. For ζ = 0 the response will be a pure sinusoidal signal. ζ is called
the damping ratio and ωn is called the natural frequency. The natural frequency is natural
p frequency: ωn
proportional with the inverse of mc. The damping ratio is proportional with the
p
damping or friction coefficient f , with c, the square root of the compliance and
with the inverse of the square root of the mass, p1m .
FixedWorld
Spring Damper
1 1
m1 Mass1
+
Spring Damper2
2
m2 Mass2
nals of Spring1 and Damper1 and with the upper terminals of Spring2 and Damper2 .
Mass m 2 has a velocity v 2 and shares this velocity with the lower terminals of Spring2
and Damper2 . We can thus write the equations:
and
F mass1 + F spring1 + F damper1 − F spring2 − F damper2 = 0 (7.39)
The minus sign is due the fact that positive forces and velocities are directed down
wards (by choice/definition, see the arrow in figure 7.5).
From eq. 7.38 it follows:
1
m 2 sv 2 + (v 2 − v 1 ) + f 2 (v 2 − v 1 ) = 0 (7.40)
sc 2
1 1
µ ¶
v2 = − + f2 v3 (7.43)
m 2 s sc 2
1 1
m 1 sv 1 + v1 + f1 v1 − (v 2 − v 1 ) − f 2 (v 2 − v 1 ) = 0 (7.44)
sc 1 sc 2
1 1 1
· µ ¶ µ ¶ ¸
v1 = − + f1 v1 + + f2 v3 (7.45)
m1 s sc 1 sc 2
The equations 7.42, 7.43 and 7.45 give a complete description of this system. We
could convert these equations into a set of two coupled differential equations. The
most convenient form for a differential equation is obtained again if we use posi
tions x instead of velocities v.
d 2 x2 dx 3 1
µ ¶
m2 + f2 + x3 = 0
dt 2 dt c2
2
(7.46)
d x1 dx 1 1 dx 3 1
µ ¶
m1 + f1 + x1 − f 2 + x3 = 0
dt 2 dt c1 dt c2
with x 3 = x 2 − x 1 .
We see that the springdamper combination that connects m 1 and m 2 is present
in the equation for x 3 as well as in the equation for x 1 . This can be clarified with
a block diagram. From eq. 7.46 it follows that there are two coupled secondorder
differential equations. The total system is thus a fourthorder system. This implies
that we need four integrators to represent such a system in a block diagram.
7.3. MECHANICAL SYSTEMS 101
This block diagram is most easily constructed by rewriting eq. 7.43 and eq. 7.45
as
1 1
µ ¶
sv 2 = − + f2 v3
m 2 sc 2
(7.47)
1 1 1
· µ ¶ µ ¶ ¸
sv 1 = − + f1 v1 + + f2 v3
m1 sc 1 sc 2
This leads to the block diagram of figure 7.6
spring damper
combination 1
f1
1
c1
spring1
sv v
1 1 1
m1
m
1
F v
21 1
spring damper
combination 2
f2
v
3
1
c2
spring2
sv v
1 2 2
m2
v
2
m
F 2
31
Note that the interaction between the upper and lower massspringdamper system
is through the signals F 21 and v 1 . The product of these two signals has the dimen
sion [W]. It represents the power that is exchanged between the two subsystems.
When we would add another massspringdamper system, the block diagram can
be extended with a copy of the lower part (below the dashed line). This lower part is
also described by the second equation of eq. 7.46.
7.3.1 Cases
A large mechatronics project at the University of Twente dealt with the design of
the Mobile Autonomous Robot Twente (MART), which could drive through a factory, Mobile
Autonomous
collect product parts and assemble these parts while driving around. Many inno Robot Twente
vations were developed and applied in this project. The goal of this project was to (MART)
102 CHAPTER 7. MECHANICAL SYSTEMS
Dead reckoning is a technique applied in all kinds of navigation systems. Take, for in
stance, a GPS navigation system. Accurate position data are available at certain intervals
and when the reception is bad, e.g. in a tunnel, data can be completely missing. Other
sensors, such as a compass and acceleration sensors deliver also information, which may
be less accurate on a longer term, but might even be more accurate in short time inter
vals. In addition, the map in a navigation system can also predict a car’s position during
loss of GPS data. When it is assumed that the speed of the car is constant and the car does
not leave the road, this prediction can be highly accurate as well. All these other infor
mation sources can yield a position based on dead reckoning. Dead reckoning is thus the
process that leads to the best estimated position when real position data are (temporar
ily) unavailable.
In order to perform accurate dead reckoning the velocity and orientation of the
MART had to be known accurately. The velocity and orientation were calculated out
of the rotations of the wheels. Therefore, the wheels should be very hard. As a result
these hard wheels could result in a bumpy ride. This was undesirable given the ac
curacy of the assembly tasks that were to be performed by the robot manipulator
suspension on top of the vehicle. Therefore, a good suspension system between the lower frame
system
with the wheels and the upper system had to be designed. Based on model studies,
proper parameters could be chosen such that the motions of the upper frame were
smooth. This enabled the assembly robot to perform its tasks.
7.3. MECHANICAL SYSTEMS 103
When we extend the system of figure 7.5 with a modulated velocity source, which
represents a bump in the floor, this system can be analysed. Figure 7.8 gives a proper
simulation model. Note that the system of figure 7.5 is put upside down and that
the fixed world is now replaced by a modulated velocity source.
m mupper frame
m m
lower frame
Pulse1
bump
Pulse
VelocityActuator
Exercise 7.39
Simulate this system and play with the compliances and damping of the suspension sys
tem. Note that the total weight of the mobile robot is fixed due to other constraints.
However, the distribution of the weight over the upper and lower frame is within certain
bounds not fixed. Use the numerical values of table 7.2 to start with. Select the start and
stop times of pulse such that the bump has a height of 10 [cm].
From the experiments in this exercise it becomes clear that the springdamper
mechanical combination acts as a mechanical lowpass filter. The quick motions of the lower
lowpass filter
part of the body, due to the bump, are smoothed and lead to slow motions in the
upper frame. See also a short movie
http://www.controllab.nl/en/books/dynsys.html
The MART is an example of a purely technical system. But exactly the same compo
nents can be used to make a realistic simulation of flowers moving in the wind.
Exercise 7.40
Make a model of a flower that moves in the wind. Start with modelling the flower as an
inertia connected with a stem (rotation springdamper combination) to the fixed world.
Make the motions more realistic by modelling the stem as a number of massspring
damper systems. The presentation of the results could be much more impressive and
explanatory when a 3Danimation is made. See
http://www.controllab.nl/en/books/dynsys.html
7.4 Summary
In this chapter we have seen that mechanical elements can also be described with
impedances. The law of d’ Alembert, the equivalent of Kirchhoff’s voltage law, en
ables computation of transfer functions of mechanical systems in a similar way as
for the electrical domain. The mechanical domain can be split into a translation
and a rotation domain. On an equation level these domains behave similarly. The
icons in the mechanical domain are less ‘standard’ than the icons in the electrical
domain. It is, for instance, quite common to use the translation icons of figure 7.10
7.4. SUMMARY 105
friction
sources
F F v v
transformers
l2
l1 l1
l2
levers pulleybelt
Figure 7.11 gives the same for the rotation domain. From these two figures it is ob
vious that the equations are similar if F and ω are replaced by T and v. When fig
ure 7.10 and figure 7.11 are compared with figure 6.18, we see a similar correspon
dence. This will be considered further in the next chapter.
106 CHAPTER 7. MECHANICAL SYSTEMS
J
spring damper inertia fixed world
bearing
sources
T T
transformers
1 1 n
n
– the analogy between the basic concepts in mechanical and electrical systems
– the role of power as something common to all domains
– the concept of power ports
– how to couple electrical and mechanical systems by means of a transducer
– the difference between signals in a block diagram and powerport connections in a
physical system.
8.1 Introduction
In chapter 5 we have already seen that we can use analogies to make analogue
simulations. Hydraulic or mechanical systems can be simulated on an analogue
computer by means of electronic circuits. But the importance of these analogies
is even greater. If we were able to couple the different domains, it would be pos
sible to solve problems in one domain by adding dynamical elements in another
domain. This way of solving problems, especially by replacing mechanical com
ponents by electronic circuits, often in combination with a computer, is seen ev
erywhere. When we enhance mechanical systems with electronics, this is called
mechatronics. In expensive cars the value of the (digital) electronics already exceeds mechatronics
the value of the mechanical components. And this trend is likely to continue. In
most cases control systems are involved. A control system cannot only guarantee
that certain quantities are kept at a constant value (e.g the water level in the wa
ter clock or the speed of a car in a cruisecontrol system). It can also alter the be
haviour of a physical system. Electronically controlled shock dampers, which can
give a car completely different driving characteristics, are an example of the latter.
Because these changes are mostly made by means of a programme in a computer,
altering the behaviour of the system can be done in a very flexible way. It merely
requires changing a few variables or lines of code in the programme, rather than
modifying a whole mechanical construction. In this chapter we will take a closer
look at the common properties of elements in various domains. We will define what
107
108 CHAPTER 8. DOMAIN INDEPENDENT DESCRIPTIONS
8.1.1 Analogies
At several places in the previous chapters we have already seen that the basic el
ements in different domains have a lot in common. Let us, for example, recall ta
ble 4.2 (table A.1 in the appendix). This table is shown again in table 8.1.
domain behaviours
mechanical spring:R friction: mass: R
F = 1c vd t F=fv v=m1
Fdt
electrical capacitor: resistor: inductance:
u = C1 i d t u = Ri i = L1 ud t
R R
The way in which these elements are arranged suggests e.g. that a spring, a capac
itor and a water tank share common properties. From table 4.3 (or table A.2) it fol
lows that
Z
q = i dt (8.1)
and Z
V= ϕ dt (8.2)
or in words, the integrated electrical current is the charge of a capacitor and the
integrated fluid flow is the volume of fluid in a tank. This is indeed analogue be
haviour. It thus makes sense to consider the load q and the volume V as analogous
quantities and thus also the voltage u and the pressure p. A similar reasoning can
be given for the relation between the mechanical impulse p and the hydraulic im
pulse Γ. In this case even the names are equal. The related quantities are the ve
locity v and the flow ϕ. However, the symmetry in table 8.1 does not change if, for
instance, we exchange the formula for the mass and the formula for the spring. This
would just lead to a different analogy. When we consider u and F as analogous sig
voltageforce or nals we talk about a ‘voltageforce’ analogy. If we consider u and v as analogous sig
voltagevelocity
analogy
nals we talk about a ‘voltagevelocity’ analogy. Here we choose for the voltageforce
analogy (and for the voltagepressure analogy).
8.2. POWER 109
8.2 Power
8.2.1 Power ports
All the elements of table 8.1 have in common that they describe the relation be
tween two variables. The product of these variables has the dimension of power in
Watts. Therefore, we call these variables power conjugated variables. These vari power
conjugated
ables are variables
For each of the elements of table 8.1 it holds that there is a single variable, the power
P , which determines the flow of energy to and from this element. Therefore, we call
the elements of table 8.1 oneport elements. (The power variable itself is determined oneport element
by the product of two other variables: e.g. P = ui .) By definition the power is con
sidered to be positive when there is a flow of energy into the element and negative
when there is a flow of energy from the element. This corresponds with the defini
tion for a positive current: when the current through an element flows from u + to
u − , the current is positive. The energy flow for a discharging battery is thus neg By definition the
ative (the current through the battery flows from u − to u + , figure 8.1 left) and for energy flow into
an element is
a charging battery positive (the current through the battery flows from u + to u − , considered to be
figure 8.1 right). positive
discharging + charging +
P = u(i) i P = ui
battery i battery
_ P<0 _ P>0
The elements in the first and last column of table 8.1 are able to store energy. In
case of a positive energy flow the energy stored in the element increases, otherwise
it decreases. The elements in the center column dissipate energy. They cannot store
energy and never deliver energy back to the rest of the system. The energy flow to
these elements is thus always positive.
In fact the term dissipation of energy in the foregoing is not completely correct. Both, in
the case of a resistor and friction the energy is irreversibly converted to energy in the ther
mal domain. Brakes in a car or bicycle heat up when they are used. This energy is indeed
‘lost’. But we could hardly say that a resistor, in the form of an incandescent lamp or an
electrical heater dissipates energy. It delivers something useful, but in another domain.
However, we still will use the word dissipation for all cases where energy is irreversibly
converted into another domain. From a system’s point of view we can also say that this
is an energy flow to the environment in the case we are not interested in the thermal do
main.
110 CHAPTER 8. DOMAIN INDEPENDENT DESCRIPTIONS
TF I
C R R
n:1
In such a circuit diagram the idea of ports and energy flows is hardly visible. There
fore, we redraw this figure, which yields figure 8.3. Here we indicate that all the el
ements at the primary (left) side of the transformer share the same current i 1 , and
at the secondary (right) side of the transformer the current i 2 . We have also indi
cated the voltages over all the elements. The energy flows have been indicated by
power bonds means of half arrows, which we will call bonds. Or, because the half arrows repre
‘Bond’ means sent an energy flow (i.e. power), power bonds. Energy flows from the source to the
band or binding. elements, which share i 1 , the C and R element and the primary side of the trans
The bonds in this
diagram connect former. From the secondary side of the transformer energy flows to the R and I ele
the elements to ment (the inductor).
each other by We can remove the whole electrical circuit diagram and still have the same in
means of a
energy flow formation available about the connections in the system. This results in figure 8.4.
Note that we indicated the voltage source as S u .
uC u R1 u R2 uL
+ + +
+
C R R I
TF +
u TF1+ u TF2
+
i1 i2
u source
n:1
F IGURE 8.3 An electrical circuit: the half arrows indicate positive energy flows
This graph emphasises the oneport and twoport character of the elements.
Because the half arrow represents the energy flow, it also represents two signals:
8.2. POWER 111
C R R I
capacitor resistor resistor inductance
Su i TF i
voltage transformer
source
the voltage u and the current i . This could be explicitly indicated by writing these
signals on each side of the arrow. By convention we write the voltage above or at the
left of the arrow and the current below or at the right of the arrow. In figure 8.5 the
voltage and current signals are indicated in the graph.
C R R I
uC uR1 uR2 u
L
i1 i1 i2 i2
uSu uTF1 uTF1
Su i1 i i1
TF i2
i
F IGURE 8.5 Graph representing the energy flows to the elements, with voltage
and current signals added
The representations of figure 8.4 and figure 8.5 may seem very abstract and mean
ingless in the beginning. But due to this abstraction they have the advantage of
strongly supporting the idea of analogous behaviour in the different domains. Go
ing from figure 8.4 in the electrical domain to figure 8.6 in the mechanical domain
is a very simple step. Because of the analogy between i and v we exchange the com
mon current by common velocities. We do not change the symbols, but realise our
selves that C now means a spring, R a damper or friction and I a mass. Finally, the
electrical transformer is a mechanical transmission.
C R R I
spring damper friction mass
SF v TF v
transmission
F IGURE 8.6 Graph representing the energy flows to the elements in the
mechanical domain
Exercise 8.41
Check that figure 8.7 is indeed a possible realisation of the graph of figure 8.6. Draw an
alternative realisation, using another friction element instead of the damper. Draw also a
realisation in the rotation domain. Map the graph of figure 8.6 on the IPM of figure 8.7, in
a similar way as in figure 8.3.
Damper
F
Force FixedWorld
Spring
1 m
n
Friction Mass
Transmission
C R R I
Se 1 TF 1
These graphs are also a powerful tool for computing the system equations, either
in the form of a transfer function or as a differential equation. One of the system
bond graph representations available in the graph editor of 20sim, is the bond graph represen
tation. The graph of figure 8.8 can directly be drawn in 20sim. In the next chapter
we will treat bond graphs in more detail and more formally.
8.2. POWER 113
Exercise 8.42
The models of figure 8.3, figure 8.7 and figure 8.8 can all be drawn in 20sim. Do this and
show that (when giving the corresponding parameters the same values) the responses are
the same indeed.
i u
d/dt
C C
u 1 i
C C
An actuator in the form of a modulated voltage source has a signal as an input and actuator
delivers a voltage to the system, proportional to the modulating signal. The power
P and the current i are the result of the response of the rest of the system on the
varying voltage of the modulated voltage source. The power of the modulating sig
nal itself is completely irrelevant. Only the information of this signal (e.g. a signal
sin(ωt )) is relevant. A modulated voltage source thus couples the information do
main (e.g signals coming from a computer) to the physical domain. Figure 8.10
gives this situation, represented by means of an iconic diagram and by means of
114 CHAPTER 8. DOMAIN INDEPENDENT DESCRIPTIONS
a combination of block diagram and bondgraph elements. In the right figure the
output signal of the signal generator (in this case the signal sin(ωt )) is represented
by an ‘ordinary’ arrow, the output (power) of the voltage source by means of a half
arrow, a bond. A modulated voltage source can practically be realised as a power
amplifier: the power of the input signal is negligible, the output could have a high
power.
MSe
Modulated
VoltageSource
Another element that connects the power domain with the information domain is
optical encoder an optical encoder or code disc. This is a disc that can be connected to an axis with a
digital code printed on it, in the form of black and white (or transparent) blocks or
bars. The code provides information about the angle of the axis and is thus pure a
signal representing the angle of the axis (figure 8.11).
In a computer we always deal with signals. Here, information processing is all that
counts. The power needed to perform the calculations is not essential for this pro
cess. If less powerconsuming electronics are used, the result of the calculations is
similar, but the electricity bill will be lower (or the battery will last longer).
8.3. TRANSDUCERS 115
8.3 Transducers
In section 8.1 we came across examples of actuators: elements that convert sig actuator
nals to power: e.g. the modulated voltage source. We also saw sensors: elements sensor
that extract information from the system in the form of a (digital) signal: the opti
cal encoder. What we did not consider yet, are elements that convert power from
one domain to another domain. Most close to this class of elements was the belt
pulley type of transformer. The beltpulley combination transforms motions in the
translation domain to the rotation domain or vice versa. But both of these domains
belong to the mechanical domain. Even if we restrict ourselves to the electrical and
mechanical domain there are many transducers that convert electrical to mechani transducer
cal power or vice versa.
8.3.1 DCmotor
One of the most common transducers is an electrical motor. In its most simple
form, as a rotating DC motor, it works as follows (figure 8.12).
The motor consists of a rotor (or armature) and a stator. The stator consists of per
manent magnets with alternating north and south poles. The rotor consists of one
or more coils, which rotate around the axle. The current flowing through these coils
produces a magnetic field. If this magnetic field is not aligned with the magnetic
field of the permanent magnets there is a resulting force, which tries to align the
two fields. When, at the right moment, the current in the coils is inverted, the direc
tion of the field from the coils is inverted as well. The result is a more or less con
stant force and torque on the rotor, resulting in rotation of the motor. The process
of inverting the direction of the current is called commutation. Commutation is re commutation
alised by connecting the coils in the rotor via socalled brushes with a (modulated)
voltage or current source. Modern brushless DCmotors use electronics to provide
116 CHAPTER 8. DOMAIN INDEPENDENT DESCRIPTIONS
a rotating magnetic field in the stator. By putting the permanent magnets in the ro
tor, brushes are no longer needed. This has lots of advantages. More information on
the basics of DCmotors and an animation can be found on
http://electronics.howstuffworks.com/brushlessmotor.htm.
Like we did with the other elements we define an ideal, elementary DCmotor. Such
a motor can be described by the equations
T = Kmi
u = Kmω (8.3)
The torque is proportional to the current flowing through the coils. This is not sur
prising: the larger the current, the larger the magnetic field. The voltage is propor
counter tional to the angular velocity. This voltage is called the counter electromotive force
electromotive
force (EMF)
(EMF). This implies that the motor can also be used as a generator, i.e. a device that
converts mechanical energy in electrical energy. Examples are the dynamo in a car
or a bicycle dynamo.
Exercise 8.43
If you turn the small wheel of a bicycle dynamo you can feel the influence of the magnets
in the dynamo. Because of the iron cores in the electro magnets the dynamo has a number
of preference positions. Such a dynamo also shows the validity of the electromotive force
formula. The faster you ride, the brighter the lights of your bicycle.
Taking into account that on the one hand T and u and on the other hand i and ω
are each others analogons, eq. 8.3 is the equation of a gyrator (see eq. 6.8). K m is
called the motor constant. The icon for such an ideal motor and the bondgraph
representation are given in figure 8.13. Because the DCmotor has an electrical port
and a mechanical port, it is a twoport element.
+
u T
i GY
_
F IGURE 8.13 Icon for a DCmotor and the corresponding bondgraph element
A more realistic DCmotor is more complex. It is obvious that the permanent mag
nets in the rotor are not weightless. The rotor must therefore have some inertia. In
addition, the motor will have friction. And finally, the windings of the electromag
nets on the electrical side of the motor will have some resistance and inductance. If
we add these elements to the elementary motor of figure 8.13, we get the IPM of a
DCmotor as a component (figure 8.14).
Friction in a motor can be minimised by using socalled air bearings. This is an expensive
construction, applied in machines were an extreme high accuracy is required.
8.3. TRANSDUCERS 117
8.3.3 Potentiometer
Besides velocity, position is an important quantity in mechanical systems. An
gular positions can be measured by means of an optical encoder, as we have al
ready seen. Another way to measure positions is with a variable resistor, called a
potentiometer. The symbol for a potentiometer is given in figure 8.15, together with potentiometer
an example of a real potentiometer. Potentiometers are (were) quite common in
e.g. audio amplifiers to control the volume. When one terminal of the potentiome
ter is connected to a constant voltage and the other one to ground, the voltage of
the sliding contact is proportional to its position. If the mass or inertia and the fric
tion are negligible, the potentiometer has no influence on the mechanical part of
the system. Because any change in voltage or current on the electrical side of the
potentiometer has no influence on the mechanical side, the potentiometer is a pure
sensor, where only signals play a role. The output voltage is just a measure for the
mechanical position.
u0
uslider
plied in pressure sensors or gas lighters). But it can also produce a force if a volt
age is applied. This principle is applied in small loudspeakers, small motors or in
antisound devices. Most loudspeakers are more similar to a DC motor. A coil in the
loudspeaker produces a magnetic field, which acts on a permanent magnet con
nected to the conus of the loudspeaker. The motions of the conus result in changes
in the air pressure around the conus, resulting in sound. A loudspeaker is thus a
transducer from the electrical to the mechanical domain and then to the acoustic
domain. Figure 8.16 gives an example of a system where loudspeakers are used as
transducers from the electrical to the mechanical domain.
Modern cars are also full of transducers, sensors and actuators. By using a sensor
actuator combination, the properties of a system can be changed by information
processing in a computer instead of by changing the mechanical system. A typical
example is a ‘Segway’ (figure 1.6). It could be stabilised by adding an extra wheel. It
can also be stabilised by measuring the error with respect to the vertical position,
computing a correction in the embedded computer and sending a correction signal
to the motors that drive the wheels. This is the area of automatic control, where al
ways sensors and actuators are used to couple the process that should be controlled
and where power plays a role, to the controller where only signals (information) is
relevant.
8.3. TRANSDUCERS 119
Bond graphs
9.1 Introduction
In the previous chapter we have seen how we could represent the energy flows in
an IPM of a physical system by means of a bond graph. This bond graph could eas
ily be converted into an IPM in another domain. In this way the bond graph helps
to understand the analogies between different domains. In the example we used
it was just a matter of replacing the junctions with a common current i by junc
tions with a common velocity v. We generalised this i junction to a 1junction: a 1junction
1junction represents a current in the electrical domain, an (angular) velocity in the
mechanical domain and a flow in the hydraulic domain. In a domainindependent
bond graph we refer to these variables as flow variables. The 1junction thus rep flow variables
resents a common flow. For these generalised flow variables we use the symbol f .
All the elements we considered so far, always described the relation between two
variables, voltage and current, force and velocity, or pressure and flow. Therefore we
can expect the existence of another junction, representing a voltage, force or pres
sure. Such a junction indeed exists. In a generalised form we call it a 0junction. 0junction
In a domainindependent bond graph we refer to the variables voltage, force and
pressure, represented by a 0junction as effort variables. effort variables
121
122 CHAPTER 9. BOND GRAPHS
9.2 Junctions
Example
As an example of a system with a 0junction, we consider the electrical circuit of
figure 9.1.
F IGURE 9.1 + uR _
Electrical circuit
+
u source i C u I
We see that the voltage source, the resistor and the parallel circuit of the capacitor
and the inductance share the same current. This implies that they are connected
to a single 1junction. The capacitor and the inductor share a common voltage
u  . They are thus connected to a 0junction. Together they are connected to the
1junction. This leads to the bond graph of figure 9.2. The voltage source is in this
case the effort source S e .
Example
As a second example we consider a mechanical system. In a mechanical system a
1junction represents a velocity and a 0junction a force. In figure 9.3 we see two
masses, connected by means of a springdamper combination.
F IGURE 9.3
Mechanical system (IPM)
v1 v2
m m
The two masses have different speeds and can thus be connected to two different
1junctions. The springdamper combination is subject to a common force, repre
9.2. JUNCTIONS 123
sented by a 0junction. But we see here that the two also share a common velocity
difference (v 1 − v 2 ). This can be expressed by connecting the springdamper combi
nation to a 1junction, which represents this velocity difference (figure 9.4).
F IGURE 9.4 C R
Bond graph of the mechanical
system 1 : v1_v2
I 1.. 0
.. 1
.. I
v1 Fspring v2
A 0junction thus not only represents an effort, e.g. a force. It also implies that the
(algebraic) sum of all flows, e.g. velocities at the 0junction is zero. Similarly, a 1
junction represents a flow (velocity). And at the same time it implies that the (al
gebraic) sum of all efforts, e.g. forces at the 1junction is zero. This is illustrated in
figure 9.5.
1 : f3 = f1 _f2 0 : e3 = e1 _e2
1 : f3 = f1+ f2 0 : e3 = e1+ e2
1
.. 0 1.. ..0 1 ..0
f1 f2 e1 e2
F IGURE 9.5 Rules to compute the sums of efforts and flows at a junction
Note the influence of the orientation of the arrows on the sum. An arrow pointing
towards the junction gives a positive contribution, the contribution of an arrow
pointing away from the junction is negative. This implies that for the four situations
in figure 9.5 the following relations hold:
f1 − f2 − f3 = 0 e1 − e2 − e3 = 0
(9.1)
f1 + f2 − f3 = 0 e1 + e2 − e3 = 0
124 CHAPTER 9. BOND GRAPHS
Once causality has been assigned, we can draw the equivalent block diagrams. See
figure 9.7. A causal bond graph contains the same information as the correspond
ing equations or block diagram. These equations are given in figure 9.7 as well.
Note that it does not matter whether the element is connected to a 1junction (rep
resenting a flow) or a 0junction (representing an effort): the equations remain the
same. In the case of an Relement, there is no preference for either one of the two
indifferent causal forms: the Relement has indifferent causality.
causality
9.3. BILATERAL SIGNAL FLOWS AND CAUSALITY 125
e e
1 f R:R 1 f R:R
e e
0 f R:R 0 f R:R
e f f e
1 R
R
F IGURE 9.7 Causal bond graphs and the corresponding equations and block
diagrams of an Relement
Most other elements are subject to more restrictions. Ideal effort and flow sources
can have only one causal form. The output of an effort source must, by definition,
be the effort and the output of a flow source the flow. Sources thus have a fixed fixed causality
causality (figure 9.8). We say that the effort source has fixed effortout causality and
the flow source fixed flowout causality.
e e
Se f 0 S.. f f 1
..
u i
e f
Se Sf
F IGURE 9.8 Causal bond graphs and the corresponding equations and block
diagrams of source elements
Exercise 9.44
Explain why in figure 9.8 there are still signals e and f along the bonds, while in the block
diagram only one signal seems to play a role.
The next category of elements we consider are the C  (capacitor, spring and fluid
bufffer) and I  (inductor, mass and hydraulic inertia) elements. These elements are
described with an integrator or differentiator.
In acausal form the C element is described by the relations:
1 de
Z
e− i dt = 0 or i −C =0 (9.3)
C dt
and the I element by
1 di
Z
f− e dt = 0 or e − I =0 (9.4)
I dt
126 CHAPTER 9. BOND GRAPHS
0 C: C 1 I:I
f 1
_ e e 1
_ f
C I
0 C:C 1 I:I
e f f e
C I
F IGURE 9.9 Causal bond graphs and the corresponding equations and block di
agrams of C  and I elements. The upper two systems have integral
causality, the lower two figures, with the red causal strokes have
derivative causality.
The last two elements are the transformer and the gyrator. A transformer is de
scribed by the relations
e 1 − ne 2 = 0
(9.5)
n f1 − f2 = 0
This implies that if the primary side of the transformer has effortin causality, the
secondary side must have effortout causality, because e 2 = n1 e 1 . Simultaneously
the primary side will then have flowout causality and the secondary side flowin
causality. This situation is given in the upperleft graph in figure 9.10. The lower left
graph of figure 9.10 gives the opposite situation.
A gyrator is described by the relations
e1 − n f2 = 0
(9.6)
n f1 − e2 = 0
This implies that if the primary side of the gyrator has effortin causality, the sec
ondary side must have flowout causality, because f 2 = n1 e 1 . Simultaneously the
9.3. BILATERAL SIGNAL FLOWS AND CAUSALITY 127
primary side will then have flowout causality and the secondary side effortin
causality. This situation is given in the lowerright graph in figure 9.10. The upper
right graph of figure 9.10 gives the opposite situation.
1 TF 1 1 GY 1
1 TF 1 1 GY 1
F IGURE 9.10 Causal bond graphs and the corresponding equations of a trans
former and gyrator
Transformers and gyrators thus just propagate the causality. This implies that these
elements are subject to a causal constraint. If one of the ports of a transformer has causal constraint
effortout causality, the other one must have flowout causality. In a gyrator the pri
mary effort determines the secondary flow and vice versa. Both ports of the gyrator
must thus have the same causality. The various causal situations of transformers
and gyrators are given in figure 9.10.
Finally we consider the causality constraints of the junctions. Figure 9.5 and
eq. 9.1 give the formulas relevant for junctions. A 1junction represents a flow sig
nal, f . For a 1junction, as in the upper right graph of figure 9.5, the sum of all the
efforts is equal to zero:
e1 − e2 − e3 = 0 (9.7)
The flow of the junction will be uniquely determined by one and only one of the
connected elements. Let this be element 1. Then
f 1 = F (e 1 ) (9.8)
e1 = e2 + e3 (9.9)
f1 − f2 − f3 = 0 (9.10)
The effort of the junction will be uniquely determined by one and only one of the
connected elements. Let this be element 1. Then
e1 = F ( f1) (9.11)
128 CHAPTER 9. BOND GRAPHS
R R R R1
Se 1 I L Sf 0 I L1
Se Sf
C C C C1
+ R L
Uo Io R L C
C
Exercise 9.45
Check yourself how the rules for the causality assignment lead to the causal strokes in the
bond graph at the right of figure 9.11.
9.4. DERIVING EQUATIONS FROM A CAUSAL BOND GRAPH 129
1 1
Z Z
f = e L dt → i = u L dt (9.13)
L L
Taking the direction of arrows of the bonds into account (see the rules in figure 9.5)
it follows that
e S e − e R − e I − eC = 0 → e I = e S e − e R − eC (9.14)
or
1
Z
u L = Uo − i R − i dt (9.15)
C
These equations are ready for simulation, or can, after some manipulations, be
converted into a differential equation.
Exercise 9.46
Derive in a similar way the equations of the circuit at the right in figure 9.11 from the bond
graph.
R L
+
Km
U J
f J
F IGURE 9.12 IPM and causal bond graph of a DC motor connected to a voltage
source and a mechanical load
130 CHAPTER 9. BOND GRAPHS
The equations can again be easily derived from the causal bond graph:
1
Z
i= u L dt (9.16)
L
uL = U − i R − K m ω (9.17)
1
Z
ω= T J dt (9.18)
J
T J = Km i − f ω (9.19)
With some computational effort these equations can be converted into a differen
tial equation or directly into the block diagram of figure 9.13.
i
1/L Km 1/J
Constant
R f
Km
1. fixed causality
2. causal constraints
3. preferred causality
4. indifferent causality
This is also the order, which we follow to assign the causality. We start at a source
element (or at one of the sources). This source gets the fixed causality belonging to
this source. The source will be connected to a junction. It is possible that due to the
causal constraints of the junctions, this causality assignment propagates through
the graph to other junctions. If no further propagation is possible another source
9.5. CAUSALITY ASSIGNMENT 131
can be given preferred causality. If there are no sources left, the next step is to con
sider an element with preferred causality. This element gets the preferred causal
ity. This causality assignment may propagate again through the graph to other ele
ments and junctions. This is repeated until all elements with preferred causality are
handled. The last step is to assign an arbitrary causality to one of the elements with
indifferent causality and propagate this. Also this step is repeated until all elements
with indifferent causality have been handled. This procedure will be illustrated with
the bond graph of figure 9.12.
We start with assigning the required fixed causality to the S e source. At the first 1
junction this leaves enough freedom for assigning causality to other elements. This
implies that the causality of the effort source does not propagate. This first step is
indicated by the number 1 in the black circle in figure 9.14.
If there are more source elements, we repeat this procedure. Because there are no
other source elements, we proceed to step 2.
In step 2 we assign the preferred causality to one of the elements with preferred
causality. We can choose between the mechanical or the electrical Ielement. We
choose here, arbitrarily, the electrical Ielement (the inductance L). This causal
stroke of this element gets the number 2. Because there is now one bond (from the
Ielement) determining the flow of the electrical 1junction, all other bonds con
nected to this junction should have the effort directing to the junction. They get
a causal stroke near the junction (2a and 2b). Because of the causal constraint of
the gyrator, the causality is propagated to the other port of the gyrator (2c). At the
mechanical junction there are no further constraints. Thus the propagation stops
here (figure 9.15). Because another element with preferred causality is found at the
mechanical 1junction, we repeat step 2 and assign the preferred causality to the
mechanical Ielement, the inertia J (3). Because of the causal constraint of the me
chanical 1junction, the Relement, the mechanical friction f gets the last causal
stroke (3a in figure 9.16).
132 CHAPTER 9. BOND GRAPHS
In this example no elements are left to which causality has to be assigned. Other
wise the procedure would continue, similar to the one in step 2, for all elements
with indifferent causality.
The causality assignment in 20sim is done automatically. It can be made visible
by selecting view/causality info in the graph editor window. 20sim uses a different
numbering. Instead of 2a and 2b the notation 2.1, 2.2 is used and numbering starts
at 0. The graph with the numbering of 20sim is given in figure 9.17. Note that 20
sim started with giving the mechanical Ielement preferred causality first.
R L
+
Km
U J J
f J J2
R:R I :L I :J I : J2
3
2
2a 3b
Se
.. 1.. GY
.. 1:
U
1 i
2b 2c
Km 3a
R:f
F IGURE 9.18 Causal conflict: the inertia J 2 cannot get the preferred causality
1
Z
ω= T dt + ω(0) (9.20)
J
A second inertia on the same axle can only have the same angular velocity and the
same initial condition. Because these initial conditions are not independent from
each other, we say that these elements have dependent states. If the initial condition dependent states
ω(0), the state, of inertia J is chosen, the state of J 2 is the same, because it depends
on the state of J . The easiest way to get rid of this dependent state is to combine the
two inertias into one inertia. Another solution is to make the states independent.
One could wonder if the axle between the two inertias is not somewhat flexible. If
so, a more correct model would be to add a springdamper combination in between
the two masses. This is done in figure 9.19.
This model is probably a better description of the reality than the model with a
stiff axle. But if the flexibility is negligible, the solution of combining the two iner
tias into one is to be preferred.
134 CHAPTER 9. BOND GRAPHS
R L R damper
+
Km
U J J
f J C J2
C :C R : Rdamper
R:R I :L I :J 4c 4d I :J
2
3 4
2
1
2a : 1 3b 4b 4a
Se
.. 1.. GY
.. 1 0 1 : 2
U
1 i
2b 2c
Km 3a
R:f
F IGURE 9.19 Causal conflict solved by adding a springdamper combination to
represent flexibility of the axle
Exercise 9.47
Derive the equations of this system and show that these equations can be converted into
the block diagram of figure 9.20.
1 2
R f Rd
Km
In a next example of a causal conflict we consider the situation of figure 9.12 again,
but we replace the voltage source by a current source. We now see a causal conflict
in the electrical part of the system (figure 9.21).
9.5. CAUSALITY ASSIGNMENT 135
Sf 1.. GY 1:
.. ..
I i Km
When we take a closer look, we see that in the presence of a current source, the
electrical components cannot have any influence on the current in the current loop
of the motor. This implies that we could just leave out the inductance in our simu
lation or computation model. When we remove the inductance the bond graph can
be made causal without any causal conflict.
Exercise 9.48
Check this yourself and simulate the two systems. Show that also the resistor can be re
moved and explain why.
K2
In the feedback loop only gain elements are present. This implies that in the loop
the input of each block directly depends on its own output. This can only be solved
by introducing a small delay somewhere in the loop. This leads to an approxima
tion. To make the approximation as accurate as possible, a very small computation
136 CHAPTER 9. BOND GRAPHS
interval must be chosen, which is less desirable. We can also find an exact solution
symbolic by means of a symbolic solution. We can write the following equations:
solution
C = K1E (9.21)
E = R − K 2C (9.22)
C = K 1 R − K 1 K 2C (9.23)
(1 + K 1 K 2 )C = K 1 R (9.24)
C K1
= K loop = (9.25)
R 1 + K1K2
When, for example, K 1 = 1 and K 2 = 2, the algebraic loop can thus be replaced by
the gain K loop = 13 .
Although the bondgraph representation of a system makes causal conflicts im
mediately clear, these causal conflicts are not only a problem when we work with
bond graphs. Because IPM’s can be mapped one to one on a bond graph, similar
problems are present, and of course similar solutions. Causal conflicts arise when
we try to derive equations from a model that is too complex or too simple. It does
not matter whether the model is represented by a bond graph or an IPM. However,
in a bond graph, the cause of a causal conflict is immediately clear and the solu
tions to solve it as well. This is less obvious for an IPM where the solution of causal
problems requires quite some expertise. You can show the causality information of
causality info IPM’s in 20sim by selecting Causality Info from the View menu. Another way to ob
serve causal conflicts when working with IPMs is by starting the simulator from the
grapheditor window. This produces a report (log file) at the bottom of the graph
editor window.
When you want to do your own coding, deriving a model that can simply be sim
ulated, is even more important. To prevent that complex algorithms must be used it
is crucial for the model to be as simple as possible. The causal analysis with a bond
competent model graph, either manual or with the aid of 20sim, helps in finding such a competent
model: a model that is complex enough to model all relevant phenomena, but is at
the same time not unnecessarily complex.
e e
fixed causality: Se f 0 Sf f 1
sources
e f
Se Sf
causal constraints:
 only 1 bond without
a causal stroke
1 0
at 1junction
 only 1 bond with
a causal stroke
at 0junction
causal constraints: 1 TF 1 1 GY 1
transformer and gyrator
1 TF 1 1 GY 1
preferred causality: 0 C: C 1 I :I
C and Ielements
f e e f
e e
indifferent causality: 1 f R 1 f R
Relements
e f f e
1 R
R
2. Step 1a
Repeat this until all sources have been handled.
4. Step 2a
Repeat this until all elements with preferred causality have been handled.
6. Step 3a
Repeat this until all elements with indifferent causality have been handled.
After studying this chapter you are expected to completely master the topics treated
in the previous chapters:
10.1 Introduction
In the previous sections we have seen several representations of a system. It is now
time to wrap up and determine in which situation each of these model types is
most useful. We should not forget that most of the time making a model is not a
goal in and by itself. A model helps us to formulate a problem, or to understand a
complex system. In a design phase of a product or project a model is helpful to in
vestigate the behaviour of the system we plan to build. In the virtual world models
play a crucial role. They represent reality or augmented reality or even a surrealis
tic world, with physical laws that do not really exist. In all these cases relationships In a closedloop
between subsystems and closed loops are important. These relations determine the system the output
of a system
system’s dynamics. Catching the important behaviour in a competent model is the element depends
art of modelling. Often this modelling process starts with a global description, e.g. on itself.
in the form of finding (causal or noncausal) relations. Such a model can be rep
resented with a (causal) relation diagram. A causal relation diagram just depicts causal relation
the relations without any quantitative description. In principle, descriptions in the diagram
139
140 CHAPTER 10. REVIEW OF CHAPTERS 19
form of formulas are missing. Still, finding these relations is an important phase in
the modelling process, because some basic modelling decisions are made at this
point. The major elements, relevant for the problem context must be identified and
system boundaries are chosen.
If the relation diagram is indeed a causal relation diagram, it can be converted
block diagram into a block diagram or equations. This requires that the linguistic descriptions of
the causal relation diagram are translated into formulas and that parameters in
these formulas are chosen or estimated from the real system (if such a system ex
ists). Block diagrams are widely used and if all the parameters and equations are
available, they can be used as input for several simulation programs. In fact, block
diagrams are nothing else than a graphical representation of the underlying causal
equations. Programs like Matlab/Simulink and 20sim accept both equations and
block diagrams as an input format.
Physical systems are, in first instance, best described by acausal models in the
IPM form of Ideal Physical Models, or IPMs. These IPMs often closely resemble engi
neering drawings. This is especially true for electric circuit diagrams, which can in
many cases be directly translated into an IPM. In principle IPMs are acausal. 20
sim is one of the few programmes that support IPMs as an input format.
bond graph A more abstract input format is a bond graph. A bond graph can be seen as an
abstract and domainindependent representation of an IPM. Such an abstraction is
helpful to find an analogon model or even a realisation in another domain. 20sim
supports the input of bond graphs in the graph editor.
Both bond graphs and IPMs must be made causal if simulation is required. In
principle, the causality assignment procedures for a bond graph are applicable
to the corresponding IPM as well. However, this is much easier to perform in the
bond graph. The causality assignment supports the modelling process, because
causal conflicts point to a model being oversimplified or too complex. Acausal
bond graphs (and IPMs) can be used as an input for 20sim. 20sim performs the
causality assignment. Most of the causal conflicts are solved by the programme. If a
causal conflict is detected in a bond graph, a red stroke warning for nonpreferred
causality is displayed at the problem elements. These messages may lead the mod
eller to make a better model or they will make the modeller aware of the conse
quences of the modelling choices made. This red causal stroke does not always
mean that the system cannot be simulated. By symbolic manipulation or iteration a
simulation may still be possible.
We have already seen several examples of electrical and mechanical systems. In
this chapter we will see a few more. A domain we did not yet cover is the thermal
domain. In section 10.3.4 we will see that this domain needs a special treatment.
Finally we will review the consequences of our models for simulation. This is
especially important if not all the actions to be taken are performed by a simula
tion programme. If you want to write your own code it is important to make models
which can easily be simulated. Also care must be taken that these equations are
properly sorted.
10.2. SYSTEM DESCRIPTIONS 141
When we want to model the motor or the generator we can start with drawing a
(causal) relation diagram. We may choose to model the ‘motor’ as a transducer,
without deciding if it is a motor or a generator yet. But we could also choose one of
the two. These choices are given in figure 10.3 and 10.4.
When we take a closer look at the inside of the motor (figure 10.5) we may de
cide that we want to model the components in more detail. We see that the rotor
consists of an iron core with windings. The stator consists of permanent magnets
and a housing. Thus, both electrical and mechanical system components are to be
modelled.
Exercise 10.49
Take a closer look at the components of figure 10.5. We see that there are electrical and
mechanical components (figure 10.6). Which of the components of this figure would you
include in your model and how will these models look? Are there also components that
do not play a role in a model of the dynamics of this transducer?
Which elements After examining the electrical and mechanical parts more closely, as in exercise
we include in the 10.49, we could decide to model the inductance and resistance of the windings at
model is a
modelling choice. the electrical side of the motor and inertia and friction at the mechanical side of the
motor. This leads to the relation diagram of figure 10.7. This diagram has no indica
tion of a positive power flow and can thus represent both a motor and a generator.
10.2. SYSTEM DESCRIPTIONS 143
F IGURE 10.5 A motor taken apart. The stator with permanent magnets and the
rotor with its iron core and the windings are clearly visible
R L
Km
J
f J
When used as a motor, we can connect the electrical side of the transducer to a
voltage source or a current source. If the voltage or current is constant, after some
144 CHAPTER 10. REVIEW OF CHAPTERS 19
F IGURE 10.6 Motor and generator with electrical and mechanical components
‘detected’
time, this will lead to a constant angular velocity (steady state). Although this may
be interesting, for instance, for a motor driving a fan, there are many applications
in which we want to be able to influence this velocity. This can be achieved by ex
modulated changing the constant voltage or current source with a modulated voltage or cur
voltage or
current source
rent source. The output of these sources is determined by a modulating signal. The
iconic diagrams for these modulated sources are given in figure 10.9.
The modulating signal may be adjusted manually but can also be the result of a
feedback control system, implemented to move the rotor into a certain position, as
in a robot arm. All the motors in figure 10.1, for instance, must be controlled to let
the pet robot or the robot arm make certain motions.
In figure 10.10 the motor is connected to a modulated voltage source. On the
mechanical side, a mechanical load in the form of an inertia is connected to the
modulating motor. Note that the modulating signal of the voltage source is a signal (i.e. no
signal
power is involved). The modulated voltage source converts this signal into electrical
power, where the voltage follows the modulating signal.
10.2. SYSTEM DESCRIPTIONS 145
R L
+
Km J J
f J J load
motor
In a similar way, when used as a generator, the mechanical side of the transducer
can be connected to a modulated torque or angular velocity source (figure 10.11). modulated
torque or
angular velocity
source
T
Modulated Modulated
Torque Actuator Velocity Actuator
In this case the electrical load is modelled as a resistor (figure 10.12). Note that al
though we called the transducer a motor in one case and a generator in the other,
the IPM inside the dotted lines is the same in both applications. Because we deal
with the same device in both situations, this should not come as a surprise.
R L
R Km J
load T
f J
generator
MSe
.. 1
.. GY
.. 1
..
u i Km
When we remove the voltage source and add a torque source (a modulated effort
source at the mechanical side) we obtain figure 10.14. The half arrow connected to
a source is always directed away from the source. This emphasises that the source
always delivers energy to the rest of the system.
1.. GY
.. 1
.. MSe
..
i Km T
In figure 10.14, at the 1junction representing ω, there is a positive power flow from
the torque source. When we do not modify the directions of the half arrows in the
rest of the system, the orientations of the half arrows suggest that there is also a
positive power flow from the electrical part of the system. This follows from the
rules, given in figure 9.5. For a generator this is obviously not true. The power will
flow to the electrical part of the system (‘to the left’). This power flow, with the given
orientations of the half arrows must thus be negative. Although the bond graph of
figure 10.14 will give correct results in computations, when the ‘motor’ is used as
a generator, it is more convenient to change the directions of the half arrows, as in
figure 10.15.
1.. GY
.. 1
.. MSe
..
i Km T
If we horizontally flip the bond graph of figure 10.15, it is completely similar to the
bond graph of figure 10.13, except for the domain dependent variables, T , u, ω and
i . Identical elements are used to represent the mechanical and electrical domain.
10.2. SYSTEM DESCRIPTIONS 147
When we replace the effort sources by flow sources, this implies a current source
for the motor and an (angular) velocity source for the generator (figure 10.16, upper
row). To simplify the figures we leave out the modulation, but with modulated flow
sources the reasoning would be entirely similar. We notice that this leads to a causal
problem: in the case of the motor we cannot assign the preferred causality to the in
ductance and in the case of the generator we cannot assign the preferred causality
to the inertia.
motor generator
Sf 1 GY
.. .. .. ..1 1
.. GY
.. 1
.. Sf
..
i i Km i Km
R: f I: J R :R I:L
Sf
.. 1.. GY 1 1.. GY 1.. Sf
..
.. .. ..
i i Km i Km
R: f I: J R: R I:L
Se Se
.. ..1 1
.. ..
T :Km i u :Km
In figure 9.21 and exercise 9.48 we have already seen that, in the case of a current
source, the inductance and resistor can be removed from the model because the
current in the electrical circuit is completely determined by the current source.
A similar reasoning holds for the mechanical part of the system with a velocity
source. The velocity is completely determined by the velocity source. The inertia
and friction have no effect on the dynamics of the system. When we remove these
elements, we get the middle row of figure 10.16. Taking a closer look at these bond
graphs shows that first of all the 1junction to which the flow source is connected
can be left out. The outgoing bond of this junction carries exactly the same infor
mation as the ingoing bond. A next step is to eliminate the gyrator. The gyrator does
nothing else but interchange the effort and the flow and multiplying the signals
with K m (see eq. 6.8). In this case the gyrator equations are:
e2 = Km f1
e1 = Km f2 (10.1)
148 CHAPTER 10. REVIEW OF CHAPTERS 19
where in the case of the motor, f 1 is the current, e 1 the voltage, f 2 is the angular
velocity and e 2 the torque. Because the current ( f 1 ) is fixed by the current source,
also the torque (e 2 = K m f 1 ) is completely fixed. This implies that we can replace the
current source S f and the gyrator by a torque source S e with an output value K m
times the output of the original current source.
The same reasoning can be followed in the case of the generator. The angular
velocity source, combined with the gyrator can be replaced by a K m times larger
voltage source. These simplifications lead to the lower row of figure 10.16.
Exercise 10.50
Show in a simulation that the different bond graphs of the motor in figure 10.16 indeed
lead to the same angular velocity signals.
Exercise 10.51
Draw the IPMs, which correspond to the bond graphs in figure 10.16.
causality We have seen that the causalityassignment procedure helps us make a compe
assignment
tent model of the system. The manipulations we performed before with the models
of the motor and the generator are an example. In addition, the causality assign
ment leads to equations that can be computed without problems in a numerical
simulation. As long as a programme like 20sim is used, the required equations are
generated automatically. However, when an input in the form of block diagrams
is needed, or if the code has to be programmed manually, a causal bond graph is a
relatively easy intermediate step towards deriving these equations. Block diagrams
will be reviewed in the next section.
Let us consider figure 10.10 again. We have already seen that the combination
of two masses leads to a causal conflict. When we use a current source instead of
a voltage source we can disregard the electrical part of the motor. When we also
replace the current sourcegyrator combination by a torque source we obtain the
IPM and bond graph of figure 10.17.
R :f
J J Se
T ..1 I
..
..
Torque Bearing Inertia Inertia
T J load
Load
I : Jmotor
F IGURE 10.17 Motor as torque source with mechanical elements
causal conflict There is a causal conflict for the load inertia, because it cannot be assigned the pre
ferred causality. 20sim solves this by combining the two inertias into one inertia
(figure 10.18).
10.2. SYSTEM DESCRIPTIONS 149
R :f
Se
..
1.. I : J motor + Jload
T
The other solution is to add flexibility in the axle, in the form of a spring (figure 10.19
left bond graph) or a springdamper combination (figure 10.19 right bond graph).
C : c axle R : daxle
R :f C : c axle R :f
1
Se
..
1 0 ..
1 I Se
..
1 0 1 I
: motor .. : motor .. ..
T load J load T load J load
I : Jmotor I : Jmotor
The bond graph of figure 10.19 (right) can be drawn as the IPM of figure 10.20.
T J J
Torque Bearing Inertia Spring Inertia
motor Damper load
Blocks with transfer functions can be combined into a new transfer function, fol
lowing some simple rules. When two blocks are placed in series, the combined
transfer function, H is the product of the two transfer functions, H1 and H2 (fig
ure 10.21):
F IGURE 10.21 u y
H1 and H2 in a series configuration: H1 H2
y = Hu = H1 H2 u
When the blocks are placed in parallel, the combined transfer function, H is the
sum of the two transfer functions, H1 and H2 (figure 10.22):
F IGURE 10.22
H1 and H2 in a parallel configuration: H1
u y
y = Hu = H1 u + H2 u = (H1 + H2 )u
H2
When the blocks are placed in a feedback configuration, the combined transfer
function, H is found as follows (figure 10.23):
y = H1 u − H1 H2 y (10.3)
y + H1 H2 y = H1 u (10.4)
(1 + H1 H2 )y = H1 u (10.5)
This yields:
y H1
H= = (10.6)
u 1 + H1 H2
F IGURE 10.23 u y
H1 and H2 in a feedback configuration: H1
y H1
H= =
u 1 + H1 H2
H2
The overall transfer function of a more complex block diagram can be found by
combining these three simple configurations.
10.3. PHYSICAL DOMAINS 151
Exercise 10.52
Find the transfer function of the block diagram of figure 10.24.
H3
u y
H1
H2
H4
First of all we need an element that reduces the 230 V to 5 V. This can be done with
a transformer. Next we need elements that convert the AC power to DC power. We
call this process rectification. The AC signal out of the transformer is a sinusoidal rectification
signal with an amplitude of ±5 V. If we would have an element that could suppress
the negative parts of the sinus and at the same time let the positive parts pass, we
obtain a pulsating voltage between 0 and 5 V (figure 10.26).
Such an element is comparable with a ‘nonreturn valve’ in a hydraulic pipe. The
electronic equivalent of the hydraulic nonreturn valve is a diode. The diode has a diode
resistance of almost zero if the voltage over the diode is positive and a resistance
152 CHAPTER 10. REVIEW OF CHAPTERS 19
10
Transformer out {V}
5
500
400
300
200
100
0
100
200
300
0 0.05 0.1 0.15 0.2
time {s}
going to infinity if the voltage over the diode is negative. Of course this current does
not lead to a nice DC voltage when we connect the diode to a load. Therefore, we
need to suppress the variations. This can be done by adding a capacitor to the elec
trical circuit. The current from the diode is then used to charge the capacitor. This
charging continues until the voltage over the capacitor is equal to the maximum
output voltage of the transformer. When the capacitor is connected to a load, it
discharges a bit during the phase of each period where the output voltage of the
transformer is lower than the voltage over the capacitor. These fluctuations are
smaller when the capacitor has a higher capacitance. The complete circuit is given
in figure 10.27. The diode icon symbolises an arrow. An ideal diode has a resistance
equal to zero if the current flows in the direction of the arrow and prevents the cur
rent from flowing in the opposite direction.
n:1
diode
Rload
In figure 10.28 several relevant signals of this circuit are given. If we choose a ca
pacitor with a relatively small capacitance, we see that there is large ripple on the
output voltage of this usbcharger. When we choose a capacitor that is 100 times
larger, it takes longer before a steady state is achieved, but the ripple in the output
voltage is much smaller.
0 0
5 5
0 0
5 5
3 3
Charger output Voltage {V} Charger output Voltage {V}
1 1
1 1
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time {s} time {s}
Note that especially in the case of the large capacitor, the current through the diode is
unrealistically large. This is because the parameter values of the components are cho
sen such that the differences between a circuit with a small ripple and a large ripple are
clearly visible.
Exercise 10.53
Model the powerconverter circuit of figure 10.27 with a bond graph. The AC source can
be modelled as a modulated Se source. Use the proper signal generator to represent the
alternating voltage of the AC source. The diode can be modelled as a modified resistor.
If the voltage over the diode is positive, the resistance must be small, when the voltage is
negative the resistance must be large. To see the effects clearly select the lower value of
the resistance R low = 1 mΩ and the higher value R high = 1kΩ.
Exercise 10.54
Make a hydraulic analogon model of this system.
154 CHAPTER 10. REVIEW OF CHAPTERS 19
The performance would be improved if we could use both the positive and negative
parts of the sinus to charge the capacitor. This can be done by inverting the nega
diode bridge tive signal. In figure 10.29 a circuit with a socalled diode bridge is given. The extra
doublesided or diodes ensure that both parts of the sinusoidal signal contribute to charging the
fullwave
rectification
capacitor. This is called doublesided rectification or fullwave rectification.
rectifier bridge
n:1
load
Exercise 10.55
Explain the working of the circuit of figure 10.29.
Modern power supplies (or more correct power converters) use more complex electronic
circuits to reduce the size of the converter and increase the efficiency. An example of such
devices are switched power supplies.
When we compare the signals in the two rectifier circuits we see the advantage
of the doublesided rectifier. In figure 10.30 signals of the singlesided (left) and
doublesided (right) rectifier are plotted during the first 0.1 s after switching it on.
We see that the doublesided rectifier has a smoother output signal and that the
current peaks are smaller.
10.3. PHYSICAL DOMAINS 155
10 10
Transformer out {V} Transformer out {V}
5 5
0 0
5 5
300 200
200 100
100 0
0 100
In figure 10.31 signals of the singlesided (left) and doublesided (right) rectifier are
plotted from 0.4 s  0.5 s after switching it on. We see that also in the steady state the
doublesided rectifier has a smoother output signal and that the current peaks are
smaller.
10 10
Transformer out {V} Transformer out {V}
5 5
0 0
5 5
10 10
5 5
4.86 4.86
4.84 4.84
4.82 4.82
4.8 4.8
0.4 0.42 0.44 0.46 0.48 0.5 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5
time {s} time {s}
We can now use this adapter as a power supply for a DCmotor. In figure 10.32 we
have connected the model of the singlesided rectifier with the DCmotor model
of section 10.2.2. In the plots of figure 10.33 we see that the ripples in the charger
output voltage are still visible in the motor current. Due to the mechanical inertia of
the motor these ripples are less visible in the angular velocity of the motor.
Step at t = 0.5
n:1 switch
Table 10.1 summarises some of the major formulas and symbols of electrical sys
tems. The bond graphs of the capacitor and inductance are given with their pre
ferred causalities.
icons
1 1
u= idt u − Ri = 0 i= ud t
R R
equations C L
q = idt
R
electrical charge
λ = ud t
R
magnetic flux
u
1 i R
u u u
bond graph 0 i C 0 i R 1 i I
power P = ui
10.3. PHYSICAL DOMAINS 157
300
200
100
1
1
0 0.5 1 1.5 2
time {s}
Torque
T BeltPulley
Bearing1
SpringDamper
Constant
Pulse m Mass
Pulse1 F
Force
signal. The model still lacks a control system to bring the elevator accurately from
one floor to the other. Instead two pulseshaped signals are used to accelerate the
elevator and to slow it down again.
Exercise 10.56
In this model a constant torque of the motor is used to compensate for the gravity force.
Explain why this solution is not used in real elevators. Propose a better solution and indi
cate what this would mean for the model of 10.34.
When we use the parameter values given in exercise 10.58, we obtain the plots of
figure 10.35.
Exercise 10.57
Have a look at the different signals in figure 10.35 and explain the shapes of the signals.
Exercise 10.58
Simulate this system yourself and have a closer look at the signals during the first 4 sec
onds. Explain your observations. Use the following numerical values
15
10
1
2000
1900
1800
30
20
10
0.4
0.3
0.2
extension of the cable {m}
0.1
0 2 4 6 8 10 12 14
time {s}
Exercise 10.59
Plot the power and energy consumption of the elevator. Apply the solution found in exer
cise 10.56 and plot these quantities again. Draw your conclusions.
We conclude this section with two tables that summarise some of the major formu
las and symbols of mechanical systems. We need two tables, because of the rotation
and translation domain. Table 10.2 summarises the formulas and symbols of the
translation domain. The bond graphs of the spring and mass are given with their
preferred causalities. Table 10.2 summarises the formulas and symbols of the rota
tion domain.
160 CHAPTER 10. REVIEW OF CHAPTERS 19
m
icons
1 1
F= vd t F − f v =0 v= Fdt
R R
equations c m
x = vd t
R
displacement
p = Fdt
R
impuls
F
1 v R
F F F
bond graph 0 v C 0 v R 1 v I
power P =Fv
J
icons
1 1
T= ωd t T −f ω=0 ω= Tdt
R R
equations c m
ϕ = ωd t
R
displacement
p = Tdt
R
impuls
T
1
R
T T T
bond graph 0 C 0
R 1 I
power P =Tω
Γ = pd t
R
hydraulic inertance
power P = pϕ
the room is determined by the heat flow delivered by the radiator and by the out
side temperature.
We can translate this relation diagram into a bond graph. The heat exchanger, pipes,
radiator and room are all components of the system with a certain temperature.
0junctions They can be seen as heat buffers. These buffers can be represented by Celements
represent connected to 0junctions. Due to temperature differences between the buffers,
temperatures.
there will be heat flows from the warmer to the colder buffers. These heat flows,
1junctions represented by 1junctions, are determined by the temperature differences and
represent heat the heat resistance between the buffers. The heat resistance is modelled by an R
flows.
element. The heat source in the boiler is supposed to deliver a constant heat flow,
which can be modelled by a thermal flow source. Finally the environment is mod
elled as a constant temperature, and thus as an effort source. In figure 10.38 the
resulting bond graph is superimposed on the relation diagram. In figure 10.39 the
bond graph without the relation diagram is given.
10.3. PHYSICAL DOMAINS 163
Se
R
1
R C R C R C R
Sf 1 0 1 0 1 0 1 0 C
Se
R C R C R C R 1 R
Sf 1 0 1 0 1 0 1 0 C
The chosen parameter values in the simulation of figure 10.40 do not really de
scribe a realistic centralheating installation, but the signals give a good impression
of the temperatures and heat flows as a function of time. We assume all initial con
ditions to be equal to zero. The thermal resistances are all equal to 1, except for the
resistance to the environment, which is chosen equal to 10. Also all heat capaci
tances are chosen equal to 1, with an exception for the room, which has a heating
capacitance of 10. The heat flow from the boiler is chosen as 5 W. As a result of this
heat flow in the steady state the room temperature increases with 5 degrees.
164 CHAPTER 10. REVIEW OF CHAPTERS 19
9
heat flow from boiler
6
70
T heat exchanger
40
10
70
T pipes
40
10
1.5
heat flow pipes
1
0.5
0
70
T radiator
40
10
0
6
T room
3
1
3
0 50 100 150 200
time {s}
10.4 Simulation
10.4.1 Preparing models for simulation
Although simulation is not always the ultimate goal of modelling, in many cases
simulations help to get insight in the behaviour of a dynamic system. The whole
10.4. SIMULATION 165
modelling process also helps to gain insight into the problem at hand. On the other
hand, there are situations in which a model is made to realise realistic motions in a
virtual environment, such as training simulators or a game. With tools like 20sim
the simulation or computation of a model is not much of a problem. All the model
types considered so far (iconic diagrams, bond graphs and block diagrams) can be
used relatively easy as input for the programme. Solving algebraic loops, removing
nonpreferred causalities, and so on, is done by the software. In most cases the user
hardly has to be aware of these underlying problems. But we have also seen that
paying attention to these problems, helps to come up with better models. Power
ful simulation algorithms are able to perform accurate and fast simulations. Being
aware of what can go wrong remains essential in order to prevent that nonsense re
sults are blindly accepted as the correct outcome. The situation is different when
you need the simulation code for an application outside a standard simulation pro
gramme, as part of your own code. Automatic code generation is one possible solu 20sim provides
tion. Deriving the necessary formulas yourself is another. automatic code
generation.
Se 1 I
F_gravity mass
C spring
In the graph editor, under Model/Show Equations you will find the following code:
system equations:
(6) mass\state = int (mass\p.e, mass\state_initial);
(7) spring\state = int (spring\p.f, spring\state_initial);
166 CHAPTER 10. REVIEW OF CHAPTERS 19
We can translate these equations with some minor efforts into simplified equations
directly suitable as programming code:
// static equations:
(1) F_gravity = constant;
mass_state = 0; // sets the initial condition for the mass
spring_state = 0; // sets the initial condition for the spring
// dynamic equations:
(2) spring_v = mass_state/ mass;
(3) spring_force = spring_state / compliance;
(4) damper_force = friction * spring_v
(5) mass_force=F_gravity  damper_force  spring_force;
// system equations:
(6) mass_state = mass_state + T*mass_force;
(7) spring_state = spring_state+T*spring_v;
Exercise 10.60
Check the correctness of these programme lines. Check also that the equations are or
dered in such a way that only previous values of the variables are used.
When we do the same for the IPM of this system we get some extra equations, which
after some manipulations lead to the same result. This secondorder system can
also be drawn as a block diagram (figure 10.42).
force
1 v
x
m
Constant
f
1
c
From this block diagram we can easily derive the simulation equations manually:
F_gravity = constant;
mass_state = 0;
spring_state = 0;
v = mass_state/m;
force = (F_gravity  spring_state/c f*v ;
10.5 To conclude
In this chapter we have reviewed the results of the previous chapters. We reconsid
ered models in the mechanical and electrical domain and combined these mod
els into complete multidomain systems. We introduced the thermal domain and
introduced temperature and heat flow as effort and flow variables. These two vari
ables are not power conjugated. Therefore, these thermal models cannot be mixed
with the models of the electrical and mechanical domain. As long as we only con
sider thermal models there is no problem.
We also considered three options for the generation of simulation code: from
(causal) bond graphs, from block diagrams and by using the automatically gener
ated equations of 20sim.
168 CHAPTER 10. REVIEW OF CHAPTERS 19
11
Feedback is present in many dynamical systems.
We see feedback mechanisms in our body, in the
environment, as well as in social and technical
systems.
11.1 Introduction
In the previous chapters we have already seen many examples of feedback systems.
One of the first examples was the water clock in Chapter 1. Here a feedback mecha
nism took care of control of the water level in the tank. In most cases feedback was control
present as an inherent system property. When we modelled a box of wine, emp
tying in a glass, the wine flow was dependent on the pressure near the outlet and
thus on the volume of wine in the box. Because the volume of wine in the box is in
fluenced by the flow of wine out of the box, a feedback loop is present. Therefore,
we can model the box of wine with an open outlet, as an integrator with feedback
(figure 11.1, see also figure 2.6). Or, in other words, as a leaking integrator. Because leaking
integrator
this outlet was not purposefully designed as a feedback mechanism, mostly it is not
recognised as such.
tank
leakage
169
170 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
The same holds for the system of heating a room with a heater without a ther
mostat. When there would be no losses and there is a constant heat flow into the
room, the temperature in the room would go to infinity. In practice there will al
ways be heat losses to the environment. When the heat flow due to losses is equal
to the incoming heat flow, the temperature goes to a constant value. The heat de
livered to the room is then in equilibrium with the heat leaking to the environment.
The outgoing heat flow is determined by the difference between the temperature
inside and outside and the heat resistance of the walls. The latter is determined
by, among others, the amount of insulation. This is again a feedback mechanism,
because the temperature on its turn depends on this outgoing heat flow. There is,
however, no guarantee that a desired temperature will ever be reached. In order to
controller control the temperature a controller, in the form of a thermostat, is needed. This
leads to an explicit feedback loop. The incoming heat flow is not constant anymore
but depends on the difference between the desired and the actual room tempera
ture. This situation is illustrated in figure 11.2. In this case there are two feedback
loops: one due to temperaturedependent heat leakage to the environment and a
second one because of the control loop, needed to realise a desired temperature.
room
desired room
temperature temperature
Thermostat 1 c
controller
outside
temperature
1 r
insulation
The examples of the wine box and the room temperature are examples of systems
with a negative feedback. When all the gains in the blocks are positive, the nega
tive signs at the summers indicate that the overall gain in the loop is negative. We
have also seen examples of positive feedback: the growth of rabbits due to the birth
rate or a bank account as a result of the interest. Another example is an economic
system with a constant percentage of annual growth.
In the dynamical systems considered here, integrators (or the discrete equiva
lent, summers) are always present. Therefore, we will start with considering the ba
sic properties of systems consisting of an integrator, and an integrator with negative
and positive feedback. In figure 11.3.a the time response of an integrator without an
input signal, but with an initial condition at t = 0 is shown. This is a constant sig
nal. An example of this situation is a wine box: if no wine is taken from the box, the
volume of wine remains constant.
11.1. INTRODUCTION 171
F IGURE 11.3
a) Integrator with initial
condition: constant output
In figure 11.3.b the integrator is part of a negative feedback loop. This situation
models the wine box when the tap is open. The box is emptied with the transient transient
response of a firstorder system. The volume (V ) is described by V (t ) = V (0)e −t /τ .
Exercise 11.61
Give other examples of such a system.
Finally we consider the situation of the bank account. A bank account can be mod
elled as an integrator with positive feedback. We see in figure 11.3.c that the output
of the integrator shows exponential growth. The balance (B ) of the bank account is
described by B (t ) = B (0)e K t , or if K = 1/τ: B (t ) = B (0)e t /τ .
Figure 11.3 shows all the possible transients in the case that there is no input sig
nal. In figure 11.4 we consider the situation that there is an input signal, while the
initial condition of the integrator is zero. In the case of a constant input signal (fig
ure 11.4.a) the output (y) of the integrator is a socalled ramp signal: y(t ) = t . This ramp signal
siuation is comparable with filling a nonleaking water tank with a constant flow of
water. Finally, figure 11.4b shows the situation of an integrator with a constant in
put signal and a negative feedback. This situation is comparable with heating up a
room with a constant heat flow. The negative feedback represents the heat leakage
to the environment. Another example is a water tank with a constant incoming flow
and a (small) hole at the bottom.
172 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
Exercise 11.62
We did not provide a plot of an integrator with constant input and positive feedback. Be
cause of the scaling this would produce a plot like in figure 11.3.c. Describe what this
situation would mean in the case of a bank account.
We see in these simple systems that, at least for firstorder systems, negative feed
back leads to a stable (constant) steadystate situation. An ideal integrator without
feedback has a constant output, or when there is a constant input signal, an out
put that increases proportional with time. Positive feedback leads to an unstable
system: the output grows exponentially as a function of time.
In the rest of this chapter we will first discuss examples of dynamical systems
where feedback is present in a natural way. Next we will consider some simple con
trol systems. These are systems where explicit measures are taken to keep certain
quantities in a system at a desired value.
biological systems mostly more than one mechanism is present to control certain
variables. In the case of temperature control muscles produce heat while sweat is
the main cooling mechanism. As a result in human beings the temperature is rather
accurately controlled around 37 ◦ C. In the case of fever another control mechanism
raises the setpoint up to 39 or 40 ◦ C. The purpose is to kill the virus, which caused setpoint: the
the disease. In the case of flu it is thus better to have a few days of fever rather than desired value of
the body
suppressing the fever with pills. However, if the temperature would increase be temperature
yond 40◦ C the patient is in danger, because the proteins in the body will coagulate.
Therefore, it is important that the temperature is accurately controlled within cer
tain bounds.
Another control mechanism in the human body is the opening of the iris in the
eye. This is similar to the automatic diaphragm control in a photo or video camera.
When its getting darker, the eye iris opens wider and more light is falling at the light
sensitive part of the eye, the retina.
Exercise 11.63
Opening and closing of the iris is a fast process. A much slower process is the dark adap
tation. Explain the difference between the two mechanisms. Which setting in a (not too
simple) digital photo camera is comparable with dark adaptation? Which, mostly auto
matic, control function in a digital photo camera is comparable with the control of the iris
opening?
The present discussion about the climate is in fact a discussion about understand
ing feedback mechanisms in a model of the climate of the earth. The atmosphere is
heated up by the radiation of the sun. The theory is that CO2 emissions will have an
insulating effect on the earth atmosphere. This could lead to less heat losses from
the atmosphere to the outer space: the greenhouse effect. But there is another the
ory that suggests that due to extra CO2 in the atmosphere less radiation of the sun
will heat up the earth and as a result the opposite could be true. Also the present
reduced solar activity could lead to a new ice age. It is well possible that there are
other factors influencing the average temperatures. We have seen large fluctuations
in history, when there was still minor human intervention. Because of the timescale
of these temperature variations only centuries later it will be possible to see what
the outcome of these effects has been. And it may even remain questionable if one
of these models is valid indeed.
Exercise 11.64
Draw a causal relation diagram of these effects under the assumption that the CO2 con
centration in the atmosphere has both influences.
174 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
This system can be represented by the block diagram of figure 11.5. In this case all
the elementary functions are performed by one single component, the floater.
R F h
valve
floater
measuring
device
F IGURE 11.5 Block diagram of the water level control system of chapter 1
R + E U C
controller actuator process
_
sensor
controlled In figure 11.6 the variable C is the Controlled variable, e.g. the amount of water in a
variable
tank, the temperature in a room or in the human body, or the speed or position of
reference a motor. The Reference R is the desired value for C . The value of C is measured by
sensor means of a sensor. The difference between R and the measured value –the output of
error signal the sensor– is the Error signal E . The latter is the input of a controller. The output
of the controller is indicated with the signal U . The controller can be hidden as a
11.3. FEEDBACK AS A TOOL FOR CHANGING A SYSTEM’S BEHAVIOUR 175
part of a mechanical device like the floater, but generally it is an electronic device.
Modern controllers are often realised with microprocessors. Because the controller
output of such a device is a signal, an actuator is needed to give this signal enough actuator
power to influence the process. In order to make the controlled variable C equal to
R, the transfer function of the sensor must be 1.
Control systems are omnipresent in our modern society. They range from all
kinds of thermostats (to control the temperature of rooms, ovens, refrigerators, etc.)
to cruise control systems in a car and autofocus systems in a photo or video cam
era. Human beings are in many cases well able to perform control tasks. Driving a
bicycle or a car is just one example.
Example
As an example, we consider the baking of a cake. At least two control processes are
involved. The temperature in the oven is likely to be automatically controlled by
means of a thermostat. But the setpoint of the oven temperature and the duration
of the baking process is mostly the result of a human control action. Based upon
the instructions in the cooking book, a temperature and duration can be set be
forehand. We refer to such actions as feedforward control: the real condition of the feedforward
control
cake at the end of the baking process has no influence on the actual duration of the
baking process nor on the actual temperature in the oven. Both are based only on
the instructions in the cooking book. Temperature and duration of the baking pro
cess are completely determined by what an ideal oven and standard baking mix is
expected to do.
When the cake is almost ready, its condition can be measured by putting a nee
dle in the cake (to see if it is still wet) and by observing the color of the cake. If the
cake is still ‘a bit pale’ and the needle is still ‘a bit wet’, the cake may need ‘a little bit
more time’ in the oven at a ‘slightly higher temperature’. If the cake is still ‘very wet’,
it may need a ‘much longer time’ in the oven. The notions: a bit pale, a bit wet, a
little bit more time, slightly higher temperature, very wet and much longer are fuzzy
observations and fuzzy actions. We call the resulting controller a fuzzy controller. fuzzy control
Although the whole process seems rather fuzzy, the result is generally a well tasting
and good looking cake, although some experiments may be necessary to translate
these fuzzy notions into more quantitative data resulting in exact timings and tem
perature setpoints.
Fuzzy control is not only a result of human control actions. Fuzzy controllers
have also successfully been applied in technical systems, such as in autofocussing
systems of cameras and in washing machines.
In order to give a more exact description of a control system, we consider the ap
proach of a bicycle or car at a traffic light. When the traffic light goes from green to
red, it is desired to come to a stand still at the stopping line. This can be seen as a
position control system. Far away from the traffic light the propulsion force should
be large. Closer to the stopping line less propulsion is needed and the propulsion
force should be zero when we are at the stopping line. When we would cross the
stopping line, a negative propulsion force is required. The propulsion force primar
176 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
ily depends on the distance to the stopping line. In other words, it is proportional to
the error between the desired position, say x 0 = 0 and the actual position x(t ), the
distance to the stopping line. Such a control action is called proportional control:
the control action u is proportional with the error e = x(t ) − x 0 .
u = Kp e (11.1)
proportional The gain K p is called the proportional gain and the controller a proportional con
control
troller. As long as K p is relatively small, the result will be OK. But for a more ‘agres
sive’ driver, such a control may not work. More aggressive driving implies that the
driver maintains a higher speed until close to the stopping line. Without taking the
overshoot actual velocity into account, this will result in an overshoot because of the dynamics
of the car. An overshoot means that the car crosses the stopping line, before coming
to a stand still at the desired position. The propulsion force should thus also be ve
locity dependent. Because the velocity v is the derivative of x, such a control action
derivative is also called derivative control. A controller, which combines proportional (P) and
control
derivative (D) control is called a PDcontroller.
A simple model clarifies this further. When we assume that the controller is able
to realise both accelerating and decelerating actions, we can describe the control
system of a stopping car with the block diagram of figure 11.7. In this block diagram
f represents the friction of the air and the roll resistance. We assume that our ob
servations start 10m before the stopping line.
v x
Kp
ref = 0
controller f car
The results of a multirun simulation for 0.5 < K p < 5 are given in figure 11.8. In all
cases there is an overshoot, for K p = 5 even of 50%. Therefore, we extend the system
to a PDcontrolled system (figure 11.9).
11.3. FEEDBACK AS A TOOL FOR CHANGING A SYSTEM’S BEHAVIOUR 177
distance x
10
5
0,5 < K p < 5
5
0 2 4 6 8 10 12 14
time {s}
F IGURE 11.8 Responses of control system with a Pcontroller (0.5 < K p < 5)
Kp
ref = 0 v x
f
Kd
controller car
The effect of the derivative action (or velocity feedback) is clearly visible in fig
ure 11.10. With a proportional controller only, a response without overshoot is ob
tained with K p = 0.3. When we increase K p to the value 5, there is a large overshoot.
When we keep the value K p = 5 and tune K d to the value 3, we see fast stopping
without overshoot. If the capacity of the brakes would allow, we could further in
crease K p and K d and achieve even faster braking. With a proper ratio between K p
and K d , this can be achieved with a similar (but faster) response. The art of tuning
the parameters of a controller is the field of control engineering. Here we can only control
engineering
178 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
distance x
10
K p = 0.3
Kd = 0
5
Kp = 5
Kd = 3
Kp = 5
Kd = 0
5
0 2 4 6 8 10 12 14
time {s}
Exercise 11.65
Explain why the rest of the response (t > 1.8) for K p = 5, K d = 0 is in general not realistic
for the example of a stopping car.
Most fuzzy controllers are in fact also PDcontrollers. The human control actions for
braking a bicycle or a car can also be expressed in such fuzzy, linguistic terms. Examples
of fuzzy rules are:
– if the distance to the stopping line is large and the speed is not high,
then brake a little bit
– if the distance to the stopping line is large and the speed is high,
then brake moderately
– if the distance to the stopping line is small and the speed is very high,
then brake as hard as you can
– etcetera
11.4. BASIC PROPERTIES OF FEEDBACK SYSTEMS 179
We have seen such a system before as an example of an algebraic loop (figure 9.22).
We can compute the transfer function C /R as follows.
C = K 1 R − K 1 K 2C (11.2)
(1 + K 1 K 2 )C = K 1 R (11.3)
C K1
= (11.4)
R (1 + K 1 K 2 )
When we make K 1 very large:
C K1 1
≈ = . (11.5)
R K1K2 K2
E = R − K1K2E (11.6)
(1 + K 1 K 2 )E = R (11.7)
E 1
= (11.8)
R (1 + K 1 K 2 )
180 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
E 1
≈ ≈ 0. (11.9)
R K1K2
From figure 11.11 it can be deduced that a large value of K 1 will help to make the
error signal, E , small. (We saw this also in figure 11.10. The larger K p , the faster
the response and the quicker the error goes to zero —at least if we also take care
for proper damping.) If the goal is indeed to let E go to zero, K 1 cannot be large
enough. In the ideal case K 1 → ∞. As long as K 1 is large enough, the value of K 1
is completely irrelevant.
Similar conclusions can be drawn when we add an extra gain K 3 at the input of
the system (figure 11.11 ).
F IGURE 11.12 R E C
K3 K1
Static feedback system with gain
at the input
K2
Exercise 11.66
Show that in this case the wish to make C /R = 1 implies that K 1 → ∞ and K 3 = K 2 .
T K
= (11.10)
Q in sτ + 1
E T
Kp K 1/
Tref = 20 °C
controller room
When we add a proportional controller, this yields the block diagram of figure 11.13.
We assume that the sensor has a transfer function 1. In that case it can be left out
11.4. BASIC PROPERTIES OF FEEDBACK SYSTEMS 181
of the diagram. In practice, the parameters of the room cannot easily be changed.
Therefore, we investigate the influence of the gain in the forward path, by varying
the controller gain K p . We simulate this system in a multirun simulation with 1 <
K p < 10. The other parameters K and τ are selected 1. Considering the timescales of
the heating process, this implies that 1s in the simulation corresponds with 1 hour
in real time. The results are given in figure 11.14. We observe that with a low gain
the response is slow and the final value is only 10◦ C, instead of the desired 20◦ C.
With K p = 10 the final value is more close to 20◦ C, but the error is still larger than
zero.
20
Kp=10
10
0
0 0.5 1 1.5 2
Exercise 11.67
Simulate this system and verify that the gain cannot be large enough. The higher the gain,
the better the desired temperature is reached and the faster the response. Explain also
why the simulation for very high gains is not realistic anymore.
Hint: plot also the output of the controller and ask yourself what this signal represents in
a heating system.
This can be explained as follows. Because there is a permanent heat leakage to the
outside world, the control system must take care that there is a constant incom
ing heat flow in the steady state. This implies that the output of the proportional
controller must always be greater than zero. And this can only be true if there is an
error greater than zero!
We can also perform some computations, which further clarify our observations.
We compute the transfer function of the complete feedback system.
K
Kp
T sτ + 1
= (11.11)
Tref K
1 + Kp
sτ + 1
This can be written as
182 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
T Kp K
= (11.12)
Tref sτ + 1 + K p K
or
Kp K
T 1 + Kp K
= τ (11.13)
Tref s +1
1 + Kp K
or
T K fb Kp K τ
= with K fb = , and τfb = (11.14)
Tref sτfb + 1 1 + Kp K 1 + Kp K
The feedback system thus has a gain equal to K fb and a time constant τfb . The time
constant is equal to the original time constant divided by 1 + K p K . The gain, K fb is
always smaller than 1.
Kp K
T Kp K 1+K K Kp K
· ¸
p
lim = = = (11.15)
t →∞ Tref sτ + 1 + K p K s=0 s τ
1 + Kp K
+1
1 + Kp K
s=0
Kp K
T= Tref = K fb Tref (11.16)
1 + Kp K
If we want a zero error we have two choices. Either we increase the gain to a very
large value (in fact we need a gain going to infinity) or we add an element, which is
able to produce an output not equal to zero when its input is zero. Such an element
is an integrator. This leads to the block diagram of figure 11.15. A controller with a
PIcontroller proportional and integral control action is called a PIcontroller.
11.4. BASIC PROPERTIES OF FEEDBACK SYSTEMS 183
E T
Kp K 1/
Tref = 20 °C
Ki
controller room
Exercise 11.68
Simulate the system with a PIcontroller and find parameter values for K p and K i that give
a ‘nice’ response.
Exercise 11.69
If you did not yet observe an oscillatory behaviour, increase the integral gain to (very) high
values.
From these experiments we can conclude that a secondorder system with a high
gain in the feedback loop, may show an undesirable behaviour in the form of over overshoot
shoot or an oscillatory transient behaviour. Like in the case of the firstorder sys
tem, increasing the gain, makes the response faster. Because of the presence of an
integrator in the controller, for stepshaped input signals accuracy is not the issue
anymore.
We get another example of a secondorder system when we extend the model
of the centralheating system, with the dynamics of the radiator. In its most simple
form the radiator can be modelled as a firstorder system with e.g. a time constant
10 times smaller than the time constant of the room. A proportional control system
for this still (over)simplified model is given in figure 11.16.
184 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
E T
Kp 10/ 1/
Tref = 20 °C
When we simulate this system (figure 11.17), our earlier observations are confirmed
here:
 the error becomes smaller and the response faster when the controller gain is
increased
 for higher controller gains the system gets an overshoot and for very high
gains an oscillatory response.
30
Kp =100
room temperature
20
Kp =10
10
Kp =1
0
0 0.5 1 1.5 2
time {s}
E T
Kp 10/ 1/
Tref = 20 °C
Ki radiator
controller room
Exercise 11.70
Simulate the system with the PIcontroller and adjust the parameters. Play with the pa
rameters and try to get a response that is fast and shows no overshoot.
You will see that it is now more difficult to get a reasonable response. When the pa
rameters are increased, this rapidly results in an unstable system. unstable system
From these examples of first, second and thirdorder systems we see that for a
firstorder system the gain can be made as large as desired, without a risk of over
shoot or instability. Secondorder systems do not become unstable, but for a higher
gain the response becomes oscillatory. Third and higherorder systems can be
come unstable for higher gains. We sometimes want high gains in order to reduce
the steadystate error, i.e. the error between the reference value and the controlled
value. And what holds for reference changes also holds for disturbances at the out
put of the system: high gains (or a pure integrator) in the feedback loop reduce the
influence of such disturbances. The art of designing control systems is to find a
compromise between a gain high enough to guarantee a small error and a quick
transient and a well damped stable system.
To fully understand feedback control systems a more extensive treatment of such
systems is needed. But this is beyond the scope of this course. Therefore we will
finalise this chapter with a short treatment of one of the most popular controllers, a
PID controller. Finally we will show that feedback cannot only result in an unstable
system, but that feedback can also be used to stabilise unstable systems.
11.4.4 PIDcontrol
We have seen that in many cases proportional control does not suffice for obtain
ing a welldamped response and a small steadystate error. In the example of the
stopping car we observed a need to use velocity feedback to realise a fast and well
damped response. We argued that velocity feedback is equivalent with using a
derivative of the error signal in the controller. In the example of the centralheating
systems we observed a need to add an integrator in the controller in order to get
186 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
a steadystate error equal to zero. There is no reason why we cannot combine the
three control actions, proportional, derivative and integral control in one controller.
PIDcontroller When we do this we get a PIDcontroller. The PIDcontroller is the most widely
used controller, because it is able to realise reasonable to good control for a wide
range of systems.
Let us here consider the use of a PID controller for the room control system.
When the number of controller settings increase, tuning becomes more difficult.
Systematic tuning of controllers is the field of control engineering. Here we will use
optimum the optimisation feature of 20sim to find an optimum controller. We consider the
controller
system of figure 11.19.
d/dt
Kd
E T
Kp 10/ 1/
Tref = 20 °C
Ki
radiator room
controller
We want the error signal to decrease as quickly as possible, and we want no over
shoot and of course no instability. This can be expressed by a criterion, J , in the
form of the integral from t = 0 to t = t end of the squared error:
Z t end
J= e 2 dt (11.17)
t =0
Exercise 11.71
Why do we use e 2 and not e. Could you think of other suitable candidates?
t end µ µ ¶2 ¶
de
Z
2
J= e +λ dt (11.18)
t =0 dt
11.4. BASIC PROPERTIES OF FEEDBACK SYSTEMS 187
room temperature
criterion = e 2 dt
20
0
0 0.5 1 1.5 2
time {s}
When we select λ = 0.02 we get the slower response without overshoot. When we
select λ = 0.001 we get the dashed plot. Instead of tuning three parameters, the op
timisation enables us to select between different responses by adjusting only one
parameter. Because all responses were obtained by means of optimisation, all re
sponses are optimal responses. We cannot say that one response is ‘more optimal’
than the other. This is complete nonsense, like saying more best. When we change
the criterion we just find another optimum. Probably we prefer the dotted response
most, because this is a fast response, almost without overshoot. But this selection is
then based on yet another (vague and not explicitly formulated) criterion.
Instead of ‘punishing’ the derivative of e, we could also ‘punish’ the controller
output u. Because the latter corresponds with the power at the output of the actua
tor, needed to control the system, this is a choice that makes sense. This leads to the
criterion:
Z t end ¡
J= e 2 + λu 2 dt (11.19)
¢
t =0
Exercise 11.72
Perform this optimisation and show responses for various values of λ.
to the other with a desired response. Systems specially designed to keep the out
regulator systems put at a constant value, even if there are disturbances, are called regulator systems.
Systems designed with the primary goal to bring the output value from one value
servo systems to the other are called servo systems. We have also seen that feedback applied to
higherorder systems may lead to instability. On the other hand, feedback may
also be used to make unstable systems stable. An example of an unstable system
that can be stabilised by means of a control system is the Segway (figure 1.6). In fig
ure 11.21 the Segway is modelled as a balancing stick.
F = mg sin()
F = mg
To simplify the analysis we assume that the mass, m, of the stick is concentrated in
the centre of gravity of the stick. When the stick is perfectly upright, there is a grav
ity force (F = mg ) completely parallel to the stick. This is an equilibrium, but it is an
unstable equilibrium. When the stick is not perfectly upright there is a component
of the gravity force perpendicular to the stick, which makes the stick fall down. This
force can be written as
F = mg sin(ϕ) (11.20)
This force increases when ϕ increases and reaches its maximum value for ϕ = 90◦ . If
there are no forces to compensate for this component of the gravity force, the stick
will further fall down and become a pendulum. Because of friction this pendulum
will finally reach a new (stable) equilibrium, upside down (figure 11.22) at an angle
of π radians (180◦ ).
11.4. BASIC PROPERTIES OF FEEDBACK SYSTEMS 189
1
2
3
−π
4
5
0 5 10 15 20 25 30 35 40
time {s}
The simulation of figure 11.22 was made with a simplified model of the system. We
assumed that the centre of gravity of the stick is exactly in the middle of the stick
with length l and that the mass is homogeneously distributed over the stick. In that
case we can find that the moment of inertia of the stick is
ml 2 Deriving this
J= (11.21) formula is out of
3 the scope of this
book.
The force acting on this centre of gravity (according to eq. 11.20) yields a torque in
the centre of gravity of
l
T = mg sin(ϕ) (11.22)
2
This torque results in an angular velocity, described by:
dϕ 1
Z
ω= = T dt (11.23)
dt J
and an angle ϕ
Z
ϕ= ω dt (11.24)
These equations can be represented by the block diagram of figure 11.23. Note that
the feedback of the angle is a positive feedback. This is why the system is unstable.
For small angles sin ϕ can be approximated by ϕ (in radians). This implies that
when we apply a feedback loop with a gain larger than mg 2l , we obtain again a neg
ative feedback and thus a stable system.
190 CHAPTER 11. FEEDBACK CONTROL SYSTEMS
mgl/2 sin
1/J
_
Exercise 11.73
Extend the block diagram of figure 11.23 with a sufficiently large negative feedback and
show that the system can now be stabilised.
This shows how feedback can help to stabilise an unstable system, but it does not
yet explain why you can go forward with a Segway. It is nice that you can stay on it
without falling, but it is not yet a vehicle.
Exercise 11.74
What is needed to make a vehicle able to ride forward?
11.5 Conclusion
In this chapter we have seen several examples of feedback systems. We will con
clude this chapter by summarising some conclusions.
Firstorder systems can be controlled with a small error by choosing a propor
tional controller with a high gain. The higher the gain, the faster the response and
the smaller the error. An example of such a system is a speed control system of a
DCmotor. The transfer from the motor current to the angular velocity, ω, can be
described by the firstorder transfer function
ω K
= (11.25)
i sτ + 1
With a proportional controller the velocitycontrolled motor can be represented by
the block diagram of figure 11.24.
The transfer function of the controlled system is
Kp K
C sτ + 1 = Kp K
= (11.26)
R Kp K sτ + 1 + K p K
1+
sτ + 1
11.5. CONCLUSION 191
R K C
Kp
s +1
Kp K KL
C 1 + Kp K 1 + KL
= τ = τ (11.27)
R s +1 s +1
1 + Kp K 1 + KL
We call K L the loop gain. The gain of the closed loop system is found with the rule, loop gain
given at page 182 to compute the steadystate value of the transfer function. This
gain is equal to
KL
(11.28)
1 + KL
This implies that for a constant input signal the transfer C /R is getting more and
more close to the desired value 1, when the loop gain, K L , becomes higher (see also
figure 11.14). Simultaneously the system becomes faster, because the time constant
τ is divided by 1 + K L .
A small steadystate error and a fast response can only be obtained by means of a high
controller gain. But this implies applying a large current to the motor. In practice this
current is limited by the power amplifier and by the specifications of the motor. For too
high currents the motor will get too hot and burn.
But within the limits of the capabilities of the power amplifier and the specifications
of the motor, we can change the dynamic properties of a physical system, by means of
feedback. In this case we can make a faster motor.
Next we consider the same motor in a positioncontrol system, i.e. we want the mo
tor angle to go to a new value. This leads to the block diagram of figure 11.25.
R K 1 C
Kp s
s +1
Kp K
C s(sτ + 1) Kp K
= = (11.29)
R Kp K s(sτ + 1) + K p K
1+
s(sτ + 1)
This can be written as
C KL
= (11.30)
R s2τ + s + KL
From the rule for the steadystate gain at page 182 it follows that
C KL KL
· ¸
lim = 2 = =1 (11.31)
t →∞ R s τ + s + K L s=0 K L
Because in the steady state C will become equal to R, the error in the steady state
will be equal to zero. We saw before that (for constant input signals) we could ob
tain a zero steadystate error by using a PIcontroller. In the system of figure 11.25,
the transfer function of the motor itself already contains a pure integrator (block
1/s).
Also in this case, choosing a larger value of K p leads to a faster system. We have
seen that for a secondorder system a higher gain also leads to larger overshoots
and oscillatory responses (figure 11.17). This could be compensated for by using a
PDcontroller, which is more or less equivalent with using feedback of the velocity
signal.
Finally we have seen that feedback can also be used to make an unstable system
stable.
12
Operational amplifiers are basic electronic building
blocks in many electronic systems. They can be
understood with the knowledge about feedback
systems of the former chapter.
Operational amplifiers
12.1 Introduction
In this chapter we will use the knowledge of feedback systems of the previous chap
ter to describe an important and useful electronic component, the operational am
plifier. An operational amplifier can be modelled as a gain K , with the property that
K → ∞. In feedback systems with a very high loop gain, like the one in figure 11.11,
the transfer function of the complete system is determined by the gain in the feed
back (figure 12.1) only.
F IGURE 12.1 R E C
Feedback system with an _
∞
infinitely high gain in the
forward path
Ko
C K K 1
= lim = = . (12.1)
R K →∞ (1 + K K o ) K K o K o
If K → −∞ figure 12.1 changes into figure 12.2 and eq. 12.1 into eq. 12.2.
C −K −K 1
= lim = =− . (12.2)
R K →∞ (1 + K K o ) K K o Ko
193
194 CHAPTER 12. OPERATIONAL AMPLIFIERS
F IGURE 12.2 R E _ C
K → −∞ ∞
Ko
When we add a gain K i in series with the feedback system, we obtain figure 12.3,
where the transfer function is described by
C Ki
=− . (12.3)
R Ko
F IGURE 12.3 R E _ C
K → −∞ Ki ∞
Ko
An ideal element with an infinitely high gain (or a gain K → −∞) can be very well
approximated by a socalled operational amplifier. Operational Amplifiers, or in
opamps short opamps, are important components in many electronic circuits. Because
they are ‘active’ electronic components they make the design of an electronic cir
An active cuit relatively easy. With opamps basic transfer functions can be realised, which
component is a can be connected to each other as independent modules. In other words, the be
component with
an external power haviour of these modules does not depend on the properties of the modules to
supply. which they are connected. This implies that block diagrams, like figure 12.2figure 12.3
can be directly realised with opamp circuits.
The description of opamp circuits completes the introductory treatment of
electrical networks of chapter 6. After chapter 11 we have some basic understand
ing of the properties of feedback systems, necessary to understand opamp circuits.
Opamp circuits are all examples of feedback systems. In addition, they are very
useful components in many electronic circuits. Especially when it comes to inter
facing of micro computers to the physical world.
Opamps are available as electronic components in the form of integrated cir
cuits. Internally they consist of an electronic circuit with several transistors and
electrical elements. To use opamps it is not necessary to have a deep understand
ing of the electronics of the opamp chip. For the rest of this chapter and for most
practical applications, it suffices to consider the opamp as an ideal amplifier with a
very high gain.
12.2. IDEAL OPERATIONAL AMPLIFIERS 195
F IGURE 12.4
Operational amplifier
(opamp): +
Rin →∞
ideal model u in
Rout = 0
+
u out = Kuin
_
In electronic circuits with opamps we mostly use the symbol of figure 12.5.
F IGURE 12.5
Operational amplifier
(standard symbol)
We see that the amplifier has two inputs, a positive input (the noninverting input) noninverting
input
and a negative input (the inverting input). This negative input is useful, because it
inverting input
allows for adding passive feedback elements in order to give the opamp circuit the
desired properties.
Voltage follower
The most simple circuit we can make with an opamp is given in 12.6.
F IGURE 12.6
Operational amplifier Uout
(voltage follower)
Uin
This circuit is called a voltage follower or emitter follower and is described by the voltage follower
following equations emitter follower
196 CHAPTER 12. OPERATIONAL AMPLIFIERS
K
Uout = Uin (12.5)
1+K
and because K → ∞, it follows that
This seems to be a rather useless operation, but it is not. Because an opamp has an
output impedance equal to zero it is in fact an ideal voltage source. And because
modulated the output voltage is determined by the input voltage, it is a modulated voltage
voltage source
source. Like the voltage sources we have seen so far, the opamp can thus be used
to couple the signal domain (where only information is important) to the power
domain, where we deal with power and thus with two conjugated signals. The fact
that the input impedance is infinitely large, ensures that no current is flowing into
the opamp. Therefore, the opamp does not form a load for the rest of the circuit
at its input side. This is, for instance, a useful property in a measurement setup.
When a sensor is connected to the opamp the output voltage of the sensor is not
The circuit of affected by the opamp. The voltage follower converts the low power sensor signal
figure 12.6 is in to a more powerful signal. Note that all these properties assume that the opamp is
fact a realisation
of figure 12.1 ideal. Fortunately, practical opamps closely approximate the ideal opamp.
(eq. 12.1) with
K o = 1.
Inverting amplifier
In the following we will consider a number of other useful opamp circuits. In order
to keep the analysis simple we consider only opamps where the input and output
are connected (via an impedance) to the inverting input. The + input will conse
quently be connected to the ground. We start with the circuit of figure 12.7.
F IGURE 12.7
Operational amplifier Ri Ro
(gain) Ui
Uo
Ro
Uo = − Ui = −K Ui
Ri
We can easily compute the transfer function of this circuit by using the ideal prop
erties of the opamp. Because the gain of the opamp goes to infinity, in order to
have a finite value of Uo , the voltage at the inverting input must be (almost) zero.
This implies that the inverting input is in fact connected to a ‘virtual’ ground. This
is indicated in figure 12.7 by means of a dotted grey ground symbol. The current
through R o is then Uo /R o and the current through R i is Ui /R i . Because of the infinitely
high input impedance of the opamp, no current will flow into the opamp. This
implies that the sum of the currents through R o and R i must be zero.
12.2. IDEAL OPERATIONAL AMPLIFIERS 197
Uo Ui Uo Ui
+ = 0 or =− (12.7)
Ro Ri Ro Ri
This implies that
Uo Ro
=− = −K (12.8)
Ui Ri
The circuit of figure 12.7 thus represents a gain −K = −R o /R i . This gain is com gain
pletely determined by the ratio of the two resistors. The gain of the amplifier
(K amp → ∞) does not play a role at all (as long as it is just very large). When the
two resistors have the same value, the circuit realises an inverter: Uo /Ui = −1. In inverter
that case we sometimes represent the whole circuit by the bare amplifier symbol of
figure 12.8.
F IGURE 12.8
Inverter: Uo = −Ui Ui Uo
The circuit of figure 12.7 is equivalent with figure 12.3. With a proper choice of the
resistors eq. 12.8 is equivalent with eq. 12.3.
Summing amplifier
We can extend the circuit of figure 12.7 with an extra input. This yields figure 12.9.
With the same reasoning as before we can find the output as a function of the two
inputs.
F IGURE 12.9
Operational amplifier R1 Ro
(adder) U1
U2 Uo
Ro Ro
µ ¶
R2
Uo = − U1 + U2
R1 R2
Exercise 12.75
Show that the equation in figure 12.9 is correct, before reading further.
From the fact that the inverting input is virtually grounded and that the input impedance
goes to infinity it follows that
Uo U1 U2
+ + =0 (12.9)
Ro R1 R2
This can be written as:
198 CHAPTER 12. OPERATIONAL AMPLIFIERS
Ro Ro
µ ¶
Uo = − U1 + U2 (12.10)
R1 R2
or by writing the ratios of the resistances as a gain:
Exercise 12.76
Realise the addition:
Uo = U1 −U2 (12.13)
Hint: use two amplifiers.
It would be possible to use the noninverting input as well. However, with an excep
tion of the voltage follower of figure 12.6, this leads to more complex circuits and
more complex computations. We will give just one example of a noninverting am
plifier (figure 12.10). In the rest we will only consider the use of the inverting input.
F IGURE 12.10
Operational amplifier Ro
(non inverting) Uo
+
Ri + Ro
Uo = Ui +
Ri
Ui Ri
 
Ri
Uo = K Ui − K Uo (12.14)
Ri + Ro
Ri
µ ¶
Uo 1 + K = K Ui (12.15)
Ri + Ro
K
Uo = Ui (12.16)
Ri
1+K
Ri + Ro
12.2. IDEAL OPERATIONAL AMPLIFIERS 199
1 Ri + Ro
Uo = Ui = Ui (12.17)
Ri Ri
Ri + Ro
Note that eq. (12.17) is a more complex relation than eq. (12.8).
Integrator
Let us first consider the use of a capacitor as a feedback impedance. This leads to
the circuit of figure 12.11.
F IGURE 12.11
Integrator Zo
Ui Zi
with Zo = sC1
and Zi = R Uo
this circuit realises an integration:
1 1
dt
R
− sRC → − RC
When we replace the terms R o and R i in eq. (12.8) with Zo and Zi we obtain the
transfer function of the circuit of figure 12.11.
1
Uo Zo sC 1
=− =− =− (12.18)
Ui Zi Ri sRC
1
With e.g. R = 1MΩ and C = 1µF, the transfer function is equal to − , which (apart
s
from the minus sign) represents a pure integrator. integrator
Differentiator
F IGURE 12.12
Differentiator Zo
Ui Zi
1 Uo
with Zo = R and Zi = sC this circuit
d
realises a differentiation: −sRC → −RC
dt
Lowpass filter
A passive circuit The circuit of figure 12.13 consists of a voltage source, a (passive) lowpass filter and
is a circuit with a load resistance. It is clear that the voltage over the capacitor will not be the same
only resistors,
capacitors and with and without the load resistance. When we connect the load resistance the cir
inductances. cuit changes and it will behave differently. This is a typical property of all passive
systems.
F IGURE 12.13
Passive lowpass filter with a load +
Rload
lowpass filter
lowpass filter We can realise the same lowpass filter in active form by using an opamp (fig
ure 12.14). Because the output impedance of the opamp is equal to zero, the load
has no influence on the output voltage of the opamp. This makes the design of the
desired functions much easier.
F IGURE 12.14
Active lowpass filter with a load
+
Rload
lowpass filter
12.2. IDEAL OPERATIONAL AMPLIFIERS 201
Exercise 12.77
Compute the transfer function from input voltage to the voltage over the capacitor for the
circuit of figure 12.13 without the load resistance. Compute the transfer function from
voltage source to the output of the opamp for the circuit of figure 12.14 (again without
the load). Show that the two transfer functions are the same (with properly chosen val
ues of the components). Simulate the two systems (without the load) and show that the
responses are equal. (In order to have a similar sign in the two responses you may want
to give the voltage source in the case of figure 12.14 a negative value. Give all the other
parameters in the simulation a value 1.)
Repeat the simulations with the load resistances connected. Describe and explain
your observations.
Exercise 12.78
Because the opamp is an active circuit, it is possible to give the lowpass filter also a
certain amplification (>1).
 Which component should we change in the values of the resistors and capacitor if
we want to change the gain from 1 to 2 but keep the shape of the response the same?
 Which component should we change if we want to keep the gain as it is, but make
the response 10 times faster?
 Which component should we change if we want a 10 times faster response and a 10
times smaller gain?
Verify your results by examining the transfer function and by performing a simulation.
Differentiator (2)
A better way to realise a differentiator is with the circuit of figure 12.15. The opamp
in the forward path realises a gain of −100R/R = −100, the opamp in the feedback
1 1 1
path realises an integrator with transfer function − RC s . Or, with RC = 1: − s . This
leads to a transfer function of the whole circuit:
−100 −100s s s
H= = =− 1 =− (12.19)
1 + 100
s
s + 100 s 100 + 1 sτ + 1
R 100R
Exercise 12.79
Simulate the differentiator of figure 12.15. Use as input signal a ramp, with superimposed
a small amount of Gaussian noise (amplitude less than 0.001). Compare the result with
the circuit of figure 12.12
One could ask whether it is useful to discuss here ‘analogue computing’, which is out
dated. The reason to do this is that the circuits and related problems are not outdated at
all. They are still present in many analogue circuits, widely used in, for instance, inter
faces between computers and the real world.
In the previous section we have discussed the elementary building blocks, needed
to simulate linear dynamical systems. As an example of a slightly more complex
system we will consider the simulation of a secondorder system. We make an op
ampbased analogue simulation of the secondorder system of eq. (6.61) or eq.
(7.35):
ω2n
H =K (12.20)
s 2 + 2ζωn s + ω2n
This system can be translated into the block diagram of figure 12.16. In order to
simulate this system, we need to split it into the basic building blocks of the previ
ous section. We need
12.2. IDEAL OPERATIONAL AMPLIFIERS 203
 one opamp to realise the integrator and the gain ω2n (opamp 1)
 one opamp to realise the ‘lowpass filter’ and the summation at the input of
the block diagram (opamp 2)
K 2n
opamp 1
opamp 2 2n
opamp 3
1
opamp 2
opamp 1
opamp 3
Exercise 12.80
Indicate in figure 12.17 where the different parameters of figure 12.16 are realised.
Exercise 12.81
Select ωn = 1, ζ = 0.5 and simulate figure 12.17 and figure 12.16 with 20sim. The re
sponses should be the same.
204 CHAPTER 12. OPERATIONAL AMPLIFIERS
Exercise 12.82
Which component(s) in figure 12.17 should we alter and how, to make a 100 times faster
system?
Which component(s) in figure 12.17 should we alter and how, to increase the damping
ratio ζ with a factor 2?
When we want to study the change of ω2n while keeping the term 2ζωn the same,
we could do that by changing the input resistor of opamp 1. If the components
are soldered together, this is not a very attractive solution. A more flexible solution
would be to use a potentiometer. The simplest way is to replace the fixed resistor by
a potentiometer. With a potentiometer, as in figure 12.18, we can realise a variable
resistance between 0 and R. This changes the transfer function of the integrator
1 1 ∞
(realised with opamp 1) between RC s and s . This is not a very handy scale.
F IGURE 12.18
Opamp with input impedance
adjustable between 0 and R
A variable gain with a (more) linear scale can be made when we use a potentiome
ter in the configuration of figure 12.19. In the ideal case the gain can now be con
trolled between 0 and 1, with a linear scale. The ideal case refers to the sitiuation
that the input resistor of opamp 1 is very large compared with the total resistance
of the potentiometer. Because the input of the opamp is virtually grounded, this
input resistor is in fact in parallel with the lower part of the potentiometer. Figure
12.20 illustrates this.
Let, for instance, α = 0.5 and let R in = 0.5R. In that case the resistance of the two
parallel resistors is equal to (1−αR)  R in = 0.5R  0.5R = 0.25R. The voltage over the
two parallel resistors is then
0.25R 1
U = U, (12.21)
(0.5 + 0.25)R 3
rather than the intended 0.5U . If the resistance of the potentiometer (R) is chosen
100 times smaller than R in , the input voltage of R in and thus the gain, may be con
sidered proportional to α, with 0 < α < 1. With R in = 100R and α = 0.5 it follows
that
0.5R · 100R 50
0.5RR in = = ≈ 0.5 (12.22)
0.5R + 100R 100.5
Exercise 12.83
Explain how the scale can be made completely linear for arbitrary ratios between R and
R in at the expense of using an extra opamp.
12.2. IDEAL OPERATIONAL AMPLIFIERS 205
opamp 2
opamp 1
opamp 3
+
R
1R Rin

The potentiometer used in figure 12.19 can be drawn as two separate resistors
r 1 = (1 − α)R and r 2 = αR (figure 12.21 at the left). We can convert this into a bond
graph submodel with three ports, named ‘input_high’ and ‘input_low’, representing the
voltage over the potentiometer and ‘varout’, representing the variable output, which can
be connected to the load. With the aid of the bond graph we can find the equations for
this submodel. After making a representative icon for the submodel and defining the
interface, the submodel is ready to be used.
input_high 1 R : r1
r1
varout
0 varout
r2 Rload
input_low 1 R : r2
u L = u source − u R − uC (12.23)
R C
Se 1
I
m
1/L 1/C
F
R
1
Z
i= (u source − u R − uC ) dt (12.24)
L
u R = Ri (12.25)
1
Z
uC = i dt (12.26)
C
The equations can be translated onetoone into the block diagram. The output
of the block diagram represents the voltage over the capacitor. Of course the same
block diagram represents the mechanical systems as well. The only thing we have
to do is to replace the inductance by the mass: L → m, the capacitance by the com
pliance of the spring: C → c and the resistance by the friction of the damper: R → f .
Exercise 12.84
Indicate in the opamp circuit where the coefficients of the block diagram can be found
back in the values of the different components.
Exercise 12.85
Simulate all the graphical representations of figure 12.22 at once. Select all parameters
equal to one and show that all responses are similar.
12.2.4 Review
Opamps are another example of the fact that a feedback system with a high gain
in the forward path, is able to realise a desired performance. The most important
property here is that transfer functions can be realised with a modular approach
because the zero output impedance of the opamp guarantees that its performance
is not influenced by the load at its output. Or in terms of a feedback system: the
feedback system guarantees that the output is constant, even if there are ‘distur
bances’ at the output.
It has already been discussed that analogue simulation cannot compete any
more with digitalcomputerbased simulations. The reason that we treated ana
logue simulation in this chapter is because the same type of circuits is still impor
tant for making relatively simple circuits to interface a computer to the physical
world with sensors and actuators. At the sensor side it may, for instance, be desir
able to add a voltage follower to prevent that the sensor readings are influenced
by the input impedance of the interface. Another function we may want to realise
in analogue form is a lowpass filter or some extra gain in the sensor signal. For all
such applications opamps are the basic components.
We conclude this chapter with a picture of a printedcircuit board, used in the
mechatronics project of the Electrical Engineering BSc program at the University
of Twente. Figure 12.23 shows a part of this board with two opamps. The layout of
208 CHAPTER 12. OPERATIONAL AMPLIFIERS
this board is in fact a direct mapping of the circuit diagrams we have seen in this
chapter. Inside the opamp symbol the IC with the opamp and two small capac
itors, needed around each opamp, can be seen. These capacitors may be disre
garded with respect to the transfer functions realised by the input and feedback
impedances in the circuit.
F IGURE 12.23 Printedcircuit board with two opamps. The circuit diagram
can easily be found by examining the layout of the components
in this circuit
Exercise 12.86
Draw the circuit diagram, realised on the printed circuit board.
13
Controllers are mostly implemented in a digital
computer. Because such computers are ‘invisible’
they are called embedded computers.
209
210 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
appreciated by the user. If possible the simulation should quickly give a result and
preferably take less time than in the realworld situation. But as soon as computers
interact with the real world, they have to deal with the ‘real’ time.
Example
An example of a computer interacting with the real world is an automatic teller ma
chine. A customer who wants to obtain some bank notes interacts with the teller
machine by means of a keyboard or touch screen. It is essential that the screen pro
duces an echo on the display without a noticeable delay. The teller machine must
thus react in real time.
The realtime performance of a teller machine means in fact fast enough. This type
soft real time of realtime behaviour is called soft real time. From the perspective of a control en
gineer soft real time is not enough. Computers used for control must not only be
fast enough, they must also be able to communicate with the continuoustime pro
cess exactly at the desired time. Sampling must thus take place with a constant time
interval. The reason for this is, that otherwise there may be stability and accuracy
issues. We call this behaviour, where the computer interacts with the process fast
hard real time enough and at fixed time intervals, hard real time.
Most people own a considerable number of ‘computers’, without realising this.
Computers in watches, dish washers, microwaves, TVsets, blueray players and
cars, are invisible. We refer to such computers as embedded computers and to con
embedded trol systems with such embedded computers as embedded control systems. This
control systems
chapter introduces such embedded control systems. This introduction will only
cover a few of the most important aspects of such systems. Full treatment of em
digital control bedded or digital control systems, would require a much more elaborate treatment.
systems
1. sample the data from the process (this yields the input signal for the com
puter)
2. send the computation results of the former sample to the process (the output
signal of the computer is the input signal for the process)
These steps are indicated in the block diagram of figure 13.1 and in the timing dia
gram of figure 13.2.
controller process
T T
1 3 2
1 = sampling inputs
1 2 2 = sending outputs 1 2
3 = computing
3 3
idle time
t
kT (k+1)T
There must always be some idle time, because otherwise it cannot be guaranteed
that the computations are ready on time. If there is not enough time for the neces
sary computations unpredictable results may occur.
Because the computer only sees the outside world through the sampling pro
cess, it only sees values at discrete moments in time: t = T, 2T, 3T, ..., kT . For the For the computer
computer the outside world is a discrete world. This has as a direct consequence the outside world
is a discrete
that the controller should be designed for the discrete system. However, the process world.
itself remains in most cases a continuoustime process, where the variables may
change during the sampling intervals.
One effect of the sampling process, as indicated in figure 13.2, is that we intro
duce a time delay of one sampling interval. We can make this delay smaller by ex time delay
changing the steps 2 and 3, i.e. by sending the data to the process immediately after
the computations are finished. Because the duration of the computations may vary,
this will lead to a smaller but variable time delay. If the duration of the computa
tions is short compared with the total sampling interval (this implies that the idle
time is relatively large) this may be the better solution. But in all cases the use of a
digital computer in a control loop leads to some time delay. Time delays are harm
ful to the stability and therefore the stability of digital control systems requires extra
attention.
212 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
2
Sinus
AD
1
2
0 1 2 3 4 5 6 7 8 9 10
time {s}
2
Sinus
DA
1
2
0 1 2 3 4 5 6 7 8 9 10
time {s}
When we assume that the computer does nothing else with this signal than multi
plying it with 1, the sampled sinusoidal signal must be converted to a continuous
time signal again. This is performed by a DAconverter (DigitaltoAnalogue con DAconverter
verter). Inside the computer probably floatingpoint numbers are used and as a
214 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
result of more complex calculations the number offered to the DAconverter may
not be an integer at all. However, also a DAconverter is only able to convert inte
ger numbers. Thus also a DAconverter uses a certain number of bits to produce
a voltage within a certain range. Because the numbers are only presented to the
DAconverter during a very small amount of time, the DAconverter is equipped
hold circuit with a hold circuit, which ‘holds’ the voltage until a new conversion is performed.
In its most simple and most generally used form the voltage is just kept at a con
zeroorder hold stant value. Such a hold circuit is called a zeroorder hold circuit. The signal at the
output of the DAconverter, corresponding with the sampled signals in figure 13.5 is
given in figure 13.6.
2
Sinus
DA
1
2
0 1 2 3 4 5 6 7 8 9 10
time {s}
F IGURE 13.6 Output with a 10bits DA converter: 1024 discrete levels possible
Although the accuracy of the amplitudes is now rather good, the output of the DA
converter does not very well resemble the original sinusoidal signal . The sine has
a frequency of 1 rad/s (approximately 0.16 Hz). When we sample such a sine with a
sampling frequency of 10 Hz we get a signal that much better resembles the original
sine (figure 13.7).
13.2. DIGITAL CONTROL OF CONTINUOUSTIME SYSTEMS 215
2
Sinus
DA
1
2
0 1 2 3 4 5 6 7 8 9 10
time {s}
If, on the other hand, we sample at 10 Hz with 4 bits AD and DAconverters, the
discretisation in time is OK, but the discretisation in amplitude still leads to a bad
result. This is especially visible near the maximum values of the sine, where the
variations in the amplitude are smaller than the resolution of the converters (fig
ure 13.8).
2
Sinus
DA
1
2
0 1 2 3 4 5 6 7 8 9 10
time {s}
When we compare figure 13.7 with figure 13.8 we see that in order to track fast
changes we need a high sampling frequency, and to accurately track small changes
in amplitude we need AD and DAconverters with a sufficient number of bits.
216 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
13.3 Stability
The sampling process and the time needed to compute new DAvalues in the com
puter introduce a time delay. Such time delays are, for instance, noticeable when
sound and images of an analogue TVsignal are compared with the signals coming
from a digital settop box. Also when the sound of an FMstation coming through
the ether is compared with an internet radio signal the delay is obvious. Apart from
the fact that the hourly time signal is not correct anymore, these delays are hardly
a problem. This is different in feedback control systems. Delays in a feedback loop
can have a disastrous effect on the stability of the system. This can be illustrated
with a simple firstorder system. In figure 13.9 the continuoustime and discrete
time versions of a simple control system are given. In both cases a firstorder pro
cess is controlled with a proportional controller. The AD converters have a resolu
tion of 12 bits, such that the accuracy of the converters has no effect on the results.
Kp K Kp D K
s + 1 A s + 1
A
D
Simulation results for K p = 10, K = 1 and τ = 1 are given in figure 13.10. When
observing these results, we notice the following:
– the discrete system sampled with 5 Hz (Tsample = 0.2s) is on the border of instability
– the discrete system sampled with 100 Hz (Tsample = 0.01s) is, except for a small
delay of 0.01s at the start, almost similar to the continuoustime response
– the time constant of the closed system is approximately 0.1s (t 63% ). The final value
of the responses 1) and 2) is, as could be expected:
Kp K 10
= ≈ 0.9 (13.1)
1 + Kp K 11
When we sample slower than 5 Hz, or increase K p the system will become unstable.
This will never happen in the continuoustime case of a proportionallycontrolled
Rule of thumb for firstorder system. A rule of thumb for choosing the sampling rate is to sample at
choosing the least 10 times faster than the ‘dominant time constant’ of the system. In that case
sampling rate:
Tsample = the sampling process has only minor influence on the behaviour of the system.
τdominant /10. Fine tuning of the sampling rate can be done similar to the method discussed in
section 5.2.6. Even if stability is not an issue, the sampling must be so fast that the
computer appears to react ‘immediately’ on user commands. This implies that, at
least for the user interface, the sampling must not be slower than, say 100 ms.
13.3. STABILITY 217
2.5
continuous time
discrete time 100 Hz
discrete time 5 Hz
2
1.5
0.5
2
0.5
0 0.2 0.4 0.6 0.8 1
time {s}
Exercise 13.87
Repeat these experiments. Take care that the converters have sufficient bits and that the
range of the converters is large enough to prevent ‘clipping’ of the signals. It may be a
good idea to plot also the output of the DAconverter to check if the signal is still within
the maximum values.
Exercise 13.88
Replace the firstorder process by a secondorder process with transfer function
1
(13.2)
s(s + 1)
and choose K p = 1. Use the rule of thumb to find a proper sampling rate and determine
the sampling rate where the system becomes unstable.
Note again that in the continuoustime case, a secondorder system will never
be unstable. But a discretetime system can become unstable when the gain is
too high or the sampling rate too slow. Because the output of the AD and DA
converters is limited by the maximum and minimum values, the signals cannot be
come unbounded. An oscillation will be the result. This is illustrated in figure 13.11
for the secondorder system, where both the converters are limited at ±100 V.
218 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
1.5
discrete time 6.67 Hz
1
0.5
DA output 0.2Hz
100
0
100
0 10 20 30 40 50 60
time {s}
It is obvious that if we sample the sine of 1 Hz with a frequency lower than 1 Hz,
only now and then a sample of this signal is taken. From time to time a whole pe
riod will be missed, without taking a sample. There is a boundary, given by Shan
non’s theorem, which states that the sample frequency ( f s ) must not be lower than
two times the highest frequency ( f max ) in the signal. Or as a formula:
f s Ê 2 f max (13.3)
13.4. THEORETICAL LIMITS OF THE SAMPLING FREQUENCY 219
The frequency 2 f max is called the Nyquist rate. In order to show this we first con Nyquist rate
sider the results when we sample a little bit faster than the theoretical boundary of
2 Hz, i.e. with 4 Hz (figure 13.13).
1
sinusoidal signal of 1 Hz
0.5
0.5
0.5
0.5
1
0 0.5 1 1.5 2 2.5 3 3.5 4
time {s}
We see that after lowpass filtering the sine is (almost) perfectly reconstructed.
Due to the lowpass filtering there is a considerable phase lag between the origi
nal sine and the filtered signal. In signalprocessing applications, such as e.g. the
reconstruction of the analogue wave signal from a CD this is not a problem. But in
closedloop control systems such phase lags are undesirable.
The lowpass filter used in the simulations is a socalled thirdorder Butterworth filter.
The cutoff frequency of the filter is chosen equal to 0.5 f s .
CD’s are designed for a bandwidth of 20 Hz − 20 kHz. This implies that the highest
frequency on a CD is 20 kHz. This would require a sampling rate of at least 40 kHz. The
sampling rate at a CD is indeed chosen a little bit higher: 44.1 kHz.
1 sinusoidal signal of 1 Hz
0.5
0.5
0.5
0.5
1
0 0.5 1 1.5 2
time {s}
Exercise 13.89
Examine this further by using the structure of figure 13.12 and applying various sampling
frequencies, lower than the minimum required value of 2 Hz. Show that in all cases this
leads to frequencies after the hold circuit, which are smaller than f max .
13.4.1 Noise
When we deal with noisy measurements the output signal of the controller (the in
put signal of the process we want to control) will be noisy as well. Eliminating the
noise of sensors as much as possible is always desired. Because noise often con
tains mainly high frequencies, a lowpass filter could be used to suppress noise.
However, lowpass filtering introduces extra dynamics in the control loop. This has
a detrimental effect on the stability of the system. This is equally true for continuous
time and discretetime systems. But in digital control systems there is another
problem. As we just saw, in the sampling process frequencies higher than half the
sampling frequency are converted to lower frequencies! This implies that they can
not be suppressed anymore by a digital lowpass filter in the computer. Therefore,
antialiasing it is important that these frequencies are filtered out by an analogue, antialiasing
filter
filter before the AD conversion. The only way to make it possible to do (part of) the
noise filtering in a computer is selecting a higher sampling rate. In that case the
analogue antialiasing filter can be tuned at a higher cutoff frequency.
We will demonstrate this phenomenon again with a few examples. We compare
a continuoustime and discretetime process, both with noisy measurements. We
apply a lowpass filter to suppress the noise in the measurements. In the discrete
system this filter acts as an antialiasing filter as well. The two systems are given in
13.4. THEORETICAL LIMITS OF THE SAMPLING FREQUENCY 221
1
sinusoidal signal of 1 Hz
0.5
0.5
0.5
0.5
1
0 5 10 15 20
time {s}
figure 13.16.
K yc
Kp
s(s +1)
~
1 yc
s f + 1
y
D K d
Kp A s(s +1)
A 1
D s f + 1
When the systems are simulated with τ = 1, K = 1 and K p = 1, we get a step re
sponse with a roughly estimated ‘time constant’ of 1.5 s. This implies that a sam
pling interval of T s = 1.5/10 or a sampling frequency of f s = 10/1.5 = 6.66 Hz should
be fast enough. When we select a cutoff frequency for the lowpass filters of 3 Hz,
there should be no aliasing. With the filter editor of 20sim, we find that this implies
a filter time constant (τ f ) of approximately 0.05 s. The result is given in figure 13.17.
222 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
1.5 ~
yc
continuoustime output
measurement
1
0.5
0
continuoustime output
yc before the noise is added
1
0.5
0
discretetime output
yd before the noise is added
1
0.5
0
0 5 10 15 20 25 30 35 40
time {s}
1.5
continuoustime output
measurement
1
0.5
~
yc
0
continuoustime output
yc before the noise is added
1
0.5
discretetime output
yd
before the noise is added
1
0.5
We see that there is hardly any noise visible in the discretetime and continuous
time process outputs. In the next experiment we remove the antialiasing lowpass
13.5. SUMMARY 223
13.5 Summary
In this chapter the major effects of using a digital realtime computer in a control
system have been presented and demonstrated. There is much more to say than
what can be done in such an introductory chapter. The main phenomena to be
taken care of are summarised here.
When a digital computer is used as a part of a control loop, the sampling rate
of the computer must be chosen fast enough with respect to the dynamics of the
system. For firstorder systems, or systems that can be considered as being first
order, a rule of thumb is to sample at least ten times faster than the time constant
of the system. Faster sampling is in general better, but comes at the price of more
expensive hardware. A negative effect of using sampleddata systems is that time
delays are introduced, which have a negative effect on the stability of the closed
loop system. In addition noise can be a problem because highfrequency noise is
converted to lowfrequency noise if the noise contains frequencies higher than the
f s /2. Because there is no way to suppress this lowfrequency noise in the discrete
time signal, antialiasing filters must be used to suppress those high frequencies in
the continuoustime signals.
Besides discretisation in time, discretisation in amplitude affects the accuracy of
the computations. AD and DAconverters should have sufficient bits to make the
effects of discretisation negligible. Care should be taken that the input and output
signal are properly scaled, such that the full range of the converters is used. If a 12
bit converter with a range of ±10 V is used for signals never larger than ±2.5 V, in
fact two bits of the converter are not used. The result is that only 10 bits are effec
tively used.
Discretisation in time (the sampling process) and discretisation in amplitude
(the AD and DAconversion) should not be confused. Discretisation in time is any
how the most critical one of the two, because of stability and aliasing issues. Dis
cretisation in amplitude affects the accuracy. It is important, but a less accurate
system is not such a disaster as an unstable system. And of course the resolution of
the converters also influences their prices.
224 CHAPTER 13. EMBEDDED CONTROL SYSTEMS
A
This appendix summarises the tables and symbols
used in the previous text.
domain behaviours
mechanical spring:R friction: mass: R
F = 1c vd t F=fv v=m1
Fdt
electrical capacitor: resistor: inductance:
u = C1 i d t u = Ri i = L1 ud t
R R
domain behaviours
mechanical spring: position mass: mechanical impulse
p
F = xc x = vd t v=m p = Fdt
R R
225
226 APPENDIX A. TABLES AND SYMBOLS
A.2 Icons
A.2.1 Electrical domain
i1 i2 i1 i2
+ + + +
u1 u2 u1 u2
_ _ _ _
friction
sources
F F v v
transformers
l2
l1 l1
l2
levers pulleybelt
J
spring damper inertia fixed world
bearing
sources
T T
transformers
1 1 n
n
2. Step 1a
Repeat this until all sources have been handled.
4. Step 2a
Repeat this until all elements with preferred causality have been handled.
6. Step 3a
Repeat this until all elements with indifferent causality have been handled.
e e
fixed causality: Se f 0 Sf f 1
sources
e f
Se Sf
causal constraints:
 only 1 bond without
a causal stroke
1 0
at 1junction
 only 1 bond with
a causal stroke
at 0junction
causal constraints: 1 TF 1 1 GY 1
transformer and gyrator
1 TF 1 1 GY 1
preferred causality: 0 C: C 1 I :I
C and Ielements
f e e f
e e
indifferent causality: 1 f R 1 f R
Relements
e f f e
1 R
R
icons
1 1
u= idt u − Ri = 0 i= ud t
R R
equations C L
q = idt
R
electrical charge
λ = ud t
R
magnetic flux
u
1 i R
u u u
bond graph 0 i C 0 i R 1 i I
power P = ui
m
icons
1 1
F= vd t F −f v =0 v= Fdt
R R
equations c m
x = vd t
R
displacement
p = Fdt
R
impuls
F
1 v R
F F F
bond graph 0 v C 0 v R 1 v I
power P =Fv
232 APPENDIX A. TABLES AND SYMBOLS
J
icons
1 1
T= ωd t T −f ω=0 ω= Tdt
R R
equations c m
ϕ = ωd t
R
displacement
p = Tdt
R
impuls
T
1
R
T T T
bond graph 0 C 0
R 1 I
power P =Tω
A.5. BLOCKDIAGRAMS 233
A.5 Blockdiagrams
y = Hu
H1 and H2 in a series u y
H1 H2
configuration:
y = Hu = H1 H2 u
H1 and H2 in a parallel H1
configuration:
u y
y = Hu = H1 u + H2 u =
(H1 + H2 )u H2
u y
H1 and H2 in a feedback H1
configuration:
y H1
H= =
u 1 + H1 H2 H2
234 APPENDIX A. TABLES AND SYMBOLS
Gain:
Ri Ro
Ui
Ro Uo
Uo = − Ui = −K Ui
Ri
Inverter:
Ui Uo
Uo = −Ui
Adder:
R1 Ro
U1
Ro Ro
µ ¶
Uo = − U1 + U2 U2 Uo
R1 R2
R2
Integrator:
C
Ui R
1
Z
Uo = − Ui dt Uo
RC
or
1
Uo = − Ui
sRC
Lowpass filter Ro
R o /R i Ri C
Uo = − Ui Ui
sR oC + 1 Uo
Index
235
236 INDEX
towing tank, 53
transducer, 108, 115
transfer function, 37, 60, 77
discrete, 60
transformation ratio, 72
transformer, 71
icon, 72
transient, 24, 171
transmission
ratio, 94
rotation, 94
translation, 95
trapezium rule, 65
Tustin, 64
TUTSIM, 55
twoport element, 72, 110
velocity source, 95
modulated, 145
viscous friction, 41
voltage follower, 195, 234
voltage law of Kirchhoff, 79
voltage source, 50, 72, 83
modulated, 144
voltageforce analogy, 108
voltagepressure analogy, 108
voltagevelocity analogy, 108
water clock, 4
water hammer, 42
wind tunnel, 53
Dynamical Systems
Technology students at the University of Twente in mind. The book gives a concise description
of the physical properties of electrical, mechanical and hydraulic systems. Emphasis is placed
achterkant 18,5 cm + 1,5 mm voor de lijm = 18,65 voorkant 18,5 cm + 1,5 mm voor de lijm = 18,65
rug 15 mm