# Forward dynamics of variable topology mechanisms -
The case of constraint activation

Andreas Müller

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

► To cite this version:

Andreas Müller. Forward dynamics of variable topology mechanisms - The case of constraint activation. Journal of Multi-body Dynamics, 2016, 230 (4), pp.442-454. 10.1177/1464419316631862. hal-05203555

HAL Id: hal-05203555

https://inria.hal.science/hal-05203555v1

Submitted on 8 Aug 2025

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

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

<figure><img src="image_2.png" /></figure>
# Forward Dynamics of Variable Topology Mechanisms
– The Case of Constraint Activation

Andreas Müller

Institute of Robotics, Johannes Kepler University
Altenbergerstr. 69, 4040 Linz, Austria, a.mueller@jku.at

## ABSTRACT

Many mechanical systems exhibit changes in their kinematic topology altering the mobility. Ideal contact is the best known cause, but also stiction and controlled locking of parts of a mechanism lead to topology changes. The latter is becoming an important issue in human-machine interaction. Anticipating the dynamic behavior of variable topology mechanisms requires solving a non-smooth dynamic problem. The core challenge is a physically meaningful transition condition at the topology switching events. Such a condition is presented in this paper. Two versions are reported, one using projected motion equations in terms of redundant coordinates, and another one using the Voronets equations in terms of minimal coordinates. Their computational properties are discussed. Results are shown for joint locking of a planar 3R mechanisms and a 6DOF industrial manipulator.

**Keywords:** Time integration, variable topology, non-smooth dynamics, momentum conservation.

## 1 Introduction

Variable topology mechanisms (VTM) form a class of mechanisms that can switch between different kinematic topologies, and thus change their kinematic mobility and possibly their DOF. This property is known from kinematotropic mechanisms [2, 16, 20]. The latter transit between motion modes via kinematic singularities while keeping their kinematic topology. VTM on the other hand change their mobility due to constraint switching. This can be caused by joint locking or switching bilateral constraints (e.g. friction or contact activation). In this paper it assumed that, except at the switching events, the constraints are smooth and scleronomic. The VTM are then referred to as *quasi-scleronomic VTM*.

Topology variations lead to discontinuous system trajectories. This is problematic for the numerical simulation as well as for the solution of the inverse dynamics problem within model-based control schemes. Unilateral contacts in multibody systems are the prevailing source of topology changes, and have been the topic of intensive research and the driving force towards a theory for the non-smooth mechanics. An overview can be found in [4, 12, 11]. In this context the modeling of friction is crucial, and various formulations have been reported, e.g. [3, 10, 13, 18]. Another cause for non-smooth dynamics are discontinuous (bilateral) constraints, i.e. switching between different constraints. These became relevant in the context of molecular systems, where the original model is replaced by lower-dimensional surrogate models. The topology change is merely due to a change in the kinematics without the need to consider further constitutive laws (as in case of frictional contact). The dynamics simulation of such models with variable kinematic topology has been addressed in [1, 9, 14, 15]. A condition for momentum conservation within numerical time stepping schemes was proposed.

Beyond molecular dynamics, there is a recent interest in this type of discontinuous systems. Moreover, it accounts for situations with great significance for robotics, and for human-machine interaction in particular. An emergency stop is an excellent example. In such an event the joint brakes are activated. This does not lead to an immediate halt. Rather the system is initially moving according to the brakes' sliding friction. The individual joints eventually lock and enter the stiction phase. This occurs at different time instances for the different joints. Now, as part of the safety considerations of the human-machine interaction it is crucial to anticipate the trajectory of a robot in emergency situations.

Topology variations must also be resolved within the inverse dynamics providing the feed-forward term in model-based control schemes. As an example, in [17] a method for obstacle-avoiding control
of serial manipulators was proposed, where a virtual joint is introduced whose motion is in some sense perpendicular to the obstacle. This virtual joint is introduced only when possible collision is detected, thus leads to a variation of the topology.

From a computational point of view, the forward dynamics of VTM with switching constraints requires additional compatibility conditions on the velocity and momentum. Such conditions are presented in the following. The paper introduces such conditions for the general case where multiple constraints are successively activated.

## 2 Configuration Space of Quasi-Scleronomic VTM

The configuration space (c-space) of a holonomic quasi-scleronomic VTM is the time dependent variety

$$V_t := h^{-1}(\mathbf{q}, t) \qquad (1)$$

defined by a system of quasi-scleronomic geometric constraints $h(\mathbf{q}, t) = 0$. The latter are piecewise defined constraints of the form

$$h(\mathbf{q}, t) = \begin{cases} h_1(\mathbf{q}), & t \in [t_0, t_1) \\ h_2(\mathbf{q}), & t \in [t_1, t_2) \\ \vdots \\ h_i(\mathbf{q}), & t \in [t_{i-1}, t_i) \end{cases} \qquad (2)$$

where the constraint switching happens at $t_i$. Each individual constraint $h_i(\mathbf{q}) = 0$ corresponds to a kinematic topology, and defines a variety $V_i := h_i^{-1}(\mathbf{q})$, where $V_i \cap V_j \neq \emptyset$, which is the c-space of the VTM at topology $i$. Each c-space $V_i$ is stratified into smooth manifolds of regular points and subvarieties of singular points. The local DOF at $\mathbf{q} \in V_i$ is the highest dimension of submanifolds passing through that point: $\delta_{\text{loc}}(\mathbf{q}) := \dim_{\mathbf{q}} V_i$. The differential (instantaneous) DOF is $\delta_{\text{diff}}(\mathbf{q}) := \dim_{\mathbf{q}} \mathbf{J}_i(\mathbf{q})$, with $\mathbf{J}_i$ being the Jacobian of the constraint mapping $h_i$. A configuration $\mathbf{q}$ is regular if and only if $\delta_{\text{diff}}$ is constant in a neighborhood of $\mathbf{q}$ in $V$.

**Definition 1.** A topology change at time $t_i$ with configuration $\mathbf{q}_0(t_i) \in V_i \cap V_{i+1}$ is called regular if and only if $\mathbf{q}_0$ is a regular point of $V_i$ and of $V_{i+1}$. Otherwise it is called singular.

A regular topology change is thus a change of local DOF without an intermediate drop of the differential DOF. This is necessarily due to contact constraints or (time dependent) locking. Apparently this is not possible for kinematotropic mechanisms that must pass through singularities in order to switch between different-dimensional manifolds.

In this paper a momentum consistent formulation for the forward dynamics is presented for VTM undergoing regular topology changes due to the activation of constraints.

Hence the VTM does not encounter a singularity during the topology change. This fact is exploited for the momentum consistent transition condition applicable within time stepping schemes. The method is tailored to the case that additional constraints are activated.

## 3 Suitable Forms of Motion Equations

### 3.1 Lagrange Equations of First Kind

In the following a form of the equations of motions (EOM) is recalled that will be suited for the derivation of the momentum balance. The starting point are the EOM of an unconstrained MBS of the form $M(\mathbf{q})\ddot{\mathbf{q}} + C(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + P(\mathbf{q}) + Q(\dot{\mathbf{q}}, \mathbf{q}, t) = \mathbf{u}(t)$. Here $M$ is the generalized mass matrix, $C\dot{\mathbf{q}}$ represents forces quadratic in velocity, $P$ potential forces, and $Q$ any other generalized forces inherent to the system. The vector $\mathbf{u}$ represents the applied generalized control forces. The vector $\mathbf{q} \in \mathbb{V}^n$ comprises $n$ generalized coordinates, where the variety $\mathbb{V}^n = \mathbb{R}^{n_p} \times \mathbb{T}^{n_r}$ accounts for $n_p$ translational and $n_r$ rotational coordinates. It is assumed that $C$ and $P$ are smooth mappings. The reason for separating the generalized forces that are neither potential forces nor quadratic in $\dot{\mathbf{q}}$ will become clear in section 4.3.
Assume that the MBS is subjected to a system of *m* scleronomic geometric constraints $h(\mathbf{q}) = \mathbf{0}$ that define the c-space $V = h^{-1}(\mathbf{0})$. The constraint Jacobian, in the corresponding velocity constraints $\mathbf{J}(\mathbf{q})\dot{\mathbf{q}} = \mathbf{0}$, leads to the Lagrangian EOM

$$ \mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t) + \mathbf{J}^T(\mathbf{q},t)\lambda = \mathbf{u}(t) \quad (3) $$

The above geometric constraints give rise to the acceleration constraints

$$ \mathbf{J}(\mathbf{q})\ddot{\mathbf{q}} + \dot{\mathbf{J}}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}} = \mathbf{0}. \quad (4) $$

For numerical treatment, frequently (3) is combined with the acceleration constraints to yield the index 1 DAE system

$$ \left( \begin{array}{cc} \mathbf{M}(\mathbf{q}) & \mathbf{J}^T(\mathbf{q}) \\ \mathbf{J}(\mathbf{q}) & \mathbf{0} \end{array} \right) \left( \begin{array}{c} \ddot{\mathbf{q}} \\ \dot{\lambda} \end{array} \right) = \left( \begin{array}{c} -\mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} - \mathbf{P}(\mathbf{q}) - \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t) + \mathbf{u}(t) \\ -\dot{\mathbf{J}}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}} \end{array} \right). \quad (5) $$

The advantage of this formulation is that the coefficient matrix is usually sparse since the constraint Jacobian is usually sparse. The sparsity of the mass matrix depends on how the unconstrained system is modeled. If the latter is modeled in terms of absolute coordinates, **M** is bock-diagonal. Otherwise, e.g. using relative coordinates, this is a dense block-triangular matrix. Then the size $(n+m) \times (n+m)$ of the coefficient matrix can become a burden for numerical solution. Moreover, when the number of constraints is not constant, the size of the coefficient matrix changes. A formulation with coefficient matrix of constant dimension is presented in the next section. The formulation in terms of minimal coordinates is recalled in section 3.3.

## 3.2 Projected Motion Equations in terms of Redundant Coordinates –Gauß’ Principle

A system of EOM for the constrained system in terms of the complete set of the (redundant) coordinates $\mathbf{q} \in \mathbb{V}^n$ can be derived from Gauß' principle written in the form

$$ \left\{ \begin{array}{l} \frac{1}{2}(\ddot{\mathbf{q}} - \mathbf{a})^T \mathbf{M}(\mathbf{q}) (\ddot{\mathbf{q}} - \mathbf{a}) \rightarrow \min \\ \mathbf{J}(\mathbf{q})\ddot{\mathbf{q}} + \dot{\mathbf{J}}\dot{\mathbf{q}} = \mathbf{0} \end{array} \right\} \quad (6) $$

where $\mathbf{a} = \mathbf{M}^{-1}(\mathbf{u} - \mathbf{C}\ddot{\mathbf{q}} - \mathbf{P}\mathbf{u})$ is the acceleration of the unconstrained system. Assuming non-redundant constraints, the solution $\ddot{\mathbf{q}}$ solving (6) is

$$ \ddot{\mathbf{q}} = \mathbf{M}^{-1}(\mathbf{q}) \mathbf{N}_{\mathbf{J},\mathbf{M}}^T (\mathbf{u}(\mathbf{q},t) - \mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} - \mathbf{P}(\mathbf{q}) - \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t)) - \mathbf{J}_{\mathbf{M}}^T(\mathbf{q})\dot{\mathbf{J}}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}} \quad (7) $$

with $\mathbf{J}_{\mathbf{M}}^{+} = \mathbf{M}^{-1}\mathbf{J}^T(\mathbf{J}\mathbf{M}^{-1}\mathbf{J}^T)^{-1}$ being the M-weighted right pseudoinverse of $\mathbf{J}$, and $\mathbf{N}_{\mathbf{J},\mathbf{M}} = \mathbf{I} - \mathbf{J}_{\mathbf{M}}^{+}\mathbf{J}$ the corresponding projector to the null-space of $\mathbf{J}$. This formulation is free of Lagrange multipliers and further does not require selection of independent (minimal) coordinates, as minimal coordinate formulations for constrained MBS do (next section).

As reported in [6], using $\dot{\mathbf{J}}\ddot{\mathbf{q}} = -\mathbf{J}\ddot{\mathbf{q}}$, the equations (7) can be written

$$ \mathbf{N}_{\mathbf{J},\mathbf{M}}^T (\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t) - \mathbf{u}(\mathbf{q},t)) = \mathbf{0}. \quad (8) $$

The formulation (8) is advantageous since the unaltered EOM of the unconstrained system are simply projected onto the c-space (actually its cotangent space). Moreover, a change in the constraints only affects the null-space projector respectively the pseudoinverse.

**Remark 1.** The motion equations (7) form a system of *n* independent ODEs in $\mathbf{q}(t)$ that can be used for forward dynamics analysis. The system (8), on the other hand, consists of *n* equations of which only *n* − *m* are independent, since rank $\mathbf{N}_{\mathbf{J},\mathbf{M}} = n - m$. It is thus not directly applicable to forward dynamics simulation, but allows for a very efficient inverse dynamics solution applicable for model-based control schemes in redundant coordinates [8]. Nevertheless, the equations (8) together with (4) form a system of *n* + *m* motion equations of which *n* are independent.
**Remark 2.** The image space of the weighted null-space projector $N_{J,M}^T$ depends on the weight $M$. This arising from the solution of (6), respectively the elimination of the Lagrange multipliers, in order to ensure the dynamic consistency of the projection in (7). On the other hand, in the projected motion equations (8) any projector to the null-space of $J$ can be used. A particularly simple choice is the non-weighted pseudoinverse $J^+ := J^T (J J^T)^{-1}$ with corresponding $N_J \equiv N_{J,I} = I - J^+ J$. Then it is $N_J = N_J^T$, and thus

$$ N_J(M(q)\ddot{q} + C(\dot{q},q)\dot{q} + P(q) + Q(\dot{q},q,t) - u(q,t)) = 0. \quad (9) $$

### 3.3 Motion Equations in terms of Minimal Coordinates –Voronets Equations

Due to the $m$ constraints, only $n-m$ coordinates are independent (assuming non-redundant constraints). In contrast to the above formulation, the selection of a minimal set of independent generalized coordinates is not possible globally, but only feasible locally at a given configuration $q$. Assume that the c-space $V$ is a smooth manifold at the considered configuration, i.e. $\delta_{\text{loc}}(q) = n-m$, and $n-m$ of the coordinates can be used to parameterize the MBS configuration. Denote with $s \in \mathbb{V}^{n-m}$ the vector of (locally) independent minimal coordinates. The coordinate vector can be rearranged as $q = (p,s)$, where $p$ is the vector of $m$ dependent coordinates, and the Jacobian reads accordingly $J = (J_p, J_s)$. Then an orthogonal complement for the constraint Jacobian is given explicitly as

$$ F = \begin{pmatrix} -J_p^{-1}J_s \\ I_{n-m} \end{pmatrix}. \quad (10) $$

That is, $\dot{q} = F\ddot{s}$ and $JF \equiv 0$. Premultiplication of (3) with $F^T$ yields a system of $n-m$ equations

$$ F^T(q) (M(q)\ddot{q} + C(\dot{q},q)\dot{q} + P(q) + Q(\dot{q},q,t) - u(q,t)) = 0. \quad (11) $$

Together with (4) this forms a system of $n$ independent motions equations. This can be reduced to the minimal coordinates by replacing $\ddot{q} = F\ddot{s} + \bar{F}\dot{s}$, which yields the Voronets equations

$$ \bar{M}(q)\ddot{s} + \bar{C}(\dot{s},q)\dot{s} + \bar{P}(q) + \bar{Q}(\dot{s},q,t) - \bar{u}(q,t) = 0 \quad (12) $$

$$ \text{with } \bar{M} := F^T M F, \quad \bar{C} := F^T (CF + M\bar{F}), \quad \bar{P} := F^T P, \quad \bar{Q} := F^T Q, \quad \bar{u} := F^T u. \quad (13) $$

This is a system of $n-m$ second order ODEs in the $n-m$ independent coordinates $s$. $\bar{M}$ is the mass matrix projected on the subspace of minimal coordinates. The coordinate formulation (12) goes back to Voronets [19], which is a special case of the Maggi equations [5] in holonomic coordinates.

The problematic point with any minimal coordinate formulation is that a chosen set of independent coordinates (determining the orthogonal complement) is only valid within a certain part of the c-space. A set of coordinates fails as local parameters when the matrix $J_p$ becomes singular. Throughout this paper it assumed that no constraint singularities occur and that a valid set of minimal coordinates has been chosen.

# 4 Compatibility Condition for general Switching Constraints

## 4.1 General Form of Switching Constraints

Without loss of generality a constraint switching at time $t=0$ is considered, which can be formulated as

$$ h(q,t) = \begin{cases} h_{-}(q), & t < 0 \\ h_{+}(q), & t \ge 0 \end{cases}, \quad J(q,t) = \begin{cases} J_{-}(q), & t < 0 \\ J_{+}(q), & t \ge 0 \end{cases} \quad (14) $$

where $h_{-}$ and $h_{+}$ are respectively the constraints before and after the switching event, and $J_{-}$ and $J_{+}$ are the corresponding constraint Jacobians. Denote the switch configuration with $q_0 := q(0)$. It is assumed that the individual constraints $h_{-}$ and $h_{+}$ are smooth at $t=0$.
## 4.2 Kinematic Compatibility

The velocity before the switching event is denoted with $\dot{\mathbf{q}}_-$, and the one after the event with $\dot{\mathbf{q}}_+$. The velocity constraints are satisfied at any time, i.e.

$$ \mathbf{J}_+(\mathbf{q}_0)\dot{\mathbf{q}}_+ = \mathbf{0} \qquad (15) $$

$$ \mathbf{J}_-(\mathbf{q}_0)\dot{\mathbf{q}}_- = \mathbf{0}. \qquad (16) $$

These two conditions can be combined to the following condition on the velocity jump

$$ \mathbf{J}_+(\mathbf{q}_0)\Delta\dot{\mathbf{q}} + \mathbf{J}_+(\mathbf{q}_0)\dot{\mathbf{q}}_- = \mathbf{0}. \qquad (17) $$

## 4.3 Momentum Balance

The switching causes impulsive constrain forces, and thus a discontinuous change of the generalized momentum. This cannot be captured by the projected EOM (8) or (12) since one particular set of constraints is incorporated in order to eliminate the Lagrange multipliers. Starting instead from the unconstrained equations, imposing the quasi-scleronomic constraints leads to the Lagrange equation

$$ \mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t) + \mathbf{J}^T(\mathbf{q},t)\boldsymbol{\lambda} = \mathbf{u}(\mathbf{q},t). \qquad (18) $$

The switching causes a jump in the velocity and thus in the generalized momentum due to the constraint Jacobian in (14). It is assumed that $\mathbf{J}_+$ and $\mathbf{J}_-$ are smooth for $t \in (-\varepsilon, 0)$ and $t \in [0, \varepsilon)$, respectively. The momentum conservation at the switching time $t = 0$, with corresponding configuration $\mathbf{q}_0 = \mathbf{q}(0)$, leads to

$$ \int_{0}^{\varepsilon} (\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t) + \mathbf{J}^T(\mathbf{q},t)\boldsymbol{\lambda}) dt = \int_{0}^{\varepsilon} \mathbf{u}(\mathbf{q},t) dt \qquad (19) $$

for $\varepsilon \to 0$. Noting that $\mathbf{M}$ is constant during the switching, and that $\mathbf{J}_+$ is smooth at $t \in [0, \varepsilon)$ yields the relation

$$ \mathbf{M}(\mathbf{q}_0)\Delta\dot{\mathbf{q}} + \int_{0}^{\varepsilon} (\mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}},\mathbf{q},t)) dt + \mathbf{J}_{+}^{T}(\mathbf{q}_{0})\Lambda = \mathbf{U}(\mathbf{q}_{0}) \qquad (20) $$

on the velocity jump $\Delta\dot{\mathbf{q}} := \dot{\mathbf{q}}_+ - \dot{\mathbf{q}}_-$. Here $\Lambda := \int_0^\varepsilon \lambda dt$ is the impulsive constraint force due to the constraint switching, and $\mathbf{U}(\mathbf{q}_0) = \int_0^\varepsilon \mathbf{u}(\mathbf{q},t) dt$. The integral over $\mathbf{P}$ vanishes for $\varepsilon \to 0$ since the potential forces depend smoothly on $\mathbf{q}$. The vector of Coriolis and centrifugal forces $\mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}}$ is a quadratic form in $\dot{\mathbf{q}}$. The ith component of this force reads explicitly $\sum_{j,k} \Gamma_{ijk}(\mathbf{q}) \dot{\mathbf{q}}^j \dot{\mathbf{q}}^k$, with $\Gamma_{ijk}$ being the Christoffel symbols corresponding to the mass matrix. Although the velocities are discontinuous during the event, they are bounded. Hence also the integral over the quadratic form $\mathbf{C}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}}$ vanishes for $\varepsilon \to 0$. The only remaining integral term is that for $\mathbf{Q}$ representing general velocity dependent forces, such as friction.

**Assumption 1.** The contribution of the forces $\mathbf{Q}$ to the momentum balance can be neglected.

With this presumption the momentum balance becomes

$$ \mathbf{M}(\mathbf{q}_0)\Delta\dot{\mathbf{q}} + \mathbf{J}_+(\mathbf{q}_0)\Lambda = \mathbf{U}(\mathbf{q}_0). \qquad (21) $$

## 4.4 Overall Transition Condition

Combining the momentum balance with the kinematic conditions (17) gives rise to the following system

$$ \begin{pmatrix} \mathbf{M}(\mathbf{q}_0) & \mathbf{J}_+^T(\mathbf{q}_0) \\ \mathbf{J}_+(\mathbf{q}_0) & \mathbf{0} \end{pmatrix} \begin{pmatrix} \Delta\dot{\mathbf{q}} \\ \Lambda \end{pmatrix} = \begin{pmatrix} \mathbf{U}(\mathbf{q}_0) \\ -\mathbf{J}_+(\mathbf{q}_0)\dot{\mathbf{q}}_- \end{pmatrix}. \qquad (22) $$

A solution $\Delta\dot{\mathbf{q}}$ of (22) is an admissible change of generalized velocity such that the constraints prior and after the switching event as well as the momentum balance are satisfied. This system of $n+m_+$ equations for the $n+m_+$ unknowns $\dot{\mathbf{q}}_+$ and $\Lambda$, has a unique solution provided that the constraints are non-redundant.
## 4.5 Incorporation into a Time Integration Scheme

The transition condition (22) is only required at a switching event. Any motion equations (such as (3), (7) or (12)) can be numerically integrated until the event, providing the velocity $\dot{q}_-$ prior to the event and the configuration $q_0 \in V$ satisfying the geometric constraints. The velocity jump at $t = 0$ could then be determined by solving (22). The compatibility condition (22) yields the full (redundant) state of the system, from which any desired set of coordinates can be selected, e.g. minimal coordinates.

The coefficient matrix in (22) is exactly the one in the index 1 formulation (5) evaluated at $q_0$. Hence the system (22) can be solved in parallel with the EOM if the EOM (5) is integrated. However, for large $n$ and a large number $m$ of constraints (e.g. switching molecular systems [15]) the EOM in redundant or minimal coordinates may be computationally simpler. Then the condition (22) is still applicable, but would require solving a system of $n+m_+$ equations. To avoid this, a transition condition for either formulation is required. This can be derived for the special case of activation of additional constraint, as shown in the following.

The impulsive force $U(q_0)$ can possibly be substituted by a contact model.

# 5 Compatibility Condition for Activation of additional Constraints

## 5.1 Activation of additional Constraints

A frequently encountered type of VTM switching constraints is that further constraints are activated in addition to constraints already active before the switching event. This can be modeled by the following form of the quasi-scleronomic constraints

$$h(\mathbf{q}, t) = \begin{cases} h_{-}(\mathbf{q}) := h_{1}(\mathbf{q}), & t < 0 \\ h_{+}(\mathbf{q}) := \begin{pmatrix} h_{1}(\mathbf{q}) \\ h_{2}(\mathbf{q}) \end{pmatrix}, & t \ge 0 \end{cases}, \quad \mathbf{J}(\mathbf{q}, t) = \begin{cases} \mathbf{J}_{-}(\mathbf{q}) := \mathbf{J}_{1}(\mathbf{q}), & t < 0 \\ \mathbf{J}_{+}(\mathbf{q}) := \begin{pmatrix} \mathbf{J}_{1}(\mathbf{q}) \\ \mathbf{J}_{2}(\mathbf{q}) \end{pmatrix}, & t \ge 0 \end{cases}. \qquad (23)$$

Here $h_1(\mathbf{q}) = \mathbf{0}$ is a set of $m_1$ persistent constraints throughout the switching to which another set of $m_2$ constraints $h_2(\mathbf{q}) = \mathbf{0}$ is added at $t = 0$.

The c-space before the switching event is $V_- := h_-^{-1}(\mathbf{0})$ and that after is $V_+ := h_+^{-1}(\mathbf{0})$. Due to the persistent constraints it is $V_- := h_-^{-1}(\mathbf{0}) = h_1^{-1}(\mathbf{0})$ and $V_+ := h_+^{-1}(\mathbf{0}) = h_1^{-1}(\mathbf{0}) \cap h_2^{-1}(\mathbf{0})$, and thus $V_+ \subset V_- := h_1^{-1}(\mathbf{0})$.

Denote with $q_0 := q(0)$ the configuration where the switching takes place at $t = 0$.

**Assumption 2.** Both constraint mappings, $h_1$ and $h_2$, are smooth at $q_0$. That is, $V_1 = h_1^{-1}(\mathbf{0})$ and $V_2 = h_2^{-1}(\mathbf{0})$ are locally smooth manifolds at $q_0$. Further each $\mathbf{J}_1(q_0)$ and $\mathbf{J}_2(q_0)$ has full rank $m_1$ and $m_2$, respectively. That is, the individual constraint systems are non-redundant.

**Assumption 3.** The constraints $h_1$ and $h_2$ are locally algebraically independent. That is, $V_+ = V_1 \cap V_2$, with $V_1 = h_1^{-1}(\mathbf{0})$ and $V_2 = h_2^{-1}(\mathbf{0})$, is a smooth manifold of dimension $n - m_1 - m_2$. That is, the overall constraint system is non-redundant.

## 5.2 Transition Condition for the Lagrangian Motion Equations

With the partitioned form of the constraints (23), the transition conditions (5) are

$$\begin{pmatrix} \mathbf{M}(\mathbf{q}_0) & \mathbf{J}_1^T(\mathbf{q}_0) & \mathbf{J}_2^T(\mathbf{q}_0) \\ \mathbf{J}_1(\mathbf{q}_0) & \mathbf{0} & \mathbf{0} \\ \mathbf{J}_2(\mathbf{q}_0) & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} \Delta\dot{\mathbf{q}} \\ \Lambda_1 \\ \Lambda_2 \end{pmatrix} = \begin{pmatrix} \mathbf{U}(\mathbf{q}_0) \\ -\mathbf{J}_1(\mathbf{q}_0)\dot{\mathbf{q}}_- \\ -\mathbf{J}_2(\mathbf{q}_0)\dot{\mathbf{q}}_- \end{pmatrix} \qquad (24)$$

where $\Lambda_1$ and $\Lambda_2$ are the impulsive constraint forces due to the persistent and additional constraints, respectively.
* Solving the system (24) requires inverting the $(n+m_1+m_2) \times (n+m_1+m_2)$ matrix. The mass matrix $M$ in (24) can be inverted with the same method as for the solution of the system (5) within the time integration scheme. For instance, if the EOM are evaluated with an $O(n)$ method, then also the system (24) can be evaluated with this method.

* The condition can be used in conjunction with any dynamics formulation (redundant or minimal coordinates). The compatibility condition (24) yields the full (redundant) state of the system, from which any desired set of coordinates can be selected, e.g. minimal coordinates. The system (24) is only solved at the switching event.

* If the constraints $h_1(\mathbf{q}) = \mathbf{0}$ and $h_2(\mathbf{q}) = \mathbf{0}$ are independent (assumption 3), and $\mathbf{J}_1$ and $\mathbf{J}_2$ have full rank (assumption 2), the coefficient matrix in (24) has full rank $n+m_1+m_2$.

## 5.3 Transition Condition in Terms of the full Set of Coordinates

### 5.3.1 Momentum Balance

In the projected EOM (8), the Lagrange multipliers are eliminated so that the above approach is not applicable directly. Nevertheless the constraint forces can be retained if the projection in the equations (8) is restricted to the set of persistent constraints $h_1(\mathbf{q}) = \mathbf{0}$. Imposing the additional constraints leads to corresponding constraint forces.

The projected EOM accounting for the persistent constraints are

$$ \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}}, \mathbf{q}, t) + \mathbf{J}^{T}(\mathbf{q}, t)\lambda - \mathbf{u}(\mathbf{q}, t)) = \mathbf{0} \quad (25) $$

that split to the two equations

$$ \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}}, \mathbf{q}, t) - \mathbf{u}(\mathbf{q}, t)) = \mathbf{0}, \quad \text{for } t < 0 $$

$$ \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}}, \mathbf{q}, t) + \mathbf{J}_2^T(\mathbf{q})\lambda_2 - \mathbf{u}(\mathbf{q}, t)) = \mathbf{0}, \quad \text{for } t \ge 0 $$

where $\lambda_2$ is the part of $\lambda$ of the constraint reactions corresponding to the activated constraints, i.e. the Jacobian $\mathbf{J}_2$. With $\mathbf{J}\ddot{\mathbf{q}} = -\mathbf{J}\dot{\mathbf{q}}$ the equations (25) can be written as

$$ \mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{q})(\mathbf{C}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}}, \mathbf{q}, t) + \mathbf{J}^{T}(\mathbf{q}, t)\lambda) + \mathbf{J}_1^T(\mathbf{J}_1\mathbf{M}^{-1}\mathbf{J}_1)^{-1}\mathbf{J}_1\dot{\mathbf{q}} = \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}\mathbf{u}(\mathbf{q}, t). \quad (26) $$

These are actually the equations (7) after the switching. The momentum balance then reads

$$ \int_{0}^{\varepsilon} \mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} dt + \int_{0}^{\varepsilon} \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{q})(\mathbf{C}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{q}} + \mathbf{P}(\mathbf{q}) + \mathbf{Q}(\dot{\mathbf{q}}, \mathbf{q}, t)) dt + \int_{0}^{\varepsilon} \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{q})\mathbf{J}_2^T(\mathbf{q}) \lambda_2 dt = \int_{0}^{\varepsilon} \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}\mathbf{u}(\mathbf{q}, t) dt. \quad (27) $$

With the assumed smoothness of the persistent constraints (assumption 2), $\mathbf{N}_{\mathbf{J}_1, \mathbf{M}}$ is smooth, and neglecting the integral of $\mathbf{Q}$ (assumption 1), the second integral term vanishes. Presuming smoothness of the activated constraints for $t \ge 0$, then (27) yields

$$ \mathbf{M}(\mathbf{q}_0)\Delta\dot{\mathbf{q}} + \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{q}_0)\mathbf{J}_2^T(\mathbf{q}_0)\Lambda_2 = \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^{T}(\mathbf{q}_0)\mathbf{U}(\mathbf{q}_0) \quad (28) $$

with the impulsive constraint force $\Lambda_2 := \int_0^\varepsilon \lambda_2 dt$.

If $\mathbf{u}$ is smooth at $t_0$ (no discontinuous control forces), the impulsive force $\mathbf{U}(\mathbf{q}_0)$ vanishes.

### 5.3.2 Kinematic Compatibility

The persistent constraints can be written as

$$ \mathbf{J}_1(\mathbf{q}_0)\dot{\mathbf{q}} = \mathbf{J}_1(\mathbf{q}_0)\dot{\mathbf{q}}_+ - \mathbf{J}_1(\mathbf{q}_0)\Delta\dot{\mathbf{q}} = \mathbf{0}, \quad (29) $$

and the additional constraints for $t \ge 0$ as

$$ \mathbf{J}_2(\mathbf{q}_0)\dot{\mathbf{q}}_+ = \mathbf{J}_2(\mathbf{q}_0)\Delta\dot{\mathbf{q}} + \mathbf{J}_2(\mathbf{q}_0)\dot{\mathbf{q}}_- = \mathbf{0}. \quad (30) $$

The constraints (29) must be satisfied throughout the switching. A particular solution of (29) is $\dot{\mathbf{q}}_+ = \mathbf{J}_{1,M}^+(\mathbf{q}_0)\mathbf{J}_1(\mathbf{q}_0)\Delta\dot{\mathbf{q}}$. Inserting this into (30) yields

$$ \mathbf{J}_2(\mathbf{q}_0)\mathbf{N}_{\mathbf{J}_1, \mathbf{M}}(\mathbf{q}_0)\Delta\dot{\mathbf{q}} = -\mathbf{J}_2(\mathbf{q}_0)\dot{\mathbf{q}}_- \quad (31) $$
### 5.3.3 Overall Transition Condition

The momentum balance together with the kinematic compatibility conditions can be summarized as

$$ \left( \begin{array}{cc} \mathbf{M}(\mathbf{q}_0) & \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}^T(\mathbf{q}_0) \mathbf{J}_2^T(\mathbf{q}_0) \\ \mathbf{J}_2(\mathbf{q}_0) \mathbf{N}_{\mathbf{J}_1, \mathbf{M}}(\mathbf{q}_0) & \mathbf{0} \end{array} \right) \left( \begin{array}{c} \Delta \dot{\mathbf{q}} \\ \Lambda_2 \end{array} \right) = \left( \begin{array}{c} \mathbf{U}(\mathbf{q}_0) \\ -\mathbf{J}_2(\mathbf{q}_0) \dot{\mathbf{q}}_- \end{array} \right). \quad (32) $$

The simple case of an MBS subjected to a single set of constraints, which is activated at $t = 0$, is included with $\mathbf{N}_{\mathbf{J}_1, \mathbf{M}} = \mathbf{I}$. The so determined $\Delta \dot{\mathbf{q}}$ is the admissible velocity jump such that the momentum balance is satisfied. The impulsive constraint force $\Lambda_2$ represents the change in the system's generalized momentum. As a by-product, the impulsive constraint force $\Lambda_2$ caused by the event is determined.

* The compatibility condition (32) yields the full (redundant) state of the system. It can be used in conjunction with any dynamics formulation.

* The square coefficient matrix has dimension $n+m_2$ since only the $m_2$ (projected) constraints are included that are added at the event. Solving (32) requires inversion of the $(n+m_2) \times (n+m_2)$ matrix. The determination of the null-space projector requires inversion of a $m_1 \times m_1$ matrix. This inverse exists with assumption 2.

* The system (32) is solved at the switching event. If the EOM are evaluated with an $O(n)$ method, then possibly also the system (32) can be solved using this method. The apparent obstacle is the null-space projector. Evaluating the null-space projector requires computing the pseudoinverse $\mathbf{J}_M^+ = \mathbf{M}^{-1}\mathbf{J}^T(\mathbf{J}\mathbf{M}^{-1}\mathbf{J}^T)^{-1}$, and thus the inverse of the mass matrix. The complexity depends on the specific form of the constraints. These are very simple for instance, if joints are locked (see sections 6 and 7).

* If the constraints $h_1(\mathbf{q}) = \mathbf{0}$ and $h_2(\mathbf{q}) = \mathbf{0}$ are independent, i.e. $\ker \mathbf{J}_1 \cap \text{range} \mathbf{J}_2 = \emptyset$ (assumption 3), and $\mathbf{J}_2$ has full rank (assumption 2), then the coefficient matrix in (32) has full rank $n+m_2$.

## 5.4 Transition Condition in Terms of Minimal Coordinates

### 5.4.1 Momentum Balance

The above condition (32) involves the null-space projector, and thus requires the determination of $\mathbf{M}^{-1}$. Even if this is only necessary at the switching points, for large systems this may be infeasible to be performed. An alternative formulation can be derived in terms of minimal coordinates resorting to the concept of Voronets equations (12). The latter cannot be applied unaltered to quasiscleronomic constraints, however. For the special case of activation of additional constraints, the persistent constraints $h_1(\mathbf{q}) = \mathbf{0}$ can be used to formulate EOM on $V_-$, The additional constraints $h_2(\mathbf{q}) = \mathbf{0}$ then restrict the EOM to $V_+ \subset V_-$. Starting from the Lagrange equations (18), the Voronets equations on $V_-$ are

$$ \overline{\mathbf{M}}(\mathbf{q})\ddot{\mathbf{s}} + \overline{\mathbf{C}}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{s}} + \overline{\mathbf{Q}}(\dot{\mathbf{q}}, \mathbf{q}, t) + \mathbf{F}_1^T(\mathbf{q})\mathbf{J}^T(\mathbf{q}, t)\lambda = \overline{\mathbf{u}}(\mathbf{q}, t) \quad (33) $$

that split into

$$ \overline{\mathbf{M}}(\mathbf{q})\ddot{\mathbf{s}} + \overline{\mathbf{C}}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{s}} + \overline{\mathbf{Q}}(\dot{\mathbf{q}}, \mathbf{q}, t) = \overline{\mathbf{u}}(\mathbf{q}, t), \quad \text{for } t < 0 $$

$$ \overline{\mathbf{M}}(\mathbf{q})\ddot{\mathbf{s}} + \overline{\mathbf{C}}(\dot{\mathbf{q}}, \mathbf{q})\dot{\mathbf{s}} + \overline{\mathbf{Q}}(\dot{\mathbf{q}}, \mathbf{q}, t) + \mathbf{F}_1^T(\mathbf{q})\mathbf{J}_2^T(\mathbf{q})\lambda_2 = \overline{\mathbf{u}}(\mathbf{q}, t), \quad \text{for } t \ge 0 $$

with $\mathbf{F}_1$ being the orthogonal complement to $\mathbf{J}_1$, and $\lambda_2$ are the Lagrange multipliers accounting for the additional constraints not captured by the projection to $V_-$. This resembles the formulation in redundant coordinates (25), but now the EOM already projected to $V_-$ are subjected to additional constraints, whereas in (25) the projector changes. The equations (33) may be considered as constrained Voronets equations. The crucial difference is that here locally valid set of independent coordinates $\mathbf{s}$ must be selected explicitly.
Proceeding as above, the momentum balance during the switching leads to

$$ \int_0^\epsilon \bar{\mathbf{M}}(\mathbf{q})\ddot{\mathbf{s}}dt + \int_0^\epsilon (\bar{\mathbf{C}}(\dot{\mathbf{q}},\mathbf{q})\dot{\mathbf{q}} + \bar{\mathbf{Q}}(\dot{\mathbf{q}},\mathbf{q},t))dt + \int_0^\epsilon \mathbf{F}_1^T(\mathbf{q})\mathbf{J}_2^T(\mathbf{q})\lambda_2 dt = \int_0^\epsilon \bar{\mathbf{u}}(\mathbf{q},t)dt. \quad (34) $$

It is presumed that $\mathbf{s}$ are valid local coordinates, so that $\mathbf{F}$ is smooth, that $\mathbf{J}_1$ is full rank so that $\mathbf{C}\dot{\mathbf{q}}$ and $\mathbf{Q}$ are smooth. The momentum balance then yields

$$ \bar{\mathbf{M}}(\mathbf{q}_0)\Delta\dot{\mathbf{s}} + \mathbf{F}_1^T(\mathbf{q}_0)\mathbf{J}_2^T(\mathbf{q}_0)\Lambda_2 dt = \bar{\mathbf{U}}(\mathbf{q}_0) \quad (35) $$

where $\Delta\dot{\mathbf{s}} = \dot{\mathbf{s}}_+ - \dot{\mathbf{s}}_-$ is the change in the independent generalized velocities, $\Lambda_2 := \int_0^\epsilon \lambda_2 dt$ is the impulsive constraint force collocated with the minimal coordinates, and $\bar{\mathbf{U}}(\mathbf{q}_0) = \int_0^\epsilon \bar{\mathbf{u}}(\mathbf{q},t)dt = \mathbf{F}_1^T(\mathbf{q}_0)\int_0^\epsilon \mathbf{u}(\mathbf{q},t)dt = \mathbf{F}_1^T(\mathbf{q}_0)\mathbf{U}(\mathbf{q}_0)$. The increment of the generalized velocities is thus $\Delta\dot{\mathbf{q}} = \mathbf{F}_1(\mathbf{q}_0)\Delta\dot{\mathbf{s}}$.

### 5.4.2 Kinematic Compatibility

The persistent velocity constraints are already incorporated in the Voronets equations on $V_-$.

$$ \begin{aligned} \mathbf{0} &= \mathbf{J}_2(\mathbf{q}_0)\dot{\mathbf{q}}_+ = \mathbf{J}_2(\mathbf{q}_0)\mathbf{F}_1(\mathbf{q}_0)\dot{\mathbf{s}}_+ \\ &= \mathbf{J}_2(\mathbf{q}_0)\mathbf{F}_1(\mathbf{q}_0)\Delta\dot{\mathbf{s}} + \mathbf{J}_2(\mathbf{q}_0)\mathbf{F}_1(\mathbf{q}_0)\dot{\mathbf{s}}_-. \end{aligned} \quad (36) $$

The last equation relates the independent velocities before the event, $\dot{s}_-$, to the change due to the switching, $\Delta\dot{s}$.

### 5.4.3 Overall Transition Condition

Combining momentum balance (35) with the kinematic constraints (36) gives rise to the overall condition

$$ \left( \begin{array}{cc} \bar{\mathbf{M}}(\mathbf{q}_0) & \mathbf{F}_1^T(\mathbf{q}_0)\mathbf{J}_2^T(\mathbf{q}_0) \\ \mathbf{J}_2(\mathbf{q}_0)\mathbf{F}_1(\mathbf{q}_0) & \mathbf{0} \end{array} \right) \left( \begin{array}{c} \Delta\dot{\mathbf{s}} \\ \Lambda_2 \end{array} \right) = \left( \begin{array}{c} \mathbf{U}(\mathbf{q}_0) \\ -\mathbf{J}_2(\mathbf{q}_0)\mathbf{F}_1(\mathbf{q}_0)\dot{\mathbf{s}}_-. \end{array} \right). \quad (37) $$

This is the compatibility condition on the generalized momentum and the generalized velocity. A solution $\Delta\dot{s}$ of (37) satisfies the kinematic constraints while ensuring momentum balance.

This is a system of $n - m_1 + m_2$ equations for the change of $n - m_1$ generalized velocities $\Delta\dot{s}$ and the $m_2$ impulsive constraint forces $\Lambda_2$. The system (37) has an obvious interpretation as momentum balance of a constrained MBS with local DOF $n - m_1$ that is subjected to $m_2$ additional constraints.

* Solving (37) requires inverting the $(n - m_1 + m_2) \times (n - m_1 + m_2)$ coefficient matrix.

* The computation of the orthogonal complement $\mathbf{F}_1$ requires inversion of a $m_1 \times m_1$ matrix.

## 6 Example 1: Joint Locking in a Planar 3-Bar Pendulum

The first example is a planar 3R pendulum with parallel revolute joint axes linked to the ground and subjected to gravity in fig. 1. The solid aluminium links have lengths 1 m and rectangular cross section of 0.2 × 0.2 m. Accordingly, the mass of each link is $m_i = 108$ kg, and the principle inertia moments w.r.t. to the COM are $\Theta_{11} = 0.72$ kg m$^2$, $\Theta_{22} = \Theta_{33} = 9.36$ kg m$^2$. The generalized coordinates are the three joint angles. For the experiment, the system is released from rest in the configuration $\mathbf{q} = (\pi/6, \pi/6, \pi/6)$ and set in motion by the gravity force ($g = 9.81$ m/s$^2$).

At $t_1 = 0.8$ s, the second joint is locked. The third joint is locked at $t_2 = 1.3$ s. This successive joint locking is described by the quasi-scleronomic constraints

$$ h(\mathbf{q},t) = \left\{ \begin{array}{ll} 0, & t < t_1 \\ h_1(\mathbf{q}), & t_1 \le t < t_2 \\ \left( \begin{array}{c} h_1(\mathbf{q}) \\ h_2(\mathbf{q}) \end{array} \right), & t_2 \le t \end{array} \right. , \quad \mathbf{J}(\mathbf{q},t) = \left\{ \begin{array}{ll} 0, & t < t_1 \\ \mathbf{J}_1, & t_1 \le t < t_2 \\ \left( \begin{array}{c} \mathbf{J}_1 \\ \mathbf{J}_2 \end{array} \right), & t_2 \le t \end{array} \right. \quad (38) $$
<figure><img src="image_3.png" /><figcaption>**Figure 1.** Planar 3R-pendulum in its reference configurations $q_1 = q_2 = q_3 = \pi/6$. Also shown are the configurations at the switching time $t_1 = 0.8$ s where joint 2 is locked, and at the switching time $t_2 = 1.3$ s where joint 3 is locked.</figcaption></figure>

with $h_1(\mathbf{q}) = q_2 - q_2(t_1)$, and $h_2(\mathbf{q}) = q_3 - q_3(t_2)$, and the corresponding Jacobians

$$ \mathbf{J}_1 = (\mathbf{0} \quad \mathbf{1} \quad \mathbf{0}), \quad \mathbf{J}_2 = (\mathbf{0} \quad \mathbf{0} \quad \mathbf{1}). \qquad (39) $$

**Minimal Coordinates** Prior to $t_1$ the system is unconstrained, so that the transition condition (22) applies with $\mathbf{J}_+ = \mathbf{J}_1$. Additionally, joint 3 is locked at $t_2$. Now the compatibility condition (37) is invoked with $\mathbf{J}_2$ in (39), and with the orthogonal complement $\mathbf{F}_1 = \begin{pmatrix} \mathbf{1} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{1} \end{pmatrix}$ to $\mathbf{J}_1$. The minimal coordinates are $\mathbf{s} = (q_1, q_2)$. The latter are the remaining independent joint variables after the locking of joint 2 at $t_1$. Notice that, when joints in an open kinematic chain are locked, the set of minimal coordinates in the transition equations is unique.

**Redundant Coordinates** When (32) is used as transition condition for the additional joint locking at $t_2$, the null-space projector to $\mathbf{J}_1$, and thus the pseudoinverse is required. From the special form of $\mathbf{J}_1$ follows $\mathbf{J}_1^+ = \mathbf{M}^{-1}\mathbf{J}_1^T (\mathbf{J}_1\mathbf{M}^{-1}\mathbf{J}_1^T)^{-1} = (\bar{m}_{12}/\bar{m}_{22}, 1, \bar{m}_{32}/\bar{m}_{22})^T$, where $\bar{m}_{ij}$ are the entries of the inverse $\mathbf{M}^{-1}$, and thus

$$ \mathbf{N}_{\mathbf{J}_1, \mathbf{M}} = \begin{pmatrix} \mathbf{1} & -\bar{m}_{12}/\bar{m}_{22} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & -\bar{m}_{32}/\bar{m}_{22} & \mathbf{1} \end{pmatrix} $$

**Results** The motion equations are integrated with an explicit Runge-Kutta 4 integration scheme using a fixed time step size of $10^{-4}$ s. The transition conditions are invoked at the switching events at $t_1$ and $t_2$. In order to show the need for a momentum consistent switching, the EOM are integrated where the constraints (38) are simply imposed and $\dot{q}_2$ and $\dot{q}_3$ is set to zero at $t_1$ and $t_2$, respectively. The resulting time evolution of the joint angles and the generalized momenta is shown in fig. 2. Clearly visible is that the momenta of the unlocked joints is not conserved. Next the EOM are integrated using the consistent switching. To this end, both formulations (32) and (37) were evaluated, and lead to identical results. The time evolution of the generalized coordinates is shown in fig. 3a), and the corresponding generalized velocities in fig. 3b). The velocity jumps are such that the momenta of the unlocked joints are continuous. Fig. 4a) shows the components of the generalized momentum vector $\mathbf{P} = \mathbf{F}_i^T \mathbf{M}(\mathbf{q}) \dot{\mathbf{q}}$. These are merely of the unlocked joints. At the switching points,
the total energy jumps whereas it is preserved otherwise (fig. 4b)). Notice that the geometric locking constraint is exactly satisfied because the transition conditions (32) yields $\dot{q}_2 = 0$, which is exactly integrated to $q_2 = q_2(t_1)$, for $t \ge t_1$, and analogously for $q^3$. Comparing fig. 2a) and fig. 3a) the difference of the obtained joint trajectories is apparent.

<figure><img src="image_4.png" /><figcaption>**Figure 2.** a) Joint angles, and b) generalized momenta of the planar 3R-pendulum when integrated without momentum consistent switching.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>**Figure 3.** a) Joint angles, and b) joint rates of the planar 3R-pendulum.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 4.** a) Generalized momenta, and b) total energy of the planar 3R-pendulum.</figcaption></figure>
# 7 Example 2: Joint Locking in a Planar 3-Bar Pendulum

The second example is an industrial 6 DOF serial robot Stäubli RX130L (fig. 5). All geometric and inertia parameter were identified and used in the dynamic model. The serial robot can be split into a wrist (the last three revolute joints) and the serial chain, consisting of the first three revolute joints, which achieves the positioning of the wrist. Since wrist locking has no significant effect on the overall motion, a simplified scenario is considered where joint 1 is locked at $t = 0.05$ s, then joint 2 is locked at $t = 0.1$ s, and finally joint 3 is locked at $t = 0.15$ s. In the following figures the motor angles and rates are shown that are related to the joint angles and rates by a gear ration of 100.

<figure><img src="image_7.png" /><figcaption>**Figure 5.** RX 130L robotic manipulator in the reference configuration $q_1 = q_2 = q_3 = 0$.</figcaption></figure>

Fig. 6 shows the generalized velocities and the generalized momenta of the unlocked motors when no momentum consistent update is used. Using the momentum consistent update scheme yields the motor velocities and generalized momenta in fig. 7. The respective motor angles as shown in fig. 8. From the latter it is apparent that the terminal position at which the robot comes to a halt is different. This is indeed a crucial safety aspect as this decides about possible impact with environment and human operator. Moreover, the dynamics simulation shall provide a means for safe motion planning ensuring that at any time the system can be stopped when a potential collision is detected.

<figure><img src="image_8.png" /><figcaption>**Figure 6.** a) Generalized momenta, and b) motor rates $\dot{q}_1, \dot{q}_2, \dot{q}_3$ for the RX130L manipulator when no momentum inconsistent transition is performed.</figcaption></figure>
<figure><img src="image_9.png" /><figcaption>**Figure 7.** a) Generalized momenta, and b) motor rates $\dot{q}_1, \dot{q}_2, \dot{q}_3$ for the RX130L manipulator when using momentum consistent update.</figcaption></figure>

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

<figure><img src="image_11.png" /><figcaption>**Figure 8.** Motor joint angles $q_1, q_2, q_3$ for the RX130L manipulator when a) momentum consistency is enshrined, and b) when no momentum inconsistent transition is performed.</figcaption></figure>

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

# 8 Conclusion

The time integration of the motion equations governing the dynamics of variable topology mechanisms (VTM) must ensure the compatibility of the generalized momentum and velocity at the switching events. In this paper a compatibility condition for the general case of successive activation of multiple constraints is presented. The condition is formulated in terms of the full set of (due to the constraint activation) redundant coordinates as well as in terms of minimal coordinates. The formulations have different computational complexity. Both formulations can be evaluated independently from the actual time integration method. The method can be easily extended to account for non-holonomic velocities $v$ related to generalized speed by $v = A(q)\dot{q}$. In this paper it is assumed that the constraints are non-redundant. As future work, this condition could be relaxed and a corresponding formulation derived.

As example, the locking of joints of a planar 3R mechanism and an industrial 6R serial manipulators are reported. The method has been applied to various other systems, including a metamorphic robotic hand whose palm consists of a spherical 5-bar linkage imitating the inherent mobility of the human hand. Other possible applications include docking maneuvers.

The formulation applies also to MBS comprising flexible bodies, in which case the generalized coordinates include modal/nodal coordinates. Then, as always when constraining flexible MBS, the constraints may lead to artificial mode locking.

# Acknowledgement

The author acknowledges that this work has been partially supported by the Austrian COMET-K2 program of the Linz Center of Mechatronics (LCM).
Nomenclature

$n$ - number joint variables

$m$ - number of constraints

$\mathbf{q} \in \mathbb{V}^n$ - vector of joint variables

$\dot{\mathbf{q}} \in \mathbb{R}^n$ - generalized velocity

$\Delta \dot{\mathbf{q}}$ - jump of generalized velocity due to constraint switching

$\delta_{\text{loc}}(\mathbf{q})$ - finite local DOF at $\mathbf{q}$

$\delta_{\text{diff}}(\mathbf{q})$ - differential DOF at $\mathbf{q}$

$V \subset \mathbb{V}^n$ - Configuration space (c-space) of a MBS defined by the constraints

$h(\mathbf{q}, t)$ - quasi-scleronomic constraint function

$h_{-}$ - constraint function before the event

$h_{+}$ - constraint function after the event

$\mathbf{J}$ - constraint Jacobian

$\mathbf{J}_{-}$ - constraint Jacobian before switching event

$\mathbf{J}_{+}$ - constraint Jacobian after switching event

$\mathbf{F}$ - orthogonal complement to $\mathbf{J}$

$\mathbf{N}_{\mathbf{J},\mathbf{M}}$ - projector to the null-space of $\mathbf{J}$ according to weight matrix $\mathbf{M}$

$\mathbf{J}_{\mathbf{M}}^{+}$ - weighted pseudoinverse of $\mathbf{J}$ with weight matrix $\mathbf{M}$

$\mathbf{M}$ - generalized mass matrix of the unconstrained system

$\mathbf{C}$ - generalized Coriolis matrix of the unconstrained system

$\mathbf{P}$ - vector of generalized potential forces of the unconstrained system

$\mathbf{Q}$ - vector of remaining generalized forces of the unconstrained system

$\overline{\mathbf{M}}$ - generalized mass matrix in terms of minimal coordinates

$\overline{\mathbf{C}}$ - vector of generalized potential forces of the unconstrained system in terms of minimal coordinates

$\overline{\mathbf{P}}$ - vector of generalized potential forces of the unconstrained system in terms of minimal coordinates

$\overline{\mathbf{Q}}$ - vector of remaining generalized forces of the unconstrained system in terms of minimal coordinates

$\lambda$ - vector of Lagrange multipliers

$\Lambda$ - vector of impulsive forces

$\mathbf{u}$ - generalized external (control) forces

$\mathbf{S}_{i}$ - instantaneous screw coordinate vector of joint $i$

$\mathbf{V}_{i}$ - spatial twist vector of body $i$

REFERENCES

[1] C.-C. Chang, C.Q. Liu, R.L. Huston: Dynamics of Multibody Systems Subjected to Impulsive Constraints, Multibody System Dynamics, 8, pp. 161–184, 2002

[2] C. Galletti, P. Fanghella: Single-Loop kinematotropic mechanisms, Mech. Mach. Theory, Vol. 36, 2001, pp 743-761382, 2000.

[3] E.J Haug, S.C. Wu, S.M. Yang: Dynamics of mechanical systems with Coulomb friction, stic-
tion, impact and constraint addition-deletion—I theory, Mechanism and Machine Theory, Vol.
21, No. 5, 1986, Pages 401-406

[4] R.I. Leine, U. Aeberhard, Ch. Glocker: Hamilton's Principle as Variational Inequality for Me-
chanical Systems with Impact. J. Nonlinear Science, Vol. 19, 2009, pp. 633-664

[5] G.A. Maggi: Da alcune nuove forma della equazioni della dinamica applicabile ai sistemi anolonomi. Atti della Reale Acad. Naz. dei Lincei. Rend. Cl. fis. e math, Ser. 5 1901. Vol. 10, No. 2, pp. 287-291

[6] A. Müller: Motion Equations in Redundant Coordinates with Application to Inverse Dynamics of Constrained Mechanical Systems, Nonlinear Dynamics, Vol. 67, No. 4, 2012, pp. 2527-2541
[7] A. Müller: MBS Motion Equation without explicit definition of Body-Fixed Reference Frames, 38 Mechanisms and Robotics Conference (MECH), ASME 2014 International Design Engineering Technical Conferences, August 17-20, 2014, Buffalo, NY

[8] A. Müller, T. Hufnagel: Model-Based Control of Redundantly Actuated Parallel Manipulators in Redundant Coordinates, Robotics and Autonomous Systems, Vol. 60, No.4, 2012, pp. 563-571

[9] R. M. Mukherjee, K. Anderson: Efficient methodology for multibody simulations with discontinuous changes in system definition, Multibody System Dynamics, Vol. 18, 2007, pp. 145-168.

[10] M. Pereira, P. Nikravesh: Impact dynamics of multibody systems with frictional contact using joint coordinates and canonical equations of motion, Nonlinear Dynamics, Vol. 9, No. 1+2, 1996, pp. 53-71

[11] F.G. Pfeiffer: Applications of unilateral multibody dynamics. Philos. Trans. Roy. Soc. Lond., Vol. 359, 2001, pp. 2609-2628

[12] F. Pfeiffer, Ch. Glocker: Multibody Dynamics with Unilateral Contacts, John Wiley & Sons, New York, 1996

[13] J. Piedboeuf, Y. Gonthier, J. McPhee, C. Lange: A regularized contact model with asymmetric damping and dwell-time dependent friction. Multibody Syst. Dyn. Vol. 11, 2004, pp. 209-233

[14] M. Poursina, et al.: Strategies for articulated multibody-based adaptive coarse grain simulation of RNA, Methods Enzymol., Vol. 487, 2011, pp. 73-98

[15] M. Poursina, K.S. Anderson: Long-range force-field calculations in multiresolution simulation of molecular systems," Journal of Computational Physics, Vol. 231, No. 21, 2012, pp. 7237-7254

[16] O. Röschel: Möbius mechanisms, Advances in Robot Kinematics (ARK) 2000, pp. 375-382

[17] H. Simas, R. Guenther, D.F.M. da Cruz, D. Martins: A new method to solve robot inverse kinematics using Assur virtual chains, Robotica, Vol. 27, 2009, pp. 1017-1026

[18] J. Trinkle, D. Zeng, D. Sudarsky, G. Lo: On dynamic multi-rigid-body contact problems with Coulomb friction, Z. angew. Math. Mech. (ZAMM), Vol. 77, No. 4, 1997, pp. 267-279

[19] P.V. Voronets: Equations of motion for nonholonomic systems, Matem. Sbornik, 22, No. 4, 1901

[20] K. Wohlhart: Kinematotropic Linkages, in: J. Lenarčič, V. Parent-Castelli (eds.): Recent Advances in Robot Kinematics, Kluwer, 1996, pp. 359-368