Professional Documents
Culture Documents
Abstract. Object diagrams are generalizations of block diagrams and of bond graphs, and allow mode-
ling of input/output signal
ow as well as energy
ow. It is shown how object diagrams can be used for
the modeling of mechatronic systems, consisting of 3-dimensional mechanical systems, electrical circuits,
drive trains, control blocks etc. Emphasis is given to the description of energy
ow between dierent
components. Contrary to domain-specic packages, all the details of an object diagram, such as equati-
ons of elements, graphical layout of icons or submodels, are dened in a \soft" way, not built into the
package, and can be directly accessed by the user, to either use it as a template for user-dened model
types or to make modications that are necessary for the problem at hand.
1. Introduction
The modeling of mechatronic systems is dicult because such systems consist of components from
dierent domains, especially they contain mechanical, electrical, hydraulic, control system and drive train
devices. It seems unsuitable to base modeling on a domain specic software package like a multibody
program or an electric circuit program, because these packages usually have quite limited modeling
capabilities in the other domains. What is needed is a neutral methodology as a basis for multi-domain
modeling. This is the topic of this paper.
A very popular neutral description form are block diagrams to model the signal
ow of causal
input/output blocks. Block diagrams are well suited for the modeling of control systems. For mo-
deling of physical systems, such as electrical circuits or mechanical systems, block diagrams are the
wrong tool, because the natural description form of such systems is not an input/output behavior, and
it needs great eort to manually transform into this form. See for example the simple electric circuit in
gure 1. Given the physical device, it is straightforward to draw the electric circuit diagram shown on
0
gain1 int1
R1=100 C=0.0001
R2=200
- 1/C
1/R1
S
sum1 uc 1 R1 1 R2
SE
Vs
sum2 int2
L=0.02
1/L iL
uc
- S
1 C 1 L
iL
gain2
R2
G
enhanced the understanding of physical system modeling and is therefore also very well suited for basic
modeling courses.
On the other hand, the advantage of bond graphs to describe systems by few basic elements hinders
at the same time its practical applicability: Modelers want to think in terms of their \usual" entities.
The basic components of electrical engineers include \capacitor" and \electrical transformer", whereas
mechanical engineers prefer to think in terms of \rigid bodies" and \ideal joints", although in bond
graph view these are similar elements. See e.g. the bond graph of the circuit in gure 1. Although, the
bond graph in the right side of the gure has the same structure as the circuit diagram in the left side,
it is quite obvious that engineers prefer the electric circuit diagram.
Furthermore, it turns out that all domains have unique aspects which need specic treatment as will
be explained in more detail below. The bond graph methodology is not
exible enough in such cases
and often needs enhancements which destroy the simple basic structure. Finally, the bond graphers are
very much focused on the high level description and don't have automatic and ecient algorithms to
transform the acausal bond graph down to state space form which is needed in order to apply standard
integration solvers.
A third neutral description form is object-oriented modeling, developed by Hilding Elmqvist in the late
seventies [4] as a general tool for all kinds of systems described by dierential and algebraic equations.
In the beginning, object-oriented models have been dened in textual form by a specic language, like
Dymola [4, 2] or Omola [1]. The graphical view of such models are similiar to functional diagrams
[3], often used in engineering to visualize the decomposition of a system into components. In object-
oriented modeling these diagrams are sometimes called object diagrams. An early version appeared in
the experimental modeling system HIBLIZ [5]. Object diagrams are simple to understand and are quite
general. It is useful to build object diagram model libraries, in order to encapsulate knowledge and
to allow easy reusability. Due to the generality of object diagrams, it might not always be obvious
how to apply them in a suitable way to a specic domain to build up model libraries. To overcome
this diculty, it will be explained how object diagrams can be used to model energy
ow which leads
to a general guideline how to apply object diagrams for physical system modeling. Recently, object
diagrams became especially attractive for the modeling community due to the availability of comfortable
object-diagram editors with easy-to-use graphical user interfaces [2].
2. Object Diagram
Object diagrams are used to describe systems according to their decomposition into components. An
example of a simple object diagram is shown in gure 2. Each rectangle corresponds to a physical
B1 B2
B3
a capacitor object are the two pins at which the element can be connected together with other electrical
components. Cut variables are the electric potential V and the current i
owing into/out of the pin. On
the right side of the gure, the equations of the capacitor as a function of the local variables and the cut
variables are given in Dymola notation. Note, that all cut variables to the left of the slash are dened to
be across variables, whereas all cut variables to the right of the slash are dened to be through variables.
It now becomes clear that the electric circuit in the left side of gure 1 can be interpreted as an
object diagram. In fact, the object diagram editor of Dymola was used to model this circuit. Contrary
to the more specialized bond graph methodology, ecient symbolic transformation algorithms exist to
transform the declarative description of an object diagram down to state-space form [4]. That is, object
diagrams can be practically applied to large and complex system models.
3. Energy Flow Diagram
As already mentioned, object diagrams are easy to understand and are quite general. However, it is
often not obvious how to select the cut variables, and the nice interpretation of energy
ow present in
the bond graph methodology is missing. In this section these diculties will be resolved by using the
basic idea of bond graphs, simplify it and apply it to object diagrams.
The idea is to interpret the lines connecting blocks in an object diagram as energy
ow. It is well
known that energy
ow (= power) can be described in all physical domains as the product of two variables
P = dEdt = e f
In bond graph terminology these variables are called eort and
ow variable, respectively, and it is always
possible to interchange the role of the two variables. This is dierent for object diagrams, where e is the
potential, f = dm=dt is the
ow dened to be \carrier/time", and m is the carrier, i.e., the \particle"
which transports the energy.
It is dened that potential variable e is an across variable, i.e., at energy
ow connection points
all corresponding potential variables are identical. Usually, every domain has only one mechanism to
transport energy between two components, e.g, wires in electrical circuits,
anges in mechanical systems,
surfaces in heat
ow systems. As a consequence, the selection of potential variables is usually unique.
Again note, this is in contrast to bond graph methodology, where a bond not necessarily corresponds to
a connection between components and therefore the role of eort and
ow variables can be interchanged.
When energy
ows together at one point, and no energy is stored in this point, the sum of the energy
ows must be zero, i.e., X X
0 = Pi = ei fi = e fi
X
i i i
Since, by denition, the potentials at connection points are identical, if follows that the sum of the
ow
variables fi must vanish at connection points, i.e.,
ow variables must be treated as through variables in
an object diagram. This property is well know in every domain, e.g., for electrical circuits it is Kirchhos
current law, for mechanical systems it is Newton's actio=reactio. Note, that this property is not a new
basic law but is derived directly from the energy conservation law.
For several domains the three describing variables of energy
ow are collected together in table 1. For
mechanical systems, bond graph literature uses the reversed view, i.e., velocity is used as
ow variable and
force is used as eort variable. For object diagrams this choice is not possible, because whenever compo-
nents like bodies or joints are connected rigidly together, the velocities of the components at connection
points are identical, i.e., velocity has to be a potential variable. \Hydraulic" means incompressible
uid
2nd Mathmod Vienna, IMACS Symposium on Mathematical Modelling, pp. 705-710, 1997. 4
ow with low velocity. \Adiabatic
ow" characterices the special case of
uid
ow with low velocity
where heat
ow is neglected. As can be seen, entropy is the carrier of heat
ow, as is charge for
ow of
electrical energy. This leads to the nice analogy that entropy is similiar to electrical charge since it is
the carrier or particle transporting the energy.
In the following, object diagrams will be called energy
ow diagrams provided that all the lines
connecting objects correspond to energy
ows. It is now easy to give some general guidelines for the
construction of object diagrams: If signals are the major transport mechanism between components,
use a block diagram description. If energy is the major transport mechanism between components, use
an energy
ow description. As describing variables in cuts use the corresponding potential and
ow
variables according to table 1 above. For several domains this scheme must be slightly modied due to
some pecularities of the specic domain.
Heat
ow
For heat
ow the described scheme suggests temperature and entropy
ow as cut variables. However,
this is not a good choice as pointed out in [10]: For the simplied lumped-heat-capacity method of
heat
ow analysis [6], the two most important elements are heat resistance with the equation Q_ =
kA=x(T1 ? T2), and heat capacitance with the equation Q_ = cmT,_ where Q_ is the heat
ow and T is
the temperature. Both equations are linear functions of the temperature. Since Q_ = T S,_ both equations
can be transformed into an equivalent description form containing temperature and entropy
ow, where
the equations are non-linear functions of T. Furthermore, the common boundary condition of perfect
insulation can be easier expressed in terms of heat
ow (Q_ = 0) instead of entropy
ow. Consequently,
it is better to use temperature and heat
ow instead of temperature and entropy
ow as cut variables,
as it is usually also done in the thermodynamic literature. In this case heat
ow is a through variable.
In bond graph literature this choice leads to the so-called \pseudo bond graph" [7].
Mechanical Systems
The table above suggests velocity and force, as well as angular velocity and torque as cut variables.
However, both in 3D-mechanics as well as for special cases, like positioning drive trains (= 1D rotational
mechanical systems) the position of a component is important and it is therefore necessary to use
positional variables in a cut. Still, this is not sucient: For example, the simple drive train in gure 4
consists of a common conguration of two shafts with inertia connected rigidly together by a gear box.
shaft1=J1 shaft2=J2
S
torque
gear=i
Figure 4: Object diagram of a drive train with two shafts connected by a gear box.
2nd Mathmod Vienna, IMACS Symposium on Mathematical Modelling, pp. 705-710, 1997. 5
Assume rst that both shafts would be described by an equation of the form \J ' = a ? b", where '
is the absolute angle of a shaft and a ; b are the cut-torques acting at the driving and at the driven
side of a shaft. This means that the angle ' of both shafts would be used as state variables. However,
since the two shafts are rigidly connected together a constraint equation exists between these two state
variables, i.e., this system has a DAE-index > 1 and can therefore not be transformed to state space
form by purely algebraic transformations.
Alternatively, angle ', angular velocity ! and angular acceleration can be used as cut variables
and one of the two shafts is described by equation \J = a ? b " and the gear box is described by
\'a = i'b ; !a = i!b ; a = ib ; b = ia " where i is the gear ratio. Since the dynamic equation of
one of the two shafts is now only an algebraic equation, the overall system of equations is well-dened
and can be transformed to state space form. Consequently, for such types of systems it is better to
transport not only position, but also velocity and acceleration through the mechanical cuts.
4. Example
The power of object diagrams and in particular of energy
ow diagrams is demonstrated with a quite
complicated example. In gure 5 the detailed model of a robot from [8] is shown in form of an object
diagram. Dymola was used to build the object diagram and to transform the whole system to state
space form with 66 states. With exception of the controller, the robot is described by an energy
ow
diagram, because all the connections correspond to energy
ows. In the right part of the gure, the 3D
mechanical construction of the robot is shown, i.e., it is a connection of ideal joints and rigid bodies
containing animation information. The joint axes are driven by drive lines, called \axisX", which are
mounted at the inner sides of the joints. All the drive lines have the same structure which is given in
the left side of the gure. One drive line consists of a controller, an electrical motor and a gear box.
Furthermore, the desired angular acceleration is integrated two times to arrive at the desired angular
velocity and the desired joint angle. The controller is modelled as a block diagram consisting of basic
transfer function blocks. The electrical motor is an energy
ow diagram in the form of an electrical
circuit. The gear box is also an energy
ow diagram with 1D rotational mechanical components.
5. Conclusions
Component oriented modeling in form of object diagrams is a general and useful methodology to gra-
phically model complex systems. Block diagrams and energy
ow diagrams are special cases of object
diagrams. For physical systems, energy
ow is the basic transportation mechanism between components.
Therefore, variables describing energy
ow are good candidates for the interface variables of components.
As shown by example, peculiarities in some domains may lead to some modications of this scheme. Due
to the generality of object diagrams, such changes can always be made and are uncritical. This is in
contrast to bond graph methodology which often require non-standard generalizations.
References
[1] Andersson, M., Omola | An Object{Oriented Language for Model Representation, Licenciate thesis
TFRT{3208, Dept. of Automatic Control, Lund Inst. of Technology, Lund, Sweden, 1990.
[2] Elmqvist, H., Bruck, D., and Otter, M., Dymola { User's Manual, Version 3.0, Dynasim AB, Lund,
Sweden, 1996.
[3] Cellier, F.E., Continuous System Modeling, Springer Verlag, 1991.
[4] Elmqvist, H., A Structured Model Language for Large Continuous Systems, Ph.D. Dissertation,
Report CODEN: LUTFD2/(TFRT{1015), Dept. of Automatic Control, Lund Inst. of Technology,
Lund, Sweden, 1978.
[5] Elmqvist, H., and Mattson, S.E., Simulator for Dynamical Systems Using Graphics and Equations
for Modeling, IEEE Control Systems Magazine, January, 1989, pp. 53-58.
[6] Holman, J.P., Heat Transfer, 7th ed., McGraw{Hill, New York, 1992.
[7] Karnopp, D.C., Margolis, D.L., and Rosenberg, R.C., System Dynamics: A Unied Approach, John
Wiley, 2nd edition, 1990.
2nd Mathmod Vienna, IMACS Symposium on Mathematical Modelling, pp. 705-710, 1997. 6
b6=[0 0.1 0]
box
class R3Axis
k2
b5=[0 0.02 0]
qddRef cut joint
r6=[0 1 0]
qdRef qRef k1 axis6
S
R3Control R3Drive
R3Motor
box
1 1
i
S S
q: angle
qd: angular velocity axis5
qdd: angular acceleration
S
r5=[1 0 0]
b4=[0 0.73 0]
cylinder
cut base
r4=[0 1 0]
class R3Control axis4
S
qdRef Kd
0.03
class R3Drive
b3=[0 0.075 0]
cut pDrive cut nDrive
qRef iRef Jmotor=J spring=c
pSum Kv sum wSum rate2 rate3
b(s) 340.8
S
box
+1
0.3
- +1 - a(s) S
gear=i
r3=[1 0 0]
fric=Rv0
b2=[0 0.5 0]
beam
cut base
q qd
axis2
g5
class R3Motor
S
Rp2=50
b1=[0 0.175 0]
r2=[1 0 0]
Ra=R
box
C=0.004*D/w Rp1=200
Rd1=100
Rd2=100
La=L
Ri=10
- -
-
+ + cut nDrive
cut in diff +
OpI
power
r1=[0 1 0]
axis1
S
Vs
Rd4=100
emf
iRef
Rd3=100
g3
cylinder
g1
b0
hall2
hall1
inertial
w r
y
x
g2 qd
g4
q
[8] Otter, M., Objektorientierte Modellierung mechatronischer Systeme am Beispiel geregelter Roboter,
Ph.D.-Dissertation, Fortschritt-Berichte VDI, Reihe 20, Nr. 147, VDI-Verlag Dusseldorf.
[9] Paynter, H.M., Analysis and Design of Engineering Systems, MIT Press, Cambridge, Mass., 1961.
[10] Pieters, S., Personal communication to M. Otter.