SPC and Cpk: when a control chart raises an alarm and when a process is capable
Calculating I-MR control limits, the logic of the Nelson rules, the difference between control limits and specification limits, and why Cpk can be low in a ten-point example even while the process is in control.
Statistical process control (SPC) answers two separate questions, and they are often confused: is the process stable (the control chart), and does the process meet the specification (capability, Cp/Cpk)? A stable process may not meet the specification; a process that meets it for now may be unstable.
Where do the control limits come from?
In an I-MR chart for individual measurements, the limits are calculated from the process's own data. The absolute difference between two consecutive measurements is the moving range (MR); call its mean MR-bar. The centre line is the mean, and the limits are the mean ± 2.66 × MR-bar (2.66 = 3 / 1.128). The standard deviation estimate is MR-bar / 1.128.
Example: ten measurements: 10.02 · 10.05 · 9.98 · 10.03 · 10.01 · 10.04 · 9.99 · 10.02 · 10.06 · 10.00. The mean is 10.020; MR-bar = 0.0422 (total difference 0.38 divided by 9). The limits are 10.020 ± 2.66 × 0.0422: upper 10.132, lower 9.908. The sigma estimate is 0.0422 / 1.128 = 0.0374. (Ten points are only to show the method; a real limit calculation needs at least 20-25 stable measurements.)
When does it alarm?
Rule 1: one point falls outside the 3-sigma limit. In a normal distribution, even while the process is stable, the probability of a point exceeding this limit is about 0.27%; so on average one false alarm is expected every 370 measurements. To catch small shifts the Nelson rules also look at patterns:
- 9 points in a row on the same side of the centre: the mean has shifted.
- 6 points in a row steadily rising or falling: there is a trend, often wear.
- 14 points in a row alternating up and down: two sources may be mixed.
- 2 of 3 points on the same side beyond 2 sigma: an early sign of a shift.
As the number of rules grows, detection speeds up but false alarms also increase; you need not apply all of them to every process.
A control limit is not a specification limit
Control limits say what the process does, specification limits what the customer wants. In the same example let the lower specification limit be 9.90 and the upper 10.10. Cp = (10.10 − 9.90) / (6 × 0.0374) = 0.89; Cpk = min(10.10 − 10.02; 10.02 − 9.90) / (3 × 0.0374) = 0.08 / 0.1123 = 0.71. Even though all ten measurements are within specification, the process is not capable, because its mean is close to the upper limit and its spread is wide; with the normal-distribution assumption the estimated defect rate is about 1.7%. Cp reflects the spread, and Cpk reflects the spread together with how far the mean sits off centre.
Common mistakes
- **Drawing the specification limit on the control chart.** It reflects what is wanted, not the natural behaviour of the process; control limits must be calculated separately.
- **Calculating Cpk on an unstable process.** Bring it under control first; otherwise Cpk has no meaning.
- **Not keeping the data in time order.** The moving range depends on order; shuffled data distorts the limits.
- **Recalculating limits at every alarm.** Limits come from a stable period; if there is a shift, the cause is investigated, the limit is not moved.
- **Copying a Cpk target blindly.** The accepted level varies with the customer, the sector and the contract.
- **Assuming a normal distribution.** For one-sided or skewed data the ppm estimate can mislead.
Try it with the tools
Paste your own measurements into the control chart (SPC) tool: you get the I and MR charts, the limits and the Nelson rules that were violated. For Cp, Cpk, Pp, Ppk and a ppm estimate against your specification limits there is the Cp / Cpk capability calculator. To set up quality monitoring in your process, get in touch.
Let's discuss this for your plant
More notes
All notes →- 3 min readSix common mistakes on medical device UDI labelsPackaging levels, changes that require a new UDI-DI, confusing Basic UDI-DI with UDI-DI, missing production identifiers, labels that don't match the barcode and unmeasured print quality: the most common UDI mistakes for medical devices.
- 3 min readSix ways the case–pallet relationship breaks in aggregationRejected packs, partial cases, sampling, manual handling, double assignment and pallet breakdown: the most common situations in which aggregation records drift from physical content, and how to prevent them on the line.
- 2 min readGaps and bad records in SCADA data: what to do before modellingTimestamps, gaps, frozen sensors, physically impossible values, curtailment and maintenance periods, sensor replacement: what to check in SCADA data before building a predictive maintenance or power forecasting model.