Arithmetic and Trigonometric Simplifications

To simplify multibody expressions containing unnecessary null data or similar terms which cancel each other, any encountered expression is recursively reorganized by ROBO-TRAN on the basis of a so-called *multibody priority rule* (e.g., a force symbol has a lesser priority than a mass symbol but has a higher priority than a generalized coordinate) as illustrated in the following priority "<" relationship:

$$m^i < d^{ij} < F^i\_{\text{ext}} < q^i < \sin \omega \cos < b \* c < (a - d) \tag{14}$$

in which we have intentionally classified expressions with respect to their physical meaning (ex.: mass, length, force, generalized coordinates, sine and cosine, etc.) in addition to their arithmetical nature.

For purely illustrative purposes, here are some excerpts of the symbolic generation of the inverse dynamics of a mechanism (articulation 2). *qk*, *qdk*, and *qddk*, respectively, represent the generalized coordinate, velocity and acceleration associated with joint *k*, *mi*, and *bij* are, respectively, masses and barycentric vectors. Dij and Ljk are geometric vectors. Pre-computations:

$$S1 = \sin(q1); S2 = \sin(q2); \mathbb{C}1 = \cos(q1); S3 = \sin(q3);$$

$$q1p2 = q1 + q2; q2p3 = q2 + q3; q1p2p3 = q1p2 + q3;$$

$$S1p2 = \sin(q1p2); S2p3 = \sin(q2p3); S1p2p3 = \sin(q1p2p3);$$

*mb*2 = *m*2 + *m*3; *b*11 = *m*1 ∗ *L*11; *b*21 = *m*2 ∗ *L*12 + *m*3 ∗ *D*13; *b*31 = *m*3 ∗ *L*13; *b*32 = *m*3 ∗ *L*23;

Inverse dynamics (excerpt):

$$Q(2) = b11 \ast qdd1 \ast C1\dots - b31 \ast qd1 \ast qd1 \ast S1p2p3\dots - 2 \ast b21 \ast qd1 \ast qd2 \ast S1p2\dots - mb2 \ast g.$$

When dealing with a given symbolic expression (whatever its length and complexity), the ROBOTRAN symbolic engine *recursively* refers to the above priority rule (14) to ensure that the final form of any expression will be *purged* of zero parameters and of consecutive identical terms—or sub-expressions—with opposite signs.

As regards trigonometric expressions, which can be very numerous in MBS due to the 3D rotations, an internal process is activated to drastically simplify them, as illustrated by the following example (in which *C* and *S* stand for the *sine* and *cosine* functions, respectively, and *Sij* denotes the *sine* of the sum of the generalized coordinates *q<sup>i</sup>* and *q<sup>j</sup>* ).

$$\text{C2} \ast \text{C4} \ast \text{C56} \ast \text{C56} \ast \text{S8} + \text{C2} \ast \text{C4} \ast \text{S56} \ast \text{S56} \ast \text{S8} + \text{C2} \ast \text{S4} \ast \text{S56} \ast \text{C8}$$

$$+S\\2\*C\\4\*S\\56\*C\\8-S\\2\*S\\4\*C\\56\*C\\56\*S\\8-S\\2\*S\\4\*S\\56\*S\\56\*S\\8$$

is automatically simplified on-line by ROBOTRAN into:

$$C24\*S8 + S24\*S56\*C8$$

leading to far more efficient trigonometric computation.

#### Generation of Recursive Schemes

The formalism governing the generation of the direct or inverse dynamics (Equations (3) and (4)), uses a recursivity principle to compute all the variables along the tree-like structure of the MBS. For instance, the kinematic relation which expresses the absolute angular velocity *ω*<sup>3</sup> of a given body 3 with respect to that of its parent body 2, *ω*<sup>2</sup> is written in a vector form as

$$
\omega^3 = \omega^2 + \Omega^{23} \tag{15}
$$

where *Ω*<sup>23</sup> represents the *relative* angular velocity vector of body 2 with respect to body 3.

Among the three components of this vector (and of all vectors recursively computed in the same manner as vector *ω*<sup>3</sup> in (15)), one surprisingly notices that some of them are squarely useless for the final form of the equations of motion (3) or (4). This can represent up to 30% of the intermediate equations such as some components of the above vector Equation (15): the ROBOTRAN symbolic engine can detect all of them before printing, via the use of a double-linked list containing the full set of recursive equations of type (15), and by tracing their individual utility for the final expected result, such as the mass matrix *M*(*q*) or the generalized accelerations *q*¨.

#### Constrained MBS: Fully Symbolic Models

Let us rewrite the semi-explicit form (12) in an explicit way in terms of the independent accelerations *u*¨*u*:

$$\ddot{u}\_{\text{ul}} = f(u\_{\text{ul}}, \dot{u}\_{\text{ul}}, u\_{\text{d}}, \dot{u}\_{\text{d}}, \ddot{u}\_{\text{d}}, frc, trq) \tag{16}$$

Thanks to the current ROBOTRAN symbolic engine capabilities, particularly in terms of memory management, it is possible to generate the independent accelerations *u*¨*<sup>u</sup>* according to Equation (16) in a *fully symbolic* manner (Figure 6) and in the form of a unique set of recursive equations of type (15), which successfully compute (in C or Python):


**Figure 6.** Fully symbolic generation of constrained MBS models.

Nowadays, this represents the most efficient symbolic direct dynamics model that ROBOTRAN can provide, making the most of its symbolic engine capabilities. More details on the above symbolic manipulations and tricks underlying the ROBOTRAN process can be found in details in [8].

#### **4. Hardware Framework**

The dynamic models obtained from the above symbolic multibody approach represent the key ingredient of our haptic device framework. Various competing—or even complementary—approaches can be used to reduce the computational complexity of the model, e.g., via deep learning techniques [31] or to make the most of object-oriented languages [32] and parallel programming [33]. Some results are promising but currently remain limited to rather simple MBS [31]. Regarding parallel computation, let us point out that symbolic generation lends itself perfectly to the vectorization of multibody models [8] and represents a promising avenue of exploitation of GPUs or FPGAs architectures in order to further improve model computation performances.

This section will detail the relationship between the multibody model and the human, that are both *in-the-loop*. In particular, we will describe the coupling between ROBOTRAN and the middleware ROS.

#### *4.1. Specifications*

First, as the haptic device is designed to be manipulated by a person, the apparatus specifications must meet some requirements of the human body. The human somatosensory system is composed of many sensors present at different levels of perception. According to the authors of [34], the exact contribution of the various mechanoreceptive channels to the formation of haptic perception remains to be established. Moreover, the physical values of perception, that are still the topic of fundamental researches, strongly depend on the application at hand. As regards tactile sensitivity, the latter is hard to characterize in term of frequency sensed [35] and force measurable [36] and needs psychophysical experiments to be able to understand the human tactile perception [37]. Generally speaking, it would appear that an update frequency of 1 kHz is considered as acceptable for human interactions [26,34,35].

In the scope of this paper, only the force feedback is considered, as the physical interface of our devices is exactly the same between the real object and its haptic equivalent, see Sections 5.1 and 5.2. In other words, the above-mentioned tactile sensitivity is intrinsically representative in our applications.

Second, the hardware design of a haptic device is a bidirectional apparatus that contains both motors and sensors, as it is for the human [38]. The latter may inject energy at some point, while receiving energy from the device at another time [39]. This bidirectionality is the most distinguishing feature of haptic interfaces [40].

The sensor resolution must be sufficient, especially when the movement is fast and small [41]. Of course, the sensors must not influence the device behavior, whose dynamics must satisfy the physics laws such as that of Newton [26].
