Tolerance Stack-up (cross-cutting/tolerancing/tolerance-stackup)
Use when the task is assembly tolerance stack-up analysis from the part tolerances: worst case total, root sum square (RSS) total, signed nominal assembly dimension, assembly limits, and the dominant variance contributor.
Domain quick reference
- A linear dimension chain combines signed part nominals n_i with direction d_i (plus or minus 1) into the assembly nominal dimension: N = sum_i d_i * n_i.
- The worst case stack-up total is the sum of the absolute part tolerances: T_wc = sum_i t_i. Every part at its extreme limit simultaneously; the assembly limits are N +- T_wc.
- The statistical (RSS) stack-up total assumes independent, centered part variations: T_rss = sqrt(sum_i t_i**2). RSS is always less than or equal to the worst case total.
- The assembly limits are (N - T, N + T) for the chosen total T.
- The RSS variance share of part i is 100 * t_i2 / sum_j t_j2; shares sum to 100 and rank the dominant contributor.
- Units: any consistent length unit (mm, inch); all parts must share one unit system. Tolerances are bilateral symmetric half-ranges.
Workflow
- Collect the part nominals, directions, and tolerances for the chain.
- Sum the signed nominals with nominal_total(nominals, directions).
- Compute the worst case total with worst_case_total(tolerances).
- Compute the statistical total with rss_total(tolerances).
- Produce the assembly limits with stackup_limits(nominal, total).
- Rank the contributors with rss_shares(tolerances) and report the dominant one before gating the fit assessment.
Pitfalls
- Mixing unit systems in one chain: the stack-up is meaningless unless every part shares a unit system; no conversion is performed.
- Negative tolerances: physically meaningless; the logic raises ValueError.
- Applying RSS to correlated or biased parts: the independent, centered assumption understates the true spread; worst case is the conservative bound.
- Mis-signed directions: a subtracted part entered with the wrong sign shifts the nominal by twice its value.
- Using the largest tolerance instead of the largest variance share: the share squares the tolerance, so a large tolerance on a small part may still dominate the RSS total.
Behavior contract (gate 3)
The stack-up logic is exercised by the gate 3 contract test: scripts/test_tolerance_stackup.py against scripts/tolerance_stackup_logic.py (stdlib unittest, offline). Run: python3 scripts/test_tolerance_stackup.py
Compliance
- Standards referenced, not reproduced: AS9102 (first article inspection) and AS9100 (quality management) frame the characteristic tolerance and inspection context; the worst case and RSS stack-up methods are generic engineering methodology, summary and formulas only per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false.