Philippe Lemoine

Wisama Khalil

Symbolic Dynamics

à 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.

Overview

The dynamics of robots involves the development of their equations of motion, which describe the relationship between the input joint efforts (forces or torques) and the output motion. In this entry, two basic models will be treated: the inverse dynamic model (IDM), and the Direct Dynamic Model (DDM). The IDM is used in control applications: It calculates the input joint efforts to achieve a set of prescribed joint accelerations. The DDM is used in simulation applications: It calculates the 1 Ph. Lemoine École Centrale de Nantes Laboratoire des Sciences du Numérique de Nantes (LS2N), UMR CNRS 6004 1 rue de la Noë, 44321 Nantes Cedex 3 -France e-mail : philippe.lemoine@ls2n.fr 2 W. Khalil deceased in November 2017 during the redaction of this entry. He has been Professor at École Centrale de Nantes and has done his research work at LS2N. joint accelerations resulting from a set of input joint efforts. The study is focused on tree-structure robots with rigid links. The generalization to robots with rigid links and flexible joints is straightforward using the same technique.

As an application in this entry, the IDM of an RRP serial robot will be given.

Dynamic Modeling Algorithms

General Form of the Equations of Motion

The general form of the dynamic equations of motion of tree structure robot with 𝑛𝑛 joints can be written using Lagrange equations as follows [START_REF] Angeles | Fundamentals of robotic mechanical systems -theory, methods, and algorithms[END_REF][START_REF] Khalil | Modeling, identification and control of robots[END_REF]:

𝝉𝝉 = 𝑴𝑴(𝒒𝒒)𝒒𝒒̈+ 𝒄𝒄(𝒒𝒒, 𝒒𝒒̇) (1)
where 𝒒𝒒, 𝒒𝒒̇, 𝒒𝒒̈, 𝝉𝝉 are (n×1) vectors representing the joint positions, velocities and accelerations and input efforts respectively, 𝑴𝑴(𝒒𝒒) is the inertia matrix of the robot, the vector 𝒄𝒄(𝒒𝒒, 𝒒𝒒̇) represents the Coriolis, centrifugal, and gravity efforts.

The IDM can be obtained directly from Eq. ( 1). It will be denoted by: 𝝉𝝉 = 𝒊𝒊𝒊𝒊𝒊𝒊(𝒒𝒒, 𝒒𝒒̇, 𝒒𝒒̈)

The DDM is obtained from Eq. ( 1) by: 𝒒𝒒̈= 𝑴𝑴 -𝟏𝟏 (𝒒𝒒)�𝝉𝝉 -𝒄𝒄(𝒒𝒒, 𝒒𝒒̇)�

It will be denoted by: 𝒒𝒒̈= 𝒊𝒊𝒊𝒊𝒊𝒊(𝒒𝒒, 𝒒𝒒̇, 𝝉𝝉) (4)

Efficient Dynamic Modeling Algorithms

The first works in robot dynamics computation used Lagrangian formulation [START_REF] Uicker | Dynamic behavior of spatial linkages[END_REF][START_REF] Kahn | The near minimum time control of open loop articulated kinematic chains[END_REF], but the proposed model needed more than 100,000 mathematical operations to calculate the IDM of a 6 degrees of freedom (dof) robot.

To reduce this cost of calculation, three tools have been used: a) neglecting some elements to obtain an approximated model, b) developing new efficient algorithms, and c) using symbolic software computation which can take into account the particular values of the robot parameters.

A breakthrough result in the development of efficient algorithms for IDM computation was reported by [START_REF] Luh | On-line computational scheme for mechanical manipulators[END_REF]) who proposed a recursive Newton-Euler formulation for serial kinematic chains. The algorithm consists of two recursive equations: a forward one, starting from the base link toward the end-effector link, which computes the link kinematics, followed by a backward one, starting from the end-effector link toward the base link, which computes the joint generalized forces. The number of mathematical operations of this algorithm using numerical computations are 137𝑛𝑛-22 multiplications and 101𝑛𝑛-11 additions, which is linearly proportional to the number of joints (𝑂𝑂(𝑛𝑛)). It gives the inverse dynamic model of a 6 dof serial robot with 800 multiplications and 595 additions. To obtain the DDM, [START_REF] Walker | Efficient dynamic computer simulation of robotics mechanism[END_REF] proposed to use Eq. ( 3), after calculating the matrix 𝑴𝑴(𝒒𝒒) and the vector 𝒄𝒄(𝒒𝒒, 𝒒𝒒̇) by the efficient inverse dynamic algorithm of [START_REF] Luh | On-line computational scheme for mechanical manipulators[END_REF].

The calculation cost of 𝑴𝑴 can be considerably reduced by using the composite link inertia matrix, and taking into account the fact that 𝑴𝑴 is symmetric [START_REF] Walker | Efficient dynamic computer simulation of robotics mechanism[END_REF].

An efficient solution for the DDM for serial chain is proposed in [START_REF] Featherstone | The calculation of robot dynamics using articulated-body inertias[END_REF]. The cost of this algorithm using numerical computation is 𝑂𝑂(𝑛𝑛) and takes 300𝑛𝑛-267 multiplications and 279𝑛𝑛-259 additions. For 𝑛𝑛=6, these figures yield 1533 multiplications and 1415 additions. It provides the DDM without calculating the inverse inertia matrix. This algorithm is based also on Newton-Euler formulation using three recursive equations.

Generalization of Luh and Featherstone Works

Based on the results of [START_REF] Luh | On-line computational scheme for mechanical manipulators[END_REF] and [START_REF] Featherstone | The calculation of robot dynamics using articulated-body inertias[END_REF], the following developments have been achieved:

-Development of symbolic customized programs in order to take advantage of the special structure of each robot [START_REF] Khalil | Minimum operations and minimum parameters of the dynamic model of tree structure robots[END_REF][START_REF] Khosla | Real-time control and identification of direct drive manipulators[END_REF]. This leads to reduce the computational cost by a factor around 5. -Dynamics of tree-structure and closed-loop robots. This work is realized thanks to the proposition of a new method to describe the structure of these systems [START_REF] Khalil | A new geometric notation for open and closed-loop robots[END_REF]). -Operational Space dynamics [START_REF] Lilly | Efficient O(N) computation of the operational space inertia matrix[END_REF][START_REF] Khatib | A unified approach for motion and force control of robot manipulators: the operational space formulation[END_REF]).

-Hybrid dynamic models [START_REF] Featherstone | Rigid body dynamics algorithms[END_REF], where the inverse and direct notions are defined on the joint level. The accelerations of some joints are supposed known, and their input efforts must be calculated (inverse problem), whereas the input efforts of the other joints are known and their output accelerations must be calculated (direct problem). -Dynamics of floating base systems [START_REF] Featherstone | Rigid body dynamics algorithms[END_REF][START_REF] Khalil | Open SYMORO: an open source software package for symbolic modeling of robots[END_REF].

-Dynamics of robots with flexible joints and flexible links, which is discussed in section 7.1.

The next section is devoted to the symbolic generation of IDM of tree-structure systems. The other models and other system programing can be obtained easily using the same strategy.

Automatic Generation of the Symbolic IDM of Tree-Structure Robots

Introduction

The automatic generation purpose is to develop a computer program that can provide the dynamic models of robots with efficient, accurate, and error-free results. Furthermore, if the model must be implemented on a real system for control purpose or to be called many times in an analysis application, the computational cost of the given model must be reduced. From the overview of the modeling algorithms presented in section 2, it can be deduced that efficient computational algorithms are now available for calculating IDM and DDM for robots with rigid or flexible links. Furthermore, they are purely algebraic and their computation is composed of matrix operations without differentiation. This section discusses how to use the algorithms mentioned in section 2 to obtain an optimized model. To facilitate the presentation, this section will be focused on the IDM of tree-structure robots with rigid links and fixed base. The tree-structure IDM can also be exploited in the modeling of closedloop robots, whose computation is based on modeling at first a virtual tree structure system [START_REF] Khalil | Minimum operations and minimum parameters of the dynamic model of tree structure robots[END_REF][START_REF] Nakamura | A computational scheme of closed link robot dynamics derived by d'Alembert principle[END_REF][START_REF] Featherstone | The calculation of robot dynamics using articulated-body inertias[END_REF] which is then closed using loop-closure constraint equations that can be considered using either Lagrange multipliers or virtual power principle.

Description of the Robot

The tree structure rigid system is described using Khalil and Kleinfinger notations [START_REF] Khalil | A new geometric notation for open and closed-loop robots[END_REF][START_REF] Khalil | Modeling, identification and control of robots[END_REF]. The structure is composed of 𝑛𝑛+1 links and 𝑛𝑛 joints. Link 𝑗𝑗 is articulated on joint 𝑗𝑗. The links and joints are numbered such that the numbers increase outward from the base. The topology of the system is defined by the (n×1) vector of precedent links, such that the elements 𝑝𝑝(𝑗𝑗) defines the link precedent to link 𝑗𝑗. The type of the joint is defined by the parameter 𝜎𝜎 𝑗𝑗 , which is equal to 0 if joint 𝑗𝑗 is revolute, and equal to 1 if joint 𝑗𝑗 is prismatic. We also have 𝜎𝜎 𝑗𝑗 =1-𝜎𝜎 𝑗𝑗 . A frame ℱ 𝑗𝑗 is attached to each link 𝑗𝑗 such that:

i-𝒛𝒛 𝑗𝑗 is along the axis of joint 𝑗𝑗;

ii-𝒙𝒙 𝑗𝑗 is along the common normal between 𝒛𝒛 𝑗𝑗 and one of the succeeding joint axes. The homogeneous transformation matrix 𝑻𝑻 𝑖𝑖 𝑗𝑗 , defining frame ℱ 𝑗𝑗 with respect to (wrt) frame ℱ 𝑖𝑖 , is obtained in general as a function of six geometric parameters 𝛾𝛾 𝑗𝑗 , 𝑏𝑏 𝑗𝑗 , 𝛼𝛼 𝑗𝑗 , 𝑑𝑑 𝑗𝑗 , 𝜃𝜃 𝑗𝑗 , 𝑟𝑟 𝑗𝑗 [START_REF] Khalil | Modeling, identification and control of robots[END_REF]. However, if 𝒙𝒙 𝑖𝑖 is along the common normal between 𝒛𝒛 𝑖𝑖 and 𝒛𝒛 𝑗𝑗 , both 𝛾𝛾 𝑗𝑗 and 𝑏𝑏 𝑗𝑗 will be zero. The matrix 𝑻𝑻 𝑖𝑖 𝑗𝑗 will be denoted as:

𝑻𝑻 𝑖𝑖 𝑗𝑗 = � 𝑹𝑹 𝑖𝑖 𝑗𝑗 𝑷𝑷 𝑖𝑖 𝑗𝑗 𝟎𝟎 1×3 1 � (5)
where 𝑹𝑹 𝑖𝑖 𝑗𝑗 is the (3×3) rotation matrix and 𝑷𝑷 𝑖𝑖 𝑗𝑗 is the translation vector of frame 𝑗𝑗 with respect to frame 𝑖𝑖.

Note that the definition of ℱ 𝑗𝑗 such that its 𝒛𝒛 𝑗𝑗 axis is along the axis of joint 𝑗𝑗, leads to symbolic expressions which are simpler than those obtained using 𝒛𝒛 𝑗𝑗 along the joint axis 𝑗𝑗+1. Taking 𝒛𝒛 𝑗𝑗 along the joint axis 𝑗𝑗 allows also to calculate the minimum inertial parameters, using simple rules [START_REF] Khalil | Calculation of the minimum inertial parameters of tree structure robots[END_REF][START_REF] Gautier | Direct calculation of minimum set of inertial parameters of serial robots[END_REF][START_REF] Khalil | Comments on direct calculation of minimum set of inertial parameters of serial robots[END_REF]. The Newton-Euler formulation describes the dynamics of a body in terms of forces and moments acting on it.

Newton-Euler Formulation

The resultant of total wrenches (forces and moments) on link 𝑗𝑗 can be deduced from Fig. 1, as:

𝑭𝑭 𝑡𝑡𝑗𝑗 = 𝑭𝑭 𝑗𝑗 -∑ 𝑭𝑭 𝑘𝑘 𝑘𝑘 -𝑭𝑭 𝑒𝑒𝑒𝑒𝑗𝑗 (6)
Where

𝑭𝑭 𝑡𝑡𝑗𝑗 = �𝒇𝒇 𝑡𝑡𝑗𝑗 𝑇𝑇 𝒏𝒏 𝑡𝑡𝑗𝑗 𝑇𝑇 � 𝑇𝑇
is the total wrench on the link 𝑗𝑗, composed of a force 𝒇𝒇 𝑡𝑡𝑗𝑗 and a moment 𝒏𝒏 𝑡𝑡𝑗𝑗 , 𝑭𝑭 𝑗𝑗 is the reaction wrench on link 𝑗𝑗 due to its precedent link 𝑖𝑖, where 𝑖𝑖=𝑝𝑝(𝑗𝑗), 𝑭𝑭 𝑒𝑒𝑒𝑒𝑗𝑗 is the supposed known external wrench exerted by link 𝑗𝑗 on the environment, and 𝑭𝑭 𝑘𝑘 is the reaction wrench of link 𝑗𝑗 on link 𝑘𝑘, with 𝑝𝑝(𝑘𝑘)=𝑗𝑗. If link 𝑗𝑗 is a terminal link, the wrench 𝑭𝑭 𝑘𝑘 will be eliminated.

Inverse Dynamic Model Algorithm

We denote by 𝑽𝑽 ̇𝑗𝑗 the acceleration of link 𝑗𝑗, which is composed of the linear acceleration of the origin of frame 𝑗𝑗, noted 𝒗𝒗̇𝑗𝑗, and the angular acceleration of frame 𝑗𝑗,

noted 𝝎𝝎̇𝑗𝑗, such that 𝑽𝑽 ̇𝑗𝑗 = �𝒗𝒗̇𝑗𝑗 𝑇𝑇 𝝎𝝎̇𝑗𝑗 𝑇𝑇 � 𝑇𝑇 .
Recall that the inverse dynamic algorithm is composed of two recursive equations:

𝑖𝑖 = 𝑝𝑝(𝑗𝑗) 𝝎𝝎 𝑗𝑗 𝑗𝑗 = 𝑹𝑹 𝑗𝑗 𝑖𝑖 𝝎𝝎 𝑖𝑖 𝑖𝑖 + 𝜎𝜎 𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑗𝑗 𝑞𝑞̇𝑗𝑗 = 𝝎𝝎 𝑖𝑖 𝑗𝑗 + 𝜎𝜎 𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑗𝑗 𝑞𝑞̇𝑗𝑗 (7) 𝑽𝑽 ̇𝑗𝑗 𝑗𝑗 = 𝑺𝑺 𝑖𝑖 𝑗𝑗 𝑽𝑽 ̇𝑖𝑖 𝑖𝑖 + 𝑞𝑞̈𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑗𝑗 + � 𝑹𝑹 𝑗𝑗 𝑖𝑖 � 𝝎𝝎 𝑖𝑖 𝑖𝑖 × � 𝝎𝝎 𝑖𝑖 𝑖𝑖 × 𝑷𝑷 𝑖𝑖 𝑗𝑗 �� + 2𝜎𝜎 𝑗𝑗 � 𝝎𝝎 𝑖𝑖 × 𝑞𝑞̇𝑗𝑗 𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑗𝑗 � 𝜎𝜎 𝑗𝑗 � 𝝎𝝎 𝑖𝑖 × 𝑞𝑞̇𝑗𝑗 𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑗𝑗 � � (8) 𝑭𝑭 𝑗𝑗 𝑡𝑡𝑗𝑗 = 𝑰𝑰 𝑜𝑜𝑗𝑗 𝑽𝑽 ̇𝑗𝑗 𝑗𝑗 + � 𝝎𝝎 𝑗𝑗 𝑗𝑗 × � 𝝎𝝎 𝑗𝑗 𝑗𝑗 × 𝒊𝒊𝒎𝒎 𝑗𝑗 � 𝝎𝝎 𝑗𝑗 𝑗𝑗 × �𝑰𝑰 𝑜𝑜𝑗𝑗 𝝎𝝎 𝑗𝑗 𝑗𝑗 � � (9)
with:

𝒊𝒊𝒎𝒎 𝑗𝑗 = �𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 � 𝑇𝑇 , 𝑰𝑰 𝑜𝑜𝑗𝑗 = � 𝑚𝑚 𝑗𝑗 𝟏𝟏 3 -𝒊𝒊𝒎𝒎 � 𝑗𝑗 𝒊𝒊𝒎𝒎 � 𝑗𝑗 𝑰𝑰 𝑜𝑜𝑗𝑗 � , 𝑰𝑰 𝑜𝑜𝑗𝑗 = � 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 𝑚𝑚𝑚𝑚 𝑗𝑗 �
where:

-The upper-left index on the foregoing vectors indicates the projection frame.

-𝑖𝑖= 𝑝𝑝(𝑗𝑗), indicates the link precedent to link 𝑗𝑗.

-𝒂𝒂 𝑗𝑗 𝑗𝑗 =[0 0 1] 𝑇𝑇 is the (3×1) unit vector along the axis of joint 𝑗𝑗.

-𝑺𝑺 𝑖𝑖 𝑗𝑗 the (6×6) screw transformation matrix of frame 𝑖𝑖 wrt to frame 𝑗𝑗, its elements can be obtained from 𝑻𝑻 𝑖𝑖 𝑗𝑗 .

𝑺𝑺 𝑖𝑖 𝑗𝑗 = � 𝑹𝑹 𝑗𝑗 𝑖𝑖 -𝑹𝑹 𝑗𝑗 𝑖𝑖 𝑷𝑷 � 𝑗𝑗 𝑖𝑖 𝟎𝟎 3𝑒𝑒3 𝑹𝑹 𝑗𝑗 𝑖𝑖 � (10)
-𝒂𝒂 𝑗𝑗 𝑗𝑗 is the (6×1) vector given by:

𝒂𝒂 𝑗𝑗 𝑗𝑗 = � 𝒂𝒂 𝑗𝑗 𝑇𝑇 𝑗𝑗 𝜎𝜎 𝑗𝑗 𝒂𝒂 𝑗𝑗 𝑇𝑇 𝑗𝑗 𝜎𝜎 𝑗𝑗 � 𝑇𝑇 = �0 0 𝜎𝜎 𝑗𝑗 0 0 𝜎𝜎 𝑗𝑗 � 𝑇𝑇 (11)
-𝑰𝑰 𝑜𝑜𝑗𝑗 is the (6×6) spatial inertia matrix of link 𝑗𝑗. The symbols 𝑚𝑚 𝑗𝑗 , 𝒊𝒊𝒎𝒎 𝑗𝑗 , 𝑰𝑰 𝑜𝑜𝑗𝑗 denote respectively, the mass, the (3×1) first moments vector, and the (3×3) inertia matrix at the origin of the local frame ℱ 𝑗𝑗 fixed with link 𝑗𝑗 [START_REF] Khalil | Modeling, identification and control of robots[END_REF]. Their 10 components are called the standard inertial parameters of link 𝑗𝑗.

-𝒊𝒊𝒎𝒎 � 𝑗𝑗 defines the (3×3) skew matrix of the vector product associated with the vector 𝒊𝒊𝒎𝒎 𝑗𝑗 .

-𝟏𝟏 3 is the (3×3) identity matrix. It should be mentioned that 𝑭𝑭 𝑖𝑖 𝑒𝑒𝑒𝑒𝑖𝑖 is first initialized to the known external wrench applied by link 𝑖𝑖 on the environment. It is then modified by Eq. ( 14) to include the contribution of link 𝑗𝑗 and at last used in Eq. ( 12) to continue the process of computation.

Note: Expressing the vectors of link 𝑗𝑗 in the local frame ℱ 𝑗𝑗 reduces considerably the cost of the computation, in particular because the inertial parameters 𝒊𝒊𝒎𝒎 𝑗𝑗 and 𝑰𝑰 𝑜𝑜𝑗𝑗 are constant wrt this frame, and the unit vector along the joint axis 𝑗𝑗 is

𝒂𝒂 𝑗𝑗 𝑗𝑗 𝑇𝑇 =[0 0 1].

Input Data

In order to generate the IDM, the program requires an input file containing the information required to calculate the desired output model.

An example of such a file describing an RRP serial robot is given in the section 4. The data needed can be summarized as follows:

a) The numerical values defining the structure: The number of joints is given by the parameter n. The type of joints and the topology of the system are given by the lists sigma and p, respectively, whose components correspond to the 𝜎𝜎 𝑗𝑗 and 𝑝𝑝(𝑗𝑗) values as defined in the section 3.2. b) The geometric parameters 𝛾𝛾 𝑗𝑗 , 𝑏𝑏 𝑗𝑗 , 𝛼𝛼 𝑗𝑗 , 𝑑𝑑 𝑗𝑗 , 𝜃𝜃 𝑗𝑗 , 𝑟𝑟 𝑗𝑗 defining the local frames are represented by the lists gamma, b, alpha, d, theta, and r, respectively. c) The inertia parameters 𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 are represented by the lists M, MX, MY, MZ, XX, XY, XZ, YY, YZ, and ZZ. d) The external efforts components 𝑓𝑓𝑚𝑚 𝑗𝑗 , 𝑓𝑓𝑚𝑚 𝑗𝑗 , 𝑓𝑓𝑚𝑚 𝑗𝑗 , 𝑛𝑛𝑚𝑚 𝑗𝑗 , 𝑛𝑛𝑚𝑚 𝑗𝑗 , 𝑛𝑛𝑚𝑚 𝑗𝑗 are given in the FX, FY, FZ, CX, CY, and CZ lists. e) The gravity vector 𝒈𝒈 = [𝑔𝑔𝑚𝑚 0 , 𝑔𝑔𝑚𝑚 0 , 𝑔𝑔𝑚𝑚 0 ] 𝑇𝑇 is given by the list G. f) The joint velocities and accelerations vectors 𝒒𝒒̇, 𝒒𝒒̈ are defined by the lists QP and QDP, respectively.

In order to simplify the formulation, we do not consider here the rotor inertia of actuators and the friction torques/forces. The simplest way to take into account the inertia 𝐼𝐼 𝑎𝑎𝑗𝑗 of the rotor and transmission system of actuator 𝑗𝑗 is to add it to the element 𝑀𝑀 𝑗𝑗𝑗𝑗 of the inertia matrix 𝑴𝑴 of Eq. ( 1). The friction torques/forces can be taken into account by adding their expression to the right-hand side of Eq. (1).

Note that some parameters are given symbolically, but some others can be given numerically. This helps in noticeably reducing the size of the final generated equations. For example, many geometric parameters have zero values, and many angles are typically 0 or ±π/2.

Symbolic Computation

Symbolic computation requires using a computer algebra system in order to obtain the model in terms of symbolic expressions. The symbolic output expressions can be generated automatically to constitute a customized numerical code such as Fortran, Mathematica, MATLAB, C, etc. This program can be used to find the numerical solution of the problem. The input of the symbolic dynamic program of tree-structure robots has been presented in the section 3.5. The values of the number of joints n, the topology of the tree-structure defined by p, and the type of the joints sigma must be given numerically. All the other parameters can be given symbolically (general), or numerically (customized). Some standard symbolic simplification instructions can be added to simplify the expressions. Although the output takes advantage of the particular values of the robot parameters (such as 0 or ±π/2), the output-expanded expressions will be complicated such that the cost of using them in a numerical program will be considerably greater than using general numerical program. The use of intermediate variables and grouping some inertial parameters together permit to obtain an efficient symbolic program.

The next section presents a simple solution for obtaining an optimized symbolic output.

Symbolic Programing Using Intermediate Variables Technique

In Robotran and ARM robotics software, the authors presented complicated methods to select the intermediate variables and to group some constant terms together. This section presents another systematic solution, which is based on the following strategy:

i-Using geometric description method, where the transformation matrices 𝑻𝑻 𝑖𝑖 𝑗𝑗 are calculated with 4 parameters in most cases, whereas the 6 parameters will be exceptional. ii-Defining the local frame of link 𝑗𝑗 such that 𝒛𝒛 𝑗𝑗 is along the joint axis 𝑗𝑗. iii-Using the base inertial parameters (minimum set of inertial parameters), which are calculated from the standard inertial parameters by eliminating some parameters and grouping some others together.

iv-Eliminating redundant calculations appearing in the general algorithm (section 3.4). For instance, the upper parts of Eqs. ( 8) and ( 9), corresponding to the calculation of 𝑽𝑽 ̇𝑗𝑗 The use of Khalil and Kleinfinger notations verifies the first two conditions. These notations allow also the definition of the base parameters using closed-form rules. For instance, if joint 𝑗𝑗 is revolute, the parameters 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 and 𝑚𝑚 𝑗𝑗 can be grouped on the inertial parameters of link 𝑝𝑝(𝑗𝑗), whereas if joint 𝑗𝑗 is prismatic, the parameters 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , 𝑚𝑚𝑚𝑚 𝑗𝑗 , and 𝑚𝑚𝑚𝑚 𝑗𝑗 can be grouped on the inertial parameters of link 𝑝𝑝(𝑗𝑗). The grouping relations are general and can be calculated using closedform relations [START_REF] Gautier | Direct calculation of minimum set of inertial parameters of serial robots[END_REF].

The use of intermediate variables [START_REF] Khosla | Real-time control and identification of direct drive manipulators[END_REF][START_REF] Khalil | Une modélisation performante pour la commande dynamique de robots[END_REF] is carried out after each computation step (matrix multiplication or addition) by replacing the expressions of the elements of a vector or a matrix by an intermediate variable when this element contains at least one mathematical operation, or composed of sin or cos functions. The obtained vectors and matrices are propagated in the subsequent equations. This procedure saves the multiplications by one (and minus one) and zero, and additions with zero. At the end, the model is obtained as a set of intermediate variables without incorporating loop computations. The list of output variables is then inspected, and the variables that have no effect on the desired output can be eliminated.

The output list can be put in the form of any desired computer code such as MATLAB, Mathematica, Fortran, C, etc.

The computation cost of the inverse dynamic model using this technique for a general robot, whose parameters are symbols without any particular values, is given by 92𝑛𝑛-127 multiplications and 81𝑛𝑛-117 additions, which represent about 55% the cost of a numerical program. This cost will be reduced considerably (to attain 20%) by increasing the number of robot parameters with particular numerical values. Let us consider the calculation of the IDM of the RRP serial robot given in Fig. 2. The input data for the customized symbolic program is given in Fig. 3. Note that the geometric parameter corresponding to the joint variable 𝑗𝑗 (joint position) is denoted qj. This is the case for the parameter thetaj when 𝑗𝑗 is revolute (sigma=0), or for the parameter rj when 𝑗𝑗 is prismatic (sigma=1). As already mentioned, in order to reduce the number of operations and improve the efficiency of the symbolic IDM output program, the determination of the base inertial parameters is carried out. The goal of this first step is to get the minimum set of inertial parameters not equal to zero and that are sufficient to calculate the dynamic model of the robot. They are obtained from the classical inertial parameters by eliminating those having no effect on the dynamic model and by regrouping some other parameters. The method that is used is described in [START_REF] Gautier | Direct calculation of minimum set of inertial parameters of serial robots[END_REF]) and [START_REF] Khalil | Comments on direct calculation of minimum set of inertial parameters of serial robots[END_REF]. It consists in applying simple rules that use closed-form relations function of the geometric parameters of the robot. The rules to apply depend on the type of the joints and the topology of the robot, so the base inertial parameters and the calculated grouping relations are specific to each type of robot. The result of this stage for the RRP serial robot example is given in the output file shown in Fig. 4, also containing the corresponding grouping relations. The standard inertial parameters that are eliminated or regrouped on other parameters are put to zero. The parameters on which other ones are regrouped have their name completed with the letter R. The grouping relations are used when replacing the symbolic value of these variables by their numerical value.

Example of Application

A new symbolic input file using the base inertial parameters is also generated and is given in Fig. 5. This input file is then used to compute the robot IDM.

A final step, called optimizer, is done after the generation of the symbolic IDM in order to reduce the number of calculations in the output program. At this time, one can select the list of the desired output variables (in the example, the joint torques are chosen) and the format of the output file (in the example, the MATLAB format is chosen). The output program is then inspected, and all the variables that are not involved in the computation of the selected output variables are eliminated, implying the elimination of their calculation. Here is the comparison of the calculation costs:

-Numerical (Luh et al.): 101𝑛𝑛-11=292 additions and 137𝑛𝑛-22=389 multiplications. -Calculation cost using standard inertial parameters: 92 additions and 95 multiplications after optimizer (152 additions and 173 multiplications before optimizer). -Calculation cost using base inertial parameters: 66 additions and 77 multiplications after optimizer (108 additions and 141 multiplications before optimizer).

The parameters that have been used to compute the IDM are recalled at the beginning of the output file given in Fig. 6.

Overview of Computer Algebra Systems for Symbolic Computation

Many software of computer algebra systems are now available. Some systems are open source, and some others are commercial. They can handle expressions and can carry out matrix operations and trigonometric simplifications. Their use in programing symbolic dynamics makes the programing procedure easy. Among the most cited computer algebra systems, we can mention:

Overview of Software Packages for Dynamic Models

The emergence of powerful processors and user-friendly languages and software led the scientific community to develop numerical programs able to cover a wide range of applications. Regarding multibody dynamics, several numerical packages were developed. Among those commonly cited are the following: Adams, Open Dynamics Engine, Simpack, PSpice, Mecano, etc. Each of them is described as a general-purpose code although, in reality, faced with the huge variety of applications, they all impose some restrictions on the modeling and analysis processes. The symbolic modeling is based on another concept where the generation of the equations is separated from the analysis process. Other than reducing the computational time, the symbolic models can be generated in different languages (Fortran, C, MATLAB, Mathematica...) and also for different environments for control optimization. They differ in their capabilities in a variety of ways including topologies (serial, tree, closed-loop, and mobile), joint models (one or more degrees of freedom, flexible), links model (rigid, flexible), input data, output models (kinematics, dynamics, identification, etc.), and underlying formalism (Newton-Euler, Lagrange), speed of calculation, accuracy, numerical integration routines, integration with other code, application support, user interface, graphics support, and cost.

Conclusion and Further Reading

This entry has presented the symbolic customized computation of the inverse dynamic model of an RRP serial robot. The model is expressed in terms of intermediate variables.

Inverse and direct dynamic models represent the most important problems in robotics dynamics; however, there are many topics in dynamics that have not been treated. For further reading, the following subjects are suggested:

Flexible Links

In this entry, the joints are supposed perfect and the links are supposed rigid. However, some structures may contain flexibility in the joints or the links that must be taken into account in order to obtain models with acceptable accuracy approaching the real response of the system. In general, the joint flexibility is modeled using lumped elasticity [START_REF] Khalil | Modeling of mechanical systems with lumped elasticity[END_REF][START_REF] Kruszewski | From Neweul to Neweul-M²: symbolical equations of motion for multibody system analysis and synthesis[END_REF][START_REF] Wittbrodt | Dynamics of flexible multibody systems. Rigid finite element method[END_REF], i.e., using 1 dof springs. The link flexibility can be approximated by finite number of lumped springs, but to obtain a correct model accuracy, a higher number of elements is required, thus increasing the computational time. To have good accuracy, the link-distributed flexibility is treated using finite elements. Some general methodologies based on the Lagrange principle that can be applied to any system are proposed [START_REF] Book | Recursive Lagrangian dynamics of flexible manipulator arms[END_REF]. Some other approaches use the generalized Newton-Euler equations that take into account the flexible variables [START_REF] Shabana | Dynamics of flexible bodies using generalized Newton-Euler equations[END_REF][START_REF] Sharf | Simulation of flexible-link manipulators: basis functions and nonlinear terms in the motion equations[END_REF][START_REF] Boyer | An efficient calculation of the flexible manipulator inverse dynamics[END_REF]. Hybrid dynamic models (inverse and direct problems) for structure with flexible links and joints are also proposed [START_REF] Khalil | General dynamic algorithm for floating base tree structure robots with flexible joints and links[END_REF].

The Identification of the Dynamic Parameters

To use the dynamic models in simulation or control, the numerical values of the inertial parameters of the links of the robot are needed. These values can be obtained by identification techniques using an identification model based in expressing the inverse dynamic model as a linear function of the inertial parameters.

An important topic related to this model is the determination of the identifiable parameters. In fact, not all of the inertial parameters can be identified; some of them have no effect and can be eliminated, and some others must be grouped together.

The symbolic form of this model is interesting since the identification must be carried out on a very big number of data.

For more details about this topic, the reader can consult [START_REF] Hollerbach | 6: model identification[END_REF][START_REF] Khalil | Modeling, identification and control of robots[END_REF][START_REF] Gautier | Numerical calculation of the base inertial parameters[END_REF]. Table 1. Examples of software packages for symbolic dynamic models

Figures

Figure 1 .

 1 Figure 1. Forces and moments acting on a link of a tree structure

  i-The forward, for 𝑗𝑗=1 to 𝑛𝑛, calculates 𝑻𝑻 𝑖𝑖 𝑗𝑗 and 𝝎𝝎 𝑗𝑗 𝑗𝑗 , 𝑽𝑽 ̇𝑗𝑗 𝑗𝑗 , 𝑭𝑭 𝑗𝑗 𝑡𝑡𝑗𝑗 using the following equations (Khalil and Dombre 2002):

  𝑇𝑇 . This permits to take into account the gravity forces on all the links.ii-The backward recursive equations calculate for 𝑗𝑗=𝑛𝑛 to 1[START_REF] Khalil | Modeling, identification and control of robots[END_REF]reaction wrench on link 𝑗𝑗 by link 𝑖𝑖, 𝑭𝑭 𝑗𝑗 𝑒𝑒𝑒𝑒𝑗𝑗 is the external wrench applied by link 𝑗𝑗 on the environment, which is supposed to be known.

  been calculated during a previous iteration, and some elements needed to calculate 𝒏𝒏 𝑗𝑗 𝑗𝑗 should have been calculated while computing 𝑼𝑼 𝑗𝑗 𝑗𝑗 .

Figure 2 .

 2 Figure 2. Example of an RRP serial robot

Figure 3 .

 3 Figure 3. Example of symbolic input file for the RRP serial robot

Figure 4 .

 4 Figure 4. Base inertial parameters and grouping relations of the RRP serial robot

Figure 5 .

 5 Figure 5. Symbolic input file using the base inertial parameters of the RRP serial robot

Figure 6 .

 6 Figure 6. Symbolic IDM output file of the RRP serial robot in MATLAB format

Figure 1 .

 1 Figure 1. Forces and moments acting on a link of a tree structure Figure 2. Example of an RRP serial robot Figure 3. Example of symbolic input file for the RRP serial robot Figure 4. Base inertial parameters and grouping relations of the RRP serial robot Figure 5. Symbolic input file using the base inertial parameters of the RRP serial robot Figure 6. Symbolic IDM output file of the RRP serial robot in MATLAB format

  Figure 1. Forces and moments acting on a link of a tree structure Figure 2. Example of an RRP serial robot Figure 3. Example of symbolic input file for the RRP serial robot Figure 4. Base inertial parameters and grouping relations of the RRP serial robot Figure 5. Symbolic input file using the base inertial parameters of the RRP serial robot Figure 6. Symbolic IDM output file of the RRP serial robot in MATLAB format

Table 1

 1 lists some of these software packages.

	Software	Main characteristics
	Carsim	Focuses on vehicle dynamics
	Maplesim	Graphical modeling (Shi and McPhee 2000) Rigid and flexible multibody systems
	MOBILE	Object-oriented approach (Kecskemethy 1993; Kecskemethy et al. 1997) Multibody mechatronic systems
	MotionGenesis	Produces Fortran programs for simulation
	Neweul-M²	Uses the MATLAB environment (Kurz et al. 2010) Mechanical multibody systems
	Robotran	Generates kinematic and dynamic models of rigid and flexible multibody systems in MATLAB, Python, or C subroutines
		Uses the Maple environment (Kawasaki and Shimizu 1999)
	ROSAM II	Generates kinematic and dynamic symbolic models and calculates the
		base parameters of serial, tree-structured, and closed-loop robots
	SD/FAST	Provides symbolic equations as C or Fortran source code

SYMORO+

Uses the

[START_REF] Khalil | A new geometric notation for open and closed-loop robots[END_REF]

notations. Generates geometric, kinematic, and dynamic models. Calculates the base inertial parameters and generates dynamic identification models. Output models generated in MATLAB, Mathematica, Maple, Fortran, or C source code Table

1

. Examples of software packages for symbolic dynamic models

Axiom open source http://axiom-developer.org DoCon open source http://www.botik.ru/pub/local/Mechveliani/docon/2.12 Maxima open source https://maxima.sourceforge.io Reduce open source https://reduce-algebra.sourceforge.io SymPy open source https://www.sympy.org Maple commercial https://www.maplesoft.com Mathematica commercial https://www.wolfram.com/mathematica MuPAD commercial https://www.mathworks.com/discovery/mupad.html See also https://www.mathworks.com/products/symbolic.html (MuPAD constitutes the Symbolic Math Toolbox of MATLAB since 2008)

However, some software packages have been developed using general purpose programing languages such as Fortran or C++ after developing their own symbolic manipulation library.

Cross-references

-Kinematics -Dynamics Calculation Methods -Recursive Newton-Euler Algorithm -Dynamics Simulation -Closed-Loop Dynamics -Dynamics of Parallel Robots