SPC control charts: the X-bar and R chart, worked end to end.
A control chart answers one question in real time: has my process changed, or is this just normal variation? Get that right and you stop chasing noise and catch real shifts early. The workhorse for machined and measured parts is the X-bar and R chart — here are the formulas, a full worked example, and the rules that turn a chart into a decision.
What SPC is
Statistical Process Control separates two kinds of variation. Common-cause variation is the natural noise built into a stable process — you leave it alone. Special-cause variation is a signal that something changed: a tool wore, a new batch of material arrived, an operator adjusted a setting. The control chart is the tool that tells the two apart, so you act only when action is warranted.
The classic mistake it prevents is tampering — adjusting a machine after a single part drifts, which usually adds variation rather than removing it. On the shop floor I have watched a good process turned unstable by well-meaning over-correction. A control chart draws a clear line: inside the limits with no pattern, hands off; a signal, investigate.
The X-bar and R chart formulas
You collect data in small subgroups — typically 4 or 5 consecutive parts — taken at regular intervals. For each subgroup you compute the average (X-bar) and the range (R = max − min). Then:
| Chart | Centre line | Control limits |
|---|---|---|
| R chart | R-bar (mean of ranges) | UCL = D4 × R-bar, LCL = D3 × R-bar |
| X-bar chart | X-double-bar (grand average) | X-double-bar ± A2 × R-bar |
The constants A2, D3 and D4 depend only on the subgroup size n. Read the R chart first: if the spread is unstable, the X-bar limits (which are built from R-bar) are meaningless.
| n | A2 | D3 | D4 |
|---|---|---|---|
| 2 | 1.880 | 0 | 3.267 |
| 3 | 1.023 | 0 | 2.574 |
| 4 | 0.729 | 0 | 2.282 |
| 5 | 0.577 | 0 | 2.114 |
For n of 6 or less, D3 is 0, so the R chart has no lower control limit — a range of zero is allowed.
A worked example
Take a turning operation on a shaft diameter, target ⌀25.00 mm, sampled in subgroups of n = 5 every hour. After 20 subgroups you find the grand average and the average range:
- Grand average, X-double-bar = 25.02 mm
- Average range, R-bar = 0.06 mm
From the table at n = 5: A2 = 0.577, D3 = 0, D4 = 2.114. Compute the R chart first:
- R chart UCL = D4 × R-bar = 2.114 × 0.06 = 0.127 mm
- R chart LCL = D3 × R-bar = 0 × 0.06 = 0
With the spread in control, compute the X-bar chart:
- UCL = 25.02 + (0.577 × 0.06) = 25.02 + 0.0346 = 25.055 mm
- LCL = 25.02 − (0.577 × 0.06) = 25.02 − 0.0346 = 24.985 mm
So any subgroup average between 24.985 and 25.055 mm, with ranges under 0.127 mm and no pattern, is normal. A subgroup average of 25.07 mm is a special-cause signal — investigate the process, do not simply re-cut the part.
Control limits are not specification limits
This is the single most misunderstood point in SPC. Control limits come from the process data — they describe what the process actually does. Specification limits come from the drawing — they describe what the customer needs. They are unrelated, and you must never draw the spec limits on a control chart.
The Western Electric rules
A point outside three sigma is the obvious signal, but patterns inside the limits also reveal a shift. The classic Western Electric rules flag a special cause when:
- One point beyond a 3-sigma control limit.
- Two of three consecutive points beyond 2 sigma on the same side.
- Four of five consecutive points beyond 1 sigma on the same side.
- Eight points in a row on one side of the centre line.
A run of eight points above the centre line, even with none outside the limits, means the process has drifted — a slowly wearing tool is the textbook cause. Catching that trend before it breaches the limit is exactly what SPC is for.
Which control chart to use
| Data type | Chart | Use when |
|---|---|---|
| Variable, subgroups of 2–9 | X-bar & R | Measured dimensions, standard shop case |
| Variable, subgroups of 10+ | X-bar & s | Larger subgroups; s estimates spread better |
| Variable, single readings | I-MR | Slow or costly measurement, one part at a time |
| Attribute, defectives | p or np | Pass/fail counts of nonconforming units |
| Attribute, defects | c or u | Counts of defects per unit or per area |
For most machined-part work with a caliper or micrometer, X-bar and R is the right default. Switch to I-MR when you can only measure one piece at a time, such as a slow CMM check.
Common mistakes
- Drawing spec limits on the chart. The most common error — keep tolerance and control limits on separate pages.
- Reading the X-bar chart before the R chart. X-bar limits are built from R-bar; an unstable range makes them invalid.
- Too few subgroups. Use 20–25 subgroups for trial limits; fewer and the limits are unreliable.
- Recalculating limits on every point. Fix the limits from a stable baseline and recompute only after a proven change.
- Ignoring in-limit patterns. A run or trend inside the limits is still a signal — apply the Western Electric rules.
- Subgroups that hide variation. Sample consecutive parts so within-subgroup range reflects short-term noise, not shift-to-shift drift.
Where control charts fit with your other quality data
SPC is the stability layer under everything else. Pair it with Cp and Cpk for capability, Gauge R&R to trust the measurements feeding the chart, and DPMO and sigma level to translate performance into a defect rate. The dimensional data behind your charts is only as clean as the inspection that produced it — CadNexa's auto-ballooning tool numbers every characteristic on the drawing so each reading maps to a defined feature. Blank charting forms are on the templates page.