Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to generate large transverse friction forces for soft contacts? #1649

Open
acrylic-origami opened this issue May 11, 2024 · 1 comment
Labels
question Request for help or information

Comments

@acrylic-origami
Copy link

Hi,

I'm an engineer trying to use MuJoCo for humanoid robotic control.

I'm trying to model grass interactions in MuJoCo, specifically its anisotropic drag against the robot's feet (where it is springy and fairly lossless in the normal direction and frictional in transverse directions). It sounds like friction should be perfect for this. My impression was that I could make the contact soft so the robot could sink into the grass geom, then use large friction coefficients to create transverse drag in spite of the small reaction force.

However, I think I must be misunderstanding the friction model. Symptomatically, when using larger friction values, I don't seem to get much damping, but instead I have noticed the contact seems to get much softer.

For example, here's a box on a pendulum penetrating a relatively soft, undamped plane:

<mujoco>
    <visual>
        <headlight ambient="1 1 1"/>
    </visual>
    <worldbody>
        <geom type="plane" rgba="0 1 0 0.3" size="1 1 1" condim="3" solref="-100 -0.001" friction="0.1" priority="2" solimp="0.9 0.99 0.06" pos="0 0 -0.9" /><!-- The plane has higher priority -->
            <body name="b1">
                <joint type="hinge" name="j1" axis="0 1 0" />
                <geom name="g1" type="box" size="0.1 0.1 0.1" pos="1 0 0" mass="1" />
            </body>
    </worldbody>
</mujoco>

When friction=0.1, I get a springy undamped response as expected:

friction_0p1.mp4

However, when friction=1.0, the stiffness drops out enough for the box to swing to the other side, and I don't see any additional losses:

friction_1p0.mp4

Higher values of friction don't do much, and I worry that I'm heading towards instabilities. Here's friction=10 for completeness:

friction_10p0.mp4

These are all simulated with pyramidal cones, but elliptical cones look much the same.

Is this expected behavior and am I missing something about MuJoCo's slip/friction model? Is there a way to achieve anisotropic dynamic slipping friction for a soft geom (i.e. without resorting to isotropic solref damping)?

@acrylic-origami acrylic-origami added the question Request for help or information label May 11, 2024
@acrylic-origami
Copy link
Author

acrylic-origami commented May 18, 2024

It took a few more reads of the Computation chapter, but I think I'm starting to see where I misunderstood the friction and soft contact models. It's still unclear to me how to generate large transverse drag using only contacts, so I've narrowed the issue title.

I do also appreciate some corrections if I'm still missing some parts of the picture. As I understand it, my mistake was that I thought that dynamic friction was always proportional to the normal force of the contact, and this normal force was defined by the mass-spring-damper system. That assumed:

  1. The transverse (frictional) force was given by: $f_{trans}=-\hat{v}\mu f_{\bot}$, and
  2. The normal force was defined as $f_\bot := -bJ_\bot v_\bot - kr$, where
    • $r$ is the scalar, purely normal constraint violation for elliptic cones, and
    • $J_\bot$ is the Jacobian of the normal contact component

I now understand that this is wrong, and instead, for small $R$, the constraint dynamics approach $a_{ref}$ up to the friction cone, where $a_{ref} := -bJv - kr$ is defined in all directions, and since $b$ and $r$ are scalars for every contact, the target drag is isotropic. The upshot is that friction can only limit transverse drag components relative to the drag in the normal direction for the same velocity.

It seems the simulations showed just that:

  • For large friction values and soft, undamped surfaces, the friction cone is large and the forces are mostly unconstrained, so the dynamics approach $a_{ref}$ which is isotropically soft and undamped, including in the transverse directions.
  • For small friction values, the cone is narrow and the solution is on the cone surface. My understanding is that the minimizer will generate strictly larger normal forces, since the closest point on the cone surface to $a_{ref}$ is further along the normal axis. If so, it's actually the very small friction values that are excessively stiff, not the other way around.

My understanding is that most use cases have hard and dissipative surfaces with very little penetration, so that slip involves being on the friction cone almost all the time, and friction behaves intuitively, being mostly proportional to $\mu$.

Meanwhile, in cases with soft yet grippy surfaces, the better intuition is that the penetrating object "sticks" to the soft surface and encounters the drag as it retracts and pulls the surface of the soft object back to equilibrium.

My issue with isotropic drag is that every step the robot takes will incur large energy losses, even if the robot lifts the foot directly upwards. I'm a bit surprised that I haven't found any other issues about energy losses from rebounding drag for soft surfaces; does using flex/flexcomp avoid this?

@acrylic-origami acrylic-origami changed the title Confused about friction for soft surfaces Is it possible to generate large transverse friction forces for soft contacts? May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or information
Projects
None yet
Development

No branches or pull requests

1 participant