Adding friction to joints

Viewed 83

I am setting up a simulation with some revolute and prismatic joints (fairly simple robot arm), and I was wondering if there is a straightforward way to add friction to the arm's joints?

Something simple like a coefficient of static friction and a coefficient of kinetic friction, and switching between the two based on the joint's velocity.

In the sim I just have gravity as an external force and then a PID controller controlling the joint positions and velocities. The way I see it, I could add friction to the joints by either:

  1. Hacking together a torque to apply by looking at the gravity and actuation forces at each time step
  2. Writing a new joint class that inherits from the linear/revolute joint classes and add in some sort of friction

Do either of these seem like the best way to do this? I'm hoping there's an easier way I am missing.

Thanks!

2 Answers

The joints (e.g., RevoluteJoint) already offer damping:

Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e., opposing motion, with ω the angular rate for this joint.

It can be set via the API or in SDFormat, e.g.,

      <joint name="revolute_joint" type="revolute">
        <child>link2</child>
        <parent>link1</parent>
        <axis>
          <xyz expressed_in="__model__">0 0 1</xyz>
          <limit>
            <lower>-1</lower>
            <upper>2</upper>
            <effort>100</effort>
            <velocity>100</velocity>
            <drake:acceleration>200</drake:acceleration>
          </limit>
          <dynamics>
            <damping>0.2</damping>
            <spring_reference>0</spring_reference>
            <spring_stiffness>0</spring_stiffness>
          </dynamics>
        </axis>
      </joint>

Is that a close enough match for what you need?

For revolute joints, what is needed is a frictional torque that depends on |ₙ| (the magnitude of a force on the joint), a material-dependent coefficient of friction μₖ, and an effective radius rₑ. During sliding, the direction of the frictional torque is opposite the relevant angular velocity vector . To avoid a divide by zero problem when = , add an epsilon ε that is a small positive number that represents a very small || (magnitude of angular velocity).

= -μₖ * rₑ * |ₙ| * / (|| + ε)

Note: Sometimes the coefficient of friction μₖ and effective radius rₑ are combined into a single constant.

Note: I do not unambiguously understand the SDF spec. I can guess, but that seems somewhat antagonist to a specification. http://sdformat.org/spec?ver=1.9&elem=joint#axis_dynamics

Related