L2 · PAI-150

Yield, scrap & process capability

Compute a line's yield and process-capability index (Cp/Cpk) from a batch, and raise yield above a target by centering and/or narrowing the process.

01
Challenge

Try this first — before any explanation.

Run a 500-part batch on a 3-station line whose bore station ships off-center (μ=12.07, σ=0.020) against spec Ø12.00±0.05. Read first-pass yield, scrap, and Cpk, then change only the bore station's settings (shift μ, reduce σ) until first-pass yield ≥ 98%. Most novices reach for 'make it more precise' (expensive) before noticing the mean is simply in the wrong place — that discovery is the point.

The Bench

The Yield & Capability panel streams the batch's measured bore into numpy; you compute yield, Cp, Cpk yourself, then center or narrow Station C. Edit the offset/feed and run.

tighter sigma\n return rng.normal(mu, sigma, 500)\nprint('spec band:', LSL, '-', USL)","label":"1 — Batch generator + spec"},{"code":"bore_offset = -0.070 # EDIT: shift mu toward 12.000 (centering, free)\nfeed_per_rev = 0.10 # EDIT: lower -> tighter sigma (narrowing, costs cycle time)\nctq = batch_ctq(seed=5101, bore_offset=bore_offset, feed_per_rev=feed_per_rev)\nmu, sigma = ctq.mean(), ctq.std(ddof=1)\nyield_frac = float(np.mean((ctq >= LSL) & (ctq <= USL)))\nscrap = int(np.sum((ctq < LSL) | (ctq > USL)))\nCp = (USL - LSL) / (6*sigma)\nCpk = min((USL - mu)/(3*sigma), (mu - LSL)/(3*sigma))\ncycle_s = 4.0 + (0.10 - feed_per_rev)*13.0 # narrowing raises cycle time\nprint(f'mu={mu:.4f} sigma={sigma:.4f} yield={yield_frac:.2%} scrap={scrap}/500')\nprint(f'Cp={Cp:.2f} Cpk={Cpk:.2f} cycle={cycle_s:.1f}s')","label":"2 — Your settings (EDIT) + capability"},{"code":"twist = batch_ctq(seed=5102, bore_offset=(12.000-12.07), feed_per_rev=feed_per_rev)\ntmu, tsig = twist.mean(), twist.std(ddof=1)\ntyield = float(np.mean((twist>=LSL)&(twist<=USL)))\nprint(f'twist: mu={tmu:.4f} sigma={tsig:.4f} yield={tyield:.2%} (centering wont help; narrow sigma)')","label":"3 — Twist seed 5102 (already centered, wide)"},{"code":"problems = []\nif yield_frac < 0.98:\n if abs(mu-12.000) > 0.01:\n problems.append(f'mu={mu:.3f} off-center - apply bore_offset ~ {12.000-12.07:+.3f} before touching feed; yield is capped by off-centering, not spread.')\n else:\n problems.append('centered but yield short - narrow sigma (lower feed_per_rev).')\n# G3: base task should be solved by centering, not paid narrowing\nif yield_frac >= 0.98 and feed_per_rev < 0.10:\n problems.append(f'yield reached but you lowered feed (cycle {cycle_s:.1f}s) - the base process was only off-center; re-center at zero cycle cost.')\n# G4 twist: needs narrowing\ntwist_ok = tyield >= 0.98 and tsig <= 0.019\n\nif yield_frac >= 0.98 and feed_per_rev >= 0.099 and abs(Cpk-Cpk) < 0.03:\n print(f'PASS - base yield {yield_frac:.1%} >= 98% by centering alone (Cpk={Cpk:.2f}), '\n f'at zero cycle cost. Center before you narrow.')\nelse:\n print('FAIL - ' + ' '.join(problems[:2] if problems else ['raise yield to >=98% with the cheapest correct lever.']))","label":"4 — Autograder (seeds 5101 + 5102)"}],"intro":"The Yield & Capability panel streams the batch's measured bore into numpy; you compute yield, Cp, Cpk yourself, then center or narrow Station C. Edit the offset/feed and run.","key":"manufacturing/yield-scrap-and-process-capability","kind":"python","title":"Yield, scrap & process capability"}">
PYTHON · NUMPY · IN-BROWSER

Yield, scrap & process capability

The Yield & Capability panel streams the batch's measured bore into numpy; you compute yield, Cp, Cpk yourself, then center or narrow Station C. Edit the offset/feed and run.

02
Model

The idea, built visually.

You ran a perfect plan on a perfect machine and still got bad parts — because every process is a spread and your spec is a band. Yield is just the green overlap: the fraction of parts inside the band; scrap is the tails. A line is a chain — line yield is the product of every station's pass rate, so one weak station drags the whole line down, exactly like the bottleneck dragged throughput, but for quality.

Capability adds margin: Cp = (USL−LSL)/(6σ) asks if your spread even fits; Cpk = min((USL−μ),(μ−LSL))/(3σ) adds 'are you centered?' The gap between Cp and Cpk is pure off-centering — usually the cheapest thing to fix. Two moves: center the process (often a free offset), or narrow it (costs time/tooling). Reach for centering first.

▣ Stage animation: A bell curve with warm LSL/USL lines, the in-band area shading green into a yield gauge; three station gauges multiply 0.998×0.995×0.942→0.935; then μ slides off-center and Cpk drops while Cp holds, the gap lighting warm.

03
Guided practice

Build it up, step by step.

  1. Step 1 (worked): run the metrics cell on the shipped state → μ=12.07, yield 15.87%, Cp=0.83, Cpk=−0.33 (negative Cpk = mean outside a spec limit's 3σ reach).
  2. Step 2 (guided): apply bore_offset = −0.070 to re-center → yield ≈98.8% at zero cost; the expensive narrow move was never needed.
  3. Step 3 (independent + twist): a seed already centered at 12.000 but σ=0.030 — centering does nothing; lower feed_per_rev to narrow σ and note the cost (cycle time rises 4.0→5.3 s).
04
Feedback

How the Bench grades your run.

PASS WHEN Base yield ≥0.98 reached by centering (no paid narrowing), reported Cpk within ±0.03 of computed, and on the twist seed yield ≥0.98 with σ ≤0.019 plus a noted cycle-time cost, on seeds 5101/5102.

  • μ = 12.070, center = 12.000 → mean is +0.070 above the band. Yield is capped at 16% by off-centering, not spread. Apply bore_offset ≈ −0.070 before touching feed.
  • Cpk you reported (0.41) ≠ computed (0.83) — Cpk uses min of BOTH (USL−μ) and (μ−LSL) over 3σ; did you divide by 3σ, not 6σ?
  • Yield 98% reached, but you got there by lowering feed (cycle 4.0→5.3 s). The base process was only off-center — re-centering hits target at zero cost.
  • Twist line: μ is centered, Cp=0.56 — centering can't help; you must narrow σ. Lower feed_per_rev until σ ≤ 0.019 and Cpk ≥ 1.0.
05
Retrieve & space

Bring back what you've already mastered.

  • From M3.2: a bimodal batch histogram — name the most likely systematic cause and one fix. → tool wear mid-batch / fixture swap; split or re-zero.
  • From M4.2: line yield = 0.998×0.995×0.942 — what was the throughput analogue of that weakest 0.942 station? → the bottleneck; both are governed by the worst station.
  • From M3.1: tightening the bore spec from ±0.05 to ±0.03 raises Cpk for free — true or false? → false; a narrower spec makes capability worse.
06
Mastery gate

What you must demonstrate to advance.

In sim, on an unseen 3-station line, correctly compute yield/scrap/Cp/Cpk, raise first-pass yield from sub-90% to ≥98% by the correct lever (center when off-center, narrow when centered), and state the cost of any narrowing. Unlocks 5.2.

07
Project

How this feeds your build.

Yield and Cpk become two of the three capstone scoreboard targets; 'center before you narrow' and 'line yield = product of station yields' are direct capstone levers.