S01 — The corner as a model
A wheel moves 40 mm up and 40 mm down. How far does its camber change, and what is
the simplest model that answers to a tenth of a degree? Before any of that can be
computed, the mechanism has to become equations: bodies with unknown poses, joints
that each lock some of the six ways two bodies can move apart, and a count that says
whether the equations pin the mechanism down to exactly the one motion the question
drives. This notebook builds that translation with solvers/otkd, the package the
chapter's numbers come from, and runs its check and compile on the real corner.
M08 §1–§2 used the same corner to choose a solver. This notebook stays one step earlier: what the rows are, where they come from, and how to count them.
Book pages: Chapter 1: Suspension kinematics and 1.1 The question (with its
Going deeper page, The four models, side by side) in books/maths-applied.
Design record: solvers/otkd/docs/config-layer.md §1–§5 and §9,
problem-mapping.md §2–§4, entry-points.md §4.
The question. How does a suspension corner become a set of equations a solver can be trusted with, and how do you know there are the right number of them?
By the end you can:
- name the corner's parts, and define camber and toe from the axle vector, signs included
- say what each of otkd's four input files holds, and why the topology has no numbers
- write a joint as six components, each locked, free or compliant, and read a constraint kind as a named bundle of modes
- count the unknowns (position and unit quaternion per moving body) and say why each body needs a norm row
- name every row type (hard, driver, norm, axial, plane, spring) and its expression
- compute mobility as , say when Grübler's count disagrees, and say why otkd chooses its solver from the rank
Assumes: M03 (rank and the SVD) and M08 §1–§2; vectors, rotation matrices, and what a Jacobian is.
How to use it: predict before you reveal, commit before you check, and move the controls until the equation's behaviour stops surprising you.
Warm-up: remember
1. The question, the parts, and the two angles
Setting: the problem, its sets and its symbols
Problem. Given the corner's design points () and a drive , find for each the wheel-centre travel , the axle's outboard unit vector , and from it the camber and the toe ; then find the simplest model whose is within of the truth over all of .
| Symbol | In | Meaning |
|---|---|---|
point names: lcaf, lcar, ucaf, ucar, tri, lbj, ubj, wc, wco, tro |
||
| design position of point ; outboard, forward, up; m | ||
| the drive (data): lower-arm rotation about its hinge from design, rad | ||
| wheel centre, and a point on the axle outboard of it, m | ||
| axle unit vector , dimensionless | ||
| camber , deg; positive when the top of the wheel leans out | ||
| plan-view heading of the axle, deg | ||
| toe: , deg; positive for toe-in | ||
| wheel-centre height change from design, mm | ||
| the question's tolerance on camber: 0.1° |
How these symbols connect
The design points (, in metres) fix the corner's geometry at rest, and driving the lower arm to angle (rad) moves the upright and hence the two axle points and in . From alone we read the wheel-centre travel (converted from metres to millimetres), while normalising produces the dimensionless axle unit vector . Its vertical component gives camber , and its horizontal components give heading and toe , both in degrees; candidate models are judged by whether their camber curve stays within of the full model across .
Symbol-by-symbol notes
$P_k$ — design coordinates and axis convention
All design points live in one right-hand world frame in metres: outboard, forward, up. Because the signs of camber and toe depend on pointing outboard, mirroring to a left-hand corner flips the sign conventions.
$\theta \in \Theta$ — driven input, not wheel height
The sweep prescribes the lower arm's hinge rotation in radians over , rather than prescribing wheel height directly. The vertical wheel-centre travel is an output in millimetres, not the independent variable.
$n(\theta) \in S^2$ — outboard axle unit vector
Defined as , lies on the unit sphere and is dimensionless, so its direction does not depend on how far outboard sits from . The wheel plane is perpendicular to , so tilting the wheel tilts by the same angle.
$\gamma(\theta)$ — camber and its minus sign
Camber is positive when the top of the wheel leans outboard, which dips the outboard end of the axle downward () and explains the minus sign inside . It is reported in degrees and judged against the tolerance .
$\psi(\theta)$ and $\tau(\theta)$ — heading versus toe
is the absolute plan-view direction of the axle, whereas toe is its change relative to the design pose . On this right-hand corner ( outboard, forward), positive swings the outboard axle end forward and turns the front of the wheel inboard (toe-in).
The question. The chapter's problem has two halves. How far does camber change over ±40 mm of travel needs a model that turns travel into an angle. What is the simplest model that answers to 0.1° needs a way to compare models, by the size of what each one leaves out against the tolerance. Both halves start from the same object.
The parts. A double-wishbone corner: two wishbones, each hinged to the body at two pivots and joined to the upright by a ball joint; an upright carrying the hub, so upright and wheel turn together; a tie rod from the steering rack to an arm on the upright, which stops the upright turning about the line through its ball joints. In otkd's example these are four bodies, and each owns the geometry points it carries:
| body | part | points it owns |
|---|---|---|
ground |
the car's body, fixed: the frame everything is measured in | lcaf, lcar, ucaf, ucar, tri |
lca |
lower wishbone (A-arm) | (none: its joints are shared sites) |
uca |
upper wishbone | (none: its joints are shared sites) |
up |
upright, with the hub and the wheel bolted to it | lbj, ubj, wc, wco, tro |
lcaf, lcar and ucaf, ucar are the front and rear pivots of each wishbone; lbj,
ubj the ball joints; tri, tro the tie rod's inner and outer ends; wc the wheel centre
and wco a point 0.100 m outboard on the axle. The tie rod is not a
body at all: §3 says why.
Axes. lateral (positive outboard), forward, up, metres: a right-hand corner.
The two angles. Both come from the axle's outboard unit vector . The wheel's plane is perpendicular to .
- Camber is the wheel plane's tilt from vertical in the front view, positive when the top of the wheel leans out. Tipping the top out dips the axle's outboard end, so , and .
- Toe is the change of the axle's plan-view heading from design, positive for toe-in. A positive points the outboard end forward, which turns the front of the wheel inboard: toe-in on a right-hand corner.
At the design pose , so this illustrative geometry starts at zero camber and zero toe.
What the study drives. Not the wheel: the lower arm's angle about its hinge, from
−0.10 to +0.10 rad in 81 steps. That moves the wheel centre from
-42.4 mm to +42.5 mm, the chapter's ±40 mm with a little to spare.
Choosing the input is part of the model; otkd's ride-height example drives the road instead.
Reveal result (lock in your prediction above first)
At +0.0000 rad the wheel centre has moved +0.0 mm; camber +0.000°, toe +0.000°.
Over the whole sweep camber runs from +0.899° (full droop) to -1.129° (full bump): a change of 2.03°, 20 times the 0.1° tolerance. The wheel leans in at the top as it rises. Toe moves too, from +0.651° to -0.622° (bump steer), which a front view cannot see. These are otkd's committed results for this example (the book's payload); the rest of the notebook is about the equations that produce them.
2. Three files and a library
Setting: the problem, its sets and its symbols
Problem. Given a topology , a kind library , a geometry and a study , find the compiled problem: the rows and their Jacobian as functions of , derived from alone, so that a new needs no new derivation.
| Symbol | In | Meaning |
|---|---|---|
| bodies, sites, joints with their kinds, actuators; no numbers | ||
constraints.yaml: each kind's family and component modes |
||
| geometry numbers: point coordinates (m), site-frame entries (dimensionless), lengths (m), compliances (m/N or rad/(N·m)) | ||
| how many geometry numbers asks for | ||
| drivers and their laws, loads, dropped rows, swept numbers | ||
| the unknowns: every moving body's pose (§4) | ||
| drive values, one per actuator; rad or m | ||
| the rows; each carries its own unit (m, rad or none) | ||
| , derived symbolically | ||
| the compile cache key |
How these symbols connect
otkd splits a model into symbolic structure and numerical data: the topology and the kind library determine the cache key and generate the symbolic residual map and its Jacobian once. The geometry vector supplies the design numbers (coordinates, site frames, lengths and compliances), while the study supplies the drive values and any loads or dropped rows. Evaluating and at a candidate pose plugs into those compiled expressions without re-deriving them when changes.
Symbol-by-symbol notes
$\mathcal{T}$ and $\mathcal{L}$ — structure without numbers
(topology.yaml) names bodies, sites, joints and actuators, while (constraints.yaml) defines what each joint kind means as component modes. Neither file holds coordinates or lengths, so one symbolic derivation serves every geometry sharing that layout.
$g \in \mathbb{R}^{n_g}$ — packed geometry parameters
All numerical entries from geometry.yaml — point coordinates (m), site-frame matrix entries (dimensionless), axial lengths (m) and spring compliances (m/N or rad/(N·m)) — are packed into one vector of length . Do not confuse with the unknown pose : is fixed during a solve and varies only across design variants.
$\Phi(q; g, \theta)$ and $J$ — compiled residual map and Jacobian
maps unknowns , geometry and drives to scalar residuals whose units vary by row (metres, radians or dimensionless). Its Jacobian is differentiated symbolically with respect to only, treating and as parameters.
$\theta \in \mathbb{R}^a$ and $\sigma$ — the study's prescribed inputs
(study.yaml) states the question being asked — which actuators are driven, which rows are dropped and which parameters are swept — and holds the scalar drive values (radians for rotational actuators, metres for translational ones). Changing changes the question without altering the mechanism's geometry .
$\kappa(\mathcal{T}, \mathcal{L})$ — compile cache key
is a string computed solely from topology and kind library , never from . Two geometries with the same reuse the exact same compiled and expressions.
otkd owns no model. It reads four files:
| file | answers | numbers? |
|---|---|---|
topology.yaml |
which bodies, joined by which kinds of joint, at which sites; where the actuators are | none |
geometry.yaml |
every coordinate, direction, length, compliance and mass | all |
study.yaml |
which actuators are driven and how, loads, dropped rows, swept numbers | the question's own |
constraints.yaml |
what spherical, revolute, distance … mean |
none |
The topology holds no numbers because it is the part that must not change when a design study loops over geometries. The same topology with a second geometry is a second design; with a second study it is a second question.
The split is what makes the derivation reusable. compile turns the topology and the kinds
into symbolic rows and their Jacobian, with every geometry number left as a symbol: for this
corner 67 of them (30 point, 36 site, 1 length
entries: point coordinates, the nine entries of each frame joint's site axes, and the tie
rod's length). The compiled functions take : pose, geometry, drive.
Checked here. Moving the lower ball joint 5 mm outboard changes exactly
point.lbj.0 in . The compile cache key (topology plus
kinds) is unchanged, and the second compile
returned the very same row expressions, not a re-derivation.
The derivation is the slow part (tens of seconds for this corner), so it is done once per topology.
source: solvers/otkd/examples/double-wishbone/topology.yaml:1
id: dw-1dof
constraints: ../constraints.yaml
# The book's §1: the wishbone as one rigid body per arm, one degree of freedom.
bodies:
ground: {fixed: true, points: [lcaf, lcar, ucaf, ucar, tri]}
lca: {points: []}
uca: {points: []}
up: {points: [lbj, ubj, wc, wco, tro]}
roles: {axle: [wc, wco]}
sites:
lca-hinge: {origin: lcaf, z: lca-axis}
uca-hinge: {origin: ucaf, z: uca-axis}
lbj: {origin: lbj}
ubj: {origin: ubj}
tri: {origin: tri}
tro: {origin: tro}
joints:
- {name: lca-ground, kind: revolute, a: ground, b: lca, site: lca-hinge}
- {name: uca-ground, kind: revolute, a: ground, b: uca, site: uca-hinge}
- {name: lca-up, kind: spherical, a: lca, b: up, site: lbj}
- {name: uca-up, kind: spherical, a: uca, b: up, site: ubj}
- {name: tie-rod, kind: distance, a: ground, b: up, from: tri, to: tro}
actuators:
- {name: lca-drive, joint: lca-ground, dof: rz, effort: position}
source: solvers/otkd/examples/double-wishbone/study.yaml:1
# ±0.10 rad of lower-arm rotation is ±42 mm of wheel-centre travel (a 0.42 m arm, amplified a
# little by the upright). The original ±0.35 rad assumed a 0.2 m arm; with this geometry it
# would be a 290 mm sweep. See docs/config-layer.md §10.
analysis: kinematics
drivers:
- actuator: lca-drive
law: {kind: linear, from: -0.10, to: 0.10, steps: 81}
source: solvers/otkd/examples/double-wishbone/geometry.yaml:1
# Every number in the model, in metres, at the design position.
# x lateral (positive outboard), y forward, z up. Illustrative, not a measured car.
points:
lcaf: [0.300, 0.120, 0.150]
lcar: [0.300, -0.120, 0.160]
lbj: [0.720, 0.010, 0.150]
ucaf: [0.380, 0.100, 0.480]
ucar: [0.380, -0.100, 0.470]
ubj: [0.680, 0.000, 0.520]
wc: [0.760, 0.000, 0.320]
wco: [0.860, 0.000, 0.320]
tri: [0.330, 0.140, 0.300]
tro: [0.700, 0.120, 0.310]
axes:
lca-axis: [0.000000000, -0.999133073, 0.041630545] # lcaf -> lcar, unit
uca-axis: [0.000000000, -0.998752339, -0.049937617] # ucaf -> ucar, unit
# `tie-rod.length` is omitted: it defaults to the design separation, which is exact.
# Giving it explicitly is a check; a rounded value is a real (if tiny) modelling error.
scalars:
tyre-radius: 0.200
source: `open_textbook.otkd.problem.compile._key` — `solvers/otkd/src/open_textbook/otkd/problem/compile.py:435`
The compile cache key: topology and kinds, never geometry.
def _key(model: Model) -> str:
return model.topology.model_dump_json() + "|" + "|".join(
f"{name}:{kind.model_dump_json()}" for name, kind in sorted(model.kinds.items())
)
3. Bodies, sites, and a joint as six components
Setting: the problem, its sets and its symbols
Problem. Given bodies with poses and , a site with origin and frame , and a kind assigning each component a mode, find the scalar rows the joint contributes: or for each locked , nothing for a free , and a potential term for a spring .
| Symbol | In | Meaning |
|---|---|---|
bodies: one fixed (ground), the rest moving |
||
the bodies a joint connects, in the order a → b |
||
| body positions, m | ||
| body rotations, dimensionless | ||
| the bodies' unit quaternions (§4) | ||
| site origin, world coordinates at design, m | ||
| site frame: columns are the site's in world; is the joint axis | ||
| the site as carried by each body, , m | ||
| relative translation , components , m | ||
| angle (rad) and unit axis of the relative rotation of from | ||
| vector part of in the site frame, components , dimensionless | ||
components of the frame family; axial has , plane has |
||
| a kind: the mode of each component | ||
| the residual of component (, , or a length or gap error); m or none | ||
| compliance of a spring component, m/N or rad/(N·m) | ||
a distance joint's length, m |
How these symbols connect
For two bodies sharing a site at design, their poses and carry the common origin to and in world coordinates, and projecting back through and yields the three translation residuals in metres. In parallel, the relative quaternion projected into the site frame yields the three dimensionless rotation residuals . The joint's kind maps each component to its role: a hard row if locked, nothing if free, or a potential term if spring; axial and plane families instead supply one scalar residual (length using , or gap).
Symbol-by-symbol notes
$o$ and $C \in SO(3)$ — site origin and frame
is the site's world position at design (m), and the columns of are the site's local unit axes in world coordinates. By convention the third column (site ) is the joint axis, so a revolute joint frees and a prismatic joint frees .
$x\lt em>A, x\lt /em>B$ and $d \in \mathbb{R}^3$ — relative site translation
Because every body frame coincides with the world frame at design, body carries to , and similarly . Multiplying by expresses the separation in 's moving copy of the site frame, giving the components in metres.
$q\lt em>A, q\lt /em>B$ and $V \in \mathbb{R}^3$ — quaternion rotation residual
encode the same orientations as , and is the relative rotation of from by angle about unit axis . Its vector part in the site frame, , is dimensionless and polynomial in the unknowns, avoiding trigonometric singularities at .
$\mathcal{C}$ and $\mu$ — component set and kind map
For frame joints , while axial has and plane has . A kind assigns every component in one of locked, free or spring with no implicit defaults, and the body ordering a → b sets the sign of and .
$g\lt em>i$ and $c\lt /em>i$ — generic residual and spring compliance
stands for whichever scalar component residual applies (, , length error or plane gap), in metres or dimensionless. Compliance is the inverse of stiffness (m/N or rad/(N·m)), so a smaller is stiffer and is the rigid limit; do not confuse here with the geometry vector of §2.
$L \in \mathbb{R}_{>0}$ — distance-joint length
An axial distance joint writes one scalar row in metres between a point on and a point on , without introducing an intermediate rigid body.
A site is a named point with axes: an origin and a frame (columns: the site's in world). Every body's local frame is the world frame at the design pose, so a joint's site is one point that both bodies share at design, and geometry is written once, in world coordinates, as CAD exports it.
A joint between bodies and at a site compares where each body puts that site. With poses and :
is 's displacement from at the site, in 's copy of the site frame: three components . For the relative rotation, take the quaternion . A rotation by about a unit axis is the quaternion , so the vector part in the site frame is
three more components . and mean the two copies of the site coincide and are aligned. is a polynomial in the unknowns (no , no ), smooth through .
Each component has a mode. locked writes the row or . free writes
nothing: it is a coordinate the mechanism may use, and an actuator may prescribe.
spring keeps the same expression but puts into a potential
instead of setting (compliance , so is the rigid row). The site's is
the axis: a revolute frees , a prismatic frees .
A constraint kind is a named bundle of modes, read from examples/constraints.yaml; the
package itself knows no kind by name. The library this corner uses:
| kind | family | locked | free | spring | hard rows |
|---|---|---|---|---|---|
spherical |
frame | tx, ty, tz | rx, ry, rz | — | 3 |
revolute |
frame | tx, ty, tz, rx, ry | rz | — | 5 |
cylindrical |
frame | tx, ty, rx, ry | tz, rz | — | 4 |
planar |
frame | tz, rx, ry | tx, ty, rz | — | 3 |
prismatic |
frame | tx, ty, rx, ry, rz | tz | — | 5 |
universal |
frame | tx, ty, tz, rx | ry, rz | — | 4 |
rigid |
frame | tx, ty, tz, rx, ry, rz | — | — | 6 |
bushed |
frame | — | — | tx, ty, tz, rx, ry, rz | 0 |
distance |
axial | length | — | — | 1 |
plane-gap |
plane | gap | — | — | 1 |
The axial and plane families have one component each: length, the distance between a
point on and a point on , and gap, a point's signed height above a plane.
The corner's joints, and the rows each writes:
| joint | kind | bodies | rows |
|---|---|---|---|
lca-ground |
revolute |
ground → lca |
lca-ground.tx, lca-ground.ty, lca-ground.tz, lca-ground.rx, lca-ground.ry |
uca-ground |
revolute |
ground → uca |
uca-ground.tx, uca-ground.ty, uca-ground.tz, uca-ground.rx, uca-ground.ry |
lca-up |
spherical |
lca → up |
lca-up.tx, lca-up.ty, lca-up.tz |
uca-up |
spherical |
uca → up |
uca-up.tx, uca-up.ty, uca-up.tz |
tie-rod |
distance |
ground → up |
tie-rod.length |
17 hard rows in all.
An actuator names one free component of one frame joint: lca-drive acts on
lca-ground.rz, the lower arm's hinge angle. A rotational actuator needs exactly one free
rotation on its joint, because "the angle" is not a single coordinate of a joint free about
two axes.
Why the tie rod is a distance, not a body. A rod with a ball joint at each end can spin
about its own axis, and nothing resists it. As a fifth body it would add 6 freedoms and 6 rows,
and the count becomes : the
wheel's travel plus that idle spin, which no actuator drives, so check would refuse the
model. The distance row, , says only what the rod does: it keeps two
points a fixed distance apart.
source: solvers/otkd/examples/constraints.yaml:30-77
The kind library the examples share. Every component must be listed: omission is an error, not a default.
constraint_kinds:
spherical:
family: frame
modes: {tx: locked, ty: locked, tz: locked, rx: free, ry: free, rz: free}
revolute:
family: frame
modes: {tx: locked, ty: locked, tz: locked, rx: locked, ry: locked, rz: free}
cylindrical:
family: frame
modes: {tx: locked, ty: locked, tz: free, rx: locked, ry: locked, rz: free}
planar:
family: frame
modes: {tx: free, ty: free, tz: locked, rx: locked, ry: locked, rz: free}
# Slides along the site's z, which is also the axis a revolute would turn about. A
# vertical slide for a road body needs a site whose z is up; that is the whole of it.
prismatic:
family: frame
modes: {tx: locked, ty: locked, tz: free, rx: locked, ry: locked, rz: locked}
universal:
family: frame
modes: {tx: locked, ty: locked, tz: locked, rx: locked, ry: free, rz: free}
rigid:
family: frame
modes: {tx: locked, ty: locked, tz: locked, rx: locked, ry: locked, rz: locked}
# Every component compliant: the joint is located and oriented by its bushes. What the
# book's §4 needs if the compliance is at the inner pivots rather than the tie rod.
bushed:
family: frame
modes: {tx: spring, ty: spring, tz: spring, rx: spring, ry: spring, rz: spring}
distance:
family: axial
modes: {length: locked}
# A point held a fixed perpendicular distance from a plane: a wheel of radius `gap`
# touching a road, with the plane at the `from` site and the wheel centre at `to`. Set
# `gap: spring` for a compliant tyre; that makes the study an equilibrium problem, with
# the same machinery §4 uses.
plane-gap:
family: plane
modes: {gap: locked}
When the component model of a joint breaks
- Assumes: every component is exactly locked, free or linearly compliant, in the site's fixed frame
- When it fails: a joint with play, an end stop, or a coupling such as a screw ( tied to ) is not a mode map; forced into one it gives a row set that still passes
checkbut describes a different part - Check: go through the six components of each joint and ask what the real part allows along each; a coupling needs a new family, not a new kind
4. Unknowns and rows
Setting: the problem, its sets and its symbols
Problem. Given the moving bodies and the corner's joints and actuator, find the unknown vector and the row map (hard, driver, norm and spring rows) such that at the design pose; then ask which rows needs for every solution to be a rigid pose of each body.
| Symbol | In | Meaning |
|---|---|---|
the moving bodies: lca, uca, up |
||
| position of body , m | ||
| quaternion of body , ; a rotation only when | ||
| the unknowns: for each moving body | ||
| design pose: , | ||
| geometry numbers (§2), held fixed here | ||
| the drive: lower-arm hinge angle, rad | ||
| rows in otkd's order: joint rows, drivers, norms; m, rad or none | ||
| at | ||
| the hard and norm rows of , driver left out | ||
| tie-rod length, m | ||
| potential of the spring terms and loads, J |
How these symbols connect
Each moving body contributes seven unknowns , stacked into with and known design pose . With geometry fixed and drive applied, collects every non-spring scalar equation in order — joint hard rows (including axial length ), driver rows and one norm row per moving body — while any spring components and external loads enter the potential in joules. Differentiating at gives the full Jacobian , and leaving out the driver rows gives the constraint Jacobian .
Symbol-by-symbol notes
$q\lt em>b = (q\lt /em>w, v)$ versus $q$ — body quaternion and stacked pose
Do not confuse a single body's four-number quaternion with the full unknown vector stacking over all moving bodies . At the design pose , every body has and because every body frame matches the world frame at rest.
$R(q_b)$ — polynomial rotation formula
maps to a matrix using polynomials only, so its derivatives are smooth everywhere, including at . It represents a proper rotation in only when ; is the skew-symmetric cross-product matrix of .
$\Phi$ — row groups and mixed units
orders its scalar rows as hard joint rows (m, or dimensionless for ), then actuator driver rows (rad or m), then one norm row (dimensionless) per moving body. Because rows carry different physical units, residuals and tolerances must be read with each row's unit in mind.
$J$ versus $J_c$ — full Jacobian and constraint Jacobian
includes the driver rows, whereas keeps only the hard joint rows and the body norm rows. Omitting the drivers from isolates the freedoms of the unactuated mechanism.
$\Pi(q)$ — elastic and load potential
has units of joules (N·m) and enters the solve only when the model has spring components or external loads; a purely rigid kinematic model solves without .
Unknowns. Each moving body has a position and a unit quaternion : 7 numbers. The corner has 3 moving bodies, so . The design pose is exact and known: , for every body, because every body's frame is the world frame at design.
Why a quaternion. A rotation vector (angle times axis) has three numbers, but has a derivative of the form at , and is the design pose every model is assembled, checked and first solved at. The quaternion's rotation matrix
is a polynomial, so every row and its Jacobian are exact everywhere. The cost is a fourth number for three rotations, and one more row per body, the norm row . Whether the joints would pin the fourth number without it is the prediction below.
Rows, one scalar equation each, named <joint>.<component>:
| group | from | expression | unit |
|---|---|---|---|
| hard | a locked frame component |
or | m, or none |
| hard (axial) | a distance joint |
m | |
| hard (plane) | a plane-gap joint |
m | |
| driver | a position actuator |
, or | rad or m |
| norm | each moving body | none | |
| spring | a spring component |
the same , entering | m, or none |
The driver reads the signed angle about the site axis: near design . It is the only trigonometry in the model.
check on the corner evaluates every row at the design pose (each must be zero to
, or the model is not assembled):
| row | group | unit | design residual |
|---|---|---|---|
lca-ground.tx |
hard | m | +0.0e+00 |
lca-ground.ty |
hard | m | +0.0e+00 |
lca-ground.tz |
hard | m | +6.1e-18 |
lca-ground.rx |
hard | — | +0.0e+00 |
lca-ground.ry |
hard | — | +0.0e+00 |
uca-ground.tx |
hard | m | +0.0e+00 |
uca-ground.ty |
hard | m | +0.0e+00 |
uca-ground.tz |
hard | m | -6.9e-18 |
uca-ground.rx |
hard | — | +0.0e+00 |
uca-ground.ry |
hard | — | +0.0e+00 |
lca-up.tx |
hard | m | +0.0e+00 |
lca-up.ty |
hard | m | +0.0e+00 |
lca-up.tz |
hard | m | +0.0e+00 |
uca-up.tx |
hard | m | +0.0e+00 |
uca-up.ty |
hard | m | +0.0e+00 |
uca-up.tz |
hard | m | +0.0e+00 |
tie-rod.length |
hard | m | +0.0e+00 |
lca-ground.rz |
driver | rad | +0.0e+00 |
lca.unit |
norm | — | +0.0e+00 |
uca.unit |
norm | — | +0.0e+00 |
up.unit |
norm | — | +0.0e+00 |
The rows themselves, from otkd.compile in the names otkd compile --format latex
prints ( a design point, a site-frame entry, the unknowns, the drive).
The hinge's locked rotation about its site , the driver, and a norm row:
The ground side has , , so for a hinge to ground is , linear. A translation row between two moving bodies multiplies two rotation matrices and is expanded in full, which is why otkd derives rows and never asks for them by hand. Operation counts of the expanded expressions:
| row | operations |
|---|---|
lca-ground.tx |
119 |
lca-ground.rx |
5 |
uca-ground.tx |
119 |
lca-up.tx |
1685 |
tie-rod.length |
437 |
lca-ground.rz |
8 |
up.unit |
8 |
compile --format latex: lca-ground.tx and tie-rod.length
lca-ground\,tx &: C_{\text{lca-hinge},11} P_{\text{lcaf},x} q_{\text{lca},w}^{2} + C_{\text{lca-hinge},11} P_{\text{lcaf},x} q_{\text{lca},x}^{2} - C_{\text{lca-hinge},11} P_{\text{lcaf},x} q_{\text{lca},y}^{2} - C_{\text{lca-hinge},11} P_{\text{lcaf},x} q_{\text{lca},z}^{2} - C_{\text{lca-hinge},11} P_{\text{lcaf},x} - 2 C_{\text{lca-hinge},11} P_{\text{lcaf},y} q_{\text{lca},w} q_{\text{lca},z} + 2 C_{\text{lca-hinge},11} P_{\text{lcaf},y} q_{\text{lca},x} q_{\text{lca},y} + 2 C_{\text{lca-hinge},11} P_{\text{lcaf},z} q_{\text{lca},w} q_{\text{lca},y} + 2 C_{\text{lca-hinge},11} P_{\text{lcaf},z} q_{\text{lca},x} q_{\text{lca},z} + C_{\text{lca-hinge},11} p_{\text{lca},x} + 2 C_{\text{lca-hinge},21} P_{\text{lcaf},x} q_{\text{lca},w} q_{\text{lca},z} + 2 C_{\text{lca-hinge},21} P_{\text{lcaf},x} q_{\text{lca},x} q_{\text{lca},y} + C_{\text{lca-hinge},21} P_{\text{lcaf},y} q_{\text{lca},w}^{2} - C_{\text{lca-hinge},21} P_{\text{lcaf},y} q_{\text{lca},x}^{2} + C_{\text{lca-hinge},21} P_{\text{lcaf},y} q_{\text{lca},y}^{2} - C_{\text{lca-hinge},21} P_{\text{lcaf},y} q_{\text{lca},z}^{2} - C_{\text{lca-hinge},21} P_{\text{lcaf},y} - 2 C_{\text{lca-hinge},21} P_{\text{lcaf},z} q_{\text{lca},w} q_{\text{lca},x} + 2 C_{\text{lca-hinge},21} P_{\text{lcaf},z} q_{\text{lca},y} q_{\text{lca},z} + C_{\text{lca-hinge},21} p_{\text{lca},y} - 2 C_{\text{lca-hinge},31} P_{\text{lcaf},x} q_{\text{lca},w} q_{\text{lca},y} + 2 C_{\text{lca-hinge},31} P_{\text{lcaf},x} q_{\text{lca},x} q_{\text{lca},z} + 2 C_{\text{lca-hinge},31} P_{\text{lcaf},y} q_{\text{lca},w} q_{\text{lca},x} + 2 C_{\text{lca-hinge},31} P_{\text{lcaf},y} q_{\text{lca},y} q_{\text{lca},z} + C_{\text{lca-hinge},31} P_{\text{lcaf},z} q_{\text{lca},w}^{2} - C_{\text{lca-hinge},31} P_{\text{lcaf},z} q_{\text{lca},x}^{2} - C_{\text{lca-hinge},31} P_{\text{lcaf},z} q_{\text{lca},y}^{2} + C_{\text{lca-hinge},31} P_{\text{lcaf},z} q_{\text{lca},z}^{2} - C_{\text{lca-hinge},31} P_{\text{lcaf},z} + C_{\text{lca-hinge},31} p_{\text{lca},z} = 0
tie-rod\,length &: - L_{\text{tie-rod}} + \sqrt{P_{\text{tri},x}^{2} - 2 P_{\text{tri},x} P_{\text{tro},x} q_{\text{up},w}^{2} - 2 P_{\text{tri},x} P_{\text{tro},x} q_{\text{up},x}^{2} + 2 P_{\text{tri},x} P_{\text{tro},x} q_{\text{up},y}^{2} + 2 P_{\text{tri},x} P_{\text{tro},x} q_{\text{up},z}^{2} + 4 P_{\text{tri},x} P_{\text{tro},y} q_{\text{up},w} q_{\text{up},z} - 4 P_{\text{tri},x} P_{\text{tro},y} q_{\text{up},x} q_{\text{up},y} - 4 P_{\text{tri},x} P_{\text{tro},z} q_{\text{up},w} q_{\text{up},y} - 4 P_{\text{tri},x} P_{\text{tro},z} q_{\text{up},x} q_{\text{up},z} - 2 P_{\text{tri},x} p_{\text{up},x} + P_{\text{tri},y}^{2} - 4 P_{\text{tri},y} P_{\text{tro},x} q_{\text{up},w} q_{\text{up},z} - 4 P_{\text{tri},y} P_{\text{tro},x} q_{\text{up},x} q_{\text{up},y} - 2 P_{\text{tri},y} P_{\text{tro},y} q_{\text{up},w}^{2} + 2 P_{\text{tri},y} P_{\text{tro},y} q_{\text{up},x}^{2} - 2 P_{\text{tri},y} P_{\text{tro},y} q_{\text{up},y}^{2} + 2 P_{\text{tri},y} P_{\text{tro},y} q_{\text{up},z}^{2} + 4 P_{\text{tri},y} P_{\text{tro},z} q_{\text{up},w} q_{\text{up},x} - 4 P_{\text{tri},y} P_{\text{tro},z} q_{\text{up},y} q_{\text{up},z} - 2 P_{\text{tri},y} p_{\text{up},y} + P_{\text{tri},z}^{2} + 4 P_{\text{tri},z} P_{\text{tro},x} q_{\text{up},w} q_{\text{up},y} - 4 P_{\text{tri},z} P_{\text{tro},x} q_{\text{up},x} q_{\text{up},z} - 4 P_{\text{tri},z} P_{\text{tro},y} q_{\text{up},w} q_{\text{up},x} - 4 P_{\text{tri},z} P_{\text{tro},y} q_{\text{up},y} q_{\text{up},z} - 2 P_{\text{tri},z} P_{\text{tro},z} q_{\text{up},w}^{2} + 2 P_{\text{tri},z} P_{\text{tro},z} q_{\text{up},x}^{2} + 2 P_{\text{tri},z} P_{\text{tro},z} q_{\text{up},y}^{2} - 2 P_{\text{tri},z} P_{\text{tro},z} q_{\text{up},z}^{2} - 2 P_{\text{tri},z} p_{\text{up},z} + P_{\text{tro},x}^{2} q_{\text{up},w}^{4} + 2 P_{\text{tro},x}^{2} q_{\text{up},w}^{2} q_{\text{up},x}^{2} + 2 P_{\text{tro},x}^{2} q_{\text{up},w}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},x}^{2} q_{\text{up},w}^{2} q_{\text{up},z}^{2} + P_{\text{tro},x}^{2} q_{\text{up},x}^{4} + 2 P_{\text{tro},x}^{2} q_{\text{up},x}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},x}^{2} q_{\text{up},x}^{2} q_{\text{up},z}^{2} + P_{\text{tro},x}^{2} q_{\text{up},y}^{4} + 2 P_{\text{tro},x}^{2} q_{\text{up},y}^{2} q_{\text{up},z}^{2} + P_{\text{tro},x}^{2} q_{\text{up},z}^{4} + 2 P_{\text{tro},x} p_{\text{up},x} q_{\text{up},w}^{2} + 2 P_{\text{tro},x} p_{\text{up},x} q_{\text{up},x}^{2} - 2 P_{\text{tro},x} p_{\text{up},x} q_{\text{up},y}^{2} - 2 P_{\text{tro},x} p_{\text{up},x} q_{\text{up},z}^{2} + 4 P_{\text{tro},x} p_{\text{up},y} q_{\text{up},w} q_{\text{up},z} + 4 P_{\text{tro},x} p_{\text{up},y} q_{\text{up},x} q_{\text{up},y} - 4 P_{\text{tro},x} p_{\text{up},z} q_{\text{up},w} q_{\text{up},y} + 4 P_{\text{tro},x} p_{\text{up},z} q_{\text{up},x} q_{\text{up},z} + P_{\text{tro},y}^{2} q_{\text{up},w}^{4} + 2 P_{\text{tro},y}^{2} q_{\text{up},w}^{2} q_{\text{up},x}^{2} + 2 P_{\text{tro},y}^{2} q_{\text{up},w}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},y}^{2} q_{\text{up},w}^{2} q_{\text{up},z}^{2} + P_{\text{tro},y}^{2} q_{\text{up},x}^{4} + 2 P_{\text{tro},y}^{2} q_{\text{up},x}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},y}^{2} q_{\text{up},x}^{2} q_{\text{up},z}^{2} + P_{\text{tro},y}^{2} q_{\text{up},y}^{4} + 2 P_{\text{tro},y}^{2} q_{\text{up},y}^{2} q_{\text{up},z}^{2} + P_{\text{tro},y}^{2} q_{\text{up},z}^{4} - 4 P_{\text{tro},y} p_{\text{up},x} q_{\text{up},w} q_{\text{up},z} + 4 P_{\text{tro},y} p_{\text{up},x} q_{\text{up},x} q_{\text{up},y} + 2 P_{\text{tro},y} p_{\text{up},y} q_{\text{up},w}^{2} - 2 P_{\text{tro},y} p_{\text{up},y} q_{\text{up},x}^{2} + 2 P_{\text{tro},y} p_{\text{up},y} q_{\text{up},y}^{2} - 2 P_{\text{tro},y} p_{\text{up},y} q_{\text{up},z}^{2} + 4 P_{\text{tro},y} p_{\text{up},z} q_{\text{up},w} q_{\text{up},x} + 4 P_{\text{tro},y} p_{\text{up},z} q_{\text{up},y} q_{\text{up},z} + P_{\text{tro},z}^{2} q_{\text{up},w}^{4} + 2 P_{\text{tro},z}^{2} q_{\text{up},w}^{2} q_{\text{up},x}^{2} + 2 P_{\text{tro},z}^{2} q_{\text{up},w}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},z}^{2} q_{\text{up},w}^{2} q_{\text{up},z}^{2} + P_{\text{tro},z}^{2} q_{\text{up},x}^{4} + 2 P_{\text{tro},z}^{2} q_{\text{up},x}^{2} q_{\text{up},y}^{2} + 2 P_{\text{tro},z}^{2} q_{\text{up},x}^{2} q_{\text{up},z}^{2} + P_{\text{tro},z}^{2} q_{\text{up},y}^{4} + 2 P_{\text{tro},z}^{2} q_{\text{up},y}^{2} q_{\text{up},z}^{2} + P_{\text{tro},z}^{2} q_{\text{up},z}^{4} + 4 P_{\text{tro},z} p_{\text{up},x} q_{\text{up},w} q_{\text{up},y} + 4 P_{\text{tro},z} p_{\text{up},x} q_{\text{up},x} q_{\text{up},z} - 4 P_{\text{tro},z} p_{\text{up},y} q_{\text{up},w} q_{\text{up},x} + 4 P_{\text{tro},z} p_{\text{up},y} q_{\text{up},y} q_{\text{up},z} + 2 P_{\text{tro},z} p_{\text{up},z} q_{\text{up},w}^{2} - 2 P_{\text{tro},z} p_{\text{up},z} q_{\text{up},x}^{2} - 2 P_{\text{tro},z} p_{\text{up},z} q_{\text{up},y}^{2} + 2 P_{\text{tro},z} p_{\text{up},z} q_{\text{up},z}^{2} + p_{\text{up},x}^{2} + p_{\text{up},y}^{2} + p_{\text{up},z}^{2}} = 0
The Jacobian at the design pose, 21 rows by 21 unknowns, 92 non-zero entries. Each joint's rows touch only the bodies it joins; rows to ground touch one body. The norm rows touch only , with entry 2: at the derivative of is .
Reveal result (lock in your prediction above first)
All 20 constraint rows: rank 20, mobility 1. Drop one norm row at a time:
| dropped | rank | mobility |
|---|---|---|
lca.unit |
19 | 2 |
uca.unit |
19 | 2 |
up.unit |
19 | 2 |
The new free direction (the part of the null space not already there) has its largest
entries at up.px (-0.68), up.qw (+0.46), up.pz (-0.33): the
upright's quaternion grows while the body shifts and the arms swing. Because is
homogeneous of degree 2, a non-unit gives times a rotation: a scaling of the
upright's points about the world origin. The joint rows fix where three of those points go,
not the length of , and to first order a scaled, shifted upright with the arms swung to
match satisfies them all. The rank finds that without anyone having to see it.
When the quaternion pose breaks
- Assumes: every moving body has its norm row, and its design frame is the world frame so the seed is exact
- When it fails: without the norm row the quaternion's length is a free direction and stops being a rotation; a design authored with per-body frames would seed far from the root
- Check:
checklists one<body>.unitrow per moving body, and every row's design residual is zero to
5. Counting: Grübler against the rank
Setting: the problem, its sets and its symbols
Problem. Given a model's unknowns , its constraint rows (hard and norm) with Jacobian at the design pose , its driver rows and its position actuators, find the mobility and the redundancy , compare with Grübler's count, and decide the solver class.
| Symbol | In | Meaning |
|---|---|---|
| bodies, the fixed one included | ||
| constraints joint imposes: its locked components | ||
| Grübler's count | ||
| unknowns, | ||
| hard plus norm rows | ||
| Jacobian of the hard and norm rows at , rows in m or none | ||
| Jacobian of every non-spring row, driver included | ||
| singular values of | ||
| number of | ||
| mobility | ||
| redundancy: rows of minus | ||
position actuators; check requires |
How these symbols connect
From the model's bodies (including ground) and its joint constraint counts , Grübler's formula produces the integer count , which in otkd's coordinates equals because each moving body adds unknowns and norm row. To test linear independence at the design pose , otkd takes the SVD of the constraint Jacobian , counts its singular values above to get , and defines the true mobility , which check compares against the actuator count . Including the driver rows gives the full Jacobian , whose excess of rows over rank is the redundancy ; together, , and the presence of springs determine the solver class.
Symbol-by-symbol notes
$N$, $n$ and $r_c$ — translating bodies into matrix dimensions
counts all bodies including the fixed ground, so there are moving bodies and scalar unknowns. counts every hard joint row plus the quaternion norm rows, excluding driver rows, so .
$M_{\text{count}}$ versus $M$ — combinatorial count versus rank mobility
depends only on how many bodies and locked components are listed (and can be zero or negative), whereas measures the dimension of the first-order free-motion space at . Because , never exceeds .
$\sigma_i$ and $\operatorname{rank}$ — SVD tolerance
The singular values of (or ) are ordered largest to smallest, and counts those strictly larger than . Comparing the smallest kept singular value with shows whether the rank decision sits cleanly away from round-off.
$J_c$ versus $J$, and $\rho$ — redundancy with drivers included
omits the driver rows so counts the unactuated freedoms, while includes the driver rows so counts how many equations in the full system are linearly dependent on the rest. A square system has and ; with is redundant.
$a$ — position actuators and the check gate
is the number of prescribed position drivers in the study. otkd.check requires so that the drivers supply exactly the freedoms the mechanism possesses.
The count. Grübler's (Kutzbach's) formula for a spatial mechanism of bodies, one fixed, gives each moving body 6 freedoms and subtracts the constraints each joint imposes:
In otkd's terms each moving body has 7 unknowns and 1 norm row, which is the same 6, so the count is minus the hard and norm rows. For the corner: .
The rank. Write for the Jacobian of the hard and norm rows at the design pose (the driver row left out). Its null space is the set of first-order motions the joints allow, so
Since a rank never exceeds the row count, : the
count is a lower bound on the mobility, equal to it exactly when the rows are
independent. otkd computes the rank from the SVD with a relative tolerance of , at
no cost, because the Jacobian is already symbolic. The corner's 20 singular
values of run from 4.053 down to 0.0864: the
smallest is 2.1e-02 of the largest, nowhere near the
tolerance, so the rank is unambiguous. check then requires mobility to equal the number of
position actuators: 1 against 1 here.
Your prediction at the top is answered here.
Reveal result (lock in your prediction above first)
From otkd.check on both models:
| model | constraint rows | count | rank of | mobility | redundancy | |
|---|---|---|---|---|---|---|
| double-wishbone (hinge) | 21 | 20 | 1 | 20 | 1 | 0 |
| double-wishbone-two-leg | 21 | 21 | 0 | 20 | 1 | 1 |
The two-leg model's count says 0 and its rank says 1. A count would reject the model the chapter exists to explain; the rank reports the truth, one freedom and one spare row. M08 §2 finds which row with the left null space of the SVD.
Change a joint's kind and recount. Each joint offers the library's kinds of the same family that lock a subset of what it locks now, so every row needed is already in the compiled Jacobian; (none) deletes the joint. The rank is recomputed live from otkd's design Jacobian; the verdict applies otkd's rules (config-layer §9, rules 6–7, and problem-mapping §4.1) without re-running check. Try the two-leg model with uca-rear deleted: the count and the rank agree again, because the spare row went with it; then make the hinge model's lower joint spherical and see the actuator refused.
| unknowns | constraint rows | count rows | rank of | mobility | redundancy |
|---|---|---|---|---|---|
| 21 | 20 | 1 | 20 | 1 | 0 |
otkd: square: Newton.
The solver follows from the rank, never from a flag. At the design pose, with the driver row included:
| condition | class | solve |
|---|---|---|
any spring row |
equilibrium | constrained minimisation of (M08 §3) |
| under | refused | |
| rows rank | square | Newton (M08 §1) |
| rows rank | redundant | least squares, then the SVD diagnosis (M08 §2) |
There is no solver: key. A model that asks for least squares but is not redundant should
not be trusted, and one that is redundant and asks for Newton cannot be: its Newton step
has no unique solution. A study can only remove rows (drop:), and dropping an
independent one is refused as under-determined.
source: `open_textbook.otkd.solvers.system.System.classify` — `solvers/otkd/src/open_textbook/otkd/solvers/system.py:78`
The classification, at the design pose.
def classify(self) -> str:
"""`square`, `redundant`, `under`, or `equilibrium`."""
if self.springs:
return "equilibrium"
rank, _, _ = rank_and_null(self.jacobian(self.problem.q0()), rtol=1e-10)
n = self.problem.n
if rank < n:
return "under"
return "square" if len(self.constrained) == rank else "redundant"
When counting by rank breaks
- Assumes: the design pose is a generic configuration, so the rank there is the rank nearby
- When it fails: at a toggle or a singular pose the Jacobian loses rank: the count shows a freedom the mechanism does not have, or a smallest singular value near the tolerance makes the rank depend on
- Check: read the ratio of the smallest to the largest singular value of the constraint rows; far above the count is safe
Practice
Hint 1
Form ; only matters for camber.
Hint 2
camber , converted to degrees. The outboard end dips, so expect a positive answer.
Mixed practice: which method, and why?
Check yourself (closed book)
Keep these:
- Camber is for the axle's outboard unit vector: positive when the top of the wheel leans out. Toe is the change of the axle's heading, positive in.
- Topology says what is joined to what and holds no numbers; geometry holds every number; the study is the question; the kinds are a library. One derivation per topology.
- A joint is six components in its site frame, each locked (a row), free (nothing) or spring (a potential term). A kind is a named bundle of those modes.
- Each moving body is seven unknowns, position and unit quaternion, and one norm row; without it the quaternion's length is a free direction.
- Mobility is ; Grübler's count is a lower bound that misses dependent rows. otkd picks its solver from the rank, never from a flag.
Your connection
Pick a mechanism you know (a bicycle's rear suspension, a folding chair, a desk lamp). Name its bodies and joints, write each joint as locked and free components, and count. Where might the count and the rank disagree?
Answers
Practice A. 4 rows for the cylindrical joint, 16 hard rows, count : the travel plus the piston rod's spin.
Practice B. about , top of the wheel out at full droop.
Practice C. .
Mixed practice. least squares and the SVD; the rank from the SVD; the KKT system; the generalised eigenproblem.
Where the maths is derived
Optional. These notes give the intuition and application; the sources below give the full derivations and proofs.
§1 The question, the parts, and the two angles
- SAE J670, Vehicle Dynamics Terminology: the standard definitions of camber and toe; check its sign wording against the book's own.
- Milliken and Milliken (1995), Race Car Vehicle Dynamics: why camber matters: how the tyre turns the angle into grip.
§2 Three files and a library
- otkd, the model, its exports and a generated solver: the file split and the compile cache (docs/config-layer.md §1, docs/entry-points.md §4).
§3 Bodies, sites, and a joint as six components
- McCarthy and Soh (2011), Geometric Design of Linkages: joints as constraints on relative motion, and spatial linkages built from them.
§4 Unknowns and rows
- otkd, the model, its exports and a generated solver: the quaternion unknowns, the norm row and every row shape (docs/problem-mapping.md §2–§3).
§5 Counting: Grübler against the rank
- McCarthy and Soh (2011), Geometric Design of Linkages: mobility of a linkage, and why a count of constraints can disagree with it.
- Trefethen and Bau (1997), Numerical Linear Algebra: rank from the singular value decomposition, and why a tolerance is needed to read it.
Compiled from notebooks/suspension/s01_corner_as_a_model.py — run locally with cd notebooks && uv run marimo edit suspension/s01_corner_as_a_model.py for live Python scratch cells.
Back to the book: 1.1 The question · Chapter 1 Review