Abstract
This paper presents the implicit inversion method (IIM), a recursive method to evaluate the Jacobian of the forward dynamics w.r.t. the system inputs, using intermediate results obtained from an O(n) forward dynamics algorithm. The resulting coefficient matrix, called the inertia-weighted input matrix (IWIM), can be used to significantly improve the performance of solving optimal control problems that take into account system dynamics for only the current time step. As the relationship between inputs and accelerations appears fixed within a time step, this matrix can be evaluated in the initialization step of the optimization. This means that the forward dynamics only needs to be solved once at the initialization of the optimization, rather than having to solve the equations in every iteration of the optimization. The method presented in this paper especially targets a case where the forward dynamics are calculated using an O(n) method and takes advantage of variables that are already known through the evaluation of that method. These quantities allow us to obtain the inertia-weighted input matrix without having to convert the system to its generalized coordinate form. Exploiting the shape of the resulting equation, it is even possible to avoid an explicit inversion of any matrices in the process. Finally, runtime comparisons between three different methods to calculate the IWIM are made for several examples.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Task space trajectory tracking appears in different contexts [1–4], ranging from fixed-base industrial robots to legged robots or even aerial robots. The goal is to follow a prescribed task velocity \(\mathbf{V}_{t,c}\) respectively acceleration \(\dot{\mathbf{V}}_{t,c}\). For redundant systems, such as legged robotics [5–8], the trajectory tracking problem is often formulated as an optimization problem of the form
which has to be solved for the generalized acceleration \(\ddot{\mathbf{q}}\) and input \(\mathbf{u}\) at the current state \((\mathbf{q},\dot{\mathbf{q}})\). Here, \(\mathbf{J}_{t}\) is the task Jacobian relating task velocity and generalized velocity as \(\mathbf{V}_{t}~=~\mathbf{J}_{t} \dot{\mathbf{q}}\), and (1b) are the equations of motion (EoM) of the system with generalized mass matrix \(\mathbf{M}\), input matrix \(\mathbf{B}\) and \(\mathbf{h}\), the sum of all remaining generalized forces. A solution of (1a)–(1b) minimizes the deviation from the desired acceleration \(\dot{\mathbf{V}}_{t,c}\) while satisfying the dynamic constraints (1b). The above formulation accounts for general task tracking problem with possibly changing inputs and outputs. The inputs \(\mathbf{u}\) may consist of actuation torques/forces \(\boldsymbol{\tau}\) as well as interaction torques/forces \(\mathbf{F}_{c}\) so that generally \(\mathbf{u}~=~ \begin{pmatrix} \boldsymbol{\tau}^{\top }& \mathbf{F}_{c}^{\top }\end{pmatrix} ^{\top}\). As an example consider the bipedal humanoid robot in Fig. 1. The task trajectories given through \(\mathbf{J}_{t}\) would be the trajectories of the two feet and the trajectory of its centroidal momentum, which is used to guarantee the stability of the robot [9]. Clearly, for this example, the number of prescribed task velocities and contact forces changes during the motion.
It should be emphasized that the optimization problem must be solved at a given instant of time with given state \((\mathbf{q},\dot{\mathbf{q}})\). Moreover, of interest are the input variables \(\mathbf{u}\) only rather than the acceleration \(\ddot{\mathbf{q}}\). The crucial point is that a numerical optimization scheme repeatedly evaluates (1a)–(1b) for fixed state. That is, all matrices in (1b) and (1a) are constant during the optimization.
The above problem (1a)–(1b) can be transformed to an unconstrained optimization problem [9, 10]. To this end, (1b) is solved for the accelerations, also known as the forward dynamics (FD) solution,
where \(\ddot{\mathbf{q}}_{0} = -\mathbf{M}^{-1}\mathbf{h}\) is the acceleration that depends on the current system state only, and \(\ddot{\mathbf{q}}_{u}\) are the accelerations due to the inputs, \(\ddot{\mathbf{q}}_{u} = \hat{\mathbf{B}} \mathbf{u}\). The task acceleration is thus
where \(\dot{\mathbf{V}}_{t,0} = \mathbf{J}_{t} \ddot{\mathbf{q}}_{0} + \dot{\mathbf{J}}_{t} \dot{\mathbf{q}}\) are the task accelerations occurring inherently from the system dynamics, which can therefore be assumed constant for the optimization since they are purely state dependent. This simplifies problem (1a) to the unconstrained optimization
For solving problem (4), the EoM only need to be evaluated once for every optimization run (in which \((\mathbf{q}, \dot{\mathbf{q}})\) is const.) since except for the optimization variables \(\mathbf{u}\), all other occurring quantities only depend on known values. This means that the FD only needs to be solved once to initialize the optimization. Additionally, the set of optimization variables gets smaller since the accelerations \(\ddot{\mathbf{q}}\) are eliminated.
To efficiently evaluate the FD of multibody systems with many degrees of freedom (DOF), \(O(n)\) methods were developed, such as the articulated-body algorithm (ABA) [11] or earlier algorithms in [12, 13], as well as a similar method presented in [14], which is used in this paper. All these methods are, however, unable to decouple the accelerations from the inputs, which is necessary for solving (4). Consequently, the IWIM \(\hat{\mathbf{B}}\) should be derived separately. Explicitly evaluating and inverting the generalized mass matrix of the system to compute the IWIM as \(\hat{\mathbf{B}} = \mathbf{M}^{-1}\mathbf{B}\) is computationally expensive. The performance could be improved by directly calculating the inverse of the mass matrix with a recursive method [15]. Another way to calculate the IWIM might be found through the inverse operational space inertia matrix (OSIM) \(\boldsymbol{\Lambda}^{-1} = \mathbf{J}_{t}\mathbf{M}^{-1}\mathbf{J}_{t}^{ \top}\), for which there are recursive algorithms [16–20]. By partitioning the input \(\mathbf{u}\) into motor torques \(\boldsymbol{\tau}\) and contact forces \(\mathbf{F}_{c}\), the relationship of \(\boldsymbol{\Lambda}^{-1}\) and \(\hat{\mathbf{B}}\) can be established. Partitioning the input matrix \(\mathbf{B}\) into \(\mathbf{B}~=~ \begin{pmatrix} \mathbf{J}_{a}^{\top }& \mathbf{J}_{t}^{\top}\end{pmatrix} \), with the actuation Jacobian \(\mathbf{J}_{a}\) and the task Jacobian \(\mathbf{J}_{t}\), yields \(\mathbf{J}_{t} \hat{\mathbf{B}} = \begin{bmatrix} \mathbf{J}_{t} \mathbf{M}^{-1} \mathbf{J}_{a}^{\top }& \boldsymbol{\Lambda}^{-1}\end{bmatrix} \). That is, the IWIM premultiplied by the task Jacobian results in a matrix that contains the inverse OSIM. Thus, evaluating the OSIM does not help to compute the IWIM.
This paper presents the implicit inversion method (IIM), an algorithm which enables the calculation of the IWIM for systems with chain or tree topology using intermediate results obtained by solving an \(O(n)\) method. Section 2 covers how the EoM are derived as well as the \(O(n)\) algorithm that is used to solve the FD problem, showing the deficiencies inherent to this method regarding the desired application. Then, Sect. 3 presents the extended unit force method, a method to calculate the IWIM, which augments an algorithm that is originally used to evaluate the inverse OSIM. In Sect. 4 the main contribution of this work, the IIM, is presented. Building on this, simulation results of several models and runtime comparisons are shown in Sect. 5. Finally, Sect. 6 concludes this paper.
2 Subsystem formulation
To efficiently evaluate the FD of more complex systems, recursive algorithms were developed, ideally with a computational complexity of \(O(n)\). In the following, an \(O(n)\)-method [14], which is based on the subsystem formulation introduced in [14, 21], and [22], is presented. This method is equivalent to the ABA described in [11] if subsystems only consist of single bodies.
The subsystem formulation as introduced in [14, 21] is a modeling approach where the overall system is considered an assembly of smaller subsystems that are attached to one another at so-called coupling points, usually the joints connecting them. Such a subsystem can consist of a single rigid or flexible body or a compound of such. In industrial robots for example, it often occurs that a link of the robot arm is combined as a unit with the corresponding motor and gearbox. Therefore, it makes sense to combine these components into a subsystem, and thus to simplify the modeling of the robot. The kinematic topology of a subsystem can be arbitrary, so it can also contain closed kinematic loops.
2.1 Recursive kinematics
Instead of the generalized coordinates \(\dot{\mathbf{q}}\), subsystems use the subsystem-specific velocity coordinates
These consist of the guidance velocities \(\mathbf{v}_{o,i}\) and \(\boldsymbol{\omega}_{o,i}\) as well as the internal velocities \(\dot{\mathbf{q}}_{i}\). The internal velocities describe the movement caused by components of the subsystem itself, while the guidance velocities introduce the motion of the system the current subsystem is coupled with. The first two components, \(\mathbf{v}_{o,i}\) and \(\boldsymbol{\omega}_{o,i}\), are the velocities of the preceding subsystem at the coupling point \(i\), expressed in frame \(i\), while the last one usually consists of joint velocities or velocities of flexible bodies as shown in Fig. 2.
The subsystem velocities can be calculated recursively through
with the index \(p\) indicating the parent subsystem of \(i\), the velocity transformation matrix \(\mathbf{T}_{ip}\) from \(p\) to \(i\) and \(\mathbf{F}_{i}\) the matrix that maps the generalized velocities belonging to subsystem \(i\) to the internal velocities. Therefore, \(\mathbf{F}_{i}\) usually is constant, like
Then the matrix \(\mathbf{T}_{ip}\) transforms the velocities \(\boldsymbol{V}_{\!\!p}\) of the preceding subsystem into the guidance velocity components \(\mathbf{v}_{o,i}\) and \(\boldsymbol{\omega}_{o,i}\), therefore it takes the shape
with \(\mathbf{v}_{pi}\) and \(\boldsymbol{\omega}_{pi}\) being the relative velocities between the coupling points \(p\) and \(i\). The upper left 2x2-submatrix is a spatial transform as described in [23], Chap. 2.2. This matrix transforms the point at which the velocities \(\mathbf{v}_{o,p}\) and \(\boldsymbol{\omega}_{o,p}\) are defined from coupling point \(p\) to \(i\) while also changing the frame in which the velocities are described from \(p\) to \(i\) through the rotation matrix \(\mathbf{R}_{ip}\). The (∼)-operator is called the cross-product operator and turns a vector into a so-called cross-product matrix, so that \(\mathbf{a} \times \mathbf{b} = \tilde{\mathbf{a}} \mathbf{b}\). The vector \(\mathbf{r}_{pi}\) is the position vector connecting the coupling points of the subsystems \(p\) and \(i\). The other component of \(\mathbf{T}_{ip}\) is the Jacobian of the relative velocities \(\mathbf{v}_{pi}\) and \(\boldsymbol{\omega}_{pi}\) w.r.t. the internal velocities of \(p\), represented in frame \(i\).
This relationship between preceding and current subsystem velocities is called the kinematic chain [14] due to the chain-like structure of relationship (6). After evaluating this formula for all subsystems, the result can be rewritten as a global relationship
of the set of all subsystem velocities \(\boldsymbol{V}_{\!i}\) and the generalized velocities \(\dot{\mathbf{q}}\). Velocity transformation matrices over multiple subsystems, like \(\mathbf{T}_{N1}\), are obtained by multiplication of neighboring transformation matrices, e.g., \(\mathbf{T}_{ac} = \mathbf{T}_{ab} \mathbf{T}_{bc}\). For systems with a topological tree structure, \(\mathbf{F}\) exhibits a lower triangular block structure, which will be exploited later on in the IIM.
2.2 Subsystem-based EoM
The dynamic equations of the subsystems (see Sect. A) give rise to the EoM of the multibody system
The velocity vector \(\boldsymbol{V}_{\!i}\) of subsystem \(i\) can be fully described. The matrix \(\overline{\mathbf{M}}_{i}\) is the mass matrix of subsystem \(i\) and \(\overline{\mathbf{h}}_{i}\) includes all the generalized subsystem forces apart from the inertia reaction forces. The transpose of the Jacobian \(\frac{\partial \boldsymbol{V}_{i}}{\partial \dot{\mathbf{q}}}\), which is the row of \(\mathbf{F}\), can be interpreted as the transformation from subsystem forces into the generalized forces. Further information on the composition of these subsystem matrices is compiled in appendix A.
Finally, the relation between the EoM in subsystem form (10) and the EoM in generalized coordinates (1b) is given obtained by substituting the relationships \(\boldsymbol{V}~=~\mathbf{F}\dot{\mathbf{q}}\) and \(\dot{\boldsymbol{V}}~=~\mathbf{F}\ddot{\mathbf{q}}~+~\dot{\mathbf{F}} \dot{\mathbf{q}}\), which results in
with \(\overline{\mathbf{B}}_{i} = - \frac{\partial \, \overline{\mathbf{h}}_{i}}{\partial \,\mathbf{u}}\). These global matrices now allow to solve the FD according to (2), i.e., the mass matrix \(\mathbf{M}\) is inverted to obtain the system accelerations \(\ddot{\mathbf{q}}\).
2.3 Subsystem \(O(n)\) algorithm
The solution of the forward dynamics as shown in (2), however, has a computational complexity of \(O(n^{3})\) due to the necessary inversion of the mass matrix. For more efficient evaluation, various recursive algorithms with complexity \(O(n)\) were proposed, e.g., [11–14]. Due to increased overhead, however, they only become faster than the direct solution of the global form for \(n > 9\).
The \(O(n)\)-methods consist of three recursions. In the first recursion of the subsystem \(O(n)\) algorithm [14], the kinematics is evaluated from the base subsystem outwards as in (6). Then, in the following inward recursion, the articulated-body inertia \(\overline{\mathbf{M}}_{i}^{*}\) and bias forces \(\overline{\mathbf{h}}_{i}^{*}\), as they are named in the ABA, are computed as
The set \(\{s(p)\}\) consists of all subsystems directly attached to \(p\), i.e., that have \(p\) as their common parent. Finally, the accelerations are calculated through the final outward recursion
As can be seen from (17) and (18), the only matrix that needs to be inverted here is \(\overline{\mathbf{M}}_{Ri}\), whose dimension is that of the internal velocities of the respective subsystem. The downside of this method is, however, that it does not allow the splitting of the accelerations as in (2). Therefore, a different method is needed to calculate the IWIM.
3 The extended unit force method (eUFM)
One method to calculate the inverse OSIM that fulfils the criteria mentioned in Sect. 1 is shown in [20]. It builds on the unit force method of [16] but is augmented so that it does not rely on additional assumptions to simplify the system dynamics. Because of this, it will be called the extended unit force method.
To calculate the inverse OSIM \(\boldsymbol{\Lambda}^{-1} = \mathbf{J}_{t}\mathbf{M}^{-1} \mathbf{J}_{t}^{ \top}\), the matrix \(\mathbf{M}^{-1} \mathbf{J}_{t}^{\top}\) is evaluated first since this term can be taken directly from the FD
This can also be written as \(\ddot{\mathbf{q}} = \ddot{\mathbf{q}}_{[0]} + \mathbf{M}^{-1} \mathbf{J}_{t}^{\top }\mathbf{F}_{c}\), where \(\ddot{\mathbf{q}}_{[0]}\) are the system accelerations according to the current state and actuator torques, which can be obtained through the \(O(n)\)-method. The matrix \(\mathbf{M}^{-1}\mathbf{J}_{t}^{\top}\) can then be calculated column-wise by choosing a unit vector \(\mathbf{e}_{i}\) (whose \(i\)th entry is 1) as force input. When solving for the accelerations, the result is
so \(\ddot{\mathbf{q}}_{[i]}\) are the system accelerations for input \(u_{i} = 1\). Now, the \(i\)th column of \(\mathbf{M}^{-1}\mathbf{J}_{t}^{\top}\) is simply the difference \(\ddot{\mathbf{q}}_{[i]} - \ddot{\mathbf{q}}_{[0]}\). By repeating this process for each element of the contact force vector, the entire matrix is obtained. To get the inverse OSIM now, this result is premultiplied by \(\mathbf{J}_{t}\). This final multiplication can just be left out as mentioned in Sect. 1. Now, the input for the eUFM can be extended to \(\mathbf{u} = \begin{pmatrix} \boldsymbol{\tau}^{\top }& \mathbf{F}_{c}^{\top }\end{pmatrix} ^{\top}\) so that the dynamics can now be expressed as in (2) with \(\mathbf{B} = \begin{bmatrix} \mathbf{J}_{a}^{\top }& \mathbf{J}_{t}^{\top }\end{bmatrix} \). For this case, the eUFM now returns \(\hat{\mathbf{B}} = \begin{bmatrix} \mathbf{M}^{-1}\mathbf{J}_{a}^{\top }& \mathbf{M}^{-1}\mathbf{J}_{t}^{ \top }\end{bmatrix} \) instead of \(\mathbf{M}^{-1}\mathbf{J}_{t}^{\top}\).
The drawback of this method is that the \(O(n)\)-algorithm has to be evaluated \(m+1\) times for \(\mathbf{u} \in \mathbb{R}^{m}\), resulting in a computational complexity of \(O(m\,n)\). This reduces the usability of this method for systems with higher numbers of inputs.
4 The implicit inversion method (IIM)
This section presents the main contribution of this paper, the implicit inversion method. It is a way to evaluate the IWIM without having to explicitly invert the global mass matrix, hence the name. The aim is to derive an algorithm from the subsystem \(O(n)\)-method that is computationally less expensive than those presented in the previous sections. The algorithm should be efficient in particular for systems with multiple inputs while still working with subsystem quantities as far as possible. As mentioned in the introduction, we only consider systems that exhibit a linear relation between inputs and accelerations. Thus the \(\overline{\mathbf{h}}_{i}\) in (10) are linear in the inputs \(\mathbf{u}\) and can be partitioning into
where the matrices \(\overline{\mathbf{B}}_{i}\) determine how the inputs \(\mathbf{u}\) affect the subsystem. The vector \(\overline{\mathbf{h}}_{0,i}\) contains the sum of all subsystem forces that do not depend on the inputs \(\mathbf{u}\). The FD is evaluated using the \(O(n)\)-method presented in Sect. 2.3 so that most of the terms needed for the IIM are already available.
4.1 Basic form of the IIM
4.1.1 Computing the input-based accelerations \(\ddot{\mathbf{q}}_{u}\)
The derivation of the IWIM is done by going through the recursive FD method step by step and picking out all the terms that are related to the inputs. That means that the first step of the \(O(n)\)-method, the evaluation of the kinematic chain can be skipped, as it is not affected by the inputs.
In the second step, the bias forces do depend on the inputs. Substituting (22) in the propagation formula for the bias forces (15) gives
a recursive formula for the input-dependent component of the bias forces \(\overline{\mathbf{h}}_{u,i}^{*}\). Rewriting this formula to a global form leads to the relationship
with
The matrices \(\mathbf{T}_{ac}^{*}\) propagate as \(\mathbf{T}_{ac}^{*} = \mathbf{T}_{ab}^{*} \mathbf{T}_{bc}^{*}\).
In the third step of the \(O(n)\)-method, the accelerations are obtained through a final outward recursion (18). Here, the variables \(\dot{\boldsymbol{V}}_{\!i}\) and \(\overline{\mathbf{h}}^{*}_{i}\) depend on \(\mathbf{u}\). To separate accelerations from inputs, a change to global variables is necessary for the input-dependent accelerations \(\ddot{\mathbf{q}}_{u}\). So, inserting (2) into \(\dot{\boldsymbol{V}}_{\!i} = \frac{\partial \boldsymbol{V}_{\!i}}{\partial \dot{\mathbf{q}}} \ddot{\mathbf{q}} + \frac{\mathrm{d}\,}{\mathrm{d}\,t} \left ( \frac{\partial \boldsymbol{V}_{\!i}}{\partial \dot{\mathbf{q}}}\right ) \dot{\mathbf{q}}\) leads to
That way, all state-dependent accelerations can still be calculated as before while extracting the calculation of \(\ddot{\mathbf{q}}_{u,i}\) as
To avoid mixing variables on subsystem level and global level, namely \(\ddot{\mathbf{q}}_{u,i}\) and \(\ddot{\mathbf{q}}_{u}\), the whole equation is expanded to the global form
Substituting (24), it can be further simplified to
and using (17), the expression \(\mathbf{I} - \text{diag} \left (\overline{\mathbf{M}}_{Ri}^{-1} \mathbf{F}_{i}^{\top}\overline{\mathbf{M}}_{i}^{*}\mathbf{F}_{i} \right )\) vanishes and the equation is reduced to
On the right-hand side of this equation, the product \({\mathbf{T}^{*}}\text{diag}\left (\mathbf{F}_{i}\right )\) takes the shape
which looks like \(\mathbf{F}\), the only difference being that all transformations \(\mathbf{T}_{ip}\) are replaced by \(\mathbf{T}_{ip}^{*}\). Therefore, the product is summarized as \(\mathbf{F}^{*} = {\mathbf{T}^{*}}\text{diag}\left (\mathbf{F}_{i} \right )\). (30) also shows an acceleration transformation matrix \(\boldsymbol{\Gamma} = \text{diag}\left (\overline{\mathbf{M}}_{Ri}^{-1} \mathbf{F}_{i}^{\top}\overline{\mathbf{M}}_{i}^{*}\right )\mathbf{F}\) that needs to be inverted to obtain the input-dependent accelerations
4.1.2 Inversion of \({\Gamma}\)
The matrix \(\boldsymbol{\Gamma}\) retains the structure of \(\mathbf{F}\), i.e., it still is a lower triangular block matrix. Besides, thanks to \(\overline{\mathbf{M}}_{Ri}^{-1} \mathbf{F}_{i}^{\top } \overline{\mathbf{M}}_{i}^{*} \mathbf{F}_{i} = \mathbf{I}\), all the block matrices on the diagonal of \(\boldsymbol{\Gamma}\) are identity matrices, leading to a lower unitriangular structure, i.e., a lower triangular matrix with only ones as its diagonal entries. This guarantees that \(\boldsymbol{\Gamma}\) will always be invertible.
Using this special structure, the inversion of \(\boldsymbol{\Gamma}\) can be done through the cascaded inversion of its submatrices as shown in the following example for a 3-link chain.
The inverse of the resulting block matrix form
is
for quadratic diagonal block matrices, which is guaranteed for these matrices. By starting this inversion process with the upper left submatrix \(\mathbf{A}_{1} = \mathbf{I}\) and then iteratively expanding until \(\mathbf{A}_{N} = \boldsymbol{\Gamma}\), the inverse of the original matrix is obtained without any explicit matrix inversion, which motivates to call this approach the implicit inversion method (IIM).
4.2 Subsystem-based inversion of \(\Gamma \)
The terms that appear after following the sequential approach of building the inverse can be further simplified once more, leading to a closed form solution for the inverse. This is shown with the help of an example here, but the result can be generalized to all systems with a topological chain or tree structure.
To show the general structure of the solution, a minimum of three consecutive links is necessary. That is why a 3-link pendulum will serve as an example here. The kinematic Jacobian from (9) for this system has the shape of
which, when following the notation of (34) and introducing \(\mathbf{C}_{i} = [\mathbf{c}_{ij}]_{j=1..p}\), leads to
with
Following (34), we get the submatrices
for which (35) gives the inverses
In the matrix \(\mathbf{A}_{3}^{-1}\), the lower left element is the only entry that is not explicitly known yet. Inserting (38) into (40), we get
Using the relationships \(\mathbf{T}_{31} = \mathbf{T}_{32}\mathbf{T}_{21} \) and \(\mathbf{S}_{i}~=~{\mathbf{F}_{i}\overline{\mathbf{M}}_{Ri}^{-1} \mathbf{F}_{i}^{\top}}\), the result can be simplified further to
which can be further reduced by using the properties \(\mathbf{S}_{i} = \mathbf{S}_{i}^{\top}\) and \(\overline{\mathbf{M}}_{i}^{*} = {\overline{\mathbf{M}}_{i}^{*}}^{ \top}\). These imply \((\mathbf{I} - \mathbf{S}_{i}\overline{\mathbf{M}}_{i}^{*}) = ( \mathbf{I} - \overline{\mathbf{M}}_{i}^{*}\mathbf{S}_{i})^{\top}\), which allows for the substitution (17). This gives us the final result of
for this entry. With that, the matrix
is the result of the inversion procedure, which can also be written as
In (45), only a single variable necessary for the calculation of the inverse is new compared to \(\boldsymbol{\Gamma}\), namely
When comparing \(\hat{\mathbf{F}}\) to (31), it can be seen that each row \(i\) in \(\hat{\mathbf{F}}\) corresponds to the row of its predecessor \(p(i)\) in \(\mathbf{F}^{*}\). With this, the general form of the matrix \(\hat{\mathbf{F}}\) can be derived as
where \(p(i)\) denotes the predecessor of \(i\) and \(\mathbf{F}^{*}_{p}\) the rows of \(\mathbf{F}^{*}\) belonging to subsystem \(p\). From this, a general rule for the calculation of \(\boldsymbol{\Gamma}^{-1}\) can be deduced, namely
4.3 Recursive computation of the IIM
Inserting the inverse (48) into the previous formula (32) for the input-based accelerations gives the final result
In this formula, the only inverses remaining are those of \(\overline{\mathbf{M}}_{Ri}\), which were already calculated during the execution of the \(O(n)\)-method, so no separate matrix inversions are needed. This yields \(\ddot{\mathbf{q}} = \ddot{\mathbf{q}}_{0} + \hat{\mathbf{B}} \mathbf{u}\) with \(\ddot{\mathbf{q}}_{0}\) obtained by running the \(O(n)\)-method without any inputs as mentioned before. During this evaluation, all variables that are necessary to calculate the global matrices \(\mathbf{F}^{*}\), therefore \(\hat{\mathbf{F}}\) and subsequently \(\hat{\mathbf{B}}\), are computed in advance. Finally, the global form of the IWIM \(\hat{\mathbf{B}}\) is obtained as
However, the local nature of the resulting matrices also allows for a recursive reformulation. The fact that \(\hat{\mathbf{F}}\) only consists of components from \(\mathbf{F}^{*}\) can be utilized to further reduce the number of variables. The result is summarized in algorithm 1. The bracketed indices refer to all rows/columns corresponding to the respective subsystem. If two indices are separated by a colon, e.g., \([p:i]\), this refers to all columns from \(p\) to \(i\). That way, the sparsity patterns introduced by the topology of the system through \(\mathbf{F}\) are utilized to accelerate the calculation of the IWIM.
5 Simulation results
To analyze the performance of the proposed method, the effect of different topologies, numbers of DOF, and inputs is studied through simulation. The runtime of the three methods to calculate the IWIM presented in this paper will be compared here. These are the calculation of the IWIM by inversion of the global mass matrix as mentioned in Sect. 1 ,Footnote 1 the eUFM from Sect. 3, and the IIM as shown in algorithm 1. For that, the algorithms are implemented in Matlab 2023b and run on an Apple M2 Pro processor. The runtime is taken as the average evaluation time for the FD of a model over 1000 runs with randomized values for the states and inputs for each run.
5.1 n-link chain
At first, we look at systems with a pure chain structure, i.e., the model is an n-link pendulum with \(n\) ranging from 1 to 50. For this model, all subsystems were assumed to be a single rigid body with identical parameters. In Fig. 3 (a), only the last link is actuated, i.e., the number of inputs remained constant over the changing number of DOF.
In case only one joint is actuated, all the methods perform very similarly up until \(\sim~18\) DOF. Above that, the global inverse form starts to get noticeably slower, and up to at least 50 DOF, the IIM outperforms the eUFM marginally. From this, it can be seen that the execution of algorithm 1 for models of this scale is faster than the evaluation of the \(O(n)\) method, as that is what the eUFM does in this case. Systems with only a single input are a very rare case, however, so the same n-link pendulum is modeled as a fully actuated system next. The results for these simulations can be seen in Fig. 3 (b). When looking at the results for the eUFM now, it becomes apparent why this method should not be used for systems with multiple inputs, since the resulting computational cost becomes prohibitive. Comparing the IIM with the global inverse form, the runtime for these methods does not change much compared to the single input case, the point where the IIM becomes faster is still at around ≈ 18-19 DOF.
To get a better understanding of the influence the number of inputs has on runtime, the 50-link pendulum model was simulated with a varying number of actuated links. The results of which are shown in Fig. 4 (a). Here, we can see a steep linear increase for the eUFM for an increasing number of inputs as expected. The increase in runtime for both the global inverse and the IIM is also linear, albeit much slower. It is necessary to zoom in to Fig. 4 (b), to get a better picture of the increase for these methods.
When comparing the extreme cases of Fig. 4, the values of which are listed in Table 1, the increase of computational time per additional input is at \(\approx 1\%\) for the IIM and \(\approx 0.33\%\) for the global inverse form, while for the eUFM, it rises by \(\approx 33\%\) per input.
The low impact the number of inputs has on the IIM can be explained when looking at (50). Here, the inputs only directly affect \(\overline{\mathbf{B}}\), which is very sparsely populated, reducing the computational effort. This reasoning also applies to the solution in global inverse form since it uses \(\overline{\mathbf{B}}\) as well.
5.2 n-element binary tree
Opposed to the n-link chain, which only has a single branch in its topological graph, the next test model is an n-link complete binary tree, which has the highest number of branching points possible. Although this structure makes no sense for practical systems, all systems with topological chain or tree structure are somewhere in between those two models. Therefore, the runtime for an arbitrary system should lie somewhere between these two test models. For that, the same tests were then conducted on models with a complete binary tree for their topological graph to check how the different system topology affects the calculation time.
The runtimes for the solution of the global inverse decrease slightly, while the other methods are not really impacted by the change in topology as can be seen in Table 2. The fact that the runtime for the IIM does not change is because the sparsity pattern left by tree structures is not yet exploited in the current implementation of the IIM.
All in all, it seems as if the system topology does not significantly affect the speed of these methods, just the number of DOF and in the case of the eUFM, the inputs.
5.3 Application example: a bipedal robot
Finally, the three methods are tested on a more practical application, a bipedal robot with 20 DOF and 38 inputs as shown in Fig. 1. The system consists of 14 motor-arm subsystems as mentioned in Sect. 2.2 and of one floating base subsystem for the robot torso. The large number of inputs is due to the number of contact points on the robot. There are 8 contact points defined for the robot with 4 per foot, so there are 24 contact forces and 14 motor torques.
For this system, the FD is calculated for a set of 1000 random states and inputs. The results of these simulations are shown in Table 3, and they show the same trends as were observed in the n-link pendulum and tree. Since this system has a fairly large number of inputs, the eUFM is obviously the slowest of the three methods. For the other two methods, the results also make sense since the system has only 20 DOF, the IIM is only slightly faster than the solution of the inverse when compared with the results obtained for the chain and tree models.
6 Conclusions
This contribution introduces the implicit inversion method (IIM), a recursive method that leverages the subsystem formulation to effectively calculate the inertia-weighted input matrix (IWIM) \(\hat{\mathbf{B}} = \mathbf{M}^{-1}\mathbf{B}\), which is the Jacobian of the forward dynamics (FD) w.r.t. the system inputs. The IIM is used in conjunction with an \(O(n)\)-algorithm to evaluate the state-dependent dynamics and makes use of intermediate results coming from the evaluation of the algorithm. Therefore, the IWIM can be calculated without having knowledge of the mass matrix \(\mathbf{M}\) of the system in its generalized coordinate form. Both the accelerations from the O(n)-algorithm and the IWIM can then be used to solve an optimization of the form (4). Using all the byproducts of these methods additionally contributes to the efficiency of this method.
To determine the performance of this method, runtime comparisons were made between the IIM, an extended form of the unit force method, and the direct calculation of the IWIM through the inverse of the joint-space mass matrix using a Cholesky factorization. The IIM generally performs at least at the level of the other methods, and for systems above \(\sim 18\) DOF and multiple inputs outperforms them increasingly.
However, it still needs to be compared against methods that are more efficient in calculating the inverse mass matrix, such as the one mentioned in [15] to get a better understanding of its standing. In theory, they should perform very similarly, since they are structurally very close to one another.
For a fair comparison though, the method should be reimplemented in a different programming language, e.g., in C++ instead of the current implementation, which is done in Matlab.
Data Availability
No datasets were generated or analysed during the current study.
Notes
i.e., the calculation of \(\hat{\mathbf{B}} = \mathbf{M}^{-1}\mathbf{B}\) and \(\ddot{\mathbf{q}}_{0} = -\mathbf{M}^{-1}\mathbf{h}\) using a Cholesky factorization.
References
Khatib, O.: A unified approach for motion and force control of robot manipulators: the operational space formulation. IEEE J. Robot. Autom. 3(1), 43–53 (1987)
Hu, Q., Xu, L., Zhang, A.: Adaptive backstepping trajectory tracking control of robot manipulator. J. Franklin Inst. 349(3), 1087–1105 (2012)
Del Prete, A.: Joint position and velocity bounds in discrete-time acceleration/torque control of robot manipulators. IEEE Robot. Autom. Lett. 3(1), 281–288 (2018)
Wensing, P.M., Posa, M., Hu, Y., Escande, A., Mansard, N., Del Prete, A.: Optimization-based control for dynamic legged robots. IEEE Trans. Robot. 40, 43–63 (2023)
Abe, Y., Da Silva, M., Popović, J.: Multiobjective control with frictional contacts. In: Proceedings of the 2007 ACM SIGGRAPH/Eurographics Symposium on Computer Animation (2007)
Bouyarmane, K., Kheddar, A.: Using a multi-objective controller to synthesize simulated humanoid robot motion with changing contact configurations. In: 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems (2011)
Koolen, T., Smith, J., Thomas, G., Bertrand, S., Carff, J., Mertins, N., Stephen, D., Abeles, P., Englsberger, J., McCrory, S., Egmond, J., Griffioen, M., Floyd, M., Kobus, S., Manor, N., Alsheikh, S., Duran, D., Bunch, L., Morphis, E., Colasanto, L., Hoang, K.-L.H., Layton, B., Neuhaus, P., Johnson, M., Pratt, J.: Summary of team IHMC’s virtual robotics challenge entry. In: 2013 13th IEEE-RAS International Conference on Humanoid Robots (Humanoids) (2013)
Vaillant, J., Kheddar, A., Audren, H., Keith, F., Brossette, S., Escande, A., Bouyarmane, K., Kaneko, K., Morisawa, M., Gergondet, P., et al.: Multi-contact vertical ladder climbing with an HRP-2 humanoid. Auton. Robots 40(3), 561–580 (2016)
Wensing, P.M., Orin, D.E.: Improved computation of the humanoid centroidal dynamics and application for whole-body control. Int. J. Humanoid Robot. 13(01), 1550039 (2016)
Wensing, P.M., Orin, D.E.: Generation of dynamic humanoid behaviors through task-space control with conic optimization. In: 2013 IEEE International Conference on Robotics and Automation (2013)
Featherstone, R.: Rigid Body Dynamics Algorithms. Springer, New York (2008)
Brandl, H., Johanni, R., Otter, M.: A very efficient algorithm for the simulation of robots and similar multibody systems without inversion of the mass matrix. IFAC Proc. Vol. 19(14), 95–100 (1986)
Bae, D.-S., Haug, E.J.: A recursive formulation for constrained mechanical system dynamics: Part I. Open loop systems. J. Struct. Mech. 15(3), (1987)
Bremer, H.: Elastic Multibody Dynamics. Springer, Dordrecht (2008)
Carpentier, J., Mansard, N.: Analytical derivatives of rigid body dynamics algorithms. In: Robotics: Science and Systems (RSS 2018) (2018)
Lilly, K.: Efficient Dynamic Simulation of Robotic Mechanisms. Springer, New York (1993)
Lilly, K.W., Orin, D.E.: Efficient O(N) recursive computation of the operational space inertia matrix. IEEE Trans. Syst. Man Cybern. 23(5), 1384–1391 (1993)
Kreutz-Delgado, K., Jain, A., Rodriguez, G.: Recursive formulation of operational space control. Int. J. Robot. Res. 11(4), 320–328 (1992)
Wensing, P., Featherstone, R., Orin, D.E.: A reduced-order recursive algorithm for the computation of the operational-space inertia matrix. In: 2012 IEEE International Conference on Robotics and Automation (2012)
Gattringer, H., Müller, A., Pucher, F., Reiter, A.: O(n) algorithm for elastic link/joint robots with end-effector contact. In: Zahariev, E., Cuadrado, J. (eds.) IUTAM Symposium on Intelligent Multibody Systems – Dynamics, Control, Simulation. Springer, Cham (2019)
Bremer, H.: Dynamik und Regelung Mechanischer Systeme. Teubner, Stuttgart (1988)
Gattringer, H., Oberhuber, B., Mayr, J., Bremer, H.: Recursive methods in control of flexible joint manipulators. Multibody Syst. Dyn. 32, 117–131 (2014)
Siciliano, B., Khatib, O. (eds.): Springer Handbook of Robotics, vol. 200, 1st edn. pp. 55–56. Springer, Berlin (2008)
Funding
Open access funding provided by Johannes Kepler University Linz. This work has been supported by the “LCM - K2 Center for Symbiotic Mechatronics” within the framework of the Austrian COMET-K2 program.
Author information
Authors and Affiliations
Contributions
G.K. wrote the manuscript text and prepared all the necessary data and figures. H.G. and A.M. were involved in developing the formulations and in the preparations and revision of the paper.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix A: Subsystem dynamics
Appendix A: Subsystem dynamics
As shown in Fig. 5, subsystem \(i\) consists of \(N_{sub}\) bodies. The mass matrix of body \(j\) expressed in a body-fixed frame located at the center of mass is
where \(\boldsymbol{\Theta}_{j}^{C_{j}}\) is the inertia tensor and \(m_{j}\) the mass of body \(j\). Each body acts a spatial wrench \(\mathcal{W}_{j}\), which is expressed in frame \(j\) and accounts for gravity, friction, actuation, and other external loads. The Newton–Euler equations of body \(j\) expressed in the body-fixed frame are then written as
where the matrix \(\widetilde{\boldsymbol{\Omega}}_{j} = \mathrm{diag}(\widetilde{\boldsymbol{\omega}}_{j}, \widetilde{\boldsymbol{\omega}}_{j})\) contains the cross-product matrix of the angular velocity of \(j\). The twist \(\mathbf{V}_{C_{j}}\) of body \(j\) is related to the subsystem velocity \(\boldsymbol{V}_{\!i}\) by
Introducing this into (A2), the principle of virtual power yields the dynamic equations of subsystem \(i\)
with
Here, \(\overline{\mathbf{G}}_{i}\) is the subsystem version of the gyroscopic matrix and \(\overline{\mathbf{Q}}_{i}\) is the overall vector of subsystem forces. This formulation is applicable to system containing flexible bodies [14]. Introducing the relation \(\boldsymbol{V}_{\!i}=\frac{\partial \,\boldsymbol{V}_{\!i}}{\partial \,\dot{\mathbf{q}}} \dot{\mathbf{q}}\) of subsystem velocities and generalized velocities, in (A7), the principle of virtual power yields the overall EoM (10) of the multibody system, where the term \(\overline{\mathbf{h}}_{i} := \overline{\mathbf{G}}_{i} \boldsymbol{V}_{\!i} - \overline{\mathbf{Q}}_{i}\) is used throughout the paper for brevity.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Krög, G., Gattringer, H. & Müller, A. The implicit inversion method for calculating the forward dynamics input Jacobian. Multibody Syst Dyn (2024). https://doi.org/10.1007/s11044-024-10010-8
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11044-024-10010-8