Instability and wall penetration of a rotating cable within narrow canal geometry (rx_motor) #3329
Replies: 2 comments 1 reply
-
|
Hello, I am a MuJoCo user attempting to understand your problem!
If you can share a loadable XML file with required (minimal) assets, one could help further.
Did you find any performance improvements if you
With |
Beta Was this translation helpful? Give feedback.
-
|
Hi, thanks for the detailed questions.
For our cable-in-canal jumping issue, current findings are:
Contact tuning: We get better behavior with harder normal contact (solref time constant around 0.003–0.01) and smoother force onset using solimp (with small solimp[0], near 0–0.1, to reduce initial impulse).
Solver/integrator: Newton is the most reliable for this contact-rich case. Implicit/implicitfast is more stable than explicit when rotation is fast. RK4 did not improve this contact-discontinuous regime.
Timestep: Reducing dt helps significantly (best gains around ~5–20x smaller; 100x mainly as a diagnostic due to cost).
Friction diagnostic: condim=1 (normal-only) reduces jumping in some runs, suggesting tangential/friction effects are part of the instability.
Collision regime: Very small mesh–capsule clearance is sensitive to timestep + contact regularization; we are also checking mesh quality.
Diagnostics monitored: ncon, contact distances, nefc, solver iterations/residual indicators, and contact/constraint forces (efc_force) with contact visualization.
margin/gap: We use small nonzero margin and tune gap as a pre-contact band to make contact onset less abrupt.
I can share a minimal loadable XML + required assets next so we can isolate this behavior cleanly.
Thanks again for the guidance.

… On 11 Jun 2026, at 19:29, Vyankatesh Ashtekar ***@***.***> wrote:
Hello, I am a MuJoCo user attempting to understand your problem!
Contact Parameters for Narrow Passages: Are there specific solref or solimp configurations recommended for preventing wall penetration when a body is rotating rapidly within a tight mesh?
If you can share a loadable XML file with required (minimal) assets, one could help further.
Solver/Integrator Choice: For this type of cable-in-canal interaction, is there a preferred integrator (e.g., PGS vs. CG vs. Newton)?
Did you find any performance improvements if you
reduced the timestep by a couple of orders?
used implicit/RK4 integrator? I have seen that the implicit integrator helps when rapidly rotating objects are in consideration. RK4 seems to be the best integrator for energy conservation (asserting the validity of the simulation). The implicit integrator seems to be the best for maintaining simulation stability
reduce the condim to 1, i.e., no friction effects (something you said about jumping)
Collision Detection: Does MuJoCo have recommendations for mesh-to-capsule (or mesh-to-cylinder) collisions where the clearance is very small?
Diagnostic Tools: Are there specific internal variables or visualizers we should monitor to determine if the instability is arriving from the solver iterations or the contact-pair generation?
With solimp[0]=0 or a small number, you can reduce the initial contact force impulse.
Also, could you expand on how you chose the values of margin and gap?
—
Reply to this email directly, view it on GitHub <#3329?email_source=notifications&email_token=BQCCAM6TNWVAL35QWQUQGGT47KJZ7A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZSGYZTGNBXUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-17263347>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BQCCAM5ZQ2E6XZZF6CUR4B347KJZ7AVCNFSNUABIKJSXA33TNF2G64TZHM2DAMBVGAYTCMZWHNCGS43DOVZXG2LPNY5TCMBSGM3TENZZUF3AE>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hello MuJoCo developers,
We are working on a simulation system in MuJoCo and are encountering instability issues.
We have already tried modifying the system and previously added a force/thrust limit, which helped, but the issue is not yet fully resolved.
We are simulating a flexible cable navigating through a narrow, complex mesh geometry (a kidney canal model). The cable is controlled via three actuators: ty_motor (translation), bending, and rx_motor (rotation around the cable's axis).
We are experiencing severe numerical instability specifically when the rx_motor (rotational actuator) is active. The cable exhibits "jumping" behavior and frequently penetrates or completely passes through the walls of the canal mesh, violating the contact constraints.
My setup
Technical Details
Actuators: The instability is most prominent when applying torque via the rx_motor.
Geometry: High-curvature, narrow internal canals (Complex Mesh).
Current Mitigation: We have implemented force/torque limits (which helped slightly) and are experimenting with contact parameters.
The Issue: Rotational motion seems to "tunnel" through the mesh walls or cause the solver to diverge, leading to non-physical displacements.
My question
Request for Guidance
We would appreciate advice from the developers or the community on the following:
Contact Parameters for Narrow Passages: Are there specific solref or solimp configurations recommended for preventing wall penetration when a body is rotating rapidly within a tight mesh?
Solver/Integrator Choice: For this type of cable-in-canal interaction, is there a preferred integrator (e.g., PGS vs. CG vs. Newton)?
Collision Detection: Does MuJoCo have recommendations for mesh-to-capsule (or mesh-to-cylinder) collisions where the clearance is very small?
Diagnostic Tools: Are there specific internal variables or visualizers we should monitor to determine if the instability is arriving from the solver iterations or the contact-pair generation?
We are happy to provide our .xml model or specific code snippets if that would help diagnose the issue.
Thank you for your time and help.
Minimal model and/or code that explain my question
minimal xml:
Minimal python:
import mujoco as mj
import mujoco.viewer
import numpy as np
import time
model = mj.MjModel.from_xml_path("minimal_kidney_cable.xml")
data = mj.MjData(model)
ty_id = mj.mj_name2id(model, mj.mjtObj.mjOBJ_ACTUATOR, "ty_motor")
rx_id = mj.mj_name2id(model, mj.mjtObj.mjOBJ_ACTUATOR, "rx_motor")
with mujoco.viewer.launch_passive(model, data) as viewer:
print("Pushing cable into kidney canal via ty_motor...")
for _ in range(3000):
data.ctrl[ty_id] = 0.45 # push forward
data.ctrl[rx_id] = 0.0 # no rotation yet
mj.mj_step(model, data)
viewer.sync()
time.sleep(model.opt.timestep)
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions