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

Unstable flat-on-flat contact when switching over to contact models Lagged / Similar #21514

Closed
jbinagia opened this issue Jun 3, 2024 · 6 comments
Assignees
Labels

Comments

@jbinagia
Copy link

jbinagia commented Jun 3, 2024

What happened?

As discussed in this slack thread and reproduced in this deepnote notebook, I discovered an issue whereby unstable plane-on-plane contact was exhibit for two floating models stacked on top of one another when using the Lagged or Similar contact models. A video illustrating this behavior is shown below:

lagged_and_similar_2024-05-22.17-57-39.mp4

The hydroelastic moduli for the boxes are ~1e6 Pa. Because I do not see this instability for SAP, I expected Lagged and Similar to also be stable for this choice of moduli (i.e. I expect the same modulus value to be stable regardless of contact model choice). I believe this may be a result of the fact that SAP regularizes contact in the near-rigid regime, while Lagged and Similar models do not.

Version

No response

What operating system are you using?

No response

What installation option are you using?

No response

Relevant log output

No response

@jwnimmer-tri jwnimmer-tri added the component: multibody plant MultibodyPlant and supporting code label Jun 3, 2024
@amcastro-tri
Copy link
Contributor

This is an animiation of the instability showing the contact patch between the boxes.
This is the same typical problem we get with (multi) point contact at (large) discrete time steps.
With kSap the problem is greatly minimized, however it does not go away, you just need to run for longer becase it's a slower frequiency (~1Hz for kSap and ~15Hz for kSimilar).
The reason is that kSap overestimates the amount of regularization at large dissipation values (in this case 0.1 sec).
This, as explained in the paper above, brings other problems we'd like to avoid. So regularization is only hiding a common problem, it is not the solution. I'll post later a solution that seems to work very well.

instability_with_similar
Instability problem for kSimilar with E=1e6 Pa, d=20 s/m and dt=0.01 s.

@amcastro-tri
Copy link
Contributor

All right, teaser progress on this.
The sim below is run with kSimilar. Just to make it a "bit" more difficult, I am dropping the box from a far height, the hydro modulus is 1.0e8 Pa (there's nor regularization nor softening here, this is the real deal), no dissipation (to make it yet more difficult, so that any plaussible artifacts do not get damped out), the coefficient of friction is as before 0.4. Both boxes and the ground are compliant (with that very large modulus). As ou can see, there are no instabilitites. I run several initial conditions, orientatioins, etc and still I get this super nice stable sims.

I'll create a branch with the solution and link here shortly.

stable_with_similar

@amcastro-tri
Copy link
Contributor

Solution implemented in #21528.

amcastro-tri added a commit to amcastro-tri/drake that referenced this issue Jun 5, 2024
@jbinagia
Copy link
Author

jbinagia commented Jun 5, 2024

@amcastro-tri Just to confirm, this fix also works when using kLagged as well?

@amcastro-tri
Copy link
Contributor

yes, this improves time coherence regardless of the contact approximation, so it makes things better for kSap, kSimilar, kLagged and even kTamsi.

@jwnimmer-tri jwnimmer-tri changed the title Unstable plane-on-plane contact when switching over to contact models Lagged / Similar Unstable box-on-box contact when switching over to contact models Lagged / Similar Aug 5, 2024
@jwnimmer-tri jwnimmer-tri changed the title Unstable box-on-box contact when switching over to contact models Lagged / Similar Unstable flat-on-flat contact when switching over to contact models Lagged / Similar Aug 5, 2024
@amcastro-tri
Copy link
Contributor

#21773 introduces margin for hydroelastic contact to fix this issue.

Users must set a non-zero value of of the default in DefaultProximityProperties::margin. The recommended value is 0.1 mm (10⁻⁴ m).

After some experimentation our intentiion is to make this value of 10⁻⁴ m the default value in Drake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants