Maggi 1
Maggi 1
1 Introduction these rods, in addition to the cutting of some joints of the system.
For kinematics, a rod element can be replaced by a constant dis-
Complex multibody systems (MBS) arise in many areas of en-
tance condition, but, for dynamics, its inertia forces should be
gineering: automobiles, machinery, robotics, aerospace, biome-
considered in an exact way.
chanics, etc. The first studied practical systems (spacecraft and
robots) were open-chain systems, so relative coordinates were
more appropriate than Cartesian coordinates. In addition to this, 1.1 Lagrange’s Equations of the First Kind. In the descrip-
relative coordinates had fewer storage requirements. In the 1970s tor form, using Cartesian dependent coordinates, the differential
and 80s, the main emphasis switched to automobile applications, equations of motion take the form:
which are inherently closed-chain systems. Thus, software pack-
ages that used highly constrained Cartesian coordinates, such as q þ UTq ðq; tÞk ¼ Fðq; q;
MðqÞ€ _ tÞ (1)
ADAMS and DADS, were developed. These programs are based on
global formulations, in the sense that they consider all mecha-
nisms — open-chain and closed-chain, loosely or severely con- where q 2 Rn is the vector of Cartesian coordinates that defines
strained — in the exact same way. As a consequence, the the system position, q_ and q
€ are its first and second order time
efficiency was poor. In the bibliography, the most widespread derivatives, M 2 Rnn is the inertia or mass matrix, F 2 Rn is a
global formulations are index-1 Lagrange’s equations of the first vector that includes the external and velocity dependent inertia
kind, the null space method, and Maggi’s formulation. Laulusa forces, Uq 2 Rmn is the Jacobian matrix of the kinematic con-
and Bauchau [1] present an excellent review of the state of the art straint equations, and k 2 Rm the vector of Lagrange multipliers.
in the dynamics of constrained multibody systems. The present The position, velocity, and acceleration vectors in Eq. (1) must
paper starts from their conclusions and describes a formulation satisfy the corresponding constraint equations:
and an implementation that largely improve the efficiency of
Uðq; tÞ ¼ 0 (2)
Maggi’s formulation, which, according to these authors, is among
the best ones in terms of stability. _ ¼ Uq q_ þ Ut ¼ 0;
U Uq q_ ¼ b; b Ut (3)
In contrast with global formulations, topological formulations
try to take advantage of the system topology to improve the effi- € ¼ Uq q
U _ q q_ þ U
€þU _ t ¼ 0; € ¼ c;
Uq q _ q q_ U
c U _ t (4)
ciency of the dynamic simulations. Topological formulations tend
to use relative coordinates or special sparse matrix techniques. In Equations (1)–(4) constitute a system of index-3 DAEs. If only
their first stages, these formulations were very involved, with Eqs. (1) and (4) are considered, the following index-1 DAE
great difficulties in becoming general-purpose commercial system — equivalent to an ordinary differential equation (ODE)
packages. system — is obtained:
In this paper, a simple topological way to improve the effi-
ciency of Maggi’s formulation, based on a double velocity trans- M UTq €
q F
formation, will be described. It is known that the presence of rods ¼ (5)
Uq 0 k c
(slender elements with two spherical joints) presents some diffi-
culties when relative coordinates are used. An interesting option The matrix in this system of linear equations is known as the aug-
— when possible — is to open the closed-chains by eliminating mented matrix (Negrut, Serban and Potra [3]) or a matrix with
optimization structure (Serban et al., [4], Von Schwerin [2]). The
Manuscript received May 16, 2011; final manuscript received October 3, 2011; system of differential equations in Eq. (5) suffers from the con-
published online December 22, 2011. Assoc. Editor: Parviz Nikravesh. straint stabilization problem. As only the acceleration constraint
because its elements are the Cartesian velocities of the bodies that
are upwards in the tree, originated by a unit relative velocity in where the virtual velocities have been denoted with an asterisk
the joint j and null relative velocities in the remaining joints. Since (*). The matrices appearing in Eq. (40) are:
all the bodies share the same reference point, all have the same ve-
locity bi , according to Eq. (36). mi I3 0
Mi ¼
This velocity transformation and the way the system topology 0 Ji
is taken into account is better explained with an example. Figure 3
mi I3 mi ~gi
shows an open-chain, tree configured multibody system. As sug- M i ¼ DT M i D i ¼
i
gested by Negrut et al. [3], the bodies have been numbered from mi ~gi Ji mi ~gi ~gi
the leaves to the root, in such a way that each body has a number T
Qi ¼ Di ðMi ei Qi Þ (41)
lower than its parent. This numbering avoids the later fill-in in the
Gauss elimination process. Each body has the same number as its where mi is the mass of body i and Ji is its inertia tensor. Matrix
input joint. In this example, the velocity transformation matrix Di and vector ei are defined in Eq. (35). In Eqs. (40) and (41), the
corresponding to Eq. (38) has the following form: inertia matrices and vector forces denoted with an upper bar refer
to the origin of the global reference frame.
By defining the global system inertia matrix M, force vector Q
and acceleration vector Z_ in the form:
M diagðM 1; M 2 ; …; M nÞ (42)
h i
QT ¼ Q T; Q
T ; …; Q T (43)
1 2 n
T
h T T T
i
Z_ ¼ Z_ ; Z_ ; …; Z_
1 2 n (44)
Using Eq. (39) for matrix R, the velocity transformation and its
Fig. 3 Example of an open-chain system time derivative can be written for the whole system as:
dðRd Rz Þ i
Urj ¼ 2 rTj rTk ; Urk ¼ 2 rTj rTk (57) Z_ ¼ TRd Rz €zi þ T z_ (66)
dt
In any case, it can be assumed that the closure of the loop con- 2.3 Additional Implementation Details. The Maggi’s for-
straint equations UðzÞ ¼ 0 and their Jacobian matrix Uz are either mulation previously described, based on a double velocity trans-
known or easy to compute. Using the coordinate partitioning formation, improves very much the efficiency of the direct
method based on Gaussian elimination with full pivoting as in computation of the null space basis of Uq , that are the columns of
Eq. (24), it is possible to arrive to the following partitioned veloc- matrix R. However, the improvement in the formulation is not
ity equation: enough to get the efficiency needed for real-time dynamic simula-
tions. A careful implementation is also necessary.
The most expensive steps in the numerical algorithm are the
d z_ d 1 i i
Uz Uiz ¼ 0; z_ d ¼ Udz Uz z_ (60) computation of matrix Rz from Eq. (61) and the product of matri-
z_ i ces to arrive at Eq. (63) from Eq. (48). These operations can bene-
fit from the use of specialized routines such as dense BLAS and
where it is assumed that matrix Udz is invertible. Equation (60) sparse matrix functions.
allows an easy calculation of the transformation matrix Rz that The aforesaid product of matrices is simple and does not
relates dependent and independent relative velocities: deserve further attention. More important is the LU factorization
d of the Jacobian matrix Uz and the subsequent solution steps to get
1 i 1 i
z_ ¼ Rz z_ i ;
z_
¼ Udz Uz z_ i ; R ¼ Udz Uz matrix Rz according to Eq. (61). The presence of redundant con-
z
z_ i I I straints, which leads to systems of redundant but compatible equa-
(61) tions, is a source of difficulties. The sparse function MA48 from
Harwell is able to deal with this, but there is not an equivalent
function for dense matrices in LAPACK. Thus, two C/Cþþ func-
If this equation is differentiated with respect to time, the following
tions have been built. They directly call the BLAS functions cbla-
equation is obtained:
s_idamax, cblas_dswap and cblas_dger to perform the LU
factorization with column pivoting and row swapping, and then
€z ¼ Rz€zi þ R_ z z_ i (62)
they solve two triangular systems of linear equations. These oper-
ations have been carried out through rank-1 matrix updating
The velocity transformation defined by Eqs. (61) and (62) is intro- (function cblas_dger), which is crucial to gain efficiency.
duced in the equations of motion, Eq. (48). The final Maggi’s
equation is obtained by premultiplication by matrix RTz :
3 Results
In order to assess the computational performance of the pre-
RTz RTd MR Rd Rz€zi ¼ RTz RTd QR RTz RTd M R_ d z_ þ Rd R_ z z_ i
R
(63) sented Maggi’s formulation, two large and complex examples
have been analyzed: a 15-dof coach and a 40-dof 5-axle semi- up of a rigid support containing the axle and the differential.
trailer truck. Both models are real-life vehicles, with realistic sus- There are four air springs and four dampers between the chassis
pension geometry and forces. Both simulations consist of a 5 s and the support, which is joined to the chassis through two longi-
multiple slalom test along a flat road. A 4th-order Runge-Kutta in- tudinal rods and two diagonal rods. There is also an anti-roll bar.
tegrator with a 103 s time step has been used, with 20 000 evalu- The coach has 198 Cartesian coordinates, 32 open-chain relative
ations of the state vector derivative. coordinates, and 17 constraint equations.
Figure 5 shows a schematic view of the coach. Table 1 shows
the CPU time for 20 000 evaluations of each algorithm step, con-
3.1 Coach Model. The first model is a 15-dof coach with 34 sidering three different implementations: standard C/Cþþ, BLAS
joints, 33 bodies (14 of them auxiliary massless bodies), 11 rods (MKL), and sparse (MA48). Steps 3 and 8 are the most expensive
and a driven coordinate for the steering system. It has two wheels ones. BLAS routines do not improve the CPU times, and the
in the front and four wheels in the rear axle. The tire forces are sparse routine makes them worse.
modeled with Pacejka’s magic formula. The independent front
suspension is made up of parallel triangles between the carriers
and the chassis, an anti-roll bar between these carriers, dampers 3.2 Semitrailer Truck Model. The second example is a
and air springs. The steering system drives the carriers by means multibody model of a complete truck with tractor and semitrailer.
of two rods. The rear suspension is a live axle one, and it is made It has 40 dof, 5 axles, 81 bodies (of which 34 are massless
Coach
Semi-trailer truck
auxiliary), 89 joints, and a driven coordinate for the steering sys- 4 Conclusions
tem. All axles have two wheels. The tire-ground contact forces are
modeled by Pacejka’s magic formula. The semitrailer suspension Maggi’s formulation is a way to set out the dynamic equations
and the tractor rear suspension are made up of air springs and of constrained multibody systems with important advantages in
dampers, whereas the tractor front suspension is made up of leaf size and stability, as it has been pointed out by several authors. It
springs and dampers. The joint between the semitrailer and the implies the computation of a basis of the constraint Jacobian null
tractor has been considered a spherical joint. space at each time step. This can lead to a slow numerical per-
Table 2 shows the results of the truck model. They present a formance for medium/large systems.
different trend from the coach ones, as a consequence of its bigger In this paper, Maggi’s equations are efficiently obtained
size. Again, steps 3 and 8 are the most expensive ones, but their through a double velocity transformation. First, by removing
relative weight is bigger. Both BLAS and sparse routines improve some joints (and rods), the system is transformed into an open-
the results considerably, the latter being the best one. chain through a straightforward velocity transformation from Car-
The semitrailer truck has 282 Cartesian coordinates, 80 open- tesian to relative coordinates. The introduction of the path matrix
chain relative coordinates, and 51 constraint equations (40 inde- allows an easy way of considering the topology of tree configured
pendent). Figure 6 shows a view of the model. systems. The closure of the loop constraints are formulated in