A few months ago, I needed to prepare for a customer on-site training session. As part of the request for topics to be covered during the training, my contact there wanted to talk about contact! Contact models are important for multi-body systems because it is about the interactions between objects. An important example of a contact model is a tire component that interacts with the road. In this case, the training topic requested was a more generic question: “how to create contact models in MapleSim”. There are, of course, lots of examples available within MapleSim that contain contact models already. Two particular examples came to mind: 1) the bouncing ball; and 2) the catapult. However, this being a training session, simply presenting the example models would not accomplish the purpose of the session. So I broadened my scope and turned my attention to the question: “how does one model contact in general?”
There are two aspects to contact modeling: detection and effect. For the purpose of this blog post, the concept of contact detection is the same as collision detection. It is the way to identify when and where two (virtual) objects are in touch with each other. The difficulty in this task varies with the geometric complexity of the shapes of the objects involved. The more complex and non-smooth the profile of the surfaces of these objects are, the more complicated the detection algorithm will be. As for contact effect, it is referring to the action (reaction) taken at the instance the two objects are touching with each other. For example, a contact between two objects can be “soft and spongy” or “hard and stiff”. These descriptions refer to how the force interaction between the objects at the moment of impact affects their dynamic (motion) behaviour. It is this focus on the contact effect that differentiates between contact modeling and collision detection, which is mainly concerned with the geometric relationships between the objects. Both contact modeling and collision detection remain areas of active research. The main challenge lies in the complexity in both computation and concept. Computational complexity arises from the need for efficient methods to calculate the (potentially) massive geometrical detection algorithms, as well as robust algorithms to avoid numeric instability, such as chattering due to rapid switching between being in contact and not in contact. Conceptual complexity comes from the inherent nonlinear nature of the contact phenomenon itself. Effects, such as friction and structural deformation, contribute to the complexity. As a modeling tool, MapleSim provides an intuitive and flexible interface to simulate, investigate and explore contact models for both practising engineers, who require only basic contact models for their simulation needs, and researchers, whose interest is in advanced contact models.
As part of the training, I wanted to illustrate two points on modeling with MapleSim: 1) there is more than one way to model the same effect; and 2) it is easy to model different kinds of contact effects because of MapleSim’s flexible and intuitive physical modeling paradigm. I have selected to use a projectile (well, a ball being launched with an initial velocity at an angle with the horizontal plane) as an example for illustration purpose. This choice was motivated by my desire to focus on illustrating the contact effects aspect of contact modeling instead of detection. The contact between a ball (a sphere) and the ground (a plane) is a point, which is relatively straight-forward to detect. Actually, this choice is at least partly inspired by one of the many spontaneous Nerf gun battles that we had here at the office… more details on that at a later blog post, perhaps.
The projectile for this exercise is constrained to planar motion (about the vertical plane where gravity is acting along the vertical down direction). The reference frame is aligned such that the x-axis is along the horizontal forward direction and the y-axis along the vertical up direction. With this, I then proceeded to create two models for the training session, one for each of the two points above. The first one, named Projectile_contact_models.msim, contains four variations in the implementation of a sticky vertical contact between the ball and the ground plane. In all four implementations, there is no force effect defined along the horizontal (x) direction. The expected result of this simulation is that the ball will hit the ground, get stuck to the horizontal plane and slide along the (frictionless) surface. Two of these implementations are created with built-in 1-D mechanical components in MapleSim attached to the vertical axis: the Translational HardStop and Elasto Gap Component. Both have high damping coefficient to emulate the “sticking” effect. The other two implementations are constructed through either graphical construction (signal flow diagram) or a custom component to realize the contact force equation:
Which basically says when the ball is in contact with (or below) the ground (), apply a pushing force back that is proportional to the ground penetration (spring effect) and speed () of the ball (damping/sticky effect).
The second example I created can be found in the file named Projectile_contact_effects.msim. The different effects implemented were free fall (no contact, as a reference), hit and bounce (spring effect), hit and slide (same effect as in the above model) and hit and stuck (sticky/high damping along the horizontal direction as well). In all four cases, the same basic projectile model was used. The different effects are created by simply modifying the force computation. Conceptually, more sophisticated contact effects can be modelled with the appropriate force computations.
The new MapleSim Tire Component Library add-on toolbox is an example of where realistic contact models are useful for real industrial applications (in this case, for the automotive industry).
The experience I got from this training was very positive. As a modeling engineer, I am constantly fascinated by discovering new ways to do things. It is quite refreshing that I get to work with a flexible tool like MapleSim that allows me to explore to my heart’s content. And I am quite fortunate to have the opportunity to meet people who share the same passion as I do on a regular basis.