# HapCo: a real-time simulator with haptic device for problems with multiple contacts

Nadjet Talbi, Pierre Joli, Zhi-Qiang Feng, Abderrahmane Kheddar

<figure><img src="image_1.png" /></figure>

## To cite this version:

Nadjet Talbi, Pierre Joli, Zhi-Qiang Feng, Abderrahmane Kheddar. HapCo: a real-time simulator with haptic device for problems with multiple contacts. 8e Colloque national en calcul des structures, CSMA, May 2007, Giens, France. hal-01492449

HAL Id: hal-01492449

https://hal.science/hal-01492449

Submitted on 20 Mar 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# HapCo: a real-time simulator with haptic device for problems with multiple contacts

N. Talbi*, P. Joli*, Z.Q. Feng**, A. Kheddar*

* Laboratory IBISC, University of Evry Val d'Essonne, 91020 Evry, France.

** Laboratory LME, University of Evry Val d'Essonne 91020 Evry, France.

{nadjet.talbi, pjoli, feng, kheddar}@iup.univ-evry.fr

**ABSTRACT:** In this paper, we present HapCo, a real time simulator with haptic force feedback. The discrete modelling of the elastic solids is achieved by the Finite Element Method (FEM) and the field of nodal displacements is composed of a rigid part and a linear elastic part. In real time, the rigid displacements are applied to an elastic solid by means of a Phantom desktop haptic device. A force is computed and returned to the Phantom when a collision occurs with a second clamped elastic solid. This force feedback takes account of the linear elasticity laws and the friction contact laws (Signorini and Coulomb) of the elastic solids in contact. According to the rendering visual feedback given, the elastic deformations of the bodies computed by the Finite Element Method look physically realistic.

**RÉSUMÉ:** Dans ce papier, on présente HapCo, un simulateur temps réel avec retour haptique.

Les solides déformables sont discrétisés à partir de la Méthode des Eléments finis (MEF) et le champs des déplacements nodaux est composé d'une partie rigide et d'une partie élastique linéaire. Le déplacement rigide d'un solide déformable est modifié en temps réel par l'intermédiaire d'une interface haptique portatif type « Phantom ». Une force est calculée et restituée au Phantom lorsqu'une collision se présente avec un autre solide déformable encastré à une de ses extrémités. Cette force de retour prend en compte les lois de l'élasticité linéaire et les lois de contact frottant (Signorini et Coulomb) des corps en contact. Conformément au rendu obtenu par le retour visuel, les déformations calculées par la Méthode des Eléments Finis semble physiquement réaliste.

**KEYWORDS:** HAPTIC SIMULATION, FINITE ELEMENT METHOD, LINEAR ELASTICITY, FRICTION CONTACT, UZAWA TECHNIQUE, BIPOTENTIAL METHOD.

**MOTS-CLES:** SIMULATION HAPTIQUE, LA MÉTHODE DES ÉLÉMENTS FINIS, CONTACT FROTTANT, ELASTICITÉ LINEAIRE, TECHNIQUE D'UZAWA,, MÉTHODE DU BIPOTENTIEL.
# 1. Introduction

Physics-based animation is becoming increasingly popular due to its use in computer games, for producing special effects in movies, and as part of surgical simulation systems. Technologies related to medical areas have enormously improved in the last two decades and the interest of interactive simulators based on advanced virtual and augmented reality techniques comes mainly from the surgeon's needs in terms of advanced teaching and training tools. Indeed, the interactive simulation associated with multimodal rendering (haptic, visual, touch ...) provides the possibility to learn faster and easier.

Surgical simulators are currently being developed at many research centers and companies to create environments to help train physicians in the use of new surgical instruments and techniques (Gibson et al., 1997, Cotin et al., 2000, Zhuang, 2000). In this type of application, the numerical context is the soft body simulation based on physical models with few contact points between surgical tools and organ tissues. Most existing simulation systems use very simple mechanical models, based on the laws of linear elasticity. Some of them include biomechanical results which indicate that biological tissues exhibit much more complex behavior, including important non-linear effects such as large displacements, visco-elasticity or hyper-elasticity materials.

To our knowledge, there is not yet an interactive simulator solving non-linear problems with a large number of contact points between deformable bodies such as in a childbirth operation or in a mini-invasive endovascular surgery. In a childbirth operation multiple contact points occur between the vagina muscles, and the head and shoulders of the baby during the delivery. In mini-invasive endovascular surgery multiple contacts occur between a long flexible catheter and the artery walls during the insertion phase.

In these new medical contexts of simulation, there is an ongoing quest for faster algorithms to solve multiple contact forces while controlling the numerical stability of the solution. For reasons of modular programming, it is very important to solve the contact forces independently of how soft tissues are modeled.

So we propose to follow an incremental mixed formulation (displacement and contact force) of the equilibrium equations and to solve separately the contact force by successive local projections of these equations in the local reference frames at contact points. In order to control the solution of the contact forces with friction, the contact laws (Signorini and Coulomb) are formulated from an augmented Lagrangian formulation and computed by an Uzawa technique which leads to an iterative predictor/corrector process. Figure 1 describes the basic principle of this method. Interested readers can find more details in (De Saxcé et al., 1998, Wriggers, 2002, Duriez, 2004).
<figure><img src="image_2.png" /><figcaption>Figure 1: Algorithmic Principle</figcaption></figure>

## 2. Characteristics of the modelling

In the HapCo simulator, the solver is based on the Finite Element Method (FEM) in linear elasticity. We consider only quasi-static analysis because of very small inertial forces in medical applications. The nodal displacements are composed of a rigid part and a linear elastic part. The nodal rigid displacements are given directly by a Phantom desktop haptic device (Figure 2), so only the nodal elastic displacements and the contact forces are unknowns of the modelling.

When a contact occurs between two elastic solids, the unilateral contact law and the dry friction law are taken into account. The unilateral contact law is characterized by a geometric condition of non penetration, a static condition of no-adhesion and a mechanical complementary condition. These three conditions are known as Signorini conditions expressed, for each contact point, in terms of the signed contact distance $x_n$ and the normal contact force $r_n$ by:

$$ \text{Signor}(x_n, r_n) \hat{U} \quad x_n > 0, r_n > 0 \quad \text{and} \quad x_n \cdot r_n = 0 \qquad [1] $$

Classically, a rate independent dry friction law is characterized by a kinematic slip rule. In this work, the classic Coulomb friction rule is used and defined by:

$$ \text{Coul}(\ddot{\mathbf{x}}_t, \mathbf{r}_t) \hat{U} \quad \text{if } \|\mathbf{x}_t\| = 0 \text{ then } \|\mathbf{r}_t\| \le m_n \text{ else } \mathbf{r}_t = -m_n \frac{\dot{\mathbf{x}}_t}{\|\dot{\mathbf{x}}_t\|} \qquad [2] $$

where $\dot{\mathbf{x}}_t, \mathbf{r}_t$ are respectively the relative tangential velocity and the tangential contact and $\mu$ the coefficient of friction.

# 3. Description of the HapCo Simulator

## 3.1 Description of the application
The application simulates two 3D deformable parallelepipeds in collision (but it
can be extended to other 3D objects with different shapes). The first one is
manipulated by means of the Phantom haptic device (Figure 2) and the second one
is clamped at one extremity. A force is computed and returned to the Phantom when
a collision occurs such that the user can feel the haptic feedback force in real time.
Figure 3 describes the principle of the interactive simulation in HapCo.

<figure><img src="image_3.png" /><figcaption>**Figure 2: Phantom Desktop Haptic Device.**</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>**Figure 3: Interactive Simulation Process in HapCo.**</figcaption></figure>
The sample frequency of the elapsed time must be superior to 25 Hz to have an accurate visual rendering and superior to 300 Hz to have an accurate haptic force rendering.

## 3.2 Description of the Software

HapCo is developed in the Visual C++ environment. It includes the OpenGL Dynamic Link Library to obtain 3D visual rendering, the Ghost SDK support to provide the accurate positioning of the Phantom Desktop and to control the force feedback. Figure 4 shows the Graphical User Interface of HapCo. It is composed of two windows. The first one is dedicated to the graphic view of all objects in the virtual scene. The second one is used to edit material constants (Young's modulus and Poisson's ratio), to modify the Dirichlet boundary conditions and to set the visual graphic mode (wire, normal or transparent view).

<figure><img src="image_5.png" /><figcaption>Figure 2: HapCo Graphical User Interface</figcaption></figure>

The input file of HapCo contains the structural elastic parameters, the nodal positions and the connectivity table of tetrahedral or cubic finite elements. This file is generated from the export file of standard CAD software. After reading the input file, the program creates the CSolid class for each elastic solid following the concept of Oriented Object Programming (OOP). The CSolid class contains all necessary
data and functions to describe and compute the elastic model. Then we initialize the CSolid class to realize the following operations:

* Detect the external nodal points on the envelope of the elastic solid and re-index all the nodal points in order to optimize the displacement solver,

* Build and inverse the global stiffness matrix.

These operations are expensive in CPU time and have to be done “off line”, i.e., they are preformed only once during the initialisation phase. In case of nonlinear modelling, the stiffness matrix is no longer constant and it must be computed at each increment of the interactive simulation. The displacement solver in that case is based on the LU decomposition of the stiffness matrix.

## 4. Conclusion

HapCo represents our first contribution to bridge two domains, the computational mechanics and the haptic rendering in the context of Virtual Reality. This real time simulator with haptic force feedback includes elastic deformable objects, collision detection between interacting solids, friction contact force computation and displacement solver based on the Finite Element Method. We are working now on acceleration methods in order to consider non linear elasticity modelling and large multi-contact problems: childbirth simulation for example.

## 5. References

Cotin S., Dellingette H., Ayache N., «A hybrid elastic model allowing real-time cutting, deformations and force feedback for surgery training and simulation», Visual Computer, 16(7), 437-452, 2000.

De Saxcé G., Feng Z.Q., «The bipotential method: a constructive approach to design the complete contact law with friction and improved numerical algorithms, Mathematical and Computer Modeling», special issue, *Recent Advances in Contact Mechanics*, 28(4–8), 225-245, 1998.

Duriez C., Contact frottant entre objets déformables dans des simulations temps reel avec retour haptique, Ph.D. Thesis, Evry University, 2004.

Gibson S. F. F., Mirtich B, A survey of deformable modeling in computer graphics, Tech. Report No. TR-97-19, Mitsubishi Electric Research Lab, Cambridge, MA, November 1997.

Wriggers P., *Computational contact mechanics*, John Wiley & Sons, 2002.

Zhuang Y., Real-time simulation of physically realistic global deformations, Ph.D. Thesis, University of California at Berkeley, 2000.