Contact types hierarchy and its object-oriented implementation
Abstract
Technology of the object-oriented implementation for the multibody dynamics models is the key feature when developing the corresponding computer structures. We are based on an approach originating from concepts explained earlier. Following the guidelines outlined there one can develop the family of the constraint abstractions being adapted to any type of the machinery applications and relatively easily implement corresponding family of Modelica models. One also can reorder these classes hierarchically using sequences of the behaviour inheritance. Solutions concerning contact problems and corresponding examples are under consideration.
Full text
IS - Coupled Problems of the Dynamics of the Solid Systems with FrictionContact types hierarchy and its object-oriented implementation VI International Conference on Computational Methods for Coupled Problems in Science and Engineering COUPLED PROBLEMS 2015 B. Schrefler, E. O˜nate and M. Papadrakakis(Eds) CONTACT TYPES HIERARCHY AND ITS OBJECT-ORIENTED IMPLEMENTATION IVAN I. KOSENKO∗, KIRILL V. GERASIMOV†AND MIKHAIL E. STAVROVSKIY‡ ∗Moscow State Technical University of Radio Engineering, Electronics, and Automation 78 Vernadsky Avenue, 119454, Moscow, Russia e-mail: k[email protected], web page: https://fcyb.mirea.ru/kafedri/internal/tm.html †Faculty of Mechanics and Mathematics, Lomonosov Moscow State University 1 Leninskiye Gory, Main Building, GSP-1, 119991, Moscow, Russia e-mail: [email protected] ‡STAN Group 1 Vadkovsky lane, 127994, Moscow, Russia e-mail: stavro[email protected], web page: http://www.stan-group.com/ Key words: Object-Oriented Modeling; Mechanical Constraint; Contact Model Template; Omni Wheel; Contact Tracking. Abstract. Technology of the object-oriented implementation for the multibody dynamics models is the key feature when developing the corresponding computer structures. We are based on an approach originating from concepts explained earlier. Following the guidelines outlined there one can develop the family of the constraint abstractions being adapted to any type of the machinery applications and relatively easily implement corresponding family of Modelica models. One also can reorder these classes hierarchically using sequences of the behaviour inheritance. Solutions concerning contact problems and corresponding examples are under consideration. 1 INTRODUCTION Development of a computer model for the multibody system (MBS) dynamics is connected usually with use of a unified technology of any type for constructing models in an efficient way. Object-oriented languages [1] are known to resolve such a problem successively step by step using their natural features. On the other hand one of the natural way for representing the MBS dynamics is the so-called multiport representation of the models initially based on the bond graph application [2]. This latter approach is based on the idea of energy interchange, and substantially on energy conservation for physically 1 191
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy interconnected subsystems of any engineering type. Consider in the sequel a technology for constructing a model of MBS dynamics with constraints of any specific type in a unified way. Note that the unilateral constraints, like ones of mechanical contact may also be included in the further consideration process. A lot of methods to describe the structure of the MBS using different graph approaches is known, see for instance [3]. Consider the MBS consisting of m+ 1 bodies B0,...,B m. Represent it as a set B={B0,...,B m}. Here B0is assumed to be a base body. We suppose B0to be connected with an inertial frame of reference, or to have a known motion with respect to (w. r. t.) the inertial frame of reference. For example one can imagine the base body as a rotating platform, or as a vehicle performing its motion according to a given law. For definiteness and simplicity we suppose in the sequel all state variables describing the rigid bodies motion always refer to one fixed inertial coordinate system connected to the base body by default. Some bodies are considered as connected by mechanical constraints. Suppose all constraints compose the set C={C1,...,C n}. We include in our considerations constraints of the following types: holonomic/nonholonomic, scleronomic/rheonomic. Thus one can uniquely represent a structure of the MBS via a undirected graph G= (B,C,I). Here I⊂C×Bis an incidence relation setting in a correspondence the vertex incident to every edge Ci∈Cof the graph. According to physical reasons it is easy to see that for any mechanical constraint Cithere exist exactly two bodies Bk,B l∈Bconnected by this constraint. 2 BASE CLASSES FOR THE MULTIBODY DYNAMICS MODELS It is clear that consideration of the graph Gprovides only a simplest structural information insufficient for the MBS dynamical description. Indeed, in addition to the force interaction represented usually by wrenches between bodies Bk,Blthrough the constraint Cithere exist kinematic conditions specific for different kinds of constraints. Wrenches themselves can be represented in turn by constraint forces, reactions, and constraint torques couples. These forces and couples are connected by virtue of Newton’s third law of dynamics. Thus if the system of ODEs for translatory-rotary motion can be associated with the object of a model corresponding to rigid body, then the system of the algebraic equations in a natural way can be associated with the object of a model corresponding to constraint. Note that according to above consideration the set of algebraic equations comprises relations for constraint wrenches, and kinematic relations depending on the certain type of constraints. Thus all the “population” of any MBS model is reduced to objects of two classes: Rigid- Body (objects B0,...,B m), Constraint (objects C1,...,C n). According to this approach simulation of the whole system behavior reduces to permanent information interaction between the objects of two considered types. Within the frame of Newton’s laws of dynamics one can construct the MBS as a communicative network for this interaction. In this case 2 192
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy the objects of bodies “feel” the action of other ones through corresponding objects of constraints. Physical interactions are conducted in models due to objects splitted also in two classes of ports: WrenchPort,KinematicPort. The first one is to be used to transfer wrench. In addition, WrenchPort has to be used for transferring the information about current location of the point reaction acts upon. In our idealized model the force interaction between bodies supposed exactly at a geometric point. Its coordinates are fed outside constraint object through WrenchPort permanently in time. Now it is possible to describe an architecture of information interactions within the particular constraint Cicorresponding to an individual edge of graph G, see Fig. 1. Thus computer model of the particular constraint is represented by the communication network. Figure 1: Architecture of constraint KinematicPort is to be used to transfer the data of rigid body kinematics: configuration (position of center of mass, orientation), velocity (velocity of the center of mass, angular rate), and acceleration (acceleration of the center of mass, angular acceleration) containing in particular information about twist. When getting force information through ports W1,...,W sfrom the incident objects of class Constraint the object of class RigidBody simultaneously generates, due to an integrator, kinematic information being fed outside through the port K. On the other hand every object of class Constraint gets kinematic data from the objects corresponding to bodies connected by the constraint under consideration through its two “input” ports KA,KB. Simultaneously using the system of algebraic equations this object generates information concerning wrenches, and transmits the data to “output” ports WA,WBfor the further transfer to objects of bodies under constraint. For simplicity and clearness we apply now base classes from above for simulating the dynamics of MBSs with bilateral constraints [4]. Application of the components for the unilateral constraints [5, 6] we will see later. 3 193
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy In superclass RigidBody dynamics of rigid body is described here by means of Newton’s differential equations for the body mass center, and by Euler’s differential equations for the rotary motion. Note that to be able to have an invariant description of the rotary motion one can use an excellent tool: quaternion algebra H. In this case we “lift” the configuration manifold from SO(3) to S3⊂Hand then implement dynamics of rotation in flat space H∼ =R4taking into account that S3is an invariant manifold of the rotary dynamics redefined on H. In this way we have only one flat chart Hfor the underlying due to double covering configuration manifold SO(3), and need not in any special choices of the configuration angles or anything like that. The double covering S3→SO(3), q→ Tmentioned is implemented inside the Rigid- Body class by the known formula. The rotation matrix Tis fed outside the object through the KinematicPort permanently in time. The Euler equations are constructed using quaternion algebra in a way described in [4]. Remind that according to our technology of the constraint construction [4] two connected bodies are identified by convention with the letters Aand Bfixed for each body. All kinematic and dynamic variables and parameters concerned one of the bodies are equipped with the corresponding letter as a subscript. All objects of the class Constraint must have classes-inheritors as subtypes of a corresponding superclass. According to Newton’s third law this superclass must contain the equations of the form FA+FB=0,MA+MB=0in its behavioral section. Here arrays FA,MAand FB,MBrepresent constraint forces and torques “acting in directions” of bodies Aand Bcorrespondingly. Kinematic equations for different types of constraints are to be added to the last equations in different classes-inheritors corresponding to these particular types of constraints. 3 JOINT MODEL AS ONE OF A BILATERAL CONSTRAINT Class Joint plays a key role in the future model of a vehicle we will build. Joint is a model derived from the base class Constraint. Remind [5] that in order to make a complete definition of the constraint object behavior for the case of rigid bodies one has to compose a system of twelve algebraic equations w. r. t. twelve coordinates of vectors FA,MA,FB,MBconstituting the wrenches acting upon the connected bodies. First six (??) always present in the base model Constraint due to Newton’s third law. For definiteness suppose these six equations are used to express six components of FB, MBdepending on FA,MA. Thus six components of FA,MAremain as unknowns. To determine them each constraint of rigid bodies need in six additional independent algebraic equations. These equations may include components of force and torque directly, or be derived from the kinematic relations corresponding to specific type of the constraint. In the case of the joint constraint being under construction here let us represent the motion of the body Bas a compound one including the body Aconvective motion w. r. t. an inertial frame of reference, and a relative motion w. r. t. the body A. An absolute motion is one of the body Bw. r. t. the inertial system. 4 194
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy Define the joint constraint with help of the following parameters: (a) a unit vector nAdefining an axis of the joint in the body A; (b) a vector rAfixed in the body Aand defining a point which constantly stays on the axis of the joint; (c) a vector rBfixed in the body Band defining a point which also constantly stays on the axis of the joint. The main task of the base joint class is always to keep geometric axes fixed in each of the bodies in coincidence. First of all one has to compute the radii vectors of the points fixed in the bodies w. r. t. inertial system Rα=rOα+Tαrα(α=A, B), where [5] rOαis the position of the α-th body center of mass, Tαis its current matrix of rotation. The joint axis has the following components nAi =TAnAin the inertial frame of reference. According to the equation for relative velocity for the marked point of the body Bdefined by the position RBwe have vBa =vBe +vBr,vBa =vOB+[ωB,T BrB], vBe =vOA+[ωA,RB−rOA], where vBa,vBe, vBr are an absolute, convective, and relative velocities of the body Bmarked point, ωA, ωBare the bodies angular velocities. Furthermore, according to the computational experience of the dynamical problems simulation the precompiler work is more regular if the kinematic equations are expressed directly through accelerations. Indeed, otherwise the compiler tries to perform the formal differentiation of equations for the velocities when reducing an index of the total DAE system. Frequently this leads to the problems either in time of translation or when running the model. Thus using the known Euler formulae for the rigid body kinematics and the Coriolis theorem we obtain an equations for the relative linear acceleration in the form aBa =aOB+[εB,T BrB]+[ωB,[ωB,T BrB]] ,aBa =aBe +2[ωA,vBr]+aBr, aBe =aOA+[εA,RB−rOA]+[ωA,[ωA,RB−rOA]] ,aBr =µnAi, where aBa,aBe,aBr are an absolute, convective, and relative accelerations of the body Bmarked point, εA,εBare the bodies angular accelerations, vBr is a relative velocity of the body Bmarked point, ωA,ωBare the bodies angular velocities. We also need in an analytic representation of conditions that the only projections of the bodies angular velocities and accelerations having a differences are ones onto the joint axis. Corresponding equations have the form ωB=ωA+ωr,εB=εA+[ωA,ωr]+εr, εr=λnAi, where ωr,εrare the relative angular velocities and accelerations. Besides the kinematic scalars µ,λwe will need in their reciprocal values F=(FA,nAi), M=(MA,nAi) correspondingly. Note that the class described above is a partial one (doesn’t yet complete the constraint definition) and can be used to produce any imaginable model of the joint type constraint. To obtain a complete description of the joint model one has to add to the behavioral section exactly two equations. One of them is to define one of the values µ,F(translatory case). Other equation is intended to compute one of the values λ,M(rotary case). 5 195
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy 4 CONTACT AS A PARTICULAR CASE OF MECHANICAL INTERCONNECTION For simplicity we suppose here objects of unilateral constraint implement model of mechanical contact without impacts. Though in general according to the nature of unilateral constraint one can describe it using fundamental state variable which at any time instant can have one of three values: “Flight”, “Sliding”, “Rolling”. Values enumerated have a sense transparent enough. State “Flight” means the constraint at a current time instant is in a disconnected condition i. e. bodies in fact are not connected and can perform free relative flying. As state variable has one of values “Sliding” or “Rolling” then bodies supposed to be in a contact. The difference is that the first state permits the relative slipping of the bodies but the second one does not. The dynamics of a rigid body translatory–rotary motion was outlined above. However the mechanical constraint model representation undergoes an essential changes in compare with the bilateral case. We use the so called complementarity rules [7] as a base for the unified description of the unilateral constraint. Taking into account complementarity rules one can see easily that any constraint always is defined by the three scalar equations. To derive these equations first consider local geometry of the problem, see Figure 2. Figure 2: Area of Constraint Outer surfaces supposed to be defined with respect to principal central axes of corresponding bodies by the equations fα(rα)=0(α=A, B). Then in inertial frame of reference for the whole multibody system these equations will take the form gα(r0)= fα[T∗ α(r0−rOα)] = 0 (α=A, B), with rOA,rOBbeing a vectors of masscenters positions OA,OBfor the bodies Aand B, and TA,TBmean an orthogonal matrices for current bodies orientations. An asterisk denotes conjugating what equivalent to inverting of matrix for the case of orthogonality. Thus the functions gA(r0), gB(r0) depend upon the time 6 196
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy indirectly through the variables rA,rB,TA,TB. Constraint object of our model is to compute at each current instant positions of the points PAand PBwhich are the nearest ones for interacting bodies Aand B. By virtue of above assumptions such points are to be evaluated in a unique way. Denote the radii vectors of these points with respect to inertial frame of reference by rPA,rPB. Then using simple geometric considerations for the coordinates of the cited vectors one can derive the following system of algebraic equations grad gA(rPA)=λ·grad gB(rPB), rPA−rPB=µ·grad gB(rPB), gA(rPA)=0, gB(rPB)=0.(1) One can verify easily that the gradients can be computed by formulae grad gα(rPα)= Tαgrad fα[T∗ α(rPα−rOα)], where α=A, B. It easy to see the system (1) consists of eight scalar equations and has eight scalar unknowns: xPA,yPA,zPA,xPB,yPB,zPB,λ,µ. Variables λ,µare an auxiliary ones. The equations (1) are in use either without or with a presence of the contact of bodies A,B. In a latter case the equation µ= 0 instead of one of the surfaces equations is in use. According to computational experience it is more reliable and convenient to use the equations of constraints in a differential form instead of those ones in the algebraic form (1). Such an approach is used frequently also when analyzing the properties of mechanical systems. Normal vector nA= grad gA/|grad gA|will play an important role in the further course. Normal for an outer surface of the body Ais chosen here for definiteness. One can use the vector nBas well. Let us perform now a unified description of the unilateral constraint using kinematic and/or force equations. Denote by FAthe force acting on the body Afrom the body B. And by FBdenote the force acting on the body Bfrom one of Avice versa. Each force mentioned acts at the point Pα,α=A, B. In addition, let us introduce auxiliary notations FAn =(FA,nA), FAτ =FA−FAnnA,vr=vPA−vPB,vrn =(vr,nA), vrτ =vr−vrnnA. If the bodies are disconnected and the constraint is in a state “Flight” then the force of reaction is equal to zero. Thus we have three scalar equations. For unifying the system of constraint equations further and for taking into account arbitrary directions of the normal nAlet us introduce auxiliary scalar variable κin a way such that FAn =0,FAτ −κnA=0. Actually one has obtained the system of four equation with four unknown variables FAx, FAy,FAz,κ. In case of bodies contact the condition FAn = 0 is substituted by the kinematic one vAn = 0. States “Sliding” and “Rolling” differ one from another using conditions in a tangent plane. Implementation of the Coulomb friction model supposed for the simplicity. Then one can obtain the vector force equation in the tangent plane FAτ −d·FAnvrτ /|vrτ|−κnA=0,(2) 7 197
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy where dis the coeffitient of friction. For rolling the tangent velocity has to be zero vAτ −κnA=0. In the case of sliding the model equation (2) “works” properly if the relative velocity isn’t very small. However the problem of regularization for the equation of constraint (2) arises at the instance of transition from “Rolling” to “Sliding”. It turns out that one can apply here the known approximation for Coulomb’s friction using regularized expression for the tangent force FAτ −κnA=dFAnvrτ /|vrτ |as |vrτ |> δ, FAnvrτ /δ as |vrτ |≤δ, where one supposes that δ1. It is known [8] that in this case the solution of the regularized problem remains close to the solution of the original one on asymptotically large time intervals. Implementation and further simulation show this closeness holds with the very high degree of accuracy. Such an approach resolves completely the problem of modeling for accurate transitions between states of “Sliding” and “Rolling”. Thus properties of the frictional contact as: (a) contact tracking algorithm; (b) contact velocities computation; (c) contact forces computation; (d) contact surfaces particular properties are combined in an object-oriented manner forming lines of inheritance in a natural way. 5 CLASS PARAMETRIZATION IN CASE OF COMPLIANT CONTACT Implementation of the mechanical contact model with compliance assumes much more possibilities for the contact properties than in the rigid case. According to experience while developing the models for elastic contacting of rigid bodies interactions in the multibody dynamics a flexibility provided by an object-oriented approach can be used to utilize a wide variety of different properties concerning a contact of solids. The properties are mainly of the following categories: (a) geometric properties for surfaces in vicinity of the contact patch (gradients of the functions defining surfaces, their Hesse matrices); (b) a model to compute the contact area dimensions and normal elastic force; (c) model for the normal viscous force of resistance; (d) model for the tangent forces along the plane of the contact area. A submodel of the geometry properties is to describe analytically algebraic surfaces of the structure complex enough. To implement the normal force computation one can choose from at least two approaches: the Hertz model and its volumetric modification. Force of viscous resistance also can be modeled in several different ways: linear, non-linear, etc. In the models for tangent forces one can adopt either “simplest” approaches based 8 198
Ivan I. Kosenko, Kirill V. Gerasimov and Mikhail E. Stavrovskiy Figure 3: The model of mechanical contact by stages of inheritance. on the Amontons–Coulomb friction or more complex ones represented by the Contensou– Erismann, and other models. While developing a mechanical contact model architecture we used the base class Constraint described above as a starting point to construct its inheritor ContactConstraint- Template being simultaneously a base class of new family of models to simulate mechanical contacts. Really this class is a base template represented as a container having four “sockets” to instantiate there the specific parameter classes of four types enumerated above, see its visual model in Figure 3 at a top left corner. To develop complete model one can move along different ways. Class parametrization implemented in Modelica language for example is the facility in line to apply to the problem under description. In our case we have four class parameters corresponding to the submodel categories enumerated above. An example to construct specific contact interaction model see in Figure 3. The example includes two stages of inheritance: 1. to derive a template with the forces models, namely: the Hertz model for normal force, non-linear viscous force, the Contensou–Erismann model for the dry friction forces (to “fill in” three sockets in the middle of the base template visual model, see the derived template visual model at a central position of the Figure 3); 2. to complete the whole construct one should define a specific geometry submodel for the surfaces in contact (to “seal” the socket for geometry properties, see the complete visual model at a bottom right corner of the Figure 3). 9 199