1016
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
Port-Based Modeling and Simulation of Mechanical Systems With Rigid and Flexible Links Alessandro Macchelli, Member, IEEE, Claudio Melchiorri, Senior Member, IEEE, and Stefano Stramigioli, Senior Member, IEEE
Abstract—In this paper, a systematic procedure for the definition of the dynamical model in port-Hamiltonian form of mechanical systems is presented as the result of the power-conserving interconnection of a set of basic components (rigid bodies, flexible links, and kinematic pairs). Since rigid bodies and flexible links are described within the port-Hamiltonian formalism, their interconnection is possible once a proper relation between the powerconjugated port variables is deduced. These relations are the analogous of the Kirchhoff laws of circuit theory. From the analysis of a set of oriented graphs that describe the topology of the mechanism, an automatic procedure for deriving the dynamical model of a mechanical system is illustrated. The final model is a mixed portHamiltonian system, because of the presence of a finite-dimensional subsystem (modeling the rigid bodies) and an infinite-dimensional one (describing the flexible links). Besides facilitating the deduction of the dynamical equations, it is shown how the intrinsic modularity of this approach also simplifies the simulation phase. Index Terms—Flexible mechanisms, mechanisms dynamics, modeling, port-Hamiltonian systems, simulation.
I. INTRODUCTION EVERAL methodological approaches have been proposed in the literature for the definition of dynamic models of multibody mechanical systems, possibly taking into account both rigid and flexible links [1]–[11], and a number of software packages (see, e.g., [12]–[17]) are currently available for their numerical simulation. In case of flexible systems, these modeling approaches usually rely on finite-dimensional approximations of the flexible link dynamics (e.g., modal expansion, finite elements, or floating frame of reference) or on a simplification of the (nonlinear) elastic behavior of flexible links (Timoshenko or Euler–Bernoulli theory), and therefore, they do not allow easily the description of mechanisms characterized by
S
Manuscript received September 19, 2008; revised March 30, 2009. First published July 24, 2009; current version published October 9, 2009. This paper was recommended for publication by Associate Editor K. Yamane and Editor K. Lynch upon evaluation of the reviewers’ comments. This work was supported in part by the European project GeoPlex under Grant IST-2001-3416. This paper was presented in part at the 2006 IEEE International Conference on Robotics and Automation, Orlando, FL. A. Macchelli and C. Melchiorri are with the Department of Electronics, Computer Science and Systems, University of Bologna, Bologna 40136, Italy (e-mail:
[email protected];
[email protected]). S. Stramigioli is with the IMPACT Institute, University of Twente, Enschede 7500 AE, The Netherlands (e-mail:
[email protected]). This paper has supplementary downloadable material available at http://ieeexplore.ieee.org, provided by the authors. This material includes the 20-Sim files with the dynamical models and the experiments presented in the paper, the complete videos describing the final dynamics, and a read-me file. The size is 12 MB. Contact
[email protected] for further questions about this work. Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TRO.2009.2026504
large deformations. Moreover, even if the simulation package is able to deal with large deformations and nonlinear effects (e.g.,ABAQUS [13], ANSYS Multiphysics [14], or COMSOL Multiphysics [15]), in general, it is not a trivial task to include the presence of state-feedback controllers. In fact, this requires the development of proper spatial discretization techniques for the elastic dynamics that are able to deal with time-varying boundary conditions, such as the torques applied at the extremities of each flexible link. The main contribution of this paper is a systematic procedure, which is based on port concepts, to model and simulate mechanical systems with rigid and flexible links, where the latter are described by a nonlinear beam model. The mathematical description of the whole mechanical system, which is based on the port-Hamiltonian formalism [18]–[20], results from the interconnection of simpler components (e.g., rigid bodies, flexible links, and kinematic pairs). It is shown that, in this manner, it is not necessary, in the definition of the dynamic model, to simplify the elastic and nonlinear effects present in the flexible parts, and therefore, mechanisms with large deflections can also be handled easily. Moreover, it is shown how the modularity of the proposed approach can also be exploited to simplify the simulation of such dynamical systems, even for control applications. Within the port-Hamiltonian framework, noticeable results have recently been proposed to model complex dynamical systems, i.e., systems made of interconnected subsystems with different physical properties. As far as finite-dimensional systems are concerned, the dynamical model results from a power-conserving interconnection of a set of atomic elements characterized by a particular energetic behavior (e.g., storage, dissipation, and conversion) [18]–[20]. Each component can interact with the environment through a port, i.e., a pair of signals whose dual product gives the power flow. The interconnection is possible once a proper relation between these signals is specified. The resulting network is mathematically described by a Dirac structure [21], which is a generalization of the Kirchhoff laws of circuit theory. This approach has been generalized to the distributed parameter case by extending the notion of interconnection structure to infinite dimensions [22], [23]. The system is characterized by a spatial domain Z and the dynamics is the result of the exchange of power between different energy (sub-) domains in Z. The interaction with the environment takes place through a boundary port on ∂Z or along Z. Wave equations, fluid dynamics [22], piezoelectric materials [24], and flexible structures [25]–[27] can be described within this formalism.
1552-3098/$26.00 © 2009 IEEE Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
Finite- and infinite-dimensional systems are characterized by a common interface with the environment, which is called the power port. This makes the interconnection easier and allows the creation of dynamical models described by ordinary differential equations (ODEs) (for finite-dimensional subsystems, e.g., rigid links and springs in the case of mechanical systems), and partial differential equations (PDEs) (for distributed parameter subsystems, e.g., flexible links) with algebraic constraints, which are called mixed port-Hamiltonian systems. This class of port-Hamiltonian systems has been introduced in [28] and [29], although it is limited only to the specific, simple case of nonlinear systems interconnected with ideal transmission lines. A mechanical system with flexible links belongs to this class, since rigid bodies are described by lumped parameter systems, while elasticity requires a distributed parameter approach. The port-Hamiltonian formalism can easily combine these different mathematical models once the interconnection equations are defined. These equations involve the power ports of the rigid bodies and the boundary power ports of the flexible links. The result is an implicit port-Hamiltonian system with Lagrangian multipliers introduced by the constraints imposed by the kinematic pairs. Graph theoretical methods to model and analyze planar mechanism with rigid links have been discussed in [30] and [31], and practically implemented in an algorithm that is able to automatically produce the dynamical equations of motion. A similar approach is also adopted in commercial symbolic modeling and simulation packages [16]. In this paper, similarly to what has been presented in [32]–[34], the multibody system, which is limited to mechanisms composed by rigid bodies only, is decomposed in its fundamental parts, i.e., rigid and flexible links and kinematic pairs, and its structure is described by means of a set of oriented graphs [35]. Joint elasticity can also be included in a straightforward manner, although this aspect is not developed in this paper. Based only on the analysis of these graphs, the interconnection equations involving the port variables of the links can be written. Then, the dynamics of the mechanism follows automatically from the interconnection equations and the model of each component. The Hamiltonian description of the rigid link presented in [34] is adopted here, while the flexible link representation is based on the planar beam in port-Hamiltonian form discussed in [25], which has been generalized to the 3-D case in [27] and [35], and further extended in this paper to consider the presence of dissipation (viscoelasticity) and of a potential field (e.g., gravity). Finally, it will be shown how the modularity of the approach is useful also for simulation purposes. If an object-oriented software package to model a physical system is adopted, besides the mathematical derivation of the model, the numerical simulation of complex mechanisms can also be carried out simply by port interconnection, thus leaving the solution of the causality of each subsystem to the simulation package. Among these software packages, one can mention the implementations of the Modelica language [36], [37] as Dymola [38], Open Modelica [39], or the 20-Sim package [40]. In this paper, 20-Sim has been used since it is able to deal with models represented in terms of bond graphs, although other software or modeling languages could
Fig. 1.
1017
Simple commutative diagrams for (a) twists and (b) wrenches [34].
also have been adopted. For example, in [41], the multibody system dynamics is implemented in Modelica. This paper is organized as follows. Notation, Dirac structures, and port-Hamiltonian systems are briefly introduced in Section II, while the port-Hamiltonian models of rigid and flexible links are presented and the notion of kinematic (lower) pair is given in Section III. Then, in Section IV, the mechanism is decomposed in its main components and its description in terms of a set of oriented graphs is presented. These graphs are fundamental in order to describe the kinematic of the mechanism (see Section V) and to write the interconnection equations (see Section VI). The complete dynamical model is presented in Section VII, while two case studies of multibody systems are discussed in Section VIII. Then, conclusions and final remarks are reported in Section IX. II. BACKGROUND A. Lie Groups, Lie Algebras, and Group Operations In order to present the notation adopted in this paper, some basic concepts on Lie groups and Lie algebras are briefly discussed. For a more detailed and complete treatment, see [34] and [42]. Let us denote a couple of 3-D Euclidean spaces by Ei and Ej , and define a pair of rigid bodies Bi and Bj as subsets of Ei and Ej , respectively. The relative position of Ei with respect to Ej is an element hji ∈ SEji (3), with SEji (3) being the set of positive isometries from Ei to Ej . If I is an open interval of R, it is possible to consider curves in SEji (3) parametrized by τ ∈ I.1 The differentiable function hji : I → SEji (3) is a relative motion and its derivative with respect to τ is h˙ ji ∈ Th j SEji (3). It is convenient to transport i this vector to the tangent space at the identity of the group, i.e., to a Lie algebra. As reported in Fig. 1(a), it is possible to map h˙ ji either to an element ti,j i ∈ sei (3) or to an element j tj,j := t ∈ se (3) by means of the invertible maps πhi j and πhj j . j i i More precisely, we have that ti,j = hi ◦ h˙ j =: π i j h˙ j , i
j
i
ti,j i
i
hi
i
i
tji = h˙ ji ◦ hij =: πhj j h˙ ji . (1) i
tji
The elements and represent the twist of body Bi with respect to Bj , respectively, expressed in Ei and Ej . These representations are intrinsic because they do not depend on the relative configuration hji , and they are related through the adjoint map, since tji = Adh j ti,j i . i
1 Usually, the independent variable represents time. In this paper, it can represent time as well as the spatial parametrization of the link. In fact, as discussed in Section III-B, the spatial domain of the distributed parameter system is the interval Z = [0, L] ⊂ R, where L is the length of the unstressed link. Which of the two meanings is meant is clear from the context.
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
1018
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
Once ti,j i ∈ sei (3) is given, it is possible to compute the relative motion hji (τ ) of space Ei with respect to Ej that passes through hji (0) for τ = 0 with a velocity equal to ti,j i . The motion is given by i,j (2) hji (τ ) = hji (0) ◦ et i τ where e denotes the group exponential. The group exponential maps an element of the algebra to an element of the group. Consequently, the map Ad t i , j τ is well defined, as its differential e i in τ = 0. More precisely, the following linear map within the algebra is well defined: d Ad t i , j τ adt i , j = . (3) i e i τ =0 dτ The same considerations hold for tji ∈ sej (3). Given hji ∈ SEji (3), it is also possible to consider the covectors belonging to Th∗j SEji (3), which, applied to elements of i Th j SEji (3), result in a scalar. Based on this duality property, it is i possible to define the generalized force between two Euclidean spaces Ei and Ej in hji as an element of Th∗j SEji (3). As in (1), i for h˙ ji , this element can be intrinsically mapped to wii,j ∈ se∗i (3) or to wij ∈ se∗j (3) by means of the adjoint maps2 associated with −1 −1 χih j = πhi j , χjh j = πhj j (4) i
i
i
i
as reported in Fig. 1(b). The resulting quantities represent the wrench between Bi and Bj , which are expressed in Ei and Ej , respectively. Clearly (5) wii,j = Ad∗h j wij . i
B. Dirac Structures and Port-Hamiltonian Systems Let F × E denote the space of power variables, with F being an n-dimensional linear space, which is the space of flows (e.g., velocities and currents), and E ≡ F ∗ being its dual, which is the space of efforts (e.g., forces and voltages), and let e, f denote the power associated with the port (f, e) ∈ F × E, with ·, · being the dual product. Definition 2.1 (Dirac structure): Consider the space of power variables F × E. A (constant) Dirac structure on F is a linear subspace D ⊂ F × E, such that dim D = dim F and e, f = 0 ∀(f, e) ∈ D. Note 2.1: It is clear that a Dirac structure on F defines a powerconserving relation on F × E. Moreover, it is worth mentioning that this definition can be further generalized to cope with an infinite-dimensional space of power variables, thus leading to the notion of Stokes–Dirac structure [22]. Example 2.1: Suppose that F ≡ E = Rn . Then, given a matrix J, such that J = −J T , D = {(f, e) ∈ F × E | −f = Je} is a Dirac structure. A Dirac structure is a linear space that describes internal power flows and the exchange of energy between the system and its environment. The dynamics follows once the port behavior 2 Even
if the names are the same, the adjoint map of a linear map and the adjoint representation of a Lie group are conceptually different. Which of the two is meant is usually clear from the context.
of the energy storing elements is specified. In finite dimensions, let X denote the space of energy variables, and let H : X → R denote the energy function. Then, the dynamics of the system follows from the corresponding Dirac structure D once it is imposed that f = −x˙ and e = ∂H/∂x. If the Dirac structure of Example 2.1 is considered, the dynamics is expressed by the following differential equation: x˙ = J
∂H ∂x
x(0) = x0 ∈ X .
It is easy to see that, in this case, H˙ = 0, i.e., energy is conserved. This is due to the fact that this Dirac structure does not consider any further port to which dissipative elements or sources can be interconnected. In this system, an external port (u, y) can be included by properly modifying the Dirac structure of Example 2.1. This leads to the following input–output system in port-Hamiltonian form: ∂H + G(x)u x˙ = J(x) ∂x , x(0) = x0 ∈ X . (6) y = GT (x) ∂H ∂x Clearly, H˙ = y T u, i.e., the variation of internal energy equals the supplied power. For a general formulation of finitedimensional port-Hamiltonian systems, see [19] and [20]. A key property of port-Hamiltonian systems that justifies the modeling approach presented in this paper is that the powerconserving interconnection of port-Hamiltonian system, i.e., via a Dirac structure, results in another port-Hamiltonian system. If distributed port-Hamiltonian systems are present, then the final system is called a mixed port-Hamiltonian system due to the presence of interacting finite- and infinite-dimensional subsystems. III. MAIN COMPONENTS A. Rigid Body Let us consider a rigid body in the 3-D space, and let Ei denote a reference system connected with it and E0 denote an inertial reference frame. Position and orientation of the rigid body with respect to E0 are mathematically described by the canonical transformation h0i ∈ SE0i (3). As reported in [32] and [34], the port-Hamiltonian description of the rigid-body dynamics is given by
∂H
˙0 0 0 0 0 χh i ◦ Adh i ∂h hi i = ∗ ∗ i −Adh 0 ◦ χh 0 mi ∧ m ˙ ∂H i i ∂mi
0 + wi0 Ad∗h 0 i ∂H t0i = 0
∂h0i Adh 0i ∂H ∂mi
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
(7)
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
Fig. 2. Schematic representation of a flexible link in the deformed and unˆ 0 (s) [27]. stressed configurations, respectively, described by h 0b (s) and h b
se∗i (3)
where m ∈ is the momentum corresponding through the inertia tensor I to t0i ∈ sei (3). The inertia tensor I defines a quadratic form · | ·I on sei (3) × sei (3), while Y = I −1 defines a quadratic form · | ·Y on se∗i (3) × se∗i (3). In (7), the function H represents the energy (Hamiltonian) of the rigid body and is given by 1 i m | mi Y + U (h0i ) H(h0i , mi ) = 2 i
where U is the potential energy. Moreover, m ∧ is a mapping from sei (3) to se∗i (3), which is defined as (mi ∧)ti,0 i = ad∗t i , 0 mi , with adt i , 0 introduced in (3). The quantities wi0 ∈ i i se∗i (3) and t0i ∈ sei (3) define the power port of the rigid body. Here, wi0 is the wrench acting on the body and is expressed in terms of E0 , while t0i is the twist of Ei with respect E0 and is expressed in terms of E0 . The dual product of these quantities provides the power flow through the port. Note the similarities with (6). i
B. Flexible Link
1019
with q and p being se(3)-valued and se∗ (3)-valued 1-forms, respectively. From a physical point of view, it is necessary that these quantities are 1-forms because they are densities. The Hamiltonian function is the sum of two contributions: the kinetic energy and the potential elastic one, due to deformation. As far as the kinetic energy is concerned, following the same rationale of the rigid body discussed in Section III-A, if I denotes the inertia tensor of the cross section and p ∈ se∗b (3) the momentum of the cross section that corresponds to t0,b b ∈ seb (3) via the tensor I, the kinetic energy density of the link can be expressed as K(p) =
1 ∗ ∗p | ∗pY 2
(9)
where Y = I −1 . Note that ∗p is a function of s ∈ Z with values in se∗b (3). As far as the elastic energy contribution is concerned, let C denote the compliance tensor, with inverse given by C −1 , which defines a quadratic form on se(3). Then, the elastic energy density is given by the following 1-form [44], [45]: W (q) =
1 ∗ ∗q | ∗qC −1 . 2
(10)
Again, ∗q is a function of s ∈ Z with values in seb (3). Relation (10) holds under the hypothesis of linear elasticity theory, since the corresponding energy density is quadratic in the deformation. If nonlinear effects have to be taken into account, (10) should be replaced by a map W : Z × Ω1se(3) (Z) → Ω1R (Z), in which the dependence on the spatial variables has also been considered. For simplicity, in the remaining part of the paper, a quadratic deformation energy density in the form (10) is assumed. Finally, from (9) and (10), the total energy (Hamiltonian) function is given by 1 ∗(∗p | ∗pY + ∗q | ∗qC −1 ). (11) H(p, q) = 2 Z
Consider a slender flexible beam of length L, with an unstressed configuration, which is not required to be a straight line. As illustrated in Fig. 2, and following [25], [27], and [43], if s ∈ [0, L] denotes the position along the link in the unstressed configuration, then the configuration in the space of the cross section with respect to an inertial reference E0 is given by h0b (s) ∈ SE0b (3), where the subscript b denotes the body reference Eb (s) attached to the cross section. The unstressed configuration, i.e., the rigid body motion, is described ˆ 0 (s) ∈ SE0 (3). The motion of the cross section is due to by h b b a wrench wbb,0 and described by a twist tb,0 b (s). Both quantities are expressed in Eb (s). The link can interact with the environment through a pair of ports at its extremities. The boundary port variables are the twist and wrench of the cross sections in s = 0 and s = L and are given by b,0 b,0 tb (L), wbb,0 (L) . (8) tb (0), wbb,0 (0) ,
The distributed port-Hamiltonian formulation of the flexible link dynamics is then given by [27]
∂ q 0 d = d 0 ∂t p
0 ad(q + nˆ ) δq H + (12) −ad∗(q + nˆ ) p∧ δp H 0 −1 0 ˆ ˆ is the “twist” in body reference that where n ˆ= h dh b b provides the direction of the unstressed configuration, δ denotes the variational derivative [22], and
Note that these quantities are expressed in body references Eb (0) and Eb (L). As discussed in [27], the state (energy) variables associated with the flexible link are the infinitesimal deformation q and momentum p, which are expressed in body reference. In particular, the state space is defined as X = Ω1se(3) (Z) × Ω1se ∗ (3) (Z),
are the boundary terms. Moreover, the following energy balance relation is satisfied: dH = eB (L), f B (L) − eB (0), f B (0). (14) dt This relation states an obvious property of this physical system, i.e., the fact that the variation of internal energy equals the
f B (0) = δp H|s=0 , eB (0) = δq H|s=0 f B (L) = δp H|s=L , eB (L) = δq H|s=L
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
(13)
1020
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
total power flow at its boundary. Since no dissipative effect is considered, if the boundary energy flow is set to zero (i.e., in the case of a flexible beam clamped at both its extremities) energy is conserved. The configuration in space of the cross section is not a state variable of the flexible link (12). From a physical point of view, this property is an obvious consequence of the fact that the elastic properties of the link do not depend on the position in space of the cross section but only on its “variation” in the spatial variable s ∈ Z with respect to the unstressed configuration. This leads to a simple formulation of the system dynamics, which results in being completely invariant under Galilean transformations, but not Hamiltonian in classical sense. In Hamiltonian mechanics, in fact, the state variables would have been the momentum and the position in space of the cross section, thus leading to different dynamical equations for which zero boundary conditions have to be assumed. These are the main differences between classical and port-Hamiltonian formulations of flexible systems. For example, in [46], these approaches are compared when dealing with the general elasticity equation [47]. Position and orientation of the cross section, i.e., h0b (s), can be determined by time integration of δp H ≡ t0,b once the initial condition is known, b which means that ∂t h0b = χh 0b ◦ Adh 0b δp H
(15)
must be considered together with (12). The time integration of (15) is not immediate since it is an ODE on a Lie group. For more details and a rigorous approach to the problem, see [48]. Moreover, this equation is fundamental in the solution of the mechanism kinematics, as reported in Section V, since at least h0b (0) and h0b (L) are required for each flexible link. Note 3.1: Relation (15) introduces redundancy in the dynamical equations describing the behavior of the elastic link in the case that the information on position and orientation of the cross section are required. It is worth mentioning that, as discussed in Section VIII-B2, this redundancy can be avoided at simulation stage, and, with some approximation, if a proper finite-element description of the link is adopted. In the case that the configuration of the cross section with respect to the inertial reference h0b (s) is available due to (15), the effects of a gravity field can be easily taken into account by introducing in (11) a potential energy density U (h0b ). In this way, δh 0b U ∈ se∗0 (3) is the wrench due to the gravity field, which has to be mapped into body coordinates Ad∗h 0 ◦ χ∗h 0 δh 0b U ∈ se∗b (3). b
(16)
b
Finally, dissipative effects and the presence of a distributed actuation along the spatial domain can be introduced by including a distributed port (td , wd ) ∈ Ω0se(3) (Z) × Ω1se ∗ (3) (Z), along the domain, as in the case of Maxwell’s equations [22], Timoshenko beam [26], and piezoelectric materials [24]. This port can be terminated on a distributed impedance to model dissipative effects, such as friction. More precisely, given R : Z × Ω0se(3) (Z) → Ω1se ∗ (3) (Z) such that ∗R(s, t), t ≥ 0
∀s ∈ Z,
t ∈ Ω0se(3) (Z)
(17)
then (12) can be modified as follows: q 0 d 0 ∂ p = d 0 0 ∂t 0 0 0 0 hb 0 −ad∗(q + nˆ ) +
ad(q + nˆ ) p∧
0
−Ad∗h 0 ◦ χ∗h 0 b b 0 χh 0b ◦ Adh 0b 0 0 0 0 δq H 0 − 0 R(·) 0 δp H + 1 wd . δ 0H 0 0 0 0 hb (18)
Note that, in (18), a gravity field has been introduced by means of a potential energy density contribution V in (11) and by taking into account (15) and (16). Moreover, the distributed port (td ≡ δp H, wd ) has also been modeled. An equivalent approach to model gravity could also be the following: If position and orientation in space of the cross section is known, the gravity field is simply a source of effort that is interconnected to the distributed port and “modulated” by Ad∗h 0 , since the dynamics b of the link are expressed in body coordinates. C. Kinematic Pair Consider two rigid bodies Ei and Ej . A kinematic pair between Ei and Ej is a set of vector fields kij = {v1 , . . . , vp } on the manifold SEji (3). Given a relative configuration hji ∈ SEji (3), the number of linear independent vectors v1 (hji ), . . . , vp (hji ) in Th j SEji (3) represents the degree of freedom (DOF) of the pair i in hji . The kinematic pair kij allows a relative motion in the direction v ∈ Th j SEji (3) if there exist real numbers αk , such i that v = k αk vk , with vk ∈ kij . A kinematic pair is called bilateral in the configuration hji if allowing a motion in the v-direction implies allowing in the −v one. Even if kinematic pairs have been introduced as vector fields so that, in principle, nonholonomic constraints are also included, in the remaining part of the paper, only holonomic constraints (i.e., that do not depend on hji ) are considered. These kinematic pairs are called lower pairs. For any lower pair, it is possible to define a configuration submanifold Qji , which describes the allowed configurations of Ei with respect to Ej . Moreover, given a lower pair and a direction v ∈ Th j SE(3), it i is possible to associate to v two elements tij and tji belonging, respectively, to sei (3) and sej (3). For more details, see [34]. The Lie algebras’ se(3) and se∗ (3) are vector spaces that do not depend on the relative configuration hji . Therefore, it makes sense to define the lower pair as a constant subspace of sei (3) or sej (3). These subspaces describe the allowed twists for the pair in space Ei and Ej , respectively, and characterize the relative A A and Tj,i . Their complements, motion, and are denoted by Ti,j which are not unique due to the fact that there is no intrinsic metric in se(3), are called forbidden twists subspaces and are
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
1021
Fig. 3. Mechanism description. Manipulator with flexible links and corresponding Lagrangian tree, kinematic pairs, flexible links, and interaction graphs [35]. (a) Example of manipulator. (b) Set of vertex V B . (c) Lagrangian tree graph G B . (d) Kinematic pairs graph G K . (e) Flexible links graph G F . (f) Interaction graph GI . F F denoted by Ti,j and Tj,i , respectively. Consequently, we have A F ⊕ Ti,j , sei (3) = Ti,j
A F sej (3) = Tj,i ⊕ Tj,i .
(19)
If the dual algebras se∗i (3) and se∗j (3) are considered, it is possible to intrinsically define the subspace of the constraint wrenches C A ⊂ se∗i (3) dual to Ti,j Wi,j C A . Wi,j = wji ∈ se∗i (3) | wji , tij = 0 ∀tij ∈ Ti,j C Similarly, it is possible to define Wj,i . The actuation subspaces A A C C and Wj,i are some complements of Wi,j and Wj,i , respecWi,j tively, such that A C ⊕ Wi,j , se∗i (3) = Wi,j
A C se∗j (3) = Wj,i ⊕ Wj,i .
(20)
A base of the actuation wrenches defines the input control field. IV. MECHANISM DESCRIPTION An oriented graph G is a pair (V, E), where V is the set of vertices and E ⊂ V × V the set of edges. Given e = (vl , vr ) ∈ E, the edge e interconnects vl and vr , with orientation going from vl to vr . Moreover, it is useful to introduce the functions l, r : E → V defined as l(e) = vl and r(e) = vr . The dynamical equations of a generic manipulator, which is made of nr rigid and nf flexible links, for which the nonlinear beam model of Section III-B is appropriated and interconnected by nk kinematic (i.e., lower) pairs, can be systematically written once the mechanism is described by a set of oriented graphs. An example of mechanism is shown in Fig. 3(a). Each graph takes into account a particular aspect of the structure, e.g., the relative position of the links or the coupling introduced by a kinematic pair [34]. The vertices represent reference frames associated with each rigid link and with the extremities of each flexible link. Since the rigid body constraint is not valid for flexible links, a pair of reference frames is required to describe its configuration in space. The neutral (or inertial) reference E0 is denoted by 0.
Let VB ,r denote the set of vertices associated with the rigid links, and let VB ,f denote the set of vertices related to the flexible links. More precisely, if the robot is made of nr rigid links and nf flexible links, we assume that VB ,r = {1, . . . , nr } and VB ,f = {1L , 1R , . . . , nf L , nf R }, where iL and iR denote the extremities of the ith flexible link corresponding to s = 0 and s = Li , respectively. Finally, let us define the set of all the vertices as VB = VB ,r ∪ VB ,f , as reported in Fig. 3(b). Then, the following oriented graphs can be defined. 1) Lagrangian tree graph: GB = (VB ∪ {0}, EB ). Each edge in EB is oriented from v ∈ VB to 0 and represents the configuration of the reference system associated with v with respect to the inertial frame [see Fig. 3(c)]. Since it is convenient to separately consider rigid bodies and flexible links, this graph is the union of GB ,r = (VB ,r ∪ {0}, EB ,r ) and GB ,f = (VB ,f ∪ {0}, EB ,f ), which describe position in space of the rigid and flexible links, respectively. Clearly, the number of elements in EB ,r is equal to nr , while the number of elements in EB ,f is 2nf . Given an integer n = 1, . . . , nr , then it is possible to define a function br (n), which provides the edge in EB ,r that corresponds to the nth rigid link. Similarly, given n = 1, . . . , 2nf , we can define a function bf (n) that selects the nth edge in EB ,f , which corresponds to an extremity of a flexible link. More precisely, we have br (n) = (n, 0)
bf (n) =
(iL , 0), (iR , 0),
if n = 2i − 1 if n = 2i.
2) Kinematic pairs graph: GK = (VB ∪ {0}, EK ). Each edge e = (i, j) ∈ EK represents the kinematic pair kij , which allows a relative motion between the references Ei and Ej . Given n = 1, . . . , nk , it is convenient to introduce a function k(n), which provides the edge in EK that corresponds to the index n. As far as the mechanism reported in Fig. 3(a) is concerned, the kinematic pairs graph is shown
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
1022
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
in Fig. 3(d), while the function k(·) is k(1) = (1L , 0),
k(2) = (1, 1R ),
k(3) = (2L , 1)
k(4) = (3L , 1),
k(5) = (2, 2R ),
k(6) = (2, 3R )
other hand, from (15), h0v i −1 and h0v i result from numerical integration of h˙ 0v i −1 = χh v 0
i −1
◦ Adh v 0 δp n Hn |s=0 i −1
h˙ 0v i = χh v 0 ◦ Adh v 0 δp n Hn |s=L n
k(7) = (3, 2).
i
3) Flexible links graph: GF = (VB ,f , EF ). Each edge e = (nL , nR ) ∈ EF interconnects a pair of vertices representing the extremities of the nth flexible link [see Fig. 3(e)]. Then, it easy to define the function f (·), which provides the edge in EF that corresponds to the nth flexible link. Clearly, f (n) = (nL , nR ), with n = 1, . . . , nf . 4) Interaction graph: GI = (VB ∪ {0}, EI ). Each of the ni edges e = (i, j) ∈ EI indicates the place where an external system is able to interact with the mechanism. In particular, it denotes the fact that the environment can apply a wrench between Ei and Ej . Given n = 1, . . . , ni , it is convenient to introduce the function i(n) that provides the edge in EI , which corresponds to n. An example of this graph is shown in Fig. 3(f), for which the function i(·) is simply i(1) = (3, 0). The kinematic graph GK I N = (VB ∪ {0}, EF ∪ EK ) is necessary to compute the direct kinematics of the mechanism as a function of the joint variables and the deformation of the flexible links, while interconnection equations follow from the total graph GT = (VB ∪ {0}, EB ∪ EK ∪ EF ∪ EI ). Note that GB is a spanning tree of GT . V. MECHANISM KINEMATICS The interconnection equations can be written once h0v ∈ SE0v (3) is known for every vertex v ∈ VB . Since the mechanism is connected, it is always possible to find a path P = v0 , e1 , v1 , . . . , en s , vn s in the kinematic graph GK I N from 0 to v in ns step such that ei = (vi−1 , vi ) or ei = (vi , vi−1 ) belongs to the graph. Clearly, v0 = 0 and vn s = v, and the relative configuration of Ev with respect to the inertial reference E0 rev sults from h0v = hvv 01 ◦ hvv 12 ◦ · · · ◦ hv nn ss −1 , where each hvv ii −1 can be computed as follows. 1) ei = (vi , vi−1 ) ∈ EK : The relative position is the configuration of a k-dimensional lower pair kvvii −1 , and hvv ii −1 belongs to the space of relative configurations Qvv ii −1 , i.e., hvv ii −1 ∈ Qvv ii −1 . Following [34] again (but see also [42]), we have l l hvv ii −1 = e l x ψ v i −1 ◦ rvv ii −1 where {ψv1i −1 , . . . , ψvki −1 } is a base of the allowed twists subspace TvAi −1 ,v i , x1 , . . . , xk are the joint variables, and rvv ii −1 ∈ Qvv ii −1 is the relative configuration for which x1 = · · · = xk = 0. The case ei = (vi−1 , vi ) ∈ EK can be treated in a similar way. 2) ei = (vi , vi−1 ) ∈ EF : The transformation hvv ii −1 is determined by the relative position of the extremities of the nth flexible link of length Ln and for which (qn , pn ) are the state variables and Hn the total energy. As discussed in Section III-B, the configuration in space of the cross section is not a state variable of the flexible link (12). On the
i
with known initial condition hv i0−1 (0) and hv i0 (0). Then −1 ◦ h0v i . hvv ii −1 = h0v i −1
Similarly, ei = (vi−1 , vi ) ∈ EF . Moreover, as discussed in Section VIII-B2, the time integration of these equations can be avoided at simulation stage and with some approximation if the finite-element description of the link presented in [49] is adopted. VI. INTERCONNECTION EQUATIONS Once models of the main components are available (see Section III), the next step is to describe the mechanical structure. Given the total graph GT , for any cycle3 C, we have [34] r (i) Adh k tl(i) = 0 (21) r (i)
i∈C
where k is a fixed vertex belonging to the cycle. Dually, the next relation (22) relates wrenches, and it is simply the action and reaction principle. For every vertex k, if C¯k denotes the set of edges adjacent to k, i.e., the cocycle, then r (i) Ad∗h r ( i ) wl(i) = 0 (22) k
i∈C¯ k
where either r(i) = k or l(i) = k. Relations (21) and (22) have to be written for every cycle and cocycle in GT . r (i) If i ∈ EB , then t˜ki = Adh k tl(i) is the twist associated with r (i) the edge i and expressed in the reference Ek . Moreover T t˜kK = t˜kk (1) . . . t˜kk (n ) k
t˜kI = t˜ki(1) t˜kB =
t˜ki(n i )
...
t˜kbr (1)
T
. . . t˜kbr (n r ) t˜kbf (1) !" #
. . . t˜kbf (2n f ) !" #
t˜kB , r
can be defined. Let BK =
T (23)
t˜kB , f
BK ,r BK ,f
BI =
BI ,r BI ,f
(24)
denote the incidence matrices of GK and GI , respectively, and suppose that row j of BK ,r and BI ,r corresponds to the vertex l(br (j)) in VB ,r and row j of BK ,f and BI ,f corresponds to the vertex l(bf (j)) of VB ,f . For example, consider the mechanism shown in Fig. 3(a). It is easy to see that the incidence matrices BK and BI are given 3 In this case, the edge orientations play no role in the definition of cycle that has been adopted.
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
by
BK ,r
BK ,r
0 −1 1 1 0 0 = 0 0 0 0 −1 −1 0 0 0 0 0 0 −1 0 0 0 0 0 0 0 0 0 1 0 0 0 −1 0 0 0 = 0 1 0 0 0 0 0 0 0 −1 0 0 0 0 0 0 0 1
BI ,r = ( 0 BI ,f = ( 0
0
0
0
with
and
w ˜bkr (1)
0)
=0 =0
(25)
k w˜ B ,r
... w ˜bkf (2n f ) !" #
r (i)
T .
Each of the nr rigid links is described by (7). If T xB = h0l(b r (1)) , ml(b r (1)) , . . . , h0l(b r (n r )) , ml(b r (n r )) denotes the state vector of all the rigid bodies and HB (xb ) =
nr
Hl(b r (i)) (h0l(b r (i)) , ml(b r (i)) )
i=1
denote the total Hamiltonian, the rigid body motions are described by ∂HB k ˜B ,r x˙ B = JB (xB ) ∂xB + φB (xB )w (27) ∂H B k ∗ t˜ = φ (xB ) B ,r B ∂xB
◦ Adh 0
l(e )
ml(e) ∧
··· ···
0 0
..
.. . 0
. ··· ···
Ad∗h k
.
l(b r (n r ))
nf
Hi (qi , pi )
i=1
is the total Hamiltonian, then ∂xF = JF (xF )δx F HF (28) ∂t describes the motion of the flexible links, where T δx F HF = δq 1H1 , δp 1H1 , . . . , δq n f Hn f , δp n f Hn f and
jF (1) .. JF (xF ) = . 0 with
jF (i) =
VII. DYNAMICAL MODEL OF THE MECHANISM
l(e )
l(e )
HF (xF ) =
k w˜ B ,f
k k Consequently, (22) becomes w ˜B − BK w ˜K − BI w ˜Ik = 0, i.e., k k ˜K − BI ,r w ˜Ik = 0 w ˜B ,r − BK ,r w (26) k k w ˜B ˜K − BI ,f w ˜Ik = 0. ,f − BK ,f w
jB (br (nr )))
◦ χ∗h 0
0
For each flexible link i = 1, . . . , nf , let qi and pi denote the infinitesimal deformation and momentum, respectively. If the state vectors of the links are grouped in xF = T q1 , p1 , . . . , qn f , pn f , and
wl(i)
T
... w ˜bkr (n r ) w ˜bk (1) !" # f
−Ad∗h 0
0 .. .
χh 0
Ad∗h k l(b r (1)) .. φB (xB ) = . 0 0
T
denote the wrench between El(i) and Er (i) , and let us express Ek in space and define the dual quantities of (23) as follows: T k = w ˜kk (1) . . . w ˜kk (n k ) w ˜K
k w ˜B =
0 l(e )
r (i)
k w ˜i(n i)
jB (e) =
˜ik = Ad∗h k As in (23), for every edge i ∈ EB , let w
...
··· .. . ···
0
T ˜k T ˜k ˜k BK ,r tB ,r + BK ,f tB ,f + tK = 0 BIT,r t˜kB ,r + BIT,f t˜kB ,f + t˜kI = 0.
k w ˜Ik = w ˜i(1)
jB (br (1)) .. JB (xB ) = .
0 1 −1 0 0 0 0 0 0
0 −1 )T
From (24), (21) becomes T ˜k BK tB + t˜kK BIT t˜kB + t˜kI or, equivalently $
where
1023
0 d − ad∗(q i + nˆ )
··· .. . ···
0 .. .
jF (nf )
d + ad(q i + nˆ ) pi ∧
.
With regard to the boundary conditions, it is necessary to exk ˜B press t˜kB ,f and w ,f in terms of the boundary restriction of the variational derivative of HF . Let δp HF |b and δq HF |b denote the vectors of all the boundary conditions (13), which are defined as T b n ,0 b n ,0 δp HF |b = tbb 11 ,0 (L1 ), tbb 11 ,0 (0) · · · tb n f (Ln f ), tb n f (0) f
f
T b n ,0 b n ,0 δq HF |b = wbb11 ,0 (L1 ), wbb11 ,0 (0) · · · wb n f (Ln f ), wb n f (0) f
and let B denote the operator that is defined as β(1) · · · 0 .. .. B = ... . . 0
···
β(nf )
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
f
1024
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
with
β(i) =
Adh k l(f (i)) 0
0 Adh k
.
r (f (i))
If bf (2i − 1) = l(f (i)) and bf (2i) = r(f (i)), for every i = 1, . . . , nf , the boundary conditions δp HF |b and δq HF |b are k ˜B related to t˜kB ,f and w ,f as follows: k B∗ w ˜B ,f = δq HF |b
t˜kB ,f = B δp HF |b ,
(29)
From (25) to (29), we have x˙ B = JB (xB )
∂HB k + φB (xB ) BK ,r w ˜K + BI ,r w ˜Ik ∂xB
∂xF = JF (xF )δx F HF ∂t ∂HB T ∗ T −t˜kK = BK + BK ,r φB (xB ) ,f B δp HF |b ∂xB
The first example, which is given in Section VIII-C, is a (although unrealistic) multilink robotic arm composed of both rigid and flexible links, while the second example, which is given Section VIII-D, is a real system used to analyze the effects of a misalignment between two flexible links (called leaf-springs). The aim of the first example is to show how simple it is to define the dynamical model of quite complex mechanisms as well, while the second example is reported since the results obtained with the proposed approach have also been validated by explicit computation and simulations with another package. In this manner, it has been possible to verify the precision of the proposed methodology.
A. Port-Based Simulation
∂HB + BIT,f B δp HF |b ∂xB k 0 = −δq HF |b + B ∗ BK ,f w ˜K + BI ,f w ˜Ik .
−t˜kI = BIT,r φ∗B (xB )
(30)
These equations describe the dynamics of the mechanism under the effect of the wrenches that are applied in the kinematic pairs k w ˜K and by the environment w ˜Ik . In order to take into account the constraint that a kinematic pair introduces, let Ak denote the A (or projection operator of a twist to the allowed subspace Ti,j A Tj,i ), which is defined in (19), for a kinematic pair k, and let 0 A1 · · · . . .. .. A = .. . 0 · · · An k denote the collection of these operators. The mixed portHamiltonian model of the mechanism with flexible links, which is reported in (31), shown at the bottom of this page, follows easily from (30), where W are the actuator wrenches, WI the external wrenches, and λ the Lagrangian multipliers due to the constraints.
Following the same rationale behind the derivation of the mathematical model of a multibody system, the simulation of whatever complex mechanism should be carried out simply by port interconnection of its main components, i.e., rigid and flexible links with kinematic pairs. The same reasoning is valid if other phenomena have to be taken into account. For example, joint friction can be introduced by writing the appropriate model in port-Hamiltonian form (e.g., see [50] for the popular LuGre model) and by interconnecting it to the joint power port. Differently from signal-based approaches, which require to explicitly solve the constraints and the causality of each sub-system, the port-based approach leaves these steps to the simulation package that elaborates the topology of the system. There are several packages in which these concepts have been implemented. Among them, it is possible to mention 20-Sim, but it is also possible to mention one of the implementations of the Modelica language [36], [37] as Dymola [38] or Open Modelica [39]. In this paper, 20-Sim has been adopted, but completely equivalent consideration can be drawn for the other packages.
B. Main Components VIII. SIMULATION OF COMPLEX MULTIBODY SYSTEMS In this section, two case studies are presented and discussed in order to show the validity of the proposed methodology.
x˙ B ∂ xF ∂t
δq HF |b
=
JB (xB )
0
0 0
JF (xF ) 0
+
0
∂ HB ∂ xB
0 δ x F HF 0 δp HF |b
φB (xB )BK ,r (Id − A)∗
φB (xB )BK ,r A∗
0 ∗ B BK ,f (Id − A)∗
0
T ∗ (Id − A) BK 0 ,r φB (xB ) 0 T ∗ A BK 0 T = ,r φB (xB ) T ∗ TI BI ,r φB (xB ) 0
1) Rigid Link: The simulation of the rigid link dynamics basically requires the implementation of (7) via a bondgraph scheme. Within this formalism, the rigid link can be described
B ∗ BK ,f A∗ T (Id − A) BK ,f B T ∗ A BK ,f B
BIT,f B ∗
φB (xB )BI ,r
λ
0 W B ∗ BI ,f WI ∗ ∂ HB ∂ xB
δ x F HF δp HF |b
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
(31)
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
1025
Fig. 4. Modeling the mechanical systems of Fig. 3 in 20-Sim. (a) Finite-element dynamics. (b) Implementation of the finite-element approximation of the link (N = 20 elements). (c) 20-Sim scheme for the mechanism of Fig. 3.
by an inertia element I that is characterized by 6 DOFs. The main difficulty is that the dynamics is written in terms of quantities expressed in a moving reference frame (the body frame) in order to keep the inertia tensor constant. Consequently, the port variables, i.e., the twist of the rigid body and the applied wrench, which are expressed with respect to a fixed reference frame (usually the base frame), have to be transformed via the group adjoint map. 2) Flexible Link: The flexible link is modeled as an infinitedimensional system in the form (12) or (18), with boundary conditions given by (13) that define a pair of power ports at the extremities of the link. A finite-dimensional approximation is necessary to carry out simulations with, possibly, varying boundary conditions originated, for example, by statefeedback controllers. Classical discretization procedures generally assume that boundary conditions are given but, in this case, a boundary interaction (e.g., the torques/forces applied at the extremities by actuators) has to be taken into account. A novel spatial discretization procedure that is based on a particular type of mixed finite element and that is able to provide a
finite-dimensional input/output approximated system has been introduced in [51]. From the analysis of the geometric structure of the distributed port-Hamiltonian system, a finite-dimensional a-causal port-Hamiltonian approximation that satisfies the same energy balance relation of its infinite-dimensional counterpart can be obtained without any particular hypotheses on the boundary conditions. This technique has been generalized to a wider range of distributed systems with 1-D spatial domain in [52], and it has been applied to the flexible link model (12) in [49]. Once the spatial domain of the flexible link has been divided into N parts, the infinite-dimensional dynamics is approximated on each portion of the domain by means of a finite-dimensional system whose bond graph and 20-Sim implementation are reported in Fig. 4(a). Similar results can also be obtained for (18). This nonlinear system can be written in port-Hamiltonian form and is characterized by a couple of power ports, i.e., a pair of twist/wrench, which represents finite-dimensional counterpart of the boundary conditions (13). These power ports are used to interconnect all of these components so that the whole finite-dimensional approximation of the link dynamics
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
1026
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
TABLE I EIGENFREQUENCIES CORRESPONDENCE BETWEEN (LINEARIZED) BEAM MODEL AND FINITE-ELEMENT APPROXIMATIONS
can be obtained. The result is the bond graph that is reported in Fig. 4(b). Since it is not possible to find an explicit solution of the PDE (12), the numerical properties of the finite-element description of the link cannot be determined easily and, consequently, the accuracy of a multibody simulation as well. However, it is easy to prove that (12) reduces to the Timoshenko beam equation in port-Hamiltonian form [26], [53] after linearization around the unstressed configuration. Such PDE is linear and the resonant modes can be determined easily numerically as solution of a frequency equation. For more details, see [54]. On the other hand, this PDE can be discretized by following the same algorithm applied here to (12), and it is possible to prove that the method is accurate and rapidly converges. For example, consider a link of length L = 1 m, mass per unit length ρ = 873 kg·m, mass moment of inertia of the cross section Iρ = 2.1797 kg·m, Young’s modulus E and moment of inertia of the cross section I, with EI = 5143 N·m2 , modulus of elasticity in shear G, cross-sectional area A, and constant depending on the shape of the cross section k, with K = kGA = 656 625 N. In the freeclamped case, the first five modes, which are the solution of the corresponding frequency equation, are reported in the last row of Table I. It can be noted that with N = 9 elements, the first three resonant modes are captured with satisfactory precision (the error for the third resonant mode is about 10%), while with N = 21, the all first five modes are determined quite accurately (the maximum error, for ω5 , is less than 5%). For more details, see Table I. As suggested in Note 3.1, if position and orientation of the cross section are required for animation purposes, to include the effect of a gravity field or simply to solve the direct kinematics problem, it is possible to avoid the time integration of δp H ≡ and compute t0,b b , the twist of the cross section in body frame, 0 −1 0 dhb (see an approximate solution. In fact, since q + n ˆ = hb [27] and [49]), for any portion of the flexible link of length ∆s, it is possible to write [see (2)] s + ∆s) h0b (¯ s) ◦ e(q ( s¯)+ nˆ ( s¯))∆ s , h0b (¯
s¯ ∈ [0, L]
where q(¯ s) is the deformation of the link in s¯, state variable of the corresponding finite element, n ˆ (¯ s) is the direction of the unstressed configuration of the link, and e is the group exponential. This relation provides better results as long as the number of finite elements is increased.
3) Kinematic Pair: The kinematic pair can be simulated once the decompositions (19) and (20) are implemented. Following [55], this can be practically realized by using a rigid spring and a damper on the “components” of the relative velocity that are constrained by the kinematic pair. On the other hand, 20-Sim offers the possibility of explicitly introducing flow (i.e., velocity) constraints, thus freeing the user from the particular internal implementation. Similar results can be obtained in the Modelica language. Consider, for example, a rotational joint in a planar motion; let (vx , vy , ω) denote the relative twist and let (fx , fy , τ ) denote the wrench. Then, the kinematic pair imposes a constraint on the linear velocities vx and vy , while the port behavior at (ω, τ ) can be defined, for example, by the control action. In the simplest case, the regulator can be modeled as a source of effort (i.e., generalized torque) modulated by the proper control action (e.g., the output of a P(I)D block). For more realistic simulations, it is possible to include an electric motor in a similar way, and, if required, joint elasticity can be added by interconnecting motor (ω, τ ) and a C-element, which models a (nonlinear) spring, through a 0-junction. C. Simulation of the Mechanism Shown in Fig. 3(a) The aim of this section is to show the advantages of the proposed framework to set up a simulation of a general complex mechanical system. In particular, once the mathematical model of rigid and flexible links, together with the kinematic pairs, has been implemented within the simulation software, the complete description of the mechanism shown in Fig. 3(a) can be obtained simply by port interconnection and the resulting scheme is reported in Fig. 4(c). Note that in this multibody system, a serial mechanical structure and a closed kinematic chain made of rigid and flexible links that are interconnected by means of rotational joints coexist. The actuators have been interconnected to the joints that correspond to the kinematic pairs (1L , 0), (1, 1R ), (3L , 1), and (3, 2) [see Fig. 3(d)]. Under the effect of a decentralized proportional–differential (PD) controller, the mechanism is stabilized around a desired configuration. The effect of such a controller, in fact, can be interpreted as the result of a spring and of a damper, and can asymptotically stabilize the mechanical system [9]. Vibrations have been induced by the flexible links and transient can be made faster if the dissipative effect of the damper is increased. The parameters of the elastic links have been chosen in such a way that large deformation appear in order to show the performances of the flexible link model. The resulting motion of the structure is presented as a 3-D animation in the additional multimedia material that is included in this paper. D. Second Example: Numerical Accuracy of the Results Aim of this section is to demonstrate the numerical accuracy of the proposed modeling and simulation framework. The mechanical system under study is used, in practice, to analyze the effects of a misalignment between two flexible links (called leafsprings) due to an imprecise assembly. Leaf-springs (or elastic elements, in general) are often used in precision engineering for
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
Fig. 5.
1027
Multibody system discussed in Section VIII-D. TABLE II PARAMETERS OF THE MECHANICAL SYSTEM SHOWN IN FIG. 5 Fig. 6. Oscillatory behavior of the mechanism shown in Fig. 5 under the effect of an external force. (a) External force w x . (b) x-Coordinate of the center of mass of R 1 .
accurate manipulation of objects, assembly, or inspection [56]. The system is schematically presented in Fig. 5. It consists of two flexible links F1 and F2 , and three rigid bodies, which are denoted by R1 , R2 , and R3 . Rigid bodies and flexible links are rigidly interconnected, and F1 and F2 are also clamped to the fixed world. The main physical parameters are reported in Table II. Note that the mechanism is hyperconstrained but, due the elasticity introduced by the flexible links, it can oscillate along the x-direction. In the complete setup, F1 is not rigidly connected to the inertial reference but is connected through a rotational joint about the x-direction to introduce a measurable misalignment. The crucial point in the description of the flexible link dynamics (12) is the definition of an appropriate constitutive relation describing the elastic behavior of the mechanical structure. Under the hypothesis of a linear constitutive relation, which leads to an energy density in the form (10), according to the Von Mises theory, the compliance of the flexible link in body coordinates is given by [45] 1 0 0 0 0 0 GJ 1 0 0 0 0 0 E Iz 1 0 0 0 0 0 E I y (32) C= 1 0 0 0 0 0 EA 0 0 0 0 0 0 0
0
0
0
0
0
in which the standard representation as R vectors for the elements of se(3) is assumed.4 In (32), G = E/2(1 − ν) is the shear modulus, A is the area of the cross section, while J, Iy , and 6
4 A practical implementation of the elastic constitutive equation requires the compliance in the y- and z-direction (in body reference) not to be 0 but close to 0, e.g., 10 −9 .
Iz are the three moments of area for the beam. The numerical values can be deduced from the data of Table II. Under the effect of an impulsive force wx in the x-direction [see Fig. 6(a)], the mechanical structure starts to oscillate: the x position of the center of mass of R1 is reported in Fig. 6(b). The fast Fourier transform (FFT) analysis on the stable oscillations (i.e., after t = 2 s) gives the first natural frequency according to the 20-Sim simulation, which turns out to be f20-Sim = 3.366 Hz. The same simulation carried out with the SPACAR package [17] gives a natural frequency of fSPACAR = 3.4 Hz. On the other hand, for this mechanism, it is quite easy to explicitly compute an expression for a good approximation of the resonant frequency. Following [45], by integration of the compliance matrix (32) along the length of the link, the total stiffness in the x-direction is L3y /12EIy . Then, if mR = mR 1 + mR 2 + mR 3 denotes the total mass of the rigid structure, it follows that the natural frequency in the x-direction is equal to % 6EIy 1 = 3.369 Hz f= π mR L3y which is in very good accordance with the results provided both by 20-Sim and SPACAR. IX. CONCLUSION AND FUTURE WORK In this paper, a systematic procedure to model mechanical systems and robot manipulators with flexible links has been presented. Starting from a limited set of components, i.e., rigid and flexible links and kinematic pairs, the dynamical model follows from the analysis of a set of graphs that summarize the topology of the mechanism. The result is an implicit (mixed) port-Hamiltonian system with Lagrangian multipliers, which is the consequence of the constraints introduced by the kinematic pairs. Besides providing the mathematical formulation of the mechanism, the same rationale behind the proposed procedure also facilitates the simulation of the mechanism. In fact, once a
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
1028
IEEE TRANSACTIONS ON ROBOTICS, VOL. 25, NO. 5, OCTOBER 2009
finite elements and port-based approximation of the flexible link is deduced, it has been shown how it is possible to construct simulations of complex mechanism simply by port interconnection using appropriate software packages, such as 20-Sim, Dymola, or others. Two examples have been discussed in order to show how complex mechanisms can be modeled and simulated easily within the proposed framework and to illustrate the validity of the approach. Moreover, useful indications and suggestion on how all the main components (rigid bodies, flexible links, and kinematic pairs) can be implemented have also been included. It is worth mentioning that other phenomena, such as friction and joint elasticity, can be easily taken into account by properly interconnecting other components to the existing model through its available power ports (e.g., the power ports associated with each kinematic pair). Generally speaking, this is a straightforward extension of the proposed approach. An open issue is the development of control schemes that take advantage of the infinite-dimensional and nonlinear description of the link dynamics. For this purpose, since the model of the mechanism is a mixed port-Hamiltonian system, a starting idea could be to generalize the results presented in [29] to this class of dynamical systems. ACKNOWLEDGMENT The authors wish to thank V. Duindam (UC Berkeley) and F. Groen (Control Lab Products B.V.) for their suggestions on the simulations of complex mechanisms with 20-Sim and, in particular, on the efficient implementation of a kinematic pair. They also wish to thank D. M. Brouwer (University of Twente) for the SPACAR simulations. REFERENCES [1] W. H. Sunada and S. Dubowsky, “On the dynamic analysis and behavior of industrial robotic manipulators with elastic members,” ASME J. Mech., Transmiss. Autom. Des., vol. 105, pp. 42–51, 1983. [2] W. J. Book, “Recursive Lagrangian dynamics of flexible manipulator arms,” Int. J. Robot. Res., vol. 3, no. 3, pp. 87–101, 1984. [3] E. Bayo, “A finite-element approach to control the end-point motion of a single-link flexible robot,” J. Robot. Syst., vol. 4, no. 1, pp. 63–75, 1987. [4] Y. Nakamura and M. Ghodoussi, “Dynamics computation of closed-link robot mechanisms with nonredundant and redundant actuators,” IEEE Trans. Robot. Autom., vol. 5, no. 3, pp. 294–302, Jun. 1989. [5] A. A. Shabana, “Dynamics of flexible bodies using generalized NewtonEuler equations,” ASME J. Dyn. Syst., Meas., Control, vol. 112, pp. 496– 503, 1990. [6] H. Asada, Z. D. Ma, and H. Tokumaru, “Inverse dynamics of flexible robot arms: Modeling and computation for trajectory control,” ASME J. Dyn. Syst., Meas., Control, vol. 112, pp. 177–185, 1990. [7] A. De Luca and B. Siciliano, “Closed form dynamical model of planar multilink lightweight robots,” IEEE Trans. Syst., Man, Cybern., vol. 21, no. 4, pp. 826–839, Jul./Aug. 1991. [8] R. J. Theodore and A. Ghosal, “Comparison of the assumed modes and finite element models for flexible multilink manipulators,” Int. J. Robot. Res., vol. 14, no. 2, pp. 91–111, 1995. [9] A. De Luca, “Flexible links,” in Theory of Robot Control. Berlin, Germany: Springer-Verlag, 1996, pp. 219–261. [10] A. A. Shabana, “Flexible multibody dynamics: Review of past and recent developments,” Multibody Syst. Dyn., vol. 1, no. 2, pp. 189–222, Jun. 1997. [11] S. S. Antman, Nonlinear Problems of Elasticity. New York: SpringerVerlag, 1995. [12] The MathWorks, Inc. (2008). Simulink [Online]. Available: http://www. mathworks.com/
[13] SIMULIA. (2008). Abaqus Unified [Online]. Available: http://www. simulia.com/ [14] ANSYS, Inc. (2008). ANSYS Multiphysics [Online]. Available: http:// www.ansys.com/ [15] COMSOL Group. (2008). COMSOL Multiphysics [Online]. Available: http://www.comsol.com/ [16] R. M. Bhatt and V. N. Krovi, “DynaFlexPro for Maple,” IEEE Control Syst. Mag., vol. 26, no. 6, pp. 127–138, Dec. 2006. [17] Laboratory of Mechanical Automation, University of Twente. (2008). Spacar [Online]. Available: http://www.walab.ctw.utwente.nl/Software/ SPACAR/2008/ [18] B. M. Maschke and A. J. van der Schaft, “Port controlled Hamiltonian systems: Modeling origins and system theoretic properties,” in Proc. 3rd IFAC Symp. Nonlinear Control Syst., 1992, pp. 282–288. [19] A. J. van der Schaft, L 2 -Gain and Passivity Techniques in Nonlinear Control (Communication and Control Engineering Series). Berlin, Germany: Springer-Verlag, 2000. [20] V. Duindam, A. Macchelli, S. Stramigioli, and H. Bruyninckx, Eds., Modeling and Control of Complex Physical Systems. The Port-Hamiltonian Approach. Berlin, Germany: Springer-Verlag, 2009. [21] M. Dalsmo and A. J. van der Schaft, “On representation and integrability of mathematical structures in energy-conserving physical systems,” SIAM J. Control Optim., vol. 37, pp. 54–91, 1999. [22] A. J. van der Schaft and B. M. Maschke, “Hamiltonian formulation of distributed parameter systems with boundary energy flow,” J. Geom. Phys., vol. 42, no. 1–2, pp. 166–194, May 2002. [23] A. Macchelli, A. J. van der Schaft, and C. Melchiorri, “Port Hamiltonian formulation of infinite dimensional systems I. Modeling,” in Proc. 43rd IEEE Conf. Decision Control, Dec. 2004, vol. 4, pp. 3762–3767. [24] A. Macchelli, A. J. van der Schaft, and C. Melchiorri, “Multi-variable port Hamiltonian model of piezoelectric material,” in Proc. IEEE/RSJ Int. Conf. Intell. Robots Syst., Sep. 28–Oct. 2, 2004, vol. 1, pp. 897–902. [25] G. Golo, A. J. van der Schaft, and S. Stramigioli, “Hamiltonian formulation of planar beams,” in Proc. 2nd IFAC Workshop Lagrangian Hamiltonian Methods Nonlinear Control, A. Astolfi, F. Gordillo, and A. J. van der Schaft, Eds. Seville, Spain, Apr. 2004, pp. 169–174. [26] A. Macchelli and C. Melchiorri, “Modeling and control of the Timoshenko beam. The distributed port Hamiltonian approach,” SIAM J. Control Optim., vol. 43, no. 2, pp. 743–767, 2004. [27] A. Macchelli, C. Melchiorri, and S. Stramigioli, “Port-based modeling of a flexible link,” IEEE Trans. Robot., vol. 23, no. 4, pp. 650–660, Aug. 2007. [28] H. Rodriguez, A. J. van der Schaft, and R. Ortega, “On stabilization of nonlinear distributed parameter port-controlled Hamiltonian systems via energy shaping,” in Proc. 40th IEEE Conf. Decision Control, Dec. 2001, vol. 1, pp. 131–136. [29] A. Macchelli and C. Melchiorri, “Control by interconnection of mixed port Hamiltonian systems,” IEEE Trans. Autom. Control, vol. 50, no. 11, pp. 1839–1844, Nov. 2005. [30] G. Baciu and H. K. Kesavan, “From particle-mass to multibody systems: Graph-theoretic modeling,” IEEE Trans. Syst., Man Cybern., A, Syst., Humans, vol. 27, no. 2, pp. 244–250, Mar. 1997. [31] S. Y. T. Lang and H. K. Kesavan, “Graph theoretic modeling and analysis of multibody planar mechanical systems,” IEEE Trans. Syst., Man Cybern., A, Syst., Humans, vol. 31, no. 2, pp. 97–111, Mar. 2001. [32] B. M. Maschke, “Elements on the modelling of mechanical systems,” in Modelling and Control of Mechanisms and Robots. Singapore: World Scientific, 1996. [33] Y. Nakamura and K. Yamane, “Dynamics computation of structurevarying kinematic chains and its application to human figures,” IEEE Trans. Robot. Autom., vol. 16, no. 2, pp. 124–134, Apr. 2000. [34] S. Stramigioli, Modeling and IPC Control of Interactive Mechanical Systems: A Coordinate Free Approach (Lecture Notes in Control and Information Sciences), 1st ed. London, U.K.: Springer-Verlag, 2001. [35] A. Macchelli, S. Stramigioli, and C. Melchiorri, “Port-based modelling of manipulators with flexible links,” in Proc. IEEE Int. Conf. Robot. Autom., May 2006, pp. 1886–1891. [36] S. Mattsson, H. Elmqvist, and M. Otter, “Physical system modeling with Modelica,” Control Eng. Prac., vol. 6, no. 4, pp. 501–510, 1998. [37] P. Fritzson, Principles of Object-Oriented Modeling and Simulation With Modelica 2.1. Piscataway, NJ: Wiley–IEEE Press, Jan. 2004. [38] Dynasim A. B. (2008). Dymola [Online]. Available: http://www. dynasim.se/ [39] The Open Source Modelica Consortium (OSMC). (2008). Open Modelica [Online]. Available: http://www.ida.liu.se/labs/pelab/modelica/ OpenModelica.html
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.
MACCHELLI et al.: PORT-BASED MODELING AND SIMULATION OF MECHANICAL SYSTEMS WITH RIGID AND FLEXIBLE LINKS
[40] Control Lab Products. (2006). 20-Sim [Online]. Available: http://www. 20sim.com/ [41] G. Ferretti, F. Schiavo, and L. Vigan`o, “Modular modelling of flexible thin beams in multibody systems,” in Proc. 44th IEEE Conf. Decision Control Eur. Control Conf., Dec. 2005, pp. 3363–3368. [42] J. M. Selig, Geometric Fundamentals of Robotic (Monographs in Computer Science), 2nd ed. Berlin, Germany: Springer-Verlag, 2005. [43] J. C. Simo, “A strain beam formulation. The three-dimensional dynamic problem. Part I,” Comput. Methods Appl. Mech. Eng., vol. 49, pp. 55–70, 1985. [44] E. D. Fasse, “Some applications of screw theory to lumped-parameter modeling of visco-elastically coupled rigid bodies,” presented at the Symp. Commemorating Legacy, Works, Life Sir Robert Stawell Ball Upon 100th Anniversary ‘A Treatise on the Theory of Screws,’” London, U.K., 2000 [45] J. M. Selig and X. Ding, “A screw theory of static beams,” in Proc. IEEE/RSJ Int. Conf. Intell. Robots Systems, Oct./Nov. 2001, vol. 1, pp. 312–317. [46] A. Macchelli, A. J. van der Schaft, C. Melchiorri, “Distributed portHamiltonian formulation of infinite dimensional systems,” presented at the 16th Int. Symp. Math. Theory Netw. Syst., 2004, Leuven, Belgium, Jul., p. 25.. [47] P. J. Olver, Application of Lie Groups to Differential Equations. Berlin, Germany: Springer-Verlag, 1993. [48] J. Park and W. Chung, “Geometric integration on Euclidean group with application to articulated multibody systems,” IEEE Trans. Robot., vol. 21, no. 5, pp. 850–863, Oct. 2005. [49] A. Macchelli, S. Stramigioli, and C. Melchiorri, “Port-based finite element model of a flexible link,” presented at the 7th IFAC Symp. Nonlinear Control Syst., Pretoria, South Africa, Aug. 2007. [50] J. Koopman, D. Jeltsema, and M. Verhaegen, “Port-Hamiltonian formulation and analysis of the LuGre friction model,” in Proc. 45th IEEE Conf. Decision Control, San Diego, CA, Dec. 2006, pp. 3181–3186. [51] G. Golo, V. Talasila, A. J. van der Schaft, and B. M. Maschke, “Hamiltonian discretization of boundary control systems,” Automatica, vol. 40, no. 5, pp. 757–771, 2004. [52] L. Bassi, A. Macchelli, and C. Melchiorri, “An algorithm to discretize one-dimensional distributed port Hamiltonian systems,” presented at the 3rd IFAC Workshop Lagrangian Hamiltonian Methods Nonlinear Control, Nagoya, Japan, Jul. 2006. [53] G. Golo, V. Talasila, and A. J. van der Schaft, “A Hamiltonian formulation of the Timoshenko beam model,” presented at the 8th Mechatronics Forum, Enschede, The Netherlands, Jun. 2002. [54] T. C. Huang, “The effect of rotatory inertia and of shear deformation on the frequency and normal mode equations of uniform beams with simple end conditions,” ASME J. Appl. Mech., vol. 28, pp. 579–584, Dec. 1961. [55] D. C. Karnopp, D. L. Margolis, and R. C. Rosenberg, System Dynamics: Modeling and Simulation of Mechatronic Systems, 4th ed. New York: Wiley, 2006. [56] A. H. Slocum, Precision Machine Design. Englewood Cliffs, NJ: Prentice–Hall, 1992.
1029
Claudio Melchiorri (M’92–SM’03) was born on October 23, 1959. He received the Laurea degree in electrical engineering and the Ph.D. degree from the University of Bologna, Bologna, Italy, in 1985 and 1990, respectively. In 1998, he was an Adjunct Associate in engineering with the Department of Electrical Engineering, University of Florida, Gainesville. During 1990– 1991, he was a Visiting Scientist with the Artificial Intelligence Laboratory, Massachusetts Institute of Technology, Cambridge. Since 1985, he has been with the Department of Electrical Engineering, Computer Science, and Systems, University of Bologna, where he was engaged in the field of robotics and automatic control and is currently a Full Professor of robotics. His current research interests include dexterous robotic manipulation, haptic interfaces, telemanipulation systems, advanced sensors, and nonlinear control. He is the author or coauthor of about 200 scientific papers presented at conferences or published in journals and of 13 books on digital control and robotics.
Stefano Stramigioli (S’91–M’92–SM’03) received the M.Sc. degree (with honors) (cum laude) from the University of Bologna, Bologna, Italy, in 1992 and the Ph.D degree (with honors) (cum laude) from the Delft University of Technology, Delft, The Netherlands, in 1998. He has been a Visiting Scholar with Massachusetts Institute of Technology, Cambridge. Since 1998, he has been a faculty member with the Delft University of Technology. He is currently with the University of Twente, Enschede, The Netherlands, where he is a Full Professor of the Personal Chair of advanced robotics and the Director of the Strategic Research Orientation on Smart Devices and Materials of the IMPACT Institute. He is involved in different robotics projects and has been engaged in teaching modeling, control, and robotics. He is the author and coauthor of more than 100 publications, including four books by Springer. Dr. Stramigioli is the Editor in Chief of the IEEE Robotics and Automated Magazine, an Adcomm Member, and the Chair of the Electronic Products and Services Board of the Society.
Alessandro Macchelli (M’06) received the M.Sc. degree (cum laude) in computer science engineering and the Ph.D. degree from the University of Bologna, Bologna, Italy, in 2000 and 2003, respectively. In 2001, he was a Visiting Scholar with the Department of Applied Mathematics, University of Twente, Enschede, The Netherlands, where he was a Postdoctoral Fellow in 2003. Since 2005, he has been an Assistant Professor with the Department of Electronics, Computer Science, and Systems, University of Bologna. His current research interests include the modeling, simulation, and control aspects of finite- and infinite-dimensional systems within the port-Hamiltonian framework.
Authorized licensed use limited to: Universita degli Studi di Bologna. Downloaded on October 19, 2009 at 03:45 from IEEE Xplore. Restrictions apply.