Dynamics of serial kinematic chains with

A. Agarwal · S.V. Shah · S. Bandyopadhyay · S.K. Saha

Received: 16 September 2012 / Accepted: 28 June 2013 © Springer Science+Business Media Dordrecht 2013

Abstract This paper investigates the dynamic behaviour of serial chains with degrees-of- freedom (DOF) as large as 100,000. A recursive solver called Recursive Dynamic Simulator (ReDySim), based on the Newton–Euler formulation and the Decoupled Natural Orthog- onal Complement (DeNOC) matrices, was used to simulate the dynamics of these sys- tems. Planar, as well as spatial motions of chains with moderate- (DOF ≤ 1,000), large- (1,000 < DOF ≤ 10,000), and huge- (DOF > 10,000) DOF were simulated. The results were validated by several means, such as comparisons with reported results wherever avail- able, results obtained from commercial software, energy checks, etc. The study shows that ReDySim is capable of analysing serial chains of huge-DOF with acceptable numerical ac- curacy. The scheme is found to be numerically stable as well as computationally efficient, owing to the linear-time computation of the joint accelerations. Numerical studies were con- ducted to establish the theoretical basis for better performance of the proposed ReDySim solver. With the demonstrated capabilities of ReDySim, it may be found suitable for a large number of applications involving serial systems with huge-DOF.

Keywords Dynamics · Chains · Decomposition · Large degrees-of-freedom

A. Agarwal Systemantics India Pvt. Ltd, Bangalore, India e-mail: abhishekagarwalnit@gmail.com

S.V. Shah Robotics Research Centre, International Institute of Information Technology (IIIT), Hyderabad 500 032, India e-mail: surilshah@iiit.ac.in

S. Bandyopadhyay Department of Engineering Design, Indian Institute of Technology Madras, Chennai 600 036, India e-mail: sandipan@iitm.ac.in

S.K. Saha ( B ) Department of Mechanical Engineering, Indian Institute of Technology Delhi, Hauz Khas, New Delhi 110 016, India e-mail: saha@mech.iitd.ac.in

A. Agarwal et al.

1 Introduction

Dynamics of serial chains has been an active area of research, owing to a large variety of applications. The degrees-of-freedom (DOF) of such chains vary tremendously between ap- plications. For instance, in serial robots, this number would typically be between two and

six [ 1 ], though in the case of redundant robots [ 2 , 3 ] it may be a double-digit number. On the other hand, long serial chains are used in several engineering applications, such as moor- ing and towing chains in ships, chain-pulley arrangements in material handling, industrial hoists, and so on. In addition, many systems which are chain-like can also be approximated by chains (i.e., consisting of discrete links coupled by joints). For instance, ropes, cables, hoses, flexible tubes, etc. are examples of elastic continua used commonly in engineering applications, which can be approximately modelled as chains. The complete dynamic model of such continua constitute of partial differential equations. While, in theory, it is possible to

solve these equations using numerical techniques such as FEM [ 4 ], for long, slender systems (e.g., a rope), such a solution would be computationally very expensive [ 5 ]. Using an ordi- nary differential equation (ODE) model arising out of partial lumping of the continuum in terms of equivalent links and joints appears to be an attractive alternative [ 6 ]. While it is easy enough to appreciate the need for a dynamic modelling and simulation scheme for a large number of long serial chains or chain-like engineering components, it is difficult to find a dependable solution. There are several technical complexities with the system of ODEs that describe the dynamics of such systems. The key difficulty is that owing to the inherent rela- tionships between the links (i.e., the penultimate link carries the last link, and by induction, the base link carries all the other links), the equivalent inertia of the links can be extremely disparate, even when individual links are identical in terms of geometry and mass distribu- tion. This leads to the ill-conditioning of the mass or inertia matrix of the system. According

to a study by Featherstone [ 7 ], the problem is extremely sensitive to the number of links, n l . In fact, Featherstone estimated that the condition number of the said mass or inertia ma- trix grows asymptotically with n l anywhere from O(n l ) to O(n 4 l ) for a chain with revolute joints. For example, the maximum condition number of a planar chain with identical links is approximately 4n 4 l . In [ 8 – 10 ], parallel computation algorithms of complexity O(log n l ) , for multibody systems have been presented. In [ 8 ], no simulation result was presented, whereas in [ 9 ] and [ 10 ] simulation results for up to 131- and 201-DOF systems, respectively, were reported. Even though these methods complement O(n l ) methods for solving large-DOF systems, such large-DOF systems were not attempted/simulated in their work. In [ 11 ], com- parison between numerical performance of methods based on composite-body, O(n 3 l ) , and

articulated-body, O(n l ) , has been provided. The advantage of the articulated-body method over composite-body method in terms of performance was illustrated with a two-link chain. The paper does not illustrate efficacy of the method for large-DOF systems. Tomaszewski

et al. [ 12 ] reported experimental results for the motion of a freely falling chain composed of 229 links. Though studies on long chain is an attractive field of research [ 6 , 12 – 22 ], results of experimental studies or numerical simulations for chains with more than 229 links were not reported in literature to the best of the knowledge of the authors. Featherstone’s estimate

for the worst case condition number for 229 links is 2.75 × 10 9 —which may explain the above observation. This discussion brings up the key challenge in the study of the dynamics for long chains, and in particular, chain-like objects. Firstly, in many applications, e.g., in the mooring and towing chains, the number of links is very large. Secondly, in the case of chain-like objects, for the partially lumped (i.e., equivalent chain) model to be a “close” approximation of the actual physical system, a “fine” discretisation is required. However, as noted above, larger

Dynamics of serial kinematic chains with large number

the value of n l , greater the computational difficulties. Not only does it make the solution inaccurate and costly, after some upper limits (which are not explicitly mentioned in the existing reports in literature studied by the authors), chances are that solutions are not ob- tainable using the existing algorithms. Thus, to the best of the knowledge of the authors, there are no reported results on systems with thousands, or tens of thousands of degrees-of- freedom.

The objective of the present research is to address this particular issue with the help of a recursive formulation of dynamics (called “ReDySim,” an acronym for Recursive Dynamics Simulator), which builds upon the research reported in [ 23 ]. Note that the algorithms in [ 23 ] were mainly proposed for tree-type systems that included serial-chain systems as well. How- ever, as illustrated in [ 23 ], a closed-loop system can also be analysed by cutting its loop at an appropriate joint to make it a tree-type system. When applied to chains with moderate- (DOF ≤ 1,000), large- (1,000 < DOF ≤ 10,000), and huge- (DOF > 10,000) DOF, the al- gorithm produced promising results. In order to check the accuracy of the solutions obtained, these were validated by various means. For moderate-DOF chains, the algorithm was tested

by solving the problems reported in [ 12 ], such that the results could be compared with ex- perimental data. As no result on spatial motion of long chains could be found in the existing literature, some simulation results were generated using the commercially available multi-

body dynamics simulation software, RecurDyn [ 24 ]. However, it was observed that when n l becomes 125 and each joint is 2-DOF, giving a 250-DOF system, solutions obtained by the software fail to satisfy imposed systemic constraints (i.e., conservation of total instan- taneous energy) when the system was simulated with reasonable tolerance values for even small periods of time, e.g., 2.5 seconds. Thus, for simulations of the system with n l ≥ 125, the validity of the results was established by calculating the change in the total instantaneous energy per unit mass. It was found that ReDySim performed satisfactorily with an average

deviation of O(10 − 2 ) in the total instantaneous energy per unit mass even up to 100,000- DOF. Furthermore, it was found to be more efficient than some other algorithms, such as an

O(n 3 l ) solver based on Gaussian elimination (GE) [ 25 ].

An extensive set of numerical studies mentioned above established the superiority of ReDySim solver, albeit in an empirical manner. In order to shed some light on the mathe- matical machinery that makes it possible, one needs to dig deeper into the algorithm. For that, one should note that ReDySim uses the Reverse Gaussian Elimination (RGE) method

[ 26 , 27 ] to solve for the joint accelerations from a set of linear equations, which are basically the ODEs representing the dynamics of the system at hand. The RGE leads to the UDU T decomposition of the system’s n l × n l generalised inertia matrix (GIM), where U and D are respectively the unit upper triangular and diagonal matrices. The UDU T decomposition of the GIM is used to solve for the joint accelerations in recursive steps involving backward

and forward substitutions [ 26 , 27 ], similar to classical GE technique to solve for a system of linear algebraic equations [ 25 ]. The computed joint accelerations were then integrated using

a standard ODE solver available in the MATLAB software, namely, ODE45 [ 28 ]. Interest- ingly, the RGE algorithm differs from the classical GE not only in terms of its steps but significantly in terms of the numerical conditioning of the matrices involved. In RGE, the condition numbers of the matrices involved remain practically invariant with respect to the

variations in n l . Thus, the observations made by Featherstone in [ 7 ] do not apply to this case, making it possible to simulate serial chains with huge-DOF. The comparative analysis of the capability of ReDySim, and the numerical demonstrations of several chains, constitute the main contributions of this paper.

The rest of the paper is organised as follows. Section 2 presents the mathematical formu- lation of serial chains. Numerical simulations, validation of their results, and/or comparisons

A. Agarwal et al.

Fig. 1 Conceptualisation of a chain as a multibody system

with the existing results are presented in Sect. 3 . Some insights into the performance of the proposed algorithm are presented in Sects. 4 and 5 , whereas conclusions are provided in Sect. 6 .

2 Mathematical formulation

Figure 1 shows the schematic of a chain as a system of a number of rigid links. Here, the chain is considered to have spatial motion rather than planar, as studied in [ 6 , 12 , 15 , 16 ]. The #kth link in a chain is connected to the #(k − 1)th link by a one-, two- or three-DOF joint, say, revolute, prismatic, universal, or spherical, depending on the application. Link #0 is the base link which may be fixed or have some prescribed motion. As the chain may contain multi-DOF joints, the total number of DOF of the chain, denoted by n, may be different from the total number of links (denoted by n l ) in a chain.

The dynamic model of the chain is obtained by using the concept of the Decoupled Nat- ural Orthogonal Complement (DeNOC) matrices [ 29 ], originally proposed for serial robots having only one-DOF joints. The DeNOC-based formulation was chosen as it provided sev- eral advantages, such as minimal-order equations of motion [ 29 ] from the unconstrained or uncoupled Newton–Euler (NE) equations of motion, analytical expressions for various in- termediate expressions, several physical interpretations, and solutions using recursive algo- rithms. The mathematical formulation using the concept of the DeNOC matrices is presented

Dynamics of serial kinematic chains with large number

here for the sake of completeness of the paper. The equations pertaining to the kinematics and dynamics are represented with respect to the origin of the local coordinate system at- tached to the link.

The NE equations of motion for the #kth link (Fig. 1 (b)) moving freely in the 3- dimensional Cartesian space are written in the matrix form [ 23 ] as

(1) where M k k , and E k are the 6 × 6 extended mass, angular velocity, and coupling matrices,

M k ˙t k

k M k E k t k =w k ,

respectively; t k and w k represent twist of, and wrench acting on the #kth link, respectively. They are defined as

−m k d ˜ k m k 1 O ω ˜ k

The variables appearing in Eq. ( 2 ) are defined in Fig. 1 (b). Also, ˜d k and ˜ ω k are the 3 × 3 skew-symmetric matrices associated with the vectors d k and ω k , respectively; “O” and “1” represent null and identity matrices of compatible dimensions, respectively. For n l links, the uncoupled NE equations of motion can be assembled as

where w = w E +w C , (3) l × 6n l generalised extended mass, the angular velocity,

and the coupling matrices [ 23 ], respectively. Moreover, w E and w C are the 6n l -dimensional vectors of external/working wrench and constraint wrench, respectively.

2.1 Velocity constraints The velocity constraints leading to the expression of the DeNOC matrices are obtained next.

In contrast to [ 29 ], where the joints had only one-DOF, here the #kth link is connected to the #(k − 1)th link by either single- or multi-DOF joint k. The number of joint variables associated with the kth joint is denoted by z k . Next, the twist associated with the links #k

and #(k − 1) connected by a multi-DOF joint k is given by [ 30 ]

t k =A k,k− 1 t k− 1 +P k θ ˙ k .

(4) In Eq. ( 4 ), A k,k− 1 is the 6 × 6 twist-propagation matrix [ 30 ]; P k is the 6 × z k motion-

propagation matrix, and ˙θ k is the z k -dimensional joint rate vector. They are defined as

A k,k− 1 ≡ ˜

a k,k− 1 1 (5a)

(5c) In Eq. ( 5a ), a k,k− 1 =a k− 1,k is defined similar to a k,k+ 1 in Fig. 1 (b), while ˜a k,k− 1 is the cor-

responding skew-symmetric matrix. In Eq. ( 5b ), p k j represents the joint motion propagation

A. Agarwal et al.

vector [ 30 ] corresponding to the motion about or along the j th axis of the kth multi-DOF joint. The vectors of the generalised twist and the generalised joint-rates for the n l links of

a serial chain are defined, respectively, as

t≡ T ... t T T 1 n l ,

(6a)

(6b) Substituting Eq. ( 4 ) into Eq. ( 6a ), for k = 1, . . . , n l , the expression for the generalised

q≡ ˙ θ ˙ T ... θ ˙ T 1 n l .

twist, t, for the serial chain is obtained as

(7a) In Eq. ( 7a ), the 6n l × n matrix N represents the velocity transformation matrix, which

t = N ˙q.

relates the generalised twist with the generalised joint rate. It may be factored as

(7b) where N l is the 6n l × 6n l matrix while N d is the 6n l × n matrix. The matrices N l and N d

N=N l N d ,

are the decoupled form of the velocity transformation matrix or simply the DeNOC matri- ces [ 23 ] given by

2.2 Equations of motion As the net power due to constraint moments and forces, i.e., wrenches, is zero, the vector of

constraint forces and moments is orthogonal to the columns of N. As a result, premultiplying Eq. ( 3 ) by N T nullifies the constraint wrenches [ 29 ] leading to the equations involving the “external” wrenches alone, i.e.,

(9) In Eq. ( 9 ), the expressions for the n × n Generalised Inertia Matrix (GIM), I, is given

I¨ q + C ˙q = τ .

by

(10a) where ˜ M≡N T l MN l is the 6n l × 6n l matrix comprising of the 6 × 6 composite-mass ma-

I≡N T d MN ˜ d ,

trices [ 23 ]. Moreover, the n × n Convective Inertia Matrix (CIM), C, can be expressed in terms of the DeNOC matrices and their time derivatives as

(10b) in which ˜ M l ≡N T l M˙ N l ,˜ M w ≡˜

C≡N T d (˜ M l +˜ M w +˜ M e )N d ,

l . Note that the time derivative of N d , i.e., ˙ N d d , which is used in writing the expressions of CIM C of Eq. ( 10b ). Finally, the n-dimensional vector of the generalised external forces (e.g., externally applied forces/moments, forces/moments resisting the motion, etc.), τ , has the following expression:

M e ≡N T l

τ ≡N T d w ˜ E ,

(10c)

Dynamics of serial kinematic chains with large number

where the 6n l -dimensional vector, w ˜ E , is expressed as

(10d) Equation ( 9 ) represents the independent set of constrained equations of motion for the

w E T w ˜ E ≡N l .

chain at hand with multi-DOF joints. In the forward dynamics, the joint accelerations, ¨q, is typically obtained using GE or Cholesky decomposition [ 25 ], which requires O(n 3 ) calculations—n being the degrees- of-freedom (DOF) of the chain under study. Hence, the solution becomes computationally expensive for large n. However, recursive O(n) algorithms are popular for this purpose

due to their computational efficiency and numerical stability [ 31 ]. The algorithm used in this paper, i.e., using ReDySim, is based on the UDU T decomposition [ 26 , 27 ] of the GIM which uses Reverse Gaussian Elimination or RGE. This leads to a recursive O(n) forward dynamics algorithm, which is summarised in Appendix A.1 for the sake of completeness.

3 Numerical simulations

Several numerical simulations were carried out on chains with a wide range of DOF. Each chain is specified by the types of links and joints, the number of links, and the total length of the chain. For example, in RE-Rn l -Li and RE-Un l -Li, RE refers to the fact that the links of the chain are made of “rigid elements.” The term R or U signifies that the joints are either “revolute” or “universal,” and n l represents the number of links. Likewise, Li denotes the total length of the chain in meters. Note that an RE-Rn l -Li chain has n l -DOF, while RE-Un l -Li is a 2n l -DOF system because a universal joint has two-DOF in contrast to the revolute joint, which has only one-DOF. The numerical integrations were performed using MATLAB’s in-built ODE solver ODE45, which is based on an adaptive fourth–fifth-order Runge–Kutta method. All simulations were carried out with relative and absolute tolerances of 10 −4 and 10 −6 , respectively, unless otherwise stated. The numerical results obtained are presented in the following subsections.

3.1 Validation of ReDySim with experimental and numerical results In this subsection, the ReDySim algorithm has been validated against experimental and

numerical results available in existing literature [ 12 ] on the planar chains. For the spatial chains, the results have been compared with those generated using the commercial software RecurDyn [ 24 ], as similar experimental results could not be found in the literature. The algorithm is then applied to simulate and analyse a wide range of spatial chains. Various configurations of RE-R229-L1.02, i.e., a 1.02 m long chain with a total mass of 0.0208 kg and 229 identical links, connected by only revolute joints were analysed experi- mentally as well as numerically in [ 12 ], where the main objective was to study the effect of initial horizontal separation on the behaviour of the chain tip motion. Let a chain of length L be held between two points (X 1 ,Y 1 ) and (X 2 ,Y 2 ), as shown in Fig. 2 . The horizontal and vertical separations between the two points are denoted by =X 2 −X 1 =Y 2 −Y 1 , respectively. Two configurations, as defined in Table 1 , were used to validate the algorithm with the reported experimental and numerical results in [ 12 ]. The initial joint angles of the chain were obtained by considering the chain to form

a catenary while in static equilibrium [ 32 ].

Figure 3 shows X and Y coordinates of the chain-tip for the above two configurations. It is evident from the figure that the simulated motions of the chain using the ReDySim

A. Agarwal et al. Fig. 2 A chain hinged at

(X 1 = 0 m, Y 1 = 0 m) and suspended from (X 2 = 0.765 m, Y 2 = 0 m)

Fig. 3 Simulated tip position for chain RE-R229-L1.02

Table 1 Initial conditions and CPU time for RE-R229-L1.02

Initial configuration Initial velocity imparted Simulation CPU [ 12 ]

of the chain (m)

to the system (m/s) time (s) time (s)

algorithm match with those obtained experimentally in [ 12 ]. Interestingly, the CPU time

1 . Small implies that the chain is closer to its most stable configuration, i.e., vertical. This makes the system of equations less stiff [ 33 ], and hence, the solution is attained faster. Figure 4 shows comparison of simulated tip velocity and acceleration magnitude with the same obtained numerically in [ 12 ]. The results are in close match with those obtained in [ 12

5 shows the change in total instantaneous energy per unit mass of the chain defined as

E(t ) − E(0)

(11) where E(t) is the total instantaneous energy of the chain at any time instant, E(0) is the

M (t ) =

initial total energy, and M is the total mass. The value of δ M (t ) is O(10 −5 ) and O(10 −6 ) for

Dynamics of serial kinematic chains with large number

Fig. 4 Simulated tip velocity and acceleration magnitudes for chain RE-R229-L1.02

Fig. 5 Change in total instantaneous energy per unit mass, δ M (t ) , for RE-R229-L1.02

the two configurations of RE-R229-L1.02, respectively, which demonstrates the accuracy of the solution.

Analysis of spatial motion of chains was performed next by replacing the revolute joints with universal joints having axes of rotations orthogonal to the length of the link elements. Figure 6 shows the initial horizontal configuration of RE-Un l -L1 chain with gravitational field acting in the negative Y -direction and an initial out-of-plane velocity, ω Y 0 , applied to all the links about Y 0 . Each link of (Li/n l ) m long has a uniform circular cross-section of diameter 0.10 m and mass per unit length as 61.65 kg/m for all the simulations performed. The initial horizontal configuration of the chain corresponds to zero potential energy. All chains have initial energy resulting out of the nonzero kinetic energy due to initial angular velocity of the chain.

As shown in Table 2 , spatial motion of RE-U125-L1 with 250 degrees-of-freedom (DOF) due to the presence of 2-DOF universal joints, denoted by U, was simulated by imparting ω Y 0 = 1.0 rad/s in both ReDySim and RecurDyn [ 24 ] with common absolute tolerances of 10 −6 . The results of the tip position obtained using ReDySim are in close match with those of RecurDyn, as shown in Fig. 7 . The magnitude of the tip velocity and acceleration were also compared, as shown in Fig. 8 . It can be seen that the tip velocity obtained using ReDySim matched with those from RecurDyn for the simulation period but the acceleration deviated after 0.45 seconds. In order to check the correctness of the results, δ M (t ) , obtained

A. Agarwal et al. Table 2 Initial conditions, CPU

time, and avg|δ M (t )| for

Simulation CPU time avg|δ M (t )| RE-U125-L1 with ω Y 0 =

RE-U125-L1

E( 0)

time (s) (s) (Joule/kg) mass per unit length =

1 rad/s,

(Joules)

61.65 kg/m and integrator

absolute tolerance of 10 − 6 RecurDyn

1.0 678 3.11e−3

Fig. 6 Initial configuration of a RE-Un l -L1 chain

Fig. 7 Simulated tip position of RE-U125-L1

using both RecurDyn and ReDySim, was plotted in Fig. 9 (a–b). The plots clearly show that in RecurDyn, δ M (t ) , after 0.45 seconds, is 10 3 times larger than that of ReDySim. As seen from Fig. 7 , the chain tip reaches its bottommost position at ∼ 0.45 second before moving up, causing large joint accelerations of the order of 100g, which are difficult to capture numerically in an accurate manner. ReDySim took 65 seconds of CPU time to complete the 1.0 second simulation as compared to 678 seconds taken by RecurDyn on a 2 GHz Core2Duo-powered laptop.

The same system, when simulated for 2.6 seconds, became nonconservative toward the end of the simulation, as shown in Fig. 9 (c–d). As the chain is falling under the effect of grav- ity without any damping at the joints, the links close to the chain tip have nonsmooth motion due to numerical inaccuracy in the computation of the joint accelerations. RecurDyn showed 0.0763 J/kg average deviation in δ M (t ) , while ReDySim showed only 7.2915e–4 J/kg aver-

age deviation as shown in Fig. 9 (c–d). Thus, ReDySim appears to be better equipped to simulate systems with more-DOF, both in terms of accuracy and efficiency. This motivates the use of ReDySim to study moderate-, large- and huge-DOF chains. It may be noted that RecurDyn may give better results on tightening the tolerances, but the expected CPU time will be higher, also.

Dynamics of serial kinematic chains with large number

Fig. 8 Simulated tip velocity and acceleration magnitude for RE-U125-L1

Fig. 9 Comparison of change in total instantaneous energy per unit mass, δ M (t ) , using simulation results for ReDySim and RecurDyn for absolute error tolerances of 10 − 6

3.2 Simulations of moderate- and large-DOF chains using ReDySim In this section, simulation results for moderate- and large-DOF chains are presented, which

were obtained using ReDySim algorithm. Note that Tables 3 and 4 show the initial condi- tions of several moderate- and large-DOF chains falling under gravity. The tables also show the simulation time, corresponding CPU time, and the average value of |δ M (t )| .

Figures 10 and 11 show X, Y , and Z coordinates of the tip of moderate- and large-DOF chains. When the chain tip reaches the bottommost position, the magnitudes of both the velocity and acceleration are at their respective peaks, as depicted in Figs. 12 and 13 . It is

A. Agarwal et al. Table 3 Initial conditions, CPU time, and avg|δ M (t )| for chains with moderate-DOF (ω Y 0 =

1.0 rad/s and mass per unit length = 61.65 kg/m)

Chain Initial configuration

CPU time avg|δ M (t )| specification

E( 0)

Simulation

of the chain (m)

(Joules)

time (s)

(s) (Joule/kg)

RE-U125-L1 1 10.27 1.0 34.2 2.15e−6 RE-U250-L2

2 82.20 1.0 111.5 3.48e−6 RE-U375-L3

1.0 201.5 4.68e−6

Table 4 Initial conditions, CPU time, and avg|δ M (t )| for chains with large-DOF (ω Y 0 = 1.0 rad/s and mass per unit length = 61.65 kg/m)

CPU time avg|δ M (t )| specification

Chain Initial configuration

E( 0)

Simulation

of the chain (m)

(Joules)

time (s)

(s) (Joule/kg)

RE-U750-L6

2.0 1330 8.37e−6 RE-U1250-L10

2.0 2803 1.35e−5 RE-U3750-L30

Fig. 10 Simulated tip position of moderate-DOF chains using ReDySim

worth noting that the acceleration increases with an increase in the length of the chain. As a result, the governing equations of motion become stiff and an adaptive solver (e.g., ODE45 in MATLAB) requires smaller step sizes to achieve acceptable error tolerances. Hence, the peak value of the acceleration cannot be captured if the results are sampled too sparsely. The simulation results for the large-DOF chains corroborate the above observation. The peak value of acceleration could not be captured as the results were sampled after every

0.05 seconds. Nevertheless, when acceleration for RE-U-750-L6 (1500-DOF) was obtained using results generated at all the steps (71,488 steps were required by ODE45 for 2.0 seconds of simulation time), the peak value of 5335 m/s 2 was observed at 1.036 seconds. Note that Fig. 13 (b) shows lower values due to the sparse sampling. The change in total instantaneous energy per unit mass for chains RE-U1250-L10 (2500- DOF) and RE-U3750-L30 (7500-DOF) was of O(10 − 5 ) and O(10 − 4 ) , respectively, as shown in Fig. 14 . This shows that the ReDySim solver is able to perform such simulations with good accuracy.

Dynamics of serial kinematic chains with large number

Fig. 11 Simulated tip position of large-DOF chains using ReDySim

Fig. 12 Simulated tip velocity and acceleration magnitude for moderate-DOF chains using ReDySim

Fig. 13 Simulated tip velocity and acceleration magnitude for large-DOF chains using ReDySim

3.3 Simulation of huge-DOF chains using ReDySim Study of several huge-DOF chains, as shown in Table 5 , is carried out in this subsection.

Such systems are not reported in the literature to the best of the knowledge of the authors, and hence, an attempt has been made to establish the capability of the ReDySim solver for handling such systems. The longest chain analysed had a length of 1000 m and 100,000 DOF, designated as RE-U50000-L1000.

A. Agarwal et al.

Fig. 14 Change in total instantaneous energy per unit mass, δ M (t ) , for large-DOF chains using ReDySim

Table 5 Initial conditions, CPU time, and avg|δ M (t )| for chains with huge-DOF (ω Y 0 = 1.0 rad/s and mass per unit length = 61.65 kg/m)

Chain specification Initial configuration

CPU time avg|δ M (t )| of the chain (m)

time (s)

(s) (Joule/kg)

RE-U5000-L100 100

5.0 35848 1.14e−3 RE-U7500-L150

1.027e+7

5.0 71242 2.13e−3 RE-U10000-L200

3.468e+7

5.0 126905 3.46e−3 RE-U15000-L300

8.220e+7

5.0 230598 9.50e−3 RE-U50000-L1000

Fig. 15 Simulated tip position for huge-DOF chains using ReDySim

Figures 15 (a–c) show the X, Y , and Z coordinates of the tip, while Figs. 16 (a–b) depict the magnitudes of the tip velocity and acceleration. As stated earlier, the tip acceleration magnitude at the bottommost position is higher for a longer chain. Since the results were sampled every 0.05 seconds, the finer variations in tip velocity and acceleration magnitude are not captured.

Figure − 17 shows δ M (t ) of two of the huge-DOF systems, which are limited to O(10 1 ) . Similar results were obtained for other huge-DOF systems, but not shown here for brevity.

This proves the capability of the ReDySim solver in analysing huge-DOF systems accu- rately.

Dynamics of serial kinematic chains with large number

Fig. 16 Simulated tip velocity and acceleration magnitude for huge-DOF chains

Fig. 17 Change in total instantaneous energy per unit mass, δ M (t ) , for huge-DOF chains using ReDySim

The simulation of RE-U50000-L1000 could not proceed beyond 0.75 seconds due to the limitation of the computer’s memory.

4 Efficiency, accuracy, and numerical stability of ReDySim

Analysis of chains based on the solution of joint accelerations using an algorithm of O(n 3 ) —n being the degrees-of-freedom (DOF) of the system at hand—complexity is com-

mon in literature [ 6 , 12 ]. Hence, simulations of several moderate- and large-DOF systems were also carried out using a classical GE-based O(n 3 ) solver developed in-house. Note that

a more common technique to solve for the joint accelerations is to decompose the symmetric positive definite GIM of Eq. ( 10a ) using Cholesky decomposition [ 25 ] followed by forward and backward substitutions. This approach also has O(n 3 ) complexity. For the GIM, the GE- based decomposition is equivalent to the Cholesky decomposition without the necessity of evaluating the square-root terms [ 25 ]. Hence, the GE-based decomposition of the GIM was preferred for the in-house development of O(n 3 ) algorithm. The results were then compared with those obtained from ReDySim, which uses an analytical Reverse GE (RGE)-based de- composition [ 26 , 27 ]. This leads to an O(n) algorithm. The comparisons were then carried out in terms of efficiency, accuracy, and numerical stability. Table 6 and Fig. 18 (a) show that the time taken by O(n 3 ) solver is significantly more than that taken by ReDySim, since the latter uses a recursive O(n) algorithm. The same is

A. Agarwal et al. Table 6 Comparison of ReDySim with GE-based O(n 3 ) solver with regard to efficiency (ω Y 0 =

1.0 rad/s) Chain

CPU time for CPU time for specification

Initial configuration

E( 0)

Simulation

of the chain (m)

(Joules)

time (s)

O(n 3 ) (s) ReDySim (s)

RE-U125-L1

1.0 3,399 34.2 RE-U250-L2

1.0 18,473 111.5 RE-U375-L3

1.0 47,697 201.5 RE-U750-L6

Table 7 Detailed operation count for various forward dynamics algorithms [ 23 ] Algorithms

Computational complexity Multiplications/divisions

Additions/subtractions ReDySim

131n r + 92n u + 79 2 3 n s − 123 Mohan and Saha [ 31 ]

135n r + 99n u + 87n s − 116

150n − 133 Featherstone [ 7 ]

173n − 128

174n − 173 Lilly and Orin [ 34 ]

199n − 198

1 n 3 + 10 3 n 2 + 40 1 n− 51 1 n 3 6 2 3 6 + 7n 2 + 50 5 6 n− 51 Note: n = n r + n u + n s , where n r ,n u , and n s are the total DOF associated with all revolute, universal, and

spherical joints, respectively

Fig. 18 Comparison of complexities using ReDySim, an in-house O(n 3 ) , and other O(n) algorithms

also reflected in Table 7 and Fig. 18 (b), where theoretical complexities reported in the liter- ature are compared with that of ReDySim. In terms of computational complexity, ReDySim with special treatment of multi-DOF joint [ 30 ] performs better than O(n 3 ) and other O(n)

algorithms available in the literature, e.g., in [ 7 , 31 , 34 ].

Since discussions on accuracy of solver for large- and huge-DOF systems are not avail- able in the literature, it is not possible to benchmark the solver against available results. However, as is evident from Figs. 5 , 9 , 14 , and 17 ,δ M (t ) was of O(10 − 1 ) even for the chain

Dynamics of serial kinematic chains with large number

with 100,000-DOF. This shows the capability of the solver in simulating such huge systems accurately.

Numerical stability of the algorithm is another important issue, which directly affects the accuracy of the results. As defined in [ 35 ], an algorithm is called numerically stable if it is stable in the mixed forward-backward error sense. Numerical stability mainly depends on the method of solving the problem rather than the order of complexity of the solver. It will

be shown in the next section that the algorithm in ReDySim based on RGE is more stable than the algorithm based on GE.

5 Numerical issues with simulation of chains

In this section, some issues related to simulation of long chains are discussed, such as, ill- conditioning and other characteristics of the GIM of Eq. ( 10a ) including a comparison of the GE- and RGE-based methods of solving joint accelerations.

5.1 Ill-conditioning of the GIM The equations of motion obtained in Eq. ( 9 ) are used to solve for the joint angles and ve-

locities. The solution involves: (1) computation of the joint accelerations, and (2) numerical integration of the same for the given initial values of position and velocity. Computation of the joint accelerations, denoted by ¨ q, is given by

q=I ¨ −1 ϕ, where ϕ = τ − C ˙q.

(12) To compute ¨ q from Eq. ( 12 ), one can decompose the GIM as LU or LL T [ 25 ] using GE

or Cholesky decomposition, respectively, followed by forward and backward substitutions. The matrices L and U are the lower and upper triangular matrices, respectively. However, when the GIM becomes ill-conditioned, small perturbations in the system of equations can produce relatively large changes in the numerical solutions. Ill-conditioning of a matrix is

defined as its closeness to singularity [ 25 ]. If the system represented in Eq. ( 12 ) satisfies

(13) the relative deviation in computation of the joint accelerations is given by

(¨ q+δ¨ q) = I −1 ( ϕ + δϕ),

the condition number of the GIM, which determines the scale factor by which the relative change or deviation in ¨ q is magnified. If the condition number of the GIM is very high, it

is ill-conditioned or close to singular. The L 2 -norm [ 25 ] gives the condition number of the GIM, denoted by κ 2 ( I), as

σ max ( I)

(15) where σ max (·) and σ min (·) are the maximum and minimum singular values of a matrix. As the

I) =

σ min ( I)

GIM is symmetric and positive definite, its singular values are equal to the corresponding eigenvalues, and Eq. ( 15 ) can be rewritten as

max

I) =

λ min

A. Agarwal et al.

where λ max and λ min are the highest and smallest eigenvalues of the GIM, I. As discussed in the Introduction, the GIM of a serial-chain with n-DOF has condition number anywhere between O(n) and O(4n 4 ) [ 7 ]. Hence, with an increase in n, there can be loss of accuracy in the computation of the joint accelerations.

5.2 Investigation of the accuracy of the ReDySim solver In order to investigate why ReDySim solver produced numerically more accurate results, a

comparative study of three different methods to calculate the joint accelerations was carried out. They are:

1. Gaussian Elimination (Numerical) or GE-N: Using GE [ 25 ], annihilations of the below- diagonal elements of the GIM given by Eq. ( 10a ) were carried out starting from the first column toward the last column to obtain an upper triangular matrix. This is also referred to as the sweep out phase. Typically, such procedure is numerical in nature leading to

6) complexity. For the computation of the joint accelerations using Eq. ( 12 ), for- ward and backward substitutions were performed, requiring O(n 2 ) operations. Hence, the overall computational complexity is said to be O(n 3 ) . The method is represented by GE-N for future references to emphasise the fact that it is a purely numerical procedure.

O(n 3 /

2. Reverse Gaussian Elimination (Numerical) or RGE-N: In contrast to the classical GE [ 25 ] mentioned above, in RGE, as introduced in [ 26 , 27 ], annihilations of the above- diagonal elements started from the last column and proceeded toward the first column to convert the GIM into a lower triangular matrix. The steps of the RGE were performed nu- merically having the same number of operations as GE-N. The term RGE-N will be used for future references to emphasise that it is a numerical procedure as well. For the com- putation of the joint accelerations, backward and forward substitutions were performed,

leading to an overall computational complexity of O(n 3 ) .

3. Reverse Gaussian Elimination (Analytical) or RGE-A: This method is same as explained in item 2. However, the steps of annihilations and substitutions were performed analyti- cally, without using any numerical values for the link lengths or masses, as explained in

[ 26 , 27 ]. Such steps, as outlined in Appendix A.1 , lead to a set of recursive expressions with O(n) computational complexity. The abbreviation RGE-A will be used for future references, where “A” is used to emphasise that the steps were performed analytically. The RGE-A method is used in ReDySim.

The joint accelerations obtained using all the above three methods were then numerically integrated using the ODE45 integrator of MATLAB to yield joint velocities and angles, which are further used to calculate the tip positions and velocities.

The dynamical systems used for the study here are 3- and 10-link chains with identical link length of 1.0 m each, cross-sectional radius of 0.02 m, and 7025 kg/m 3 material density, falling under gravity. Since all the schemes performed well at the double precision accuracy, the floating point accuracy was reduced to 10 −3 and 10 −5 , so as to accentuate the numer- ical errors, leading to clear differentiation between the results generated by the different methods. The 3-link chain was simulated for 5.0 simulation seconds with a floating point accuracy of 10 −3 , and the 10-link chain was simulated for 3.0 simulation seconds with 10 −5 floating point accuracy.

Table 8 shows the number of steps required by the adaptive integrator ODE45 of MAT- LAB and the CPU time consumed. The RGE-N- and RGE-A-based solvers took less number of steps and CPU time as compared to the GE-N-based solver.

Dynamics of serial kinematic chains with large number Table 8 CPU time and number of steps for simulation of 3- and 10-link chains

3-link chain with accuracy of 10 −3 10-link chain with accuracy of 10 −5 Simulation

No. of CPU time time (s)

No. of

CPU time

Simulation

steps (s) GE-N

steps

(s)

time (s)

Fig. 19 Change in total instantaneous energy per unit mass, δ M (t ) , using GE-N, RGE-N, and RGE-A

Table 9 Solution of ¨ q(0) with double precision accuracy

Figure 19 (a–b) show the change in total instantaneous energy per unit mass. It is clearly evident that RGE-N-, and RGE-A-based solvers perform significantly better than the GE- N-based solver, while RGE-A-based solver (used in ReDySim) performs even better than RGE-N-based solver.

5.3 Numerical stability of GE-N, RGE-N, and RGE-A In order to test the stability of GE-N-, RGE-N-, and RGE-A-based solvers described in

Sect. 5.2 , the GIM I and the vector ϕ of Eq. ( 12 ) for a 3-link planar chain are considered. The numerical values of I and ϕ corresponding to the initial horizontal configuration of the chain, i.e., when q(0) = 0, denoted by I(0) and ϕ(0), respectively, are shown in Table 9 . The joint accelerations, i.e., ¨ q(0), were then obtained using MATLAB’s command “I(0)\ϕ(0)” with double precision accuracy. These results were considered as “correct” and were used as benchmarks for the comparisons performed.

The effect of varying floating point accuracy on the solution of the joint accelerations using GE-N-, RGE-N-, and RGE-A-based solvers was studied and the results are reported

A. Agarwal et al. Table 10 Comparison of GE-N, RGE-N, and RGE-A with variable floating point round off Accuracy GE-N

RGE-A q ¨

RGE-N

1e−1 ⎡ N aN ⎤ ⎡ N aN ⎤

⎡ −6.2241 ⎤ ⎡ 0.0007 ⎤ ⎡ −6.2242 ⎤ ⎡ −0.0125e−3 ⎤ ⎡ −6.2242 ⎤ ⎡ 0.3550e−5 ⎤

⎢ ⎣ 7.9198 ⎦ ⎥ ⎣ ⎢ 0.0008 ⎦ ⎥ ⎣ ⎢ 7.9198 ⎦ ⎥ ⎣ ⎢ −0.0350e−3 ⎥ ⎦ ⎢ ⎣ 7.9198 ⎦ ⎥ ⎢ ⎣ 0.2850e−5 ⎦ ⎥ −2.2603

−2.2602 −0.8028e−5 Note: NaN denotes “Not a Number”

in Table 10 . The table shows the joint accelerations obtained using the corresponding solvers and the percentage deviations relative to ¨ q(0), as given in Table 9 . For a given floating point accuracy, the percentage error, denoted by δ q ¨ is defined as

q ≡ q ¨ 1 δ q ¨ 2 δ q ¨ 3 (17a) where

for i = 1, 2, 3. The ith joint acceleration, ¨ q iF ( 0), is obtained with different floating point round-offs, and ¨ q i ( 0) is the solution obtained using MATLAB with double precision accu- racy. Here, the absolute deviation is avoided to emphasise on how ¨ q iF ( 0) varies around ¨ q i ( 0).

It is evident from Table 10 that the percentage deviation is lower for the RGE-A-based solver while the GE-N-based solver showed higher deviations. As the floating point accuracy of the computing system was made higher, the solution for joint accelerations obtained from the RGE-N- and RGE-A-based solvers converged faster to the desired solution ¨ q(0) than the GE-N-based solver.

Note that the solution of Eq. ( 12 ), which is linear in the unknown ¨ q, using GE-N- or RGE- N- or RGE-A-based solvers essentially consists of two phases, namely, annihilations or sweep-out and substitutions [ 36 ]. The sweep-out phase of GE-N starts with the first element of the first column of the GIM, i.e., i 11 = 79.4535, whereas the same in RGE-N or RGE-A

Dynamics of serial kinematic chains with large number Table 11 Variation of the percentage error in ¨ q 1 and ¨ q n l with the number of links (floating point accuracy

= 10 −7 ) Links (n l )

Condition number

RGE-A of GIM, I

GE-N

δ q ¨ 1 [during

δ q ¨ nl [during

δ q ¨ [during

sweep-out]

nl

δ q ¨ 1 [during

substitution]

sweep-out] substitution]

−0.0006998 1.2319e−5 10 4.3473e+4

0.26676 −5.6754e−6 20 6.6955e+5

7.1426e+5 −5.6762e−6 40 1.0371e+7

−4.6793e+10

−6.296e+8 −5.6744e−6 60 5.1814e+7

5.4647e+13

−1.1474e+8 −5.6842e−6 80 1.6260e+8

−4.7533e+13

−6.8846e+8 −5.6717e−6 100

1.7183e+8 −5.6563e−6

starts with the last element of the last column, i.e., i 33 = 2.9435. Each equation in Eq. ( 12 ) represents a plane, and these three planes intersect at the required solution ¨ q, as shown in Fig. 20 (a). As explained in [ 36 ] and outlined in Appendix A.2 , the GE-N transforms the GIM, I of Eq. ( 10a ), to a upper triangular matrix, denoted with U, reducing the set of algebraic equations for I ¨ q = ϕ to U ¨ q=¯ ϕ , where ¯ ϕ is related to ϕ as ¯ ϕ= L −1 ϕ in which L −1 is the resulting matrix representing the sweep-out phase. Geometrically, U ¨ q=¯ ϕ represents the two planes given by the last two equations of I ¨ q = ϕ rotated about the solution point, as

depicted in Fig. 20 (b). If these planes are nearly orthogonal to each other, then the accuracy of the solution in the following substitution phase, i.e., U ¨ q=¯ ϕ , is better, as they are less sensitive to errors in the right hand side values. This aspect is explained in Appendix A.2 . On the other hand, RGE-N or RGE-A which transforms the GIM, matrix I of Eq. ( 10a ), to

a lower triangular matrix, denoted by L ′ , reducing the set of algebraic equations I ¨ q = ϕ to L ′ q=ϕ ¨ ′ , where ϕ ′ can be related to ϕ as ϕ ′ = (U ′ ) −1 ϕ in which matrix (U ′ ) −1 represents

the resulting matrix of the sweep-out phase using RGE. The equation L ′ q=ϕ ¨ ′ represents the first two planes of I ¨ q = ϕ rotated about the solution point, as depicted in Fig. 20 (c). Comparing Figs. 20 (b) and 20 (c), it may be seen that the said planes after RGE-N or RGE-

A are closer to being mutually orthogonal, than in the case of GE-N. Hence, the substitution phase of RGE-N or RGE-A would yield better solutions than GE-N. To consolidate the above observations, numerical experiments were carried out on a va- riety of single-DOF joint chains (n l = n) at a fixed initial configuration, i.e., q(0) =0. The joint accelerations were computed using GE-N- and RGE-A-based solvers, for t = 0 second and floating point accuracy of 10 −7 , in order to study the propagation of errors in substitu- tion phase. It was assumed that some error has already been introduced during the sweep-out

phases in ¨ q 1 and ¨ q n l , for GE-N and RGE-A, respectively. The resulting differences in solu- tions of ¨ q n l and ¨ q 1 due to substitution phases in GE-N and RGE-A, respectively, are shown in Table 11 . It can be seen from Table 11 that with an error in ¨ q 1 , i.e., −272.25 % for 100- link chain, during the sweep-out phase, the error in the solution of ¨ q n l is magnified to the O( 10 15 ) . In case of RGE-A, however, even if there is an error of O(10 8 ) in ¨ q n l for 100-link chain during the sweep-out phase, the forward substitution phase provides solution for ¨ q 1 , which is fairly accurate with percentage error of O(10 −6 ) . Hence, RGE-A-based solver is much more stable than the GE-N-based solver.

A. Agarwal et al.

Fig. 20 Planes of the linear system I ¨q = ϕ, U ¨q = ¯ϕ, and L ′ ¨q = ϕ ′ for a 3-link planar chain

Dynamics of serial kinematic chains with large number

6 Conclusions

This paper investigated the dynamic behaviour of serial chains with degrees-of-freedom up to 100,000. Simulations were performed using Recursive Dynamics Simulator (ReDySim) developed for general tree-type systems. Such large-DOF systems were never previously re- ported in literature. Moreover, such systems failed to produce any results using commercial software like RecurDyn. The accuracy, stability, and efficiency, which are important for long serial-chain systems as those qualities deteriorate with the increasing number of links, n l , were proven nearly insensitive when ReDySim algorithm was used. These observations es- tablished the viability of solution of a large number of engineering problems with high-DOF using ReDySim.

Acknowledgements

The authors acknowledge the Naren Gupta Chair Professor fund of the last author at IIT Delhi, which was used to support the second author to conduct this research. Anonymous reviewers are also thanked for their constructive comments.

Appendix

A.1 Recursive O(n) forward dynamics In this section, outline of the recursive O(n) forward dynamics algorithm implemented in

Recursive Dynamics Simulator (ReDySim) solver and used for the simulation of chains with large-DOF are presented. The algorithm is based on the UDU T decomposition of the

GIM [ 27 ] using analytical Reverse Gaussian Elimination, denoted by RGE-A. The forward dynamics essentially involves the calculation of joint accelerations from Eq. ( 9 ) as

¨q = I −1 ϕ , where ϕ = τ − C ˙q.

(A.1) Using the decomposition I = UDU T , the equations of motion, Eq. ( A.1 ), are rewritten as

follows:

(A.2) where U and D, the n × n block upper-triangular and diagonal matrices, respectively. They

UDU T ¨q = ϕ,

have the following representations:

. U n l −1,n l 

O’s

In Eq. ( A.3 ), U k,j and ˆI k are the z k ×z j and z k ×z k matrices, which are scalars for one-DOF jointed chains, as shown in [ 26 , 27 ]. The matrices U k,j and ˆI k are given by

where the 6 ×z k

k and ˆ k are as follows:

k =ˆ k ˆI −1 k and ˆ k =ˆ M k P k .

(A.5)

A. Agarwal et al.

Table 12 Forward dynamic algorithm [ 23 ]

Backward recursion: Computation of ˆ ϕ and ˜ ϕ For link #k (k = n l ,..., 1)

ϕ ˆ k =ϕ k −P T k η ˜ k , where ˜η k =A T k+ 1,k η k+ 1 and η k+ 1 k+ 1 ϕ ˆ k+ 1 +˜ η k+ 1

ϕ ˜ k = ˆI −1 k ϕ ˆ k

Forward recursion: Computation of ¨ q from U T q=˜ ¨ ϕ For link #k (k = 1, . . . , n l )

θ ¨ k =˜ ϕ k

k μ ˜ k , where ˜ μ k =A k,k− 1 μ k− 1 and μ k− 1 =P k− 1 θ ¨ k− 1 +˜ μ k− 1

In Eq. ( A.5 ), the 6 × 6 matrix ˆ M k contains the mass and inertia properties of the articulated-body #k [ 23 ]. The matrix ˆ M k is computed as follows:

M ˆ k =M k +A T k+ 1,k M ˆ k+ 1,k+1 A k+ 1,k ,

(A.6) where ˆ M n ≡M n . Moreover, the 6 × 6 matrix ˆ M k+ 1,k+1 in Eq. ( A.6 ) is obtained as

(A.7) The joint accelerations are then obtained using three sets of linear algebraic equations,

k+ 1,k+1 =ˆ M k+ 1 −ˆ k+ 1 k+ 1 .

namely

Uˆ ϕ = ϕ, where ˆ ϕ ≡ DU T q, ¨ ( ii) D˜ ϕ=ˆ ϕ, where ˜ ϕ≡U T q, ¨

( i)

(A.8)

( iii) U T q=˜ ¨ ϕ. From Eq. ( A.8 ), the recursive algorithm, comprising of the backward recursions arising