Tendon physics
This chapter describes the model implemented by RaiSim's tendon solver. Use Tendons for the workflow and Tendon API and model files for parameter names. The continuous equations explain the physical meaning; the discrete equations specify how RaiSim advances that model during a timestep.
Length, velocity, and virtual work
Let
The offset accounts for motion of kinematic attachments and guides that the solver cannot accelerate. For floating and ball-joint configurations, generalized velocity is not simply the time derivative of every stored position parameter;
A signed scalar tendon force
Here
For a point with world position
Straight segments and via-points
A segment from
Thus positive tension pulls its endpoints toward one another. A via-point receives the sum of the adjacent segments' forces. If its object is dynamic, that force and its moment accelerate the object; a world anchor supplies a reaction without adding a dynamic degree of freedom.
Coincident endpoints have zero segment length and use a zero direction to avoid division by zero. A collapsed segment consequently has no defined pulling direction until its points separate. Avoid relying on it to initiate motion.
Sphere and cylinder wrapping
Each wrapping primitive sits between two sites. Its center belongs to a rigid body/link or the world; its radius belongs to the routing model. For an active exterior wrap, the path consists of an incoming tangent segment, a surface arc, and an outgoing tangent segment. The straight route is used when wrapping is inactive.
For a sphere of radius
For a cylinder, use endpoint distances projected onto the plane perpendicular to its axis. If
Axial displacement is distributed in proportion to travel along the planar route. The surface portion is a helix; treating it as a flat circular arc would produce incorrect lengths, gradients, and axial forces. The cylinder is infinite: its visual/collision height does not limit the routing surface.
The endpoint force directions follow the tangent segments. Equal and opposite forces are applied at the two tangency points on the guide, including moments about its center of mass. A translating or rotating dynamic guide therefore receives reactions, and a moving kinematic guide transfers motion while keeping its prescribed trajectory. Free dynamic bodies receive balanced internal forces/moments; fixed or driven supports can exchange momentum and energy with the rest of the scene.
Side sites and route selection
With no side site, the direct segment is used when it misses the obstacle; otherwise the valid shorter exterior wrapping route is selected. A side site outside the obstacle selects the side of the wrapping arc. It can retain an overhead-pulley route even when the direct endpoint segment passes below and misses the pulley. The route can release when the direct segment reaches the selected side.
A side site is a routing hint, rather than an additional attachment through which force is transmitted. It can belong to a body or to the world. Its position selects the route, but it receives no point-force contribution merely for serving as a side site.
An interior side site changes the routing mode: the path must intersect the sphere, or the cylinder's cross-sectional disk. If the direct segment already intersects it, the direct segment is used. Otherwise the route bends through a single point on the near boundary that minimizes the two straight lengths. This does not attach the tendon at the side site's exact position. For a cylinder, inside/outside is evaluated perpendicular to the cylinder axis.
If an endpoint is on or inside an exterior wrapping surface, the implementation falls back to the unwrapped segment. Wrapping assumes usable exterior endpoints; it is not a penetration-resolution algorithm. Route selection, contact/release, and zero-length segments introduce nonsmooth configurations. Small timesteps and suitable initial placement are especially useful near those transitions.
Pulley branches and mechanical advantage
A pulley element divides the ordered path into independent branches. If branch
The divisor scales both length and force. It does not duplicate a cable, add a wheel, create a spatial point, or join the end of one branch to the start of the next. Each branch starts and ends with sites. The initial divisor is 1; a leading pulley element can replace it. Each subsequent pulley sets the following branch's divisor directly, rather than multiplying the previous divisor.
For two branches with divisors 1 and 2,
Fixed tendons and units
A fixed tendon uses scalar revolute or prismatic joints:
The coefficients may be negative, zero, or repeated. The coordinate may also be negative. Ball, floating, and fixed joints are rejected because they do not provide the supported single revolute/prismatic coordinate. Joints may belong to different articulated systems in the same world.
Choose coefficient units deliberately. If length is measured in metres, a revolute-joint coefficient can represent a signed moment arm in m/rad and a prismatic-joint coefficient a dimensionless ratio. If the coordinate instead represents an angle, its conjugate force is a torque. Mixing joint types with arbitrary unitless coefficients does not automatically create a physical length.
For the metre/Newton convention, parameters have these units:
| Quantity | Unit |
|---|---|
| Lengths, margin, drawing radius | m |
| Force, tension, friction threshold, actuator bounds | N |
| Spring stiffness and position gain | N/m |
| Damping and velocity gain | N s/m |
| Armature | kg |
| Limit/coupling compliance and friction regularization | m/N, used in the discrete equations below |
| Activation time | s |
| Position correction, pulley divisor, RGBA | Dimensionless |
For a general transmission coordinate
Spring, slack interval, and damping
Let
Equal endpoints define an ordinary rest length. Unequal endpoints define a zero-spring-force interval: below it the spring pushes toward larger length; above it the spring pulls toward smaller length. [0, L] produces a pull-only spring for a spatial path. Damping remains active inside the spring interval.
The spring and damping share an implicit solver row. With timestep
Here
The extra
For the introductory 1 kg suspended load, the static balance above the spring interval is
Actuator and activation dynamics
Let Drive::force,
For activation time
A newly created tendon starts with zero activation. With zero activation time,
Position/velocity feedback is implicit. The discrete actuator relation is
Its impulse is
Armature and route curvature
Armature
For an unconstrained, autonomous transmission it contributes the generalized mass term
For a spatial tendon with moving endpoints or guides, let
RaiSim estimates this bias with a centered second difference of routed length, using endpoint and guide-axis kinematics. Fixed tendons have constant scalar joint coefficients and use zero curvature bias.
For a 1 kg body on a straight radial transmission with armature 3 kg, an 8 N radial force initially produces 2 m/s² radial acceleration. If the body instead has transverse velocity 2 m/s at radius 1 m, the length curvature is
Shared impulse solver
The world first computes unconstrained velocity changes from body dynamics. Tendon rows and contact rows then share iterative velocity updates. Springs, drives, friction, armature, limits, and couplings therefore respond to changes made by other rows during a sweep; they are not independent post-processing forces applied after contact resolution.
For one row, let
Prescribed-motion objects contribute velocity offsets but no inverse mass. Multiple points and joints on the same articulation share its inverse mass matrix. Solver iteration limits and convergence tolerance apply to the combined contact/tendon problem. The matrix expression explains the response; it does not imply that each tendon is solved in isolation with a constant effective mass.
After solving, each row's reported force is its impulse divided by
Length bounds, margin, and compliance
Lower and upper bounds are separate unilateral rows. A lower row can only exert positive force; an upper row can only exert negative force. They can act predictively before a bound is crossed, limiting the end-step closing velocity. They do not directly clamp the stored configuration to a target length.
With margin
Let positionCorrection. The row targets and impulse bounds are
Positive margin moves the effective boundaries inward to
Equal finite bounds create one bilateral lock with target
For compliance
This makes the parameter interaction explicit. At static equilibrium with stiffness parameter for a directly specified elastic force law, and use the constraint equation when calibrating a compliant lock or limit.
Dry friction and stiction
Dry friction targets zero length velocity with
Here frictionLoss and frictionCompliance. With zero compliance, a subthreshold disturbance can be balanced by an interior impulse while the transmission remains at rest. During sliding the impulse saturates at the threshold and opposes motion. It can bring a sufficiently small velocity to zero without reversing it simply because a fixed friction force overshot the stop.
Positive friction compliance regularizes this condition. In an unsaturated row,
Polynomial tendon couplings
Let the captured references be
Coefficient
The coupling row has Jacobian and force distribution
The derivative controls both velocity ratio and force transmission. Using the polynomial value as a force coefficient would violate virtual work. For {0, 2, 0.1, 0, 0}, the relation is
TendonCoupling::getForce() returns
Passing a null second tendon constrains the first to
Energy interpretation
The spring potential and armature kinetic energies above are the quantities returned by the tendon energy getters. They exclude body energy, actuator work, and any energy associated with compliant limit/coupling/friction rows. Passive damping and ideal sliding friction dissipate energy. Drives and moving kinematic supports can supply it. Constraint position correction and finite-step implicit integration can also change mechanical energy numerically. Use a whole-system energy/work balance when diagnosing a mechanism; summing only the tendon energy getters is not a conservation test for the complete world.