Back to cable report

Routed Massless Cable Design

Design note for Newton's XPBD and VBD routed cable feature. The feature models the effect of an inextensible, massless cable routed through attachments, pinholes, and rolling pulleys, including finite capstan friction on rolling contacts and zero-radius frictional pinholes.

Branch
mmacklin/cable-sim
Baseline
1a87f7a2 pre-split finite capstan baseline
Updated
2026-05-11 07:33 UTC
Status
XPBD pinhole friction/alternating two-prismatic routing with sagging slack curves and material ticks pass; VBD example-hook failures tracked
Feature Name
routed massless cable
Data Model
ordered tendon links
Solver
XPBD rows + VBD force kernels
Friction
capstan projection

Problem Statement

The target use case is a cable-driven mechanism where the cable is effectively massless compared with the bodies it connects. The user wants correct force transmission, cable length accounting, pulley rotation, and capstan slip behavior without discretizing the cable as many small rigid or deformable bodies.

This is intentionally different from Newton's existing JointType.CABLE, which is a rod-like joint with stretch and bend/twist stiffness between neighboring bodies. The routed cable feature is not a Cosserat rod representation; it is a reduced constraint model for a massless routed path.

Naming recommendation: keep the implementation namespace as tendon internally for now, but expose this concept as CABLE_ROUTED or CABLE_MASSLESS if it becomes a first-class public joint or constraint type. That avoids confusion with Newton's rod-style cable joint and MuJoCo's tendon terminology.

Design Goals

Physical Semantics

  • Model a single routed cable as an ordered path of links.
  • Preserve total free length plus wrap length within solver tolerance.
  • Let dynamic pulley rotation, kinematic locking, and slip arise from one formulation.
  • Use the real cable/pulley geometry rather than analytic test motion.

Solver Semantics

  • Use one stretch constraint path for slip and no-slip behavior.
  • Keep cable load in the stretch row and pulley spin coupling in the rolling friction row.
  • Project friction impulses instead of switching constraints by stick/slip state.
  • Let dynamic versus kinematic behavior come from inverse mass and inverse inertia.

Newton Formulation

A routed cable is stored as a sequence of links. Consecutive links create unilateral stretch segments. Each link is one of:

Link Type Meaning State
ATTACHMENT Fixed body-local endpoint or via point. Body index and local offset.
PINHOLE Frictionless zero-radius transfer point. Adjacent rest lengths exchange taut excess.
ROLLING Circular pulley contact with tangent points and wrap angle. Local contact points, radius, winding orientation, axis, and mu.

The current XPBD path has three kernel entry points, and VBD now uses the same routed tendon rows inside its rigid iteration:

update_tendon_attachments()
solve_tendon_stretch()
solve_tendon_slip()

update_tendon_attachments recomputes tangent points and applies the Cable Joints surface-distance rest-length transfer every XPBD iteration. Rolling transfer is scaled by the capstan coefficient, and pinhole or rolling redistribution is clamped by the capstan bound T_tight / T_slack <= exp(mu * theta). For pinholes, theta is the angle between the incoming and outgoing cable directions at the body-local routing point.

solve_tendon_stretch solves each taut free span at the current contact points. It carries the cable load while leaving the rolling link's spin-axis component for the friction row. solve_tendon_slip then applies the capstan-limited spin-axis angular impulse using the lagged stretch increment.

The VBD path shares the routed tendon state and lambdas with XPBD. It updates current geometry/rest transfer, projects taut stretch, and applies the separated capstan slip/spin row before and after the AVBD rigid body sweep. There is no VBD global routed-length force and no VBD-only tendon force/Hessian path in the current solve.

Capstan Friction

The friction model is intentionally a projection layered on the physical rolling contact row. The route update handles surfaceDist(old, new) transfer before stretch, and the slip row applies the admissible spin-axis impulse after stretch. For each rolling link, adjacent span tensions are estimated from taut stretch:

T_i ~= max(length_i - rest_i, 0) / compliance_i

The admissible imbalance is then computed from the capstan ratio:

cap_ratio = exp(mu * theta)
allowed_diff = ((cap_ratio - 1) / (cap_ratio + 1)) * (T_left + T_right)

If the candidate spin-axis correction implies more torque than this imbalance permits, the angular correction is scaled down. This gives the desired limiting behavior:

Case Result
mu = 0 Friction impulse projects to zero. Cable slips freely and a dynamic pulley receives no rim torque.
finite mu Partial torque survives. Relative slip decreases as mu increases.
high mu The projection rarely clamps under ordinary loads, recovering the no-slip rolling limit.
kinematic pulley, high mu The pulley cannot move through inverse inertia, so the cable locks against it.

Comparison To Other Methods

Method Core Model Strengths Limitations Relative To Newton Routed Cables
Newton routed massless cable Reduced cable effect represented by mutable distance constraints and rolling contact points. Dynamic pulleys, kinematic pulleys, pinholes, immediate driven-pulley response, finite capstan slip, and GPU-friendly XPBD kernels. Prototype scope: circular pulleys only, no dynamic merge/split rerouting, no cable mass or bending/twist wave propagation.
Original Cable Joints paper Distance constraints whose attachment points and rest lengths change dynamically. Robust reduced model for cable-driven rigid mechanisms without many small cable segments. The original method is primarily a no-slip routed cable baseline. Newton adds the current finite capstan projection but has not yet ported every reference-code feature.
MuJoCo spatial tendons Scalar minimum-length paths through sites and wrapping geoms; the scalar length and its gradient drive limits, springs, damping, friction loss, and actuators. Mature MJCF feature, compact modeling, tendon actuators, limits, dry friction loss, branch pulleys, and closed-form wrapping around spheres/cylinders. Wrapping geoms are obstacles in the scalar path calculation, not dynamic rolling bodies with rim inertia and capstan torque transfer. Multiple wrapping geoms must be separated by sites to avoid tendon-level iteration.
MuJoCo fixed tendons Linear combination of scalar joint positions. Excellent for abstract mechanical coupling, mimic-like mechanisms, and actuator transmissions. No routed 3D geometry, no rolling contact points, no pulley inertia, and no local capstan slip model.
Newton JointType.CABLE / rod-like cable Stretch and bend/twist relationship between neighboring bodies. Appropriate for deformable rods, cables with bending stiffness, twist propagation, contact, and visible cable dynamics. Requires discretized cable bodies. It is not a reduced massless route through pulleys and pinholes.
Explicit rope/contact simulation Many particles, rigid links, or finite elements with contact against pulleys and guides. Can represent cable mass, waves, sag, contact, self-contact, bending, and topology changes. More expensive and more sensitive to mass ratios, contact tuning, and inextensibility errors in cable-driven mechanisms.
Joint equality / mimic constraints Direct algebraic relationship between coordinates. Simple and stable for fixed-ratio gears or known transmissions. No geometry-dependent routing, no wrap-length accounting, no changing moment arms, and no capstan slip.

MuJoCo Tendon Mapping

MuJoCo tendons are closest in user intent: they provide scalar tendon lengths that can be actuated, limited, spring-damped, or used for dry-friction loss. Spatial tendons are minimum-length routed paths through sites and wrapping geoms; fixed tendons are linear combinations of scalar joint coordinates.

The important distinction is what the pulley means. In MuJoCo, a wrapping geom contributes to a scalar path length and gradient. MuJoCo's spatial/pulley element splits tendon branches by divisors, so branch geometry does not represent a single physical rotating wheel. In Newton's routed cable feature, a rolling link is a body with a contact frame, radius, inertia, and friction coefficient. The same contact can spin a dynamic pulley or lock against a kinematic pulley.

This makes MuJoCo tendons a strong abstraction for actuation, generalized-coordinate transmissions, and compact length constraints. It also means that cable/pulley behavior which depends on a local rolling contact generally has to be modeled indirectly. In Newton's formulation, the pulley is not just part of a length function; it is a rigid body whose angular motion appears in the cable Jacobian.

Concept MuJoCo Newton Routed Cable
Path representation Sites, wrapping geoms, optional branch pulleys. Ordered links: attachments, pinholes, rolling pulleys.
Wrapping objects Analytic sphere/cylinder obstacle wrapping. Circular rolling link with body-local tangent points.
Pulley dynamics Represented through scalar length gradient and actuator/constraint forces; a branch pulley is a length divisor, not a spinning wheel. Explicit rigid body inertia through the angular Jacobian.
Capstan friction General tendon dry friction loss exists on the scalar tendon. Local rolling-contact capstan cone couples adjacent span tension and pulley torque.
Branching Supported with divisor-based branch pulleys. Not currently a general branching tendon graph; examples use ordered paths and separate cables where needed.
Solver style Generalized-coordinate constraint/force model in MuJoCo. XPBD position solve with mutable rest lengths and projected angular friction impulses.

MuJoCo Limitations For This Feature

Scalar Length, Not Local Contact State

MuJoCo tendons reduce the route to a scalar length and its gradient with respect to generalized coordinates. That is exactly what is needed for many actuators and transmissions, but it discards the local state we need for rolling cable contacts: body-local tangent points, signed surface travel, rim displacement, and per-pulley adjacent-span tension balance.

Consequence: a MuJoCo spatial tendon can pull on bodies through the path gradient, but a wrapping object is not automatically a physical sheave whose angular velocity must match cable travel in the no-slip limit.

Wrapping Geometry Is Restricted

MuJoCo computes wrapping analytically, which keeps the model compact and robust, but the allowed obstacle geoms are spheres and cylinders; cylinders are treated as infinite length for wrapping. Multiple obstacle geoms in a branch must be separated by sites to avoid needing an iterative tendon-level solve.

Newton's current routed cable is also scoped to circular pulley contacts, but the solver explicitly iterates adjacent pulley tangents and stores each rolling endpoint on its pulley body. That is better matched to mechanisms where the pulley itself is part of the dynamics.

Branch Pulleys Are Abstract

In MuJoCo, spatial/pulley starts a new branch and divides branch length by a user-specified divisor. The docs explicitly note that branches do not need to be spatially connected and that the spatial relation among branches is not relevant to the simulation.

That is excellent for compact mechanical advantage models. It is a limitation when the question is whether a particular pulley rotates, whether its rim travel matches the cable, or whether a branch should inherit a local capstan slip state from a physical wheel.

Friction Is Global Along The Tendon

MuJoCo's tendon frictionloss is dry friction associated with the scalar tendon coordinate. It is not an Euler-Eytelwein capstan law applied locally at each wrap with T_tight / T_slack <= exp(mu * theta).

Consequence: it does not directly express the cases we care about: zero friction gives no pulley torque, finite friction gives partial rim transfer, high friction gives no-slip, and high friction against a kinematic pulley locks the cable.

No Implicit Sheave Inertia

MuJoCo has tendon armature, which adds inertia to changes in tendon length. That is useful for actuator internals or hydraulic-like scalar inertia, but it is not the same as a pulley body inertia coupled by R * dtheta at a local rolling contact.

In Newton, small and large pulley inertia change the cable/rim transfer through the same angular Jacobian used by the stretch row. This is why dynamic and kinematic pulleys fall out of the mass matrix rather than a separate model branch.

Side Selection Can Be Discrete

MuJoCo supports sidesite to prevent a tendon from snapping between sides of a wrapping geom, and specifying such a site is often needed. That is a reasonable tradeoff for analytic minimum-length wrapping.

The Newton route is instead an ordered contact sequence. It does not choose an arbitrary shortest path through a set of obstacles each step; the authored route defines which side of each rolling contact is used through winding orientation and tangent continuity.

When MuJoCo Is Still The Better Model

The MuJoCo tendon model is not a weaker model in general; it is solving a different modeling problem. It is likely the better choice when:

  • the mechanism only needs scalar length limits, springs, dampers, actuators, or force sensors;
  • the pulleys are abstract transmissions rather than bodies whose angular inertia matters;
  • fixed tendons can represent the desired coupling as a linear combination of scalar joints;
  • branching mechanical advantage is more important than physical sheave rotation;
  • the model should stay in native MJCF and use MuJoCo's mature actuator, sensor, and constraint stack.

Newton's routed cable feature is aimed at the complementary case: a cable-driven rigid-body mechanism where the route geometry, pulley rotation, kinematic pulley locking, and local capstan slip are the behavior being tested.

Implementation Summary

The current implementation keeps routed-cable geometry and mutable rest state shared between XPBD and VBD. The main model arrays are tendon_start, tendon_link_body, tendon_link_type, tendon_link_radius, tendon_link_orientation, tendon_link_mu, tendon_link_offset, tendon_link_axis, tendon_seg_rest_length, tendon_seg_compliance, and tendon_seg_damping.

Both solvers store body-local segment endpoints for rolling contacts. XPBD updates tangent geometry, transfers rest length along rolling surfaces and frictional pinholes, solves taut stretch rows, and applies a separate capstan-limited rolling slip row. VBD now runs those same route, stretch, and slip rows inside the rigid VBD iteration. There is no separate pulley-angle state and no separate dynamic, kinematic, slip, or no-slip path.

Current acceptance examples cover dynamic capstan, kinematic capstan, simple rolling pulleys, pinhole transfer, a three-case frictional pinhole sweep, an alternating two-prismatic top-side multi-pinhole route with sagging slack curves, material tick diagnostics, and an offset right rail on one passive non-spherical cam guide body, compound pulley equilibrium, 3D routing, cable machine routing, a five-pulley gear/block-and-tackle layout, and the cross-base XY table. The report videos are linked from the main Cable / Tendon XPBD + VBD Report.

Current VBD status is improved but not a full acceptance pass. The CPU routed-tendon VBD slice passes, and focused CUDA checks pass for rolling transfer, dynamic capstan, kinematic capstan, and compound pulley. CUDA XY table still hard-fails the reference winding check, and the five-pulley gear route remains a CUDA expected failure.

Open Design Questions

  • Public API naming: tendon is convenient internally, but CABLE_ROUTED or CABLE_MASSLESS may be clearer externally.
  • Whether to split the current combined stretch/friction kernel into an explicit solve_tendon_friction kernel after the formulation stabilizes.
  • How to represent branch graphs and compound transmissions without losing the simple ordered-path solver.
  • Whether to add non-circular guides or dynamic rerouting from the reference implementation.
  • How to expose actuator semantics: drive a pulley body, drive tendon rest length, or both.

References