Sub topic 4
Stability first: capability only means something for a stable process
This chapter assumes you can compute a mean and standard deviation. It also assumes you know the normal distribution and have seen a control chart, though you don't need to be fluent with one. You don't need the formulas for Cp and Cpk yet. This chapter explains why you must check stability before computing them.
Why stability comes first
Cp and Cpk summarize a process in two numbers: its center and its spread. Reading them as a forecast of future output ("this process will produce about this many defects") assumes the center and spread stay put. If the mean wanders or the spread grows and shrinks, the numbers describe only the period you happened to sample.
A stable process, also called in statistical control, is one whose output distribution does not change over time. Its mean and standard deviation are constant, and the variation that remains is random. Stability says nothing about whether the output meets specifications. A process can be stable and produce 30% scrap, or unstable and still happen to pass inspection this week.
A capability index answers the question "if the process keeps behaving like this, how well will it fit the specification?" The answer only means something if "keeps behaving like this" is true.
Common cause and special cause variation
Control charts separate two kinds of variation.
- Common cause variation is the steady background noise built into the process: material grain, small temperature fluctuations, normal tool wear within a shift. It is present at all times and produces a predictable, bounded pattern.
- Special cause variation comes from something specific and usually temporary: a new material lot, an operator change, a broken fixture, a miscalibrated gauge. It produces shifts, trends, or outliers that the common-cause pattern would rarely generate.
A process with only common causes is stable. Removing common cause variation takes a change to the process itself, such as new equipment or a new method. Removing a special cause means finding it and fixing it. Capability work depends on this split. The standard deviation in Cp and Cpk is meant to describe common cause variation alone, so special causes have to be removed first.
What instability does to the numbers
Suppose a process has limits of 9.85 and 10.15. Inside each subgroup the readings vary with a standard deviation of about 0.05. But the process mean drifts between 9.98 and 10.06 over the week, so the standard deviation of all readings pooled together is about 0.08.
| Method | Sigma used | Cp = 0.30 / (6 × sigma) |
|---|---|---|
| Within-subgroup (R-bar/d2) | 0.05 | 1.00 |
| Overall (all readings pooled) | 0.08 | 0.63 |
Neither number is wrong arithmetically, and they disagree by a large margin. The gap exists because the drift adds variation that the within-subgroup estimate cannot see. Neither figure predicts next week, because next week's mean could land anywhere. When a process is stable, the two estimates agree closely, and that agreement is itself a useful check. Chapter 13 covers this comparison in detail as the difference between Cp/Cpk and Pp/Ppk.
Checking stability with an Xbar-R chart
The standard tool for subgrouped measurement data is the Xbar-R chart. It is a pair of charts:
- The Xbar chart plots each subgroup's mean. It shows shifts in the process center.
- The R chart plots each subgroup's range (max minus min). It shows changes in spread.
Check the R chart first. The Xbar limits are calculated from the average range, so an unstable range makes the Xbar limits unreliable.
The center lines and limits are calculated like this, where X-double-bar is the average of the subgroup means and R-bar is the average of the subgroup ranges:
- Xbar chart: X-double-bar ± A2 × R-bar
- R chart: lower limit D3 × R-bar, upper limit D4 × R-bar
The constants depend on subgroup size. For subgroups of five, A2 = 0.577, D3 = 0 and D4 = 2.114. The same R-bar later gives the within-subgroup sigma as R-bar/d2, which is why the two tools fit together.
Computing the limits in Python
The code below computes the limits from a baseline set of subgroups, then tests new subgroups against those baseline limits. It also checks for a run of eight points on one side of the center line.
from statistics import mean
A2, D3, D4 = 0.577, 0.0, 2.114 # constants for subgroup size 5
def xbar_r_limits(subgroups):
xbars = [mean(g) for g in subgroups]
ranges = [max(g) - min(g) for g in subgroups]
xbarbar, rbar = mean(xbars), mean(ranges)
limits = {
"xbar": (xbarbar - A2 * rbar, xbarbar, xbarbar + A2 * rbar),
"range": (D3 * rbar, rbar, D4 * rbar),
}
return limits, xbars, ranges
def beyond_limits(values, lcl, ucl):
return [i for i, v in enumerate(values) if v < lcl or v > ucl]
def has_long_run(values, center, length=8):
run, side = 0, 0
for v in values:
s = 1 if v > center else -1 if v < center else 0
run = run + 1 if s == side and s != 0 else (1 if s != 0 else 0)
side = s
if run >= length:
return True
return False
baseline = [
[10.01, 10.03, 9.99, 10.02, 10.00],
[10.04, 10.00, 10.02, 10.01, 10.03],
[9.98, 10.01, 10.00, 10.02, 9.99],
]
limits, xbars, ranges = xbar_r_limits(baseline)
print([round(x, 4) for x in limits["xbar"]])
print([round(x, 4) for x in limits["range"]])
lcl, center, ucl = limits["xbar"]
new = [[10.06, 10.07, 10.05, 10.08, 10.06]]
new_means = [mean(g) for g in new]
print(beyond_limits(new_means, lcl, ucl))
print(has_long_run(new_means, center))The four lines of output are [9.9869, 10.01, 10.0331], [0.0, 0.04, 0.0846], [0] and False. The new subgroup has a mean of 10.064, above the upper limit of 10.0331, so the check flags subgroup 0. One point is too few for a run, so the last check is False.
Signals that a process is not stable
The most common rules for reading a control chart are:
- One point beyond a control limit (three standard errors from the center line).
- Eight or more consecutive points on the same side of the center line.
- Six or more points in a row steadily increasing or decreasing.
- Two out of three consecutive points beyond two standard errors on the same side.
- Fifteen points in a row within one standard error of the center line, which often means the subgroups mix different sources of variation.
Rules differ between standards (Western Electric, Nelson, AIAG). Pick one set, state it, and apply it to every chart. Each extra rule catches more real problems but also raises the false alarm rate, so adding rules has a cost.
Control limits are not specification limits. Control limits come from the process data and describe what the process does. Specification limits come from the customer or the design and describe what is acceptable. Never draw specification limits on an Xbar chart and compare subgroup means to them. Means vary less than individual readings, so the comparison hides defects.
Common errors
- Computing Cpk from a histogram alone. A histogram collapses time. A mean shift that moved halfway through the data looks like a wide, flat distribution, and the chart that would show the shift is never drawn.
- Subgroups that mix sources of variation. A rational subgroup contains items made under the same conditions, usually consecutive parts. If a subgroup spans two machines, R-bar is inflated and the Xbar limits widen until real shifts hide inside them.
- Removing outliers just to get a stable chart. Deleting a point is justified only after you have identified the cause and confirmed it will not recur. Otherwise you are discarding information about real process behavior.
- Recalculating limits after every shift. Limits should be set from a stable baseline and held. If you recompute them whenever a signal appears, the limits absorb the shift and the chart never alarms again.
- Treating "in control" as "good." Stability means predictable. A stable process can have a Cpk well below 1.
What to do when the process is not stable
You have three options, in order of preference. First, investigate each signal, identify the special cause, and fix it, then collect new data. Second, if the cause is a known and unavoidable part of operation, such as a tool change every 500 parts, change the subgrouping or the sampling plan so it is handled consistently. Third, if you must report something now, report Pp and Ppk, which use overall variation, and label the process as unstable. Do not present Cp or Cpk from unstable data without that warning, since readers will take the number as a prediction.
Exercise
A process has a mean that drifts upward by 0.01 each hour. Its within-subgroup sigma is small and constant, so the Cp calculated from R-bar/d2 looks excellent. Why is that Cp still not a trustworthy summary, and which chart would show the problem?
Show answer
R-bar/d2 measures only the variation inside each subgroup, which is unaffected by the drift between subgroups. The Cp therefore ignores the movement of the center, and the drift will push output toward a specification limit even though Cp looks fine. The Xbar chart would show the problem as a trend of rising subgroup means, and likely a run of points on one side of the center line or points beyond the upper control limit.
Exercise
For subgroups of size 5, a baseline gives a grand mean of 50.00 and R-bar of 0.06. Using A2 = 0.577 and D4 = 2.114, what are the Xbar control limits and the upper limit of the R chart?
Show answer
A2 × R-bar = 0.577 × 0.06 = 0.03462. The Xbar limits are 50.00 − 0.03462 = 49.9654 and 50.00 + 0.03462 = 50.0346. The R chart upper limit is 2.114 × 0.06 = 0.1268.