control_chart
Statistical process control: X-bar and R, X-bar and S, and individuals / moving-range charts from subgrouped data, with d₂, d₃ and c₄ computed by integration over the normal distribution (no copied table), Western Electric or Nelson run rules, capability Cp, Cpk, Pp, Ppk and the expected parts per million outside the specification.
- Field
- Measurement and data
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.1 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001n = 2 closed forms: d₂ = 2/√(π), d₃ = √(2 - 4/π), c₄ = √(2/π), D₄ = 1 + 3 √(π/2 - 1) (textbook 3.267); d₂, d₃ by 12-point Gauss-Legendre quadrature, rel 10⁻⁸passed
constants.d2= 1.128379, within 1.000000 × 10⁻⁸ relativereading not recorded on this pageconstants.d3= 0.852502, within 1.000000 × 10⁻⁸ relativereading not recorded on this pageconstants.c4= 0.797885, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageconstants.c4_gamma= 0.797885, within 1.000000 × 10⁻¹² relativereading not recorded on this pageconstants.D4= 3.266532, within 1.000000 × 10⁻⁸ relativereading not recorded on this pager0002n = 3 closed forms: d₂ = 3/√(π), c₄ = Γ(3/2) = √(π)/2, rel 10⁻⁸ (quadrature)passed
constants.d2= 1.692569, within 1.000000 × 10⁻⁸ relativereading not recorded on this pageconstants.c4= 0.886227, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0003n = 5: c₄ = √(2/4) Γ(5/2)/Γ(2) = 3 √(π)/(4 √2), A₃ = 3/(c₄ √5) (closed forms, rel 10⁻⁹); d₂(5) = 2.32593 and A₂(5) = 0.577 (Tippett 1925 / ASTM STP 15D textbook table, abs to its last digit)passed
constants.c4= 0.939986, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageconstants.A3= 1.427299, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageconstants.d2= 2.32593, within 5.000000 × 10⁻⁶reading not recorded on this pageconstants.A2= 0.577, within 5.000000 × 10⁻⁴reading not recorded on this pager0004centred process, σ = (USL - LSL)/6: Cp = Cpk = 1, ppm = 10⁶ erfc(3/√2) = 2699.796 (textbook 2700), ARL = 1/erfc(3/√2) = 370.4; closed forms, rel 10⁻⁶passed
cp1 ± 10⁻⁹1lockedunder 0.01 % of the tolerance usedcpk1 ± 10⁻⁹1lockedunder 0.01 % of the tolerance usedppm_expected2699.8 ± 0.00272699.8lockedunder 0.01 % of the tolerance usedfalse_alarm_rate0.0026998 ± 2.7 × 10⁻¹²0.0026998lockedunder 0.01 % of the tolerance usedarl_in_control370.398 ± 3.7 × 10⁻⁷370.398lockedunder 0.01 % of the tolerance usedr0005six σ with a 1.5 σ shift (Motorola): Cp = 2, Cpk = 1.5, ppm = 10⁶ (Q(4.5) + Q(7.5)) = 3.3977 (textbook 3.4); closed forms, rel 10⁻⁶passed
cp2 ± 2 × 10⁻⁹2lockedunder 0.01 % of the tolerance usedcpk1.5 ± 1.5 × 10⁻⁹1.5lockedunder 0.01 % of the tolerance usedppm_expected3.39767 ± 3.4 × 10⁻⁶3.39767lockedunder 0.01 % of the tolerance usedfraction_outside_expected3.39767 × 10⁻⁶ ± 3.4 × 10⁻¹²3.39767 × 10⁻⁶lockedunder 0.01 % of the tolerance usedr0006I-MR by hand on 1,3,2,4,3: mean 2.6, mean MR 1.5, σ = 1.5 √(π)/2, UCL = 2.6 + 3 σ, MR UCL = 1.5 (1 + 3 √(π/2 - 1)), s = √(1.3); exact arithmetic, rel 10⁻⁸ (d₂, d₃ by quadrature)passed
chart= i_mri_mrlockedexact matchmean2.6 ± 2.6 × 10⁻¹²2.6lockedunder 0.01 % of the tolerance useddispersion_mean1.5 ± 1.5 × 10⁻¹²1.5lockedunder 0.01 % of the tolerance usedsigma_within1.32934 ± 1.3 × 10⁻⁸1.32934lockedunder 0.01 % of the tolerance usedlocation_ucl6.58802 ± 6.6 × 10⁻⁸6.58802lockedunder 0.01 % of the tolerance usedlocation_lcl-1.38802 ± 1.4 × 10⁻⁸-1.38802lockedunder 0.01 % of the tolerance useddispersion_ucl4.8998 ± 4.9 × 10⁻⁸4.8998lockedunder 0.01 % of the tolerance usedsigma_overall1.14018 ± 1.1 × 10⁻¹²1.14018lockedunder 0.01 % of the tolerance usedin_control= truetruelockedexact matchr0007X-bar R by hand on four subgroups (-1, 1), specs -6..6:
sigma_within= R/d₂ = √(π), Cp = Cpk = 2/√(π), s = √(8/7), Pp = 2 √(7/8), UCL = 3 √(π/2), R UCL = 2 (1 + 3 √(π/2 - 1)); exact arithmetic, rel 10⁻⁸passedchart= xbar_rxbar_rlockedexact matchsigma_within1.77245 ± 1.8 × 10⁻⁸1.77245lockedunder 0.01 % of the tolerance usedcp1.12838 ± 1.1 × 10⁻⁸1.12838lockedunder 0.01 % of the tolerance usedcpk1.12838 ± 1.1 × 10⁻⁸1.12838lockedunder 0.01 % of the tolerance usedpp1.87083 ± 1.9 × 10⁻¹²1.87083lockedunder 0.01 % of the tolerance usedppk1.87083 ± 1.9 × 10⁻¹²1.87083lockedunder 0.01 % of the tolerance usedlocation_ucl3.75994 ± 3.8 × 10⁻⁸3.75994lockedunder 0.01 % of the tolerance useddispersion_ucl6.53306 ± 6.5 × 10⁻⁸6.53306lockedunder 0.01 % of the tolerance usedppm_observed00lockedr0008rules by construction, standards mean 0 σ 1: a 4 σ spike gives 1 point beyond 3 σ and 2 moving ranges of 4 above (d₂ + 3 d₃) = 3.686; then 8 points at +0.5 σ give one run of 8 (Western Electric)passed
in_control= falsefalselockedexact matchrule_counts.beyond_limits= 1misseddiffersrule_counts.dispersion_beyond_limits= 2misseddiffersrule_counts.run_same_side= 1misseddiffersrule_counts.two_of_three_beyond_2_sigma= 0misseddiffersrule_counts.four_of_five_beyond_1_sigma= 0misseddiffersdispersion_ucl3.68589 ± 3.7 × 10⁻⁸3.68589lockedunder 0.01 % of the tolerance used
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
data | The measurements: a list of subgroups (each an inner list of equal length), or a flat list cut into subgroups of subgroup_size. Leave out to get the constants (and, with process_mean and process_sigma, the capability of a described process). | ||
data_unit | 1 | Unit of the measurements, the specification limits and the process mean and σ (mm, um, g, ...). Only recorded and passed on to the readings. | |
subgroup_size | 1 | 1 | Parts measured together, used to cut a flat data list; 1 charts individuals. Without data: the n of the constants. |
chart | auto | auto: i_mr for single values, xbar_r for subgroups up to 10, xbar_s above. | |
rules | western_electric | western_electric: beyond limits, 2 of 3 beyond 2 σ, 4 of 5 beyond 1 σ, 8 in a row on one side. nelson adds trend of 6, 14 alternating, 15 within 1 σ, 8 beyond 1 σ on both sides, and takes 9 in a row. Every set also flags the dispersion chart beyond its limits. | |
limit_sigmas | 1 | 3 | Control limits at this many standard deviations of the plotted statistic. |
lsl | Lower specification limit (optional). | ||
usl | Upper specification limit (optional). | ||
process_mean | Known (standard) process mean: centres the chart. Without data, the mean of the described process. | ||
process_sigma | Known (standard) process standard deviation, greater than 0: sets the limits. Without data, the σ of the described process. | ||
constants_table_max_n | 1 | 0 | If 2 or more, also tabulate d₂, d₃, c₄, A₂, A₃, B₃-B₆, D₁-D₄, E₂ for n = 2 up to this, at limit_sigmas (out/constants.csv). |
Readings
| Name | Unit | Meaning |
|---|---|---|
data_unit | 1 | The unit the location readings are in. |
mode | 1 | "data" (charted measurements) or "model" (constants and a described process). |
chart | 1 | |
subgroup_size | 1 | |
subgroups_n | 1 | |
observations_n | 1 | |
limit_sigmas | 1 | |
false_alarm_rate | 1 | Probability that one in-control point falls beyond the limits, 2 (1 - Φ(L)). |
arl_in_control | 1 | Average run length between false alarms, in points. |
mean | Grand mean of the data (or the described process mean). | |
sigma_within | Mean range / d₂, mean s / c₄, or mean moving range / d₂(2). | |
sigma_overall | Sample standard deviation of every observation (n - 1). | |
dispersion_mean | ||
location_cl | ||
location_lcl | ||
location_ucl | ||
dispersion_cl | ||
dispersion_lcl | ||
dispersion_ucl | ||
in_control | 1 | true when no rule fired; null without data. |
signals_n | 1 | |
signal_points_n | 1 | |
signals | 1 | |
signals_detail | 1 | |
rule_counts | 1 | |
cp | 1 | (USL - LSL) / 6 sigma_within. |
cpk | 1 | min(USL - mean, mean - LSL) / 3 sigma_within. |
cpu | 1 | |
cpl | 1 | |
pp | 1 | (USL - LSL) / 6 sigma_overall. |
ppk | 1 | As Cpk with sigma_overall. |
sigma_level | 1 | 3 Cpk: the distance from the mean to the nearer specification limit in sigma_within. |
fraction_outside_expected | 1 | ppm_expected / 10⁶: the fraction of parts expected outside the specification, the number to chain into other runs. |
ppm_expected | No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside the specification, normal with the mean and sigma_within (a count per million parts, not a fraction). | |
ppm_below_lsl | No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected below LSL. | |
ppm_above_usl | No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected above USL. | |
ppm_expected_overall | No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside, with sigma_overall. | |
ppm_observed | No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million of the measurements that fall outside the specification. | |
constants | 1 | d₂, d₃, c₄ (by integration), c4_gamma (Γ-function check), and A₂, A₃, B₃-B₆, D₁-D₄, E₂ at limit_sigmas for the subgroup size. |
constants_table | 1 | |
points | 1 | |
points_truncated | 1 | |
notes | 1 |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.