Contact

Modelling contact

Modeling contact in robotics can be challenging because it involves modelling the interactions between two or more objects that are in contact with each other.

There are several approaches that can be used to model contact in robotics, including the following:

  1. Contact models: These models simulate the continuous interaction between two objects that are in contact with each other. Contact models can be used to calculate the forces and moments exerted on the objects as a function of time and can be used to predict the dynamic behavior of the objects during contact.
  2. Impact models: These models simulate the collision between two objects as a single, instantaneous event. Impact models are useful for simulating high-speed collisions and can be used to calculate the forces and impulses exerted on the objects during the collision.
  3. Friction models: These models simulate the forces that arise due to the relative motion between two objects that are in contact with each other. Friction models can be used to predict the forces and moments exerted on the objects due to sliding or rolling friction.
  4. Deformation models: These models simulate the deformation of one or more objects due to contact forces. Deformation models can be used to predict the shape and behavior of the objects during contact and can be used to simulate soft materials such as rubber or foam.
  5. Hybrid models: These models combine elements of different types of contact models to simulate the complex interactions that can occur during contact. Hybrid models can be used to simulate a wide range of contact scenarios and can be tailored to the specific needs of a given application.

Contact Models

There exist two fundamentally different methods for contact models. The soft contact method models the interaction by force elements (i.e. spring-damper) where the force is only a function of the location and velocity of the point in contact. The hard contact method treats the contact as a kinematic constraint.

Soft Contact Model

For soft contact model we can identify the point when first making contact with the ground as rc0r_{c0}. The ground to object interaction can the be modeled as a linear spring-damper where the contact force is calculated as follows:

Fc=Kp(rcrc0)+Kdrc˙F_c=K_p(r_c-r_{c0}) +K_d\dot{r_c}

While modeling the environment like this seems logic and physically correct from a first point of view, it turns out that finding physically correct spring and damping parameters to simulate the system dynamics is almost impossible (according to Zurich notes).

Hard Contact Model

Instead of modelling the contact forces as force elements (spring/damper), contacts can be modeled as kinematic constraints. If a point CC is in contact, it is assumed that is unable to move:

rc=constantr˙c=Jcq˙=0r¨c=Jcq¨+Jc˙q˙=0r_c = constant \\ \dot{r}_c = J_c\dot{q} = 0 \\ \ddot{r}_c = J_c \ddot{q} + \dot{J_c}\dot{q} = 0

where JcJ_c is the geometric Jacobian.

From the constraint rc¨=Jcq¨+Jc˙q˙=0\ddot{r_c} = J_c \ddot{q} + \dot{J_c}\dot{q} = 0 and the Lagrangian free floating equations of motion we can identify the contact force:

Fc=(JcM1JcT)1(JcM1(GTuC(q˙,q)q˙g(q))+Jc˙q˙)F_c = (J_cM^{-1}J_c^T)^{-1}(J_cM^{-1}(G^Tu - C(\dot{q},q)\dot{q}-g(q)) + \dot{J_c}\dot{q})

This is quite useful, as an estimate of the ground reaction force can be obtained without any contact force sensor.

Contact Consistent Dynamics

We can define the dynamically consistent support null-space matrix as:

Nc=IM1JcT(JcM1JcT)1JcN_c = I - M^{-1}J_c^T(J_cM^{-1}J_c^T)^{-1}J_c

NcN_c defines the generalized space of motion where there are no acceleration or force coupling effects on the supporting links.

Substituting the solution for the contact force FcF_c into the equations of motion results in:

Mq¨+NcTC(q,q˙)q+g(q)+JcT(JcM1JcT)1J˙cq˙=NcTGTuM\ddot{q}+N_c^TC(q,\dot{q})q + g(q) +J_c^T(J_cM^{-1}J_c^T)^{-1}\dot{J}_c\dot{q}=N_c^TG^Tu

Substituting the support constraint (J˙cq˙=Jcq¨\dot{J}_c\dot{q} = -J_c\ddot{q}) yields the constraint consistent equations of motion can be compactly formulated as:

NcT(Mq¨+C(q,q˙)q˙+g(q))=NcTG(q)Tu.N_c^T(M\ddot{q}+C(q,\dot{q})\dot{q}+g(q))=N_c^TG(q)^Tu.

Impact Models

An impact model requires subdividing the analysis of the system dynamics into two intervals, before and after a change in the contact situation. There exists many methods to model the effect of the rapid dissipation in energy and large accelerations. Various coefficients can be used such as the coefficient of restitution and the impulse ratio, however, idealizing the contact event allows a derivation of an equation that computes an instantaneous change in velocity.

Method 1: Integration

To resolve the contact impulse, we integrate equation of motion over the infinitesimal time before and after impact, denoted tt^- and t+t^+:

Lagrangian Form

tt+q¨=M(q˙+q˙)+JcTFc=0\begin{equation} \int_{t^-}^{t^+}\ddot{q} = M(\dot{q}^+-\dot{q}^-) + J_c^TF_c = 0 \end{equation}

Assuming a perfect inelastic collision with a Newtonian collision law, all contact points that are considered part of the collision instantaneously come to rest (r˙c=Jcq˙+=0)\dot{r}_c = J_c\dot{q}^+ = 0). Combining this constraint with the integrated equation of motion, we can solve for the impulsive force as:

Fc=(JcM1JcT)1Jcq˙=Λcr˙cF_c = (J_cM^{-1}J_c^T)^{-1}J_c\dot{q}^- = Λ_c\dot{r}_c^-

Looking closer, this equation is of the form impulse = mass x speed, thus we can label ΛcΛ_c as the so called end-effector inertia.

Substituting this expression the impulse force FcF_c back into the integral result (1)(1) yields the instantaneous change in generalized velocities:

Δq=q+q=M1JcT(JcM1JcT)1Jcq˙1\Delta q = q^+-q^- = -M^{-1}J_c^T(J_cM^{-1}J_c^T)^{-1}J_c\dot{q}^{-1}

Rearranging for q+q^+ yields an expression which includes the null-space projector NcN_c:

q˙+=(IM1JcT(JcM1JcT)1Jc)q˙1=Ncq˙\dot{q}^+ = (I -M^{-1}J_c^T(J_cM^{-1}J_c^T)^{-1}J_c)\dot{q}^{-1} = N_c\dot{q}^-

This result that is obtained by satisfying the post impact contact constraint. This is intuitively clear, by using the support null-space projector NcN_c, the pre-impact velocity uu^− is projected onto the support consistent manifold.

Hamiltonian Form

The constraint equation in Hamiltonian form is the following:

0=JcT(q)Hp=JcT(q)M1(q)p(t+)\begin{equation} 0 = J_c^T(q)\dfrac{\partial H}{\partial p} = J_c^T(q)M^{-1}(q)p(t^+) \end{equation}

We now integrate the momentum dynamics over the infinitesimal interval t+t^+ and tt^-:

tt+p˙=tt+(Hq+Gpu+Gc(q)Fc)\begin{equation} \int_{t^-}^{t^+}\dot{p} = \int_{t^-}^{t^+}(\dfrac{\partial{H}}{\partial{q}} + G_pu + G_c(q) F_c ) \end{equation}

The magnitude of Hq+Bu\dfrac{\partial{H}}{\partial{q}} + Bu over the interval t+t^+ and tt^- can be neglected, leading to the following:

p+p=Gc(q)tt+Fc dt\begin{equation} p^+ - p^- = G_c(q)\int_{t^-}^{t^+}F_c \space dt \end{equation}

If we substitute (6)(6) back into the constraint equation (4)(4) we obtain:

0=GcT(q)M1(q)(p(t)+Gc(q)tt+Fc dt)\begin{equation} 0 = G_c^T(q)M^{-1}(q)(p(t^-) + G_c (q)\int_{t^-}^{t^+}F_c \space dt) \end{equation}

Rearranging for tt+Fc dt\int_{t^-}^{t^+}F_c\space dt:

tt+Fc dt=(GcT(q)M1(q)Gc(q))1GcT(q)M1(q)p(t)\begin{equation} \int_{t^-}^{t^+} F_c\space dt = -(G_c^T(q)M^-1(q)G_c(q))^{-1}G_c^T(q)M^{-1}(q)p(t^-) \end{equation}

If we substitute (8)(8) back into the integral result (6)(6) we obtain the momentum projection operator:

p+=(IGc(GcTM1Gc)1GcTM1)p(t)\begin{equation} p^+ = (I - G_c(G_c^TM^{-1}G_c)^{-1}G_c^TM^{-1})p(t^-) \end{equation}

Method 2: Conservation of angular momentum

If an external force is applied at a point of interest, angular momentum about that point must be conserved. Conservation of angular momentum is a physical property of a spinning system such that its spin remains constant unless it is acted upon by an external torque. If a contact scenario only considers external forces, the angular momentum conservation approach to deriving the impact reset can be used.

Angular momentum can be calculated as follows:

L=r×mvL = r × mv

where r is the position of the mass relative to a given reference point, m is the mass and v is the velocity of the particle. Since rigid bodies consist of point masses, the following equation can be used to calculate the angular momentum about the impact point, and solving for v+v^+ allows the computation of the post impact velocity.

L=iri×mivi+=iri×miviL = \sum_i r_i \times m_i v_i^+ = \sum_i r_i \times m_i v_i^-

Method 3: Momentum Transformation

A nonholonomic constraint is a constraint that is not holonomic . An important form of nonholonomic constraints are those that are expressed as a non-integrable, linear combination of generalized velocities of the form:

JcTq˙=0cn×1J_c^T \dot{q} = 0_{c_n\times1}

Mechanical systems with holonomic/nonholonomic constraints can be modeled as pH systems where the constraints appear as Lagrange multipliers, which are of the form:

[q˙p˙]=[0IIDp][HqHp]+[00Gp(q)Jc(q)][uFc]\begin{equation} \begin{bmatrix} \dot{q} \\ \dot{p} \end{bmatrix} = \begin{bmatrix} 0 & I \\ -I & -D_p \end{bmatrix} \begin{bmatrix} \dfrac{\partial{H}}{\partial{q}}\\\dfrac{\partial{H}}{\partial{p}} \end{bmatrix} + \begin{bmatrix} 0 & 0 \\ G_p(q) & J_{c}(q) \end{bmatrix}\begin{bmatrix} u \\ F_c \end{bmatrix} \end{equation}

In order to reduce the model to remove the Lagrange multiplier, we can perform a momentum transformation given by:

p=Q0Tp=[μpr]=[AT(q)QT(q)]p\begin{equation}\mathbf{p} = Q_0^Tp = \begin{bmatrix} μ\\p_r\end{bmatrix} = \begin{bmatrix} A^T(q)\\Q^T(q) \end{bmatrix}p\end{equation}

where Q=(Jc(q))TQ=(J_c^\perp(q))^T and AA is chosen such that GcAG_c^\perp A is invertible which implies Q0=[AT(q)QT(q)]Q_0 = \begin{bmatrix} A^T(q)\\Q^T(q) \end{bmatrix} is invertible.

Under this momentum transformation the system dynamics can be equivalently expressed as

[q˙pr˙]=[0QQCrDr][HrqHrp]+[0Gr(q)]u\begin{equation} \begin{bmatrix} \dot{q} \\ \dot{p_r} \end{bmatrix} = \begin{bmatrix} 0 & Q \\ -Q & C_r - Dr \end{bmatrix} \begin{bmatrix} \dfrac{\partial{H_r}}{\partial{q}}\\\dfrac{\partial{H_r}}{\partial{p}} \end{bmatrix} + \begin{bmatrix} 0 \\ G_r(q) \end{bmatrix} u\end{equation}

where

Gr(q)=QTGp(q)Dr(pr,q)=QTDp(q,p)(Q)Cr=QT{Tq[MQ(QTMQ)1pr]q[MQ(QTMQ)1pr]}Q(q)Mr(q)=Q(q)TM(q)Q(q)G_r(q) = Q^T G_p(q) \\ D_r(p_r,q) = Q^TD_p(q,p)(Q) \\ C_r = Q^T\{\dfrac{\partial^T}{\partial q} \begin{bmatrix} MQ(Q^TMQ)^{-1}p_r\end{bmatrix}- \dfrac{\partial}{\partial q}\begin{bmatrix} MQ(Q^TMQ)^{-1}p_r\end{bmatrix}\} Q(q) \\ M_r(q) = Q(q)^TM(q)Q(q)

Note, since Q0Q_0 is invertible the canonical momentum pp can be back-calculated from prp_r directly as follows:

p=Q0Tp=MQ(QTMQ)1pr\begin{equation} p = Q_0^{-T}\mathbf{p} = MQ(Q^TMQ)^{-1}p_r \end{equation}

Considering a situation where an impact is occurring, leading to a switch from constraint scenario A to constraint scenario B, such as a biped switching stance feet during a walking gait. To model both contact scenarios a reduced system with reduced momentum prp_r can be derived for the A and B contact scenarios. At the time the impact occurs, we compute the canonical momentum pp (momentum of the full floating base system) from prp_r^- using equation (4)(4) as follows:

p=MQ((Q)TMQ)1pr\begin{equation}p = MQ^-((Q^-)^TMQ^-)^{-1}p_r^- \end{equation}

where Q=(JcA)TQ^- = (J_{cA}^\perp)^T, MM is the mass matrix of the full floating model, JcAJ_{cA} is the A scenario contact jacobian and prp_r^- is the pre-impact reduced momentum for the A scenario contact consistent dynamics.

We now apply the momentum transformation (2)(2) to map pp into the B contact consistent dynamics as follows:

[μpr+]=[AT(q)(Q+)T(q)]p\begin{equation}\begin{bmatrix} μ \\ p_r^+ \end{bmatrix} = \begin{bmatrix} A^T(q)\\(Q^+)^T(q) \end{bmatrix}p\end{equation}

where Q+=(JcB)TQ^+ = (J_{cB}^\perp)^T, A=JcBTA = J_{cB}^T, the B scenario contact jacobian, and pr+p_r^+ is the post-impact momentum for the B contact consistent dynamics.

Ultimately, the post impact momentum pr+p_r^+ can be calculated as follows:

pr+=(Q+)TMQ((Q)TMQ)1prp_r^+=(Q^+)^TMQ^-((Q^-)^TMQ^{-})^{-1}p_r^-

where Q+=(JcB)TQ^+ = (J_{cB}^\perp)^T,Q=(JcA)TQ^- = (J_{cA}^\perp)^T, MM is the floating systems mass matrix and prp_r^- is the pre-impact momentum.

Energy loss

This instantaneous velocity change is always associated with a kinetic energy loss:

Lagrangian form:

Eloss=12(q˙+q˙)TM(q˙+q˙)=12Δq˙TMΔq˙E_{loss} = -\frac{1}{2}(\dot{q}^+-\dot{q}^-)^TM(\dot{q}^+-\dot{q}^-) = -\frac{1}{2}\Delta \dot{q}^TM\Delta \dot{q}

Hamiltonian form:

Eloss=T+T=12p+TM1p12pTM1p=12pTM1Jc(JcTM1Jc)1JcTM1pE_{loss} = T^+-T^- = \dfrac{1}{2}{p^+}^TM^{-1}p^- - \dfrac{1}{2}{p^-}^TM^{-1}p^- = \dfrac{1}{2}{p^-}^TM^{-1}J_c(J_c^TM^{-1}J_c)^{-1}J_c^TM^{-1}p^-