DEV Community

chenzefeng09
chenzefeng09

Posted on

Tolerance stack-up analysis is still stuck in spreadsheets — so I built a tool that reads the CAD model

A few months ago I watched a mechanical engineer spend most of a week on a tolerance stack-up for an assembly with about thirty contributors. Not designing — adding numbers in Excel. Column per dimension, sign per direction, a comment column explaining why each sign was what it was. At the end, the answer was a single worst-case number that nobody fully trusted, because three of the dimensions were turned with the wrong sign at least once during entry and nobody could prove they'd all been caught.

This is bizarre when you think about it. The CAD model already contains every distance, every fit, every mating face. The spreadsheet exists only because nothing reads the model and asks the obvious question: given how these parts can actually vary, will the assembly still work?

What stack-up analysis actually is

Take a linear chain — the classic case is three rings stacked in a housing bore. Housing shoulder-to-shoulder is 50.00 ±0.10 mm, each ring is 16.00 ±0.05 mm. The end gap is:

g = 50.00 − (16.00 + 16.00 + 16.00) = 2.00 mm nominal
Enter fullscreen mode Exit fullscreen mode

Worst-case analysis adds the tolerances arithmetically: ±0.25 mm, so g ∈ [1.75, 2.25]. Guaranteed — no conforming set of parts can break it.

RSS (root-sum-square) treats each ±t as roughly ±3σ and combines in quadrature: √(0.10² + 3×0.05²) ≈ ±0.13 mm. Much tighter, but a small fraction of assemblies will fall outside that band — you've traded a guarantee for a quantified yield.

Same drawing, same parts. One method says "your 1.80 mm minimum fails," the other says "you're at 4.5σ, ship it." Which answer you're allowed to believe is an engineering decision — worst-case for safety and unmeasurable processes, RSS where you have controlled production data. I wrote up the full mechanics with worked examples and a separate piece on choosing between the methods if you want the detail.

Where it actually breaks

The spreadsheet approach fails quietly, not loudly:

  • Sign errors. Thirty contributors, each entered by hand with a direction. One flipped sign and you get a confident, wrong number.
  • The chain isn't linear. Fastener clearance lets parts float and rotate. A flatness callout tilts a face. Real assemblies are 3D kinematics; a 1D sum is systematically optimistic about tilt-driven variation.
  • Contact depends on the answer. Whether a pin bottoms on the left or right face changes the chain itself — the worst case has to be searched, not summed.
  • The inputs live in different vocabularies. An ISO 286 fit code like H7/g6, a position callout on a bolt circle, and a general-tolerance block all express variation differently. Normalizing them by hand is error-prone.

Teams doing model-based definition hit a subtler version of this: they invest in annotating the model with PMI (Product & Manufacturing Information — dimensions, datums, GD&T living on the 3D model), then assume the problem is solved. But PMI states requirements; it doesn't evaluate their combined effect. Ten features each inside tolerance can still produce a binding gap. Nothing in the PMI knows about the loop it participates in.

What I built

SuperNX does the loop end-to-end inside Siemens NX:

  1. Drop in a .prt file — it extracts the geometry and features directly.
  2. It infers assembly intent — which joint is a pin-in-hole, which is a slider, which is a press fit — rather than applying a rule table.
  3. It assigns tolerances the way the mechanism actually works (ISO 286 fits, ISO 2768 defaults, or your custom standards) and runs worst-case + statistical analysis with per-contributor sensitivity.
  4. It writes back a traceable report and a toleranced model — and a failing key characteristic stops the PMI write-back, so nothing unverified reaches the drawing.

Two deliberate constraints, stated plainly: it only speaks Siemens NX (.prt), and every number it reports traces to a real model measurement or a published standard — if it can't be proven, it isn't reported.

It's free to start: nxtolerance.com. If you've done stack-ups by hand, I'd genuinely like to hear where the spreadsheet version broke for you — sign errors, correlated contributors, or the "thirty contributors and no one trusts the sign column" problem.

Top comments (0)