XPBD Routed Cable Requirements
This document records the current requirements for Newton's XPBD routed cable solver. It backs the requirements out of the routed-cable design discussions, the formulation note, and the regression tests that were added while debugging capstan, pinhole, and tension reporting behavior.
The intent is to provide a single checklist for future tendon changes. A change may improve the numerical method, but it should not silently change these physical contracts without updating this document and the corresponding tests.
Scope
These requirements apply to the XPBD tendon path for massless routed cables made from:
- fixed body-local attachments,
- zero-radius pinholes,
- finite-radius circular rolling links,
- mutable free-span rest lengths, and
- unilateral stretch rows.
The VBD routed-tendon path should mirror these physical contracts where it claims feature parity, but this document treats XPBD as the reference behavior.
Core Modeling Requirements
One Cable Formulation
- Use one routed-cable formulation for slip and no-slip behavior.
- Do not add separate kinematic, dynamic, slip, no-slip, static-friction, or kinetic-friction solver paths.
- Stick, slip, and no-slip behavior must emerge from the friction projection and body mass properties.
- The friction coefficient
muis the single coefficient controlling the capstan bound. Do not require separate static and kinetic coefficients to reproduce capstan hysteresis.
Split Stretch / Slip Rows
- Segment stretch carries cable load.
- Capstan slip is represented by rest-length redistribution between adjacent free spans.
- Rolling spin-axis coupling is solved separately from free-span stretch.
- The stretch row must not include the rolling link spin-axis angular component; pulley spin does not change tangent-point geometry.
- Non-spin angular terms remain in stretch so off-axis body motion still affects route geometry.
- There must be no global cable-length force row replacing the local segment stretch and rest-transfer rows.
Rest-Length State
- Each free span stores a mutable rest length.
- Pinhole and rolling capstan slip transfer rest length between adjacent spans while preserving their rest-length sum, up to clamping at minimum span length.
- Slack spans must not be proportionally repartitioned. Only taut excess may drive rest-length transfer.
- Rest lengths must stay finite and non-negative.
- Total cable length may vary locally through slack/tension state, but it must remain bounded and must not accumulate systematic drift in stable scenes.
Capstan Law
- The admissible tension band is the Euler-Eytelwein capstan band:
text
T_tight / T_slack <= exp(mu * theta)
thetais the geometric wrap or bend angle, not the pulley spin angle.mu = 0removes the capstan friction limit and permits free slip.- Finite
mupermits partial grip/slip. - High
murecovers the no-slip limit under the tested loads. - The capstan projection must keep both adjacent tensions inside the capstan cone.
Pinhole Behavior
- A pinhole is a body-local zero-radius waypoint.
- Its bend angle is computed from the incoming and outgoing cable directions.
- Pinhole friction uses the same capstan tension-ratio bound as rolling links.
- With
mu = 0, a pinhole behaves as a frictionless slip point. - With finite
mu, through-pinhole transfer decreases monotonically asmuincreases. - With high
mu, a kinematic pinhole can lock cable transfer except for normal segment compliance. - A slack pinhole route must not redistribute rest length.
Rolling Link Behavior
- Rolling link tangent points are recomputed from the current geometry.
- Rolling tangent updates occur per XPBD iteration, not only once per frame.
- Pulley/cable coupling must happen without a delayed response to driven pulley motion.
- Rolling surface transfer follows the original routed-cable surface-distance update, then capstan projection limits the transfer by the local tension band.
- The rolling spin row may apply only the spin-axis torque permitted by the capstan bound.
- Pulley angular velocity and angular displacement signs must match the cable travel direction when friction should rotate the pulley.
Dynamic vs Kinematic Bodies
- Dynamic and kinematic capstans must use the same solver path.
- A dynamic pulley has finite inverse inertia, so friction impulses can rotate it.
- A kinematic pulley has zero inverse mass/inertia, so friction impulses cannot move it.
- High friction against a kinematic pulley should lock cable transfer naturally because the pulley cannot rotate to satisfy rolling.
- High inertia should approach the kinematic/no-motion limit.
Tension Reporting
- In the zero-damping stretch-only case, segment tension is
text
T = max(length - rest_length, 0) / compliance
- XPBD stretch multiplier readback must agree with stretch/compliance tension at equilibrium.
- A single vertical cable supporting a mass must settle to
T ~= m gand extensiondelta_x ~= m g * compliance. - Reported converged tension must not be scaled by
joint_linear_relaxation; relaxation may affect convergence speed, not the converged physical tension. - Force-driven pinhole/capstan tests should run long enough for the mass to be near rest before comparing tension against load.
Required Acceptance Scenarios
The focused XPBD acceptance suite is newton.tests.test_tendon_capstan, with a
supporting equilibrium test in newton.tests.test_tendon_equilibrium.
Pinhole Atwood
Requirement:
- A frictionless pinhole route allows the heavy side to descend and the light side to rise.
Executable check:
test_pinhole_slip_atwood
Pinhole Friction Sweep
Requirement:
mu = 0: free through-pinhole slip.- finite
mu: partial transfer; less slip thanmu = 0. - high
mu: locked more than finitemu. - Slip decreases monotonically with increasing
mu.
Executable check:
test_frictional_pinhole_mu_controls_slip_and_locking
Slack Pinhole Route
Requirement:
- Slack pinhole spans do not redistribute rest length.
Executable check:
test_slack_pinhole_does_not_redistribute
Dynamic Rolling Capstan
Requirement:
mu = 0: cable slips and pulley rotation remains near zero.- finite
mu: pulley rotates in the cable direction. - high
mu: pulley rotates more than finitemuand approaches no-slip rim/cable agreement. - Slip decreases as friction increases.
Executable checks:
test_dynamic_capstan_mu_controls_pulley_rotationtest_dynamic_capstan_example_mid_mu_stays_below_high_mu
Kinematic Rolling Capstan
Requirement:
- The pulley remains kinematic for all
mu. mu = 0: cable slips freely.- finite
mu: less slip thanmu = 0. - high
mu: cable motion locks more than finitemu.
Executable check:
test_kinematic_capstan_mu_controls_slip_and_locking
Capstan Hysteresis
Requirement:
- A single friction coefficient must reproduce the capstan hysteresis band.
- During loading, the active branch should track
T_app / T_fix = exp(mu * theta). - During early unloading, the rest-length distribution should remain latched while tensions stay inside the static capstan cone.
- During reverse slip, the unloading branch should track
T_fix / T_app = exp(mu * theta). - At comparable applied tension, fixed-side tension should be higher on the unloading branch than on the loading branch.
Executable check:
test_kinematic_capstan_hysteresis_matches_capstan_band
Force-Driven Pinhole Capstan
Requirement:
- A force-driven pinhole discretization of a capstan must stretch by a physical amount.
- Applied-side tension must balance the hanging load at equilibrium.
- Stretch/compliance tension must agree with XPBD multiplier readback.
- Both sides must remain inside the capstan cone.
Executable check:
test_pinhole_capstan_force_mode_uses_physical_compliance
Simple Cable Gravity
Requirement:
- A single cable segment with a hanging mass must settle to the expected compliance extension and support the mass load.
- Stretch/compliance tension and XPBD multiplier tension must agree.
Executable check:
test_simple_cable_gravity_balances_mass_load
Relaxation-Independent Tension
Requirement:
- Under-relaxed XPBD rows must converge to the same physical tension as fully-relaxed rows.
joint_linear_relaxationmust not scale reported cable tension.
Executable check:
test_simple_cable_gravity_tension_independent_of_relaxation
Driven Pulley Response
Requirement:
- A driven high-friction rolling pulley must convert pulley rotation into cable sliding.
- A frictionless driven pulley must not inject cable sliding through rolling transfer.
- The rest-length transfer caused by pulley rotation must occur in the initial rotation window, not after a visible delay.
Executable checks:
test_motorized_pulley_drives_slidertest_frictionless_motorized_pulley_does_not_drive_slidertest_motorized_pulley_couples_without_delaytest_motorized_pulley_updates_rest_in_first_step
Balanced Atwood Equilibrium
Requirement:
- Equal weights over a high-friction rolling pulley should stay balanced.
- Symmetric drift must remain small and finite.
Executable check:
newton.tests.test_tendon_equilibrium.TestTendonEquilibrium
Example Requirements
Rendered cable examples are not only visual demos. When examples implement
test_post_step() or test_final(), those checks are part of the contract.
Examples that should remain representative of the requirements include:
example_tendon_capstan_friction.py: dynamic capstanmu = 0, finitemu, and highmu.example_tendon_capstan_kinematic.py: kinematic capstanmu = 0, finitemu, and highmu.example_tendon_pinhole_friction.py: pinholemusweep.example_tendon_pinhole_routing.py: frictional multi-pinhole routing around a cam-like guide.
Report videos should be regenerated after changing behavior that affects these examples.
Change Policy
Acceptable updates:
- Small tolerance changes tied to a documented numerical change.
- Correcting an expected value when the previous behavior was physically wrong.
- Replacing implementation-detail assertions with stronger physical invariants.
- Adding tests for newly discovered failure modes.
Not acceptable:
- Removing sign, direction, monotonicity, or capstan-cone checks.
- Replacing physical assertions with only "does not crash" checks.
- Introducing hidden separate dynamic/kinematic or slip/no-slip paths.
- Scaling reported tension by relaxation or by a visual/debug parameter.
- Changing rendered examples without rerendering reports used for review.
Reference Documents
docs/cable_joints.md: current implementation notes and validation summary.docs/cable_joints_slip_plan.md: original finite-slip acceptance plan.docs/cable_joints_formulation.tex: mathematical formulation and capstan hysteresis derivation.newton/tests/test_tendon_capstan.py: executable XPBD acceptance tests.newton/tests/test_tendon_equilibrium.py: equal-weight equilibrium regression.