Skip to content

Quality & Process Workbench

LEAP's Quality & Process Workbench covers three tabs: SPC control charts, process capability, and Gage R&R. All computations run locally inside the panel (no external statistics dependency); results render through the panel's chart renderer and are fully exercisable headlessly.

Quality SPC

Access

  • (Ctrl+Alt+Shift+C) SPC Control Chart, (Ctrl+Alt+Shift+K) Process Capability, (Ctrl+Alt+Shift+G) Gage R&R.
  • CLI: leap spc ..., leap capability ..., leap gage-rr ....

SPC control charts

Supported chart types: xbar-r, xbar-s, i-mr, p, np, c, u. Subgroup size is configurable (2..=25); an attribute chart variant is used for p/np/c/u. Nelson rules 1–8 are flagged on points and summarized in the violation list.

I-MR (individuals + moving range)

\[\bar{x}_{\text{I}} = \text{mean}(x_i), \qquad MR_i = |x_{i+1} - x_i|, \qquad \overline{MR} = \text{mean}(MR_i)\]
\[UCL_I = \bar{x} + E_2\,\overline{MR}, \qquad LCL_I = \bar{x} - E_2\,\overline{MR}, \qquad \sigma_{\hat{}} = E_2\,\overline{MR}/3\]

Xbar-R / Xbar-S

\[UCL_{\bar{x}} = \bar{\bar{x}} + A_2\,\bar{R}, \qquad LCL_{\bar{x}} = \bar{\bar{x}} - A_2\,\bar{R} \qquad (\text{Xbar-R})\]
\[UCL_{\bar{x}}' = \bar{\bar{x}} + A_3\,\bar{s}, \qquad LCL_{\bar{x}}' = \bar{\bar{x}} - A_3\,\bar{s} \qquad (\text{Xbar-S})\]

with \(\sigma = A_2\bar{R}/3 = A_3\bar{s}/3\). R chart: \(UCL_R = D_4\bar{R}\), \(LCL_R = D_3\bar{R}\) (where defined); S chart: \(UCL_S = B_4\bar{s}\), \(LCL_S = B_3\bar{s}\) (where defined).

Attribute charts (P / NP / C / U)

\[p = \frac{\text{nonconforming}}{n}, \quad \bar{p} = \frac{\sum p_i n_i}{\sum n_i}, \quad UCL/LCL = \bar{p} \pm 3\sqrt{\bar{p}(1-\bar{p})/\bar{n}}\]
\[UCL_C = \bar{c} + 3\sqrt{\bar{c}}, \qquad LCL_C = \max(0,\ \bar{c} - 3\sqrt{\bar{c}})\]
\[u = \frac{c}{\text{exposure}}, \quad \bar{u} = \frac{\sum c_i}{\sum\text{exposures}_i}, \quad UCL_u = \bar{u} + 3\sqrt{\bar{u}/n}\]

Nelson rules evaluated

Rule 1: 1 point beyond 3σ; Rule 2: 9 points same side of CL; Rule 3: 6 points steadily increasing/decreasing; Rule 4: 14 points alternating; Rule 5: 2 of 3 beyond 2σ; Rule 6: 4 of 5 beyond 1σ; Rule 7: 15 points within 1σ; Rule 8: 8 points beyond 1σ on the same side.

Process capability

Computed indices: \(C_p\), \(C_{pk}\), \(P_p\), \(P_{pk}\), \(C_{pm}\) and PPM.

\[C_p = \frac{USL - LSL}{6\sigma}, \qquad C_{pk} = \min\!\left(\frac{USL - \mu}{3\sigma},\ \frac{\mu - LSL}{3\sigma}\right)\]
\[C_{pm} = \frac{USL - LSL}{6\sigma\,(1 - 2\,|t - \mu|/(USL - LSL))}, \qquad PPM = 10^6\left[\Phi\!\left(\frac{LSL - \mu}{\sigma}\right) + 1 - \Phi\!\left(\frac{USL - \mu}{\sigma}\right)\right]\]

Long-run / within-subgroup within mode uses range/stddev/moving-range sigma estimates (CLI). The CLI additionally supports non-normal capability models (empirical / weibull / lognormal).

Gage R&R

Crossed and nested ANOVA Gage R&R. Variance components are reported as Repeatability (EV) and Reproducibility (AV):

\[\sigma^2_{\text{total}} = \sigma^2_{\text{Rep}} + \sigma^2_{\text{Repro}}, \qquad NDC = \lfloor 1.41 \sqrt{\sigma^2_{\text{parts}} / \sigma^2_{\text{total}}} \rfloor\]

with per-component variance, pct_contribution, pct_study_var and pct_tolerance (\(100 \cdot 6\sigma_i / \text{tolerance}\)). The crossed mode treats parts and operators as two-way random effects; nested treats operators as nested within parts.

Active-table integration

Quality accepts the active table's numeric columns via show_with_table(ui, panel, numeric_cols) — a dropdown above the panel selects between the Demo Preset and each active table column; loading a column sets active_source and populates both SPC and Capability. Columns must be non-empty and finite (non-finite or too-short columns are rejected and the panel is left unchanged).

GUI / CLI parity

Open SPC with (Ctrl+Alt+Shift+C), Capability with (Ctrl+Alt+Shift+K) or Gage R&R with (Ctrl+Alt+Shift+G). Pick a table column from the Data Source bar; charts update live.

leap spc data.csv --mode xbar-r --column yield_pct --subgroup-size 5 --nelson --svg chart.svg
leap spc data.csv --mode p --counts defect_count --ns n --svg p_chart.svg
leap capability data.csv --column yield_pct --lsl 40 --usl 60 --target 50 --ppm
leap capability data.csv --column yield_pct --mode within --subgroup-size 5 --method range
leap capability data.csv --column yield_pct --mode non-normal --model weibull --lsl 40 --usl 60 --svg cap.svg
leap gage-rr data.csv --mode crossed --part part --operator operator --value reading --tolerance 60,40 --svg gage.svg
leap gage-rr data.csv --mode nested --part part --operator operator --value reading