Quality — process capability (Cp / Cpk)
Process capability study whose indices are computed from the subgroups that were actually measured, not copied off the SPC terminal. Typed FlowScript for reliability engineering. Keywords: FMEA, failure mode, RPN, reliability.
Make it your own.
// Process capability study whose indices are computed from the
// subgroups that were actually measured, not copied off the SPC terminal.
//
// The characteristic is a moulded bore on a clutch-pedal bush, nominal
// 12.000 mm with a bilateral tolerance of 0.100 mm, sampled five at a time
// across one shift. Sigma-within is s-bar / c4 rather than R-bar / d2:
// with n = 5 the sample standard deviation is the more efficient
// estimator, and each subgroup already carries its own s.
//
// Cp compares the tolerance with the spread; Cpk also charges the process
// for being off centre; Cpm charges it for missing the target. All three
// are derivations here, so correcting one measurement moves all of them.
capability_study bore_study {
title: "Bore capability — PB-4471 clutch pedal bush"
part: "PB-4471, PA66-GF30, tool 4-cavity, cavity 3 only"
characteristic: "Bore diameter, measured 24 h after ejection at 20 °C"
process: "Engel Victory 180 t press, line 2"
standard: "ISO 22514-2:2017, procedure for a stable normal process"
nominal: 12.000 mm
target: 12.000 mm
usl: 12.100 mm
lsl: 11.900 mm
tolerance: = usl - lsl
subgroup_size: 5
subgroups: 6
sampling_interval: 90 min
// c4 corrects the bias in s as an estimator of sigma; the value is the
// published constant for n = 5, not something these data can produce.
c4: 0.9400 source "ISO 22514-2 Table 3, n = 5"
}
// The thirty measurements live here once, as six subgroups of five. Each
// group carries the mean and s of its own five values because FlowScript
// aggregates ACROSS blocks, not within a list — so these two summaries are
// the only numbers in the document that are recorded rather than derived.
distribution bore_diameter {
title: "Bore diameter — six subgroups of five, one shift"
kind: raincloud
unit: "mm"
whisker: tukey
jitter: true
n: 30
group sg_0815 {
label: "08:15"
values: [12.004, 12.031, 11.986, 12.017, 11.982]
n: 5
mean: 12.0040
sd: 0.02065
}
group sg_0945 {
label: "09:45"
values: [11.998, 11.971, 12.014, 11.985, 12.022]
n: 5
mean: 11.9980
sd: 0.02080
}
group sg_1110 {
label: "11:10"
values: [12.019, 12.036, 11.992, 12.008, 12.000]
n: 5
mean: 12.0110
sd: 0.01718
}
group sg_1330 {
label: "13:30"
values: [12.012, 11.979, 12.024, 11.995, 11.995]
n: 5
mean: 12.0010
sd: 0.01736
}
group sg_1500 {
label: "15:00"
values: [11.988, 12.013, 11.968, 11.999, 12.007]
n: 5
mean: 11.9950
sd: 0.01776
}
group sg_1620 {
label: "16:20"
values: [12.021, 11.994, 12.033, 11.990, 11.997]
n: 5
mean: 12.0070
sd: 0.01891
}
}
capability_indices bore_indices {
of: bore_study
// An aggregate deliberately returns a bare number, so the millimetre is
// attached once, here, and every index below is then dimensionless.
grand_mean: = mean(kind:group, "mean") * 1[mm]
s_bar: = mean(kind:group, "sd") * 1[mm]
sigma_within: = s_bar / bore_study.c4
cp: = bore_study.tolerance / (6 * sigma_within)
cpu: = (bore_study.usl - grand_mean) / (3 * sigma_within)
cpl: = (grand_mean - bore_study.lsl) / (3 * sigma_within)
cpk: = min(cpu, cpl)
cpm: = cp / sqrt(1 + ((grand_mean - bore_study.target) / sigma_within) ^ 2)
z_min: = 3 * cpk
// Performance indices use the overall spread of all thirty readings, so
// between-subgroup drift is charged to the process rather than hidden.
sigma_overall: 0.0203 mm source { dataset: "bore_2026_03.csv", column: "bore_mm", rows: 30, aggregation: "sd" }
pp: = bore_study.tolerance / (6 * sigma_overall)
ppk: = min((bore_study.usl - grand_mean) / (3 * sigma_overall), (grand_mean - bore_study.lsl) / (3 * sigma_overall))
// Cp / Pp near 1 says the subgroups are not drifting apart: the process
// is in control, and the capability number means what it claims.
stability_ratio: = cp / pp
}
control_chart bore_xbar_s {
metric: "Bore diameter, mm — subgroup of 5 every 90 minutes"
chart: "X-bar and s"
baseline_period: "2026-02-02 to 2026-02-27, 125 subgroups"
baseline_n: 125
centre_line: "X-bar-bar 12.0021 mm, s-bar 0.0187 mm, both frozen from the February baseline and not re-based since"
limits: "3-sigma X-bar limits 11.9770 / 12.0272 mm from s-bar / c4; s-chart limits from B3, B4 at n = 5"
intervention_at: "Screw-tip and non-return valve replaced 2026-03-09 during planned maintenance; no shift followed"
rules: [
"One point beyond 3 sigma",
"Nine consecutive points on one side of the centre line",
"Six consecutive points increasing or decreasing",
"Two of three consecutive points beyond 2 sigma on the same side"
]
special_cause: "None in this shift. The 11:10 subgroup is the highest of the six and remains inside 2 sigma."
annotations: "Material lot change at 13:00 is marked on the chart; the 13:30 subgroup follows it."
}
cite iso22514 {
key: "iso22514-2"
title: "ISO 22514-2:2017 — Statistical methods in process management. Capability and performance: process capability and performance of time-dependent process models"
publisher: "International Organization for Standardization"
year: 2017
type: "guideline"
of: bore_study
}
note capability_caveat {
text: "Cpk on six subgroups is an estimate with a wide interval — roughly 1.62 (1.24 to 2.00) at 95%. Customer capability requirements are normally judged on 25 subgroups; this shift is a check, not the submission."
anchor: bore_indices
}
view spread: raincloud(bore_diameter)
caption bore_caption {
of: spread
title: "Bore diameter by subgroup"
text: "Thirty bores measured across one shift, drawn as a raincloud so every reading, the shape of the distribution and the robust summary are all visible. Specification limits 11.900 and 12.100 mm."
statistics: "Box shows median and hinges with Tukey whiskers; every observation is drawn."
n_statement: "n = 30 bores in six subgroups of five, one cavity."
style: journal
}
alt bore_alt {
of: spread
text: "Six subgroups of bore measurements, all comfortably inside the specification limits, centred slightly above nominal."
summary: "Capability is adequate and the process is centred a little high."
}