Solver Tuning Reference#
This page is the solver reference for Simulation Tuning: shared tuning concepts followed by the supported knobs per Newton solver, and order-of-magnitude sanity checks. Start from the Simulation Tuning landing page for the diagnostic workflow.
Important
The knob tables below are last-known, not a contract. Each solver’s own
constructor or Config is the source of truth for which options exist;
confirm an option against it before using it. See Simulation Tuning for
the full “verify specifics against code” guidance.
Solver-Specific Knobs#
Only tune parameters that exist on the solver you are using. Do not copy option
names from another solver or an external simulator. The notes about example
usage are based on tracked files under newton/examples; they show where the
repository examples spend tuning effort, not a shared solver API.
Solver |
Primary Newton knobs |
Notes |
|---|---|---|
|
Uses MuJoCo or MuJoCo Warp semantics. Newton’s constructor supports the
listed options, not every option from external MuJoCo documentation.
Examples most often tune |
|
|
More iterations reduce residual positional constraint error. Relaxation
and compliance change convergence and apparent stiffness. XPBD does not
use armature, joint friction, effort limits, or velocity limits.
Examples mostly tune |
|
|
Contact history requires matched contacts, for example
|
|
|
This semi-implicit articulated solver is tuned mainly through |
|
|
There is no iteration parameter. For instability, reduce |
|
|
Cloth material stiffness is usually authored when calling
|
|
|
Experimental. Keep tuning guidance conservative and prefer a dedicated
Kamino guide for detailed PADMM or closed-loop mechanism tuning.
Examples construct and pass a |
Drive Gain Sanity Checks#
Very stiff drives can destabilize a simulation even when the solver is correct. Use hardware specifications when available. If not, start with conservative gains and increase gradually.
For a rough drive check, define these variables before choosing gains:
Symbol |
Meaning |
Typical units |
|---|---|---|
\(k\) |
Drive stiffness. |
\(N/m\) for prismatic drives; \(N\cdot m/rad\) for revolute drives. |
\(d\) |
Drive damping. |
\(N\cdot s/m\) for prismatic drives; \(N\cdot m\cdot s/rad\) for revolute drives. |
\(m_{\mathrm{eff}}\) |
Effective mass moved by a prismatic drive. |
\(kg\) |
\(I_{\mathrm{eff}}\) |
Relevant effective inertia about the revolute joint axis. |
\(kg\cdot m^2\) |
\(\omega_n\) |
Approximate natural angular frequency. |
\(rad/s\) |
\(\zeta\) |
Approximate damping ratio. |
dimensionless |
For a prismatic drive, estimate:
For a revolute drive, estimate:
The damping ratio can be estimated as:
for a prismatic drive, or:
for a revolute drive. Treat these as order-of-magnitude checks, not exact
system identification. There is no universal safe threshold for the
dimensionless product \(\omega_n \Delta t\); rather than tune to a fixed
number, run a bounded dt (or stiffness) sweep and watch for instability. If
\(\omega_n \Delta t\) grows, reduce dt, reduce stiffness, add physically
justified armature, or switch to a solver/formulation that better matches the
problem.
For grippers and manipulation, set actuator limits before increasing gains:
Use the real actuator’s maximum force or torque when known.
Clamp target velocity or rate-limit target changes when targets jump far from the current joint state.
Test several object sizes and contact configurations in an isolated grasp scene before tuning the full task.
Prefer better contact geometry over extreme stiffness when the object twists, rocks, or slips due to sparse contacts.
Contact Stiffness Sanity Checks#
A similar force-space spring-damper check is useful for contact stiffness when
the active solver interprets shape_material_ke and
shape_material_kd as contact stiffness and damping. This check is
most direct for penalty-style contacts. Solver-specific mappings, such as
MuJoCo contact parameters and VBD AVBD ramping or contact history, can change
the practical meaning of stiffness and damping. Define:
Symbol |
Meaning |
Newton source |
|---|---|---|
\(k_{\mathrm{n}}\) |
Normal contact stiffness \(N/m\). |
Commonly |
\(d_{\mathrm{n}}\) |
Normal contact damping \(N\cdot s/m\). |
Commonly |
\(m_{\mathrm{eff}}\) |
Effective scalar mass seen along the contact normal \(kg\). Prefer a solver- or Jacobian-derived value. For two free bodies with purely translational normal motion, use their reduced mass. |
Derived from the contact Jacobian and inverse mass matrix, or approximated from the two free-body masses. |
\(\omega_n\) |
Approximate normal contact natural angular frequency \(rad/s\). |
Derived from \(k_{\mathrm{n}}\) and \(m_{\mathrm{eff}}\). |
\(\zeta_{\mathrm{n}}\) |
Approximate normal contact damping ratio. |
Derived from \(k_{\mathrm{n}}\), \(d_{\mathrm{n}}\), and \(m_{\mathrm{eff}}\). |
Then estimate:
for the two-free-body translational case. The lighter body mass is an upper bound only for this approximation: it overestimates \(m_{\mathrm{eff}}\) and underestimates \(\omega_n\), which can make a timestep/stiffness combination appear safer than it is.
For a scalar contact row with Jacobian \(J\) and generalized mass matrix \(M\), the principled quantity is conceptually \(m_{\mathrm{eff}} = (J M^{-1} J^T)^{-1}\) when that inverse exists. Rotational inertia, contact-point offset, articulation, and other active constraints change this value; the lighter body or subtree mass is not a general bound for those systems. If a Jacobian-derived value is unavailable, label the estimate as coarse and verify it with a bounded timestep/stiffness sweep and an explicit safety margin rather than a universal numeric factor.
Use this to catch obviously over-stiff contact settings before running large
scenes. There is no universal safe threshold for \(\omega_n \Delta t\); use
a bounded sweep rather than a fixed cutoff. If it grows large enough to threaten
stability, lower \(k_{\mathrm{n}}\), increase damping within reason, reduce
dt, or choose a solver and contact representation that can handle the desired
stiffness. For
torsional or rolling contact effects, the same idea applies with effective
inertia instead of effective mass, but the exact parameter mapping is
solver-dependent.
Contact Tuning#
Use this sequence for contact-heavy scenes:
Verify geometry and contact normals with visualization.
Check that contact margins and gaps are appropriate for the scene scale.
Choose the simplest contact representation that reproduces the needed behavior. Prefer primitives first, then a convex hull or convex decomposition. When task-relevant non-convex geometry remains, attach a precomputed SDF to the triangle mesh and choose a resolution that preserves the necessary features. Treat live BVH triangle-mesh collision without an SDF as a fallback, not the default production path: its cost scales with mesh complexity, triangle winding matters, and it does not support hydroelastic contact. Benchmark task behavior and cost, and remove collision geometry from parts that never make relevant contact. See Mesh Collision Handling.
Set friction coefficients to realistic values before raising stiffness.
Increase contact stiffness only while
dtand solver convergence can support it.Add damping to reduce bounce or oscillation.
Increase solver-specific convergence work if available.
Refresh contacts more frequently if fast motion or manipulation depends on current contact points.
Common mistakes:
Raising
shape_material_kewhile keeping a largedt.Using a detailed visual mesh as a collision mesh when a primitive, convex decomposition, SDF, or hydroelastic representation would be more stable.
Tuning friction before confirming contacts are generated at the expected locations.
Ignoring contact buffer overflow warnings or symptoms.
Disabling self-collision globally instead of identifying the specific unintended colliding pair.
Performance Tradeoffs#
Change |
Usually improves |
Usually costs |
|---|---|---|
Reduce |
Stability, contact accuracy, drive stability |
Runtime |
Increase solver iterations |
Constraint convergence where supported |
Runtime |
Tighten solver tolerance |
Accuracy where supported |
Runtime, sometimes little benefit after convergence plateaus |
Increase contact stiffness |
Penetration resistance |
Stability margin, may require smaller |
Increase contact damping |
Bounce and oscillation control |
Responsiveness, possible overdamping |
Use SDF or hydroelastic contacts |
Complex contact geometry and manipulation fidelity |
Collision cost and setup cost |
Refresh contacts less often |
Collision performance |
Contact accuracy for fast or changing contact configurations |
Add armature |
Drive stability and lower effective natural frequency |
Physical model fidelity if not actuator-justified |
Clamp or rate-limit commands |
Stability and physical realism |
Tracking performance if clamps or rates are too restrictive |