Skip to content

GuidesQuality and SPC

X̄-R control chart: limits, constants and rules

A control chart plots a process measurement over time, with a center line and two limits calculated from the process itself, usually at ±3σ. The X̄-R chart tracks the mean and the range of small samples together and flags when the process changes, before parts go out of tolerance.

By Muvia · Updated October 21, 2026

What statistical process control is

Statistical process control (SPC) starts from an idea Walter Shewhart had in the 1920s: every process varies, but there is normal variation, made of many small causes that are always present, and special variation, due to a specific cause such as a worn tool, a different batch of material or a wrong setting. The control chart is there to tell them apart.

As long as the points stay within the limits and form no unusual patterns, the process is said to be in control: it varies only from common causes, and intervening would make things worse. When a point falls outside or a rule fires, there is a special cause to look for. Note: control limits come from the process, tolerance limits from the drawing. They are two different things and must never be confused.

X̄-R chart: when to use it

The X̄-R chart is used for continuous measurements (weights, dimensions, temperatures, torques) collected in rational subgroups: a few consecutive parts, made under the same conditions, measured at regular intervals. For example, five bottles weighed every fifteen minutes.

  • X̄-R for subgroups of 2 to about 10 parts: the range R (maximum minus minimum) is simple and estimates variation well.
  • X̄-S for larger subgroups, above 10: the subgroup standard deviation is more efficient than the range.
  • I-MR (individuals and moving range) when each measurement stands alone, for example one lab analysis per batch.
  • Attribute charts when you count rather than measure: defective parts or defects.

Calculating the limits

Start from a reference period in which the process is stable, at least 20–25 subgroups. For each subgroup calculate the mean X̄ and the range R; then the grand mean X̄̄ and the average range R̄. The 3σ limits are obtained with tabulated constants that depend only on the subgroup size n.

X̄ chart: CL = X̄̄ UCL = X̄̄ + A2 × R̄ LCL = X̄̄ − A2 × R̄

R chart: CL = R̄ UCL = D4 × R̄ LCL = D3 × R̄

Estimate of the process standard deviation: σ = R̄ ÷ d2

nA2D3D4d2
21.88003.2671.128
31.02302.5741.693
40.72902.2822.059
50.57702.1142.326
60.48302.0042.534
70.4190.0761.9242.704
80.3730.1361.8642.847
90.3370.1841.8162.970
100.3080.2231.7773.078
Constants for 3σ X̄-R charts, as given in the standard statistical control tables (for example ASTM and the automotive SPC manuals). A2 = 3 ÷ (d2 × √n). For n up to 6 the lower limit of the R chart is zero.

The limits are calculated once on the reference period and then held fixed: recalculating them at every new point widens them exactly when the process shifts, and the chart stops warning you. Recalculate them after an intended and verified change to the process.

The Western Electric (and Nelson) rules

A point beyond the limits is not the only signal. The Western Electric rules, published in the company's quality control handbook in 1956, divide the chart into three zones on each side (within 1σ, between 1σ and 2σ, between 2σ and 3σ) and look for patterns that a stable process would produce very rarely. Here σ is the standard deviation of the subgroup mean, that is one third of the distance between the center line and the limit.

RuleSignalWhat it usually indicates
1One point beyond 3σA sudden special cause: measurement error, an abnormal part, a breakdown
2Two out of three consecutive points beyond 2σ, on the same sideA shift in the mean that is starting
3Four out of five consecutive points beyond 1σ, on the same sideA small but persistent shift
4Eight consecutive points on the same side of the center lineA change in level: a new batch, a new setting

The Nelson rules (1984) are eight and include the previous four, with nine points instead of eight for the same-side rule, plus four patterns: six points in a row steadily increasing or decreasing (drift, typical of wear), fourteen points in a row alternating up and down (overadjustment), fifteen points in a row within 1σ (limits too wide or mixed data) and eight points in a row beyond 1σ on either side (two mixed populations). The more rules you turn on, the more false alarms you get: choose one set and keep it the same for every line.

Worked example

A filler doses 500 g bottles. Every fifteen minutes five consecutive bottles are weighed (n = 5). Over the 25 subgroups of the reference period the grand mean is X̄̄ = 500.20 g and the average range is R̄ = 1.10 g.

X̄ chart limits: 500.20 ± 0.577 × 1.10 = 500.20 ± 0.63, that is UCL = 500.83 g and LCL = 499.57 g. R chart limits: UCL = 2.114 × 1.10 = 2.33 g, LCL = 0. The estimated process standard deviation is 1.10 ÷ 2.326 = 0.47 g. The zones of the X̄ chart fall every 0.21 g: 500.41, 500.62 and 500.83 above the center line.

SubgroupX̄ (g)R (g)ZoneRule
26500.310.9within 1σ—
27500.451.2between 1σ and 2σ—
28500.521.0between 1σ and 2σ—
29500.581.3between 1σ and 2σ—
30500.661.1between 2σ and 3σ3: four out of five beyond 1σ
31500.711.0between 2σ and 3σ2: two out of three beyond 2σ
No mean exceeds the control limit and no range is abnormal: rule 3 flags the drift at subgroup 30, one hour after the first rising point, and the Nelson rule on six rising points confirms it at 31.

With a tolerance of ±3 g on the nominal weight, no bottle is out of specification yet: the chart warns you while there is still time to look for the cause, for example a nozzle that is wearing out. Once stable, the same process is assessed with the capability indices Cp and Cpk.

Attribute charts: p, np, c, u

When the outcome is good or defective, or you count defects, you use attribute charts. The 3σ limits come from the binomial (defectives) and Poisson (defects) distributions.

ChartWhat it tracksSampleLimits
pFraction of defective partsMay varyp̄ ± 3 √(p̄(1 − p̄) ÷ n)
npNumber of defective partsConstantnp̄ ± 3 √(np̄(1 − p̄))
cNumber of defectsConstant inspection unitc̄ ± 3 √c̄
uDefects per unitMay varyū ± 3 √(ū ÷ n)
A negative lower limit is set to zero. With variable samples, p and u have different limits for each point.

From the chart in Excel to the alarm on the line

A chart kept by hand or in a spreadsheet always arrives late: the measurements are copied over at the end of the shift and the drift is discovered when the shift is over. The value of the chart lies in seeing it while the process changes.

With Muvia Industrial the measurements arrive from the checkweigher or the measuring machine through the edge node, for example over OPC UA, with their timestamp and their subgroup. A Python function written by your team calculates means, ranges, limits from the reference period and the Western Electric rules; a flow runs it at every shift change and a threshold on the violated-rules column opens an episode in the alarm register. This is the path of the use case The control chart that warns you first; for critical stamping dimensions and Cpk per die there is the use case The critical dimension that drifts before the first scrap.

Frequently asked questions

X̄ chart: X̄̄ ± A2 × R̄. R chart: upper limit D4 × R̄, lower limit D3 × R̄. The constants depend on the subgroup size: for n = 5 they are A2 = 0.577, D3 = 0 and D4 = 2.114.

Tell us which machines you run. We'll tell you how to read them.

PLC brand, protocol, how the floor is connected: with those three answers, in a demo with one of our engineers, we show you how Muvia Industrial puts line data next to the rest of the business.