Statistical Process Control (SPC)
Complete SPC guide — what it is, what it's for, how to interpret control charts, detection rules, and process capability indices in Rela AI.
What is SPC?
Statistical Process Control (SPC) is a methodology that uses statistical tools to monitor and control a production process. Its goal is to detect abnormal variations before they produce defective products.
Imagine a production line filling bottles with 500 ml of liquid. In practice, each bottle will have a slightly different amount: 499.8 ml, 500.3 ml, 500.1 ml. That's natural variation and it's inevitable. But if suddenly a bottle comes out with 495 ml, something changed in the process — a clogged nozzle, a misaligned pump, a raw material change. That's a special cause variation (or assignable cause), and SPC helps you detect it in real time.
Why does it matter?
- Prevention vs. inspection: Instead of checking every finished product, SPC detects problems while the process is running
- Cost savings: Catching a deviation in time prevents entire batches of out-of-spec product
- Regulatory compliance: Industries like food (HACCP), automotive (IATF 16949), pharmaceutical (FDA/GMP), and general manufacturing (ISO 9001) require process control evidence
- Continuous improvement: SPC data feeds evidence-based improvement decisions, not gut feelings
Fundamental concepts
Natural variation vs. special cause variation
Every process has two types of variation:
| Type | Description | Example | Action |
|---|---|---|---|
| Natural (common cause) | Inherent to the process, predictable | Small ambient temperature fluctuations | No action needed — it's part of the process |
| Special (assignable cause) | Something changed, unpredictable | A new operator, a worn tool, different raw material | Investigate and fix the root cause |
SPC distinguishes between them using statistically calculated control limits.
Subgroups
A subgroup is a set of measurements taken at the same time (or within a very short period). For example, measuring the diameter of 5 consecutive parts every hour. In Rela AI, you record subgroups manually or receive them automatically from your sensors.
Control limits vs. specification limits
Understanding this difference is critical:
| Concept | Who defines it? | What does it mean? |
|---|---|---|
| Control limits (UCL/LCL) | The process data (statistics) | What the process actually does — its natural behavior |
| Specification limits (USL/LSL) | The customer or standard | What the process should do — product requirements |
A process can be "in control" (within its control limits) but still produce out-of-spec parts if its capability is insufficient. That's why you need both control charts and capability indices.
Control charts
Control charts are the primary visual tool of SPC. They display process data over time with three reference lines:
- UCL (Upper Control Limit): the statistical ceiling at 3 sigma
- CL (Center Line): the process mean
- LCL (Lower Control Limit): the statistical floor at 3 sigma
When a point falls outside these limits, or the points show a non-random pattern, the process is "out of control" (OOC — Out Of Control).
Chart types in Rela AI
| Chart | Full name | When to use it? | Subgroup size |
|---|---|---|---|
| X-bar R | Mean and Range | Continuous data (weight, temperature, dimension) with small subgroups | 2–10 measurements |
| X-bar S | Mean and Standard Deviation | Continuous data with large subgroups | >10 measurements |
| I-MR | Individuals and Moving Range | Single measurement per time (batches, destructive tests) | 1 measurement |
| p | Proportion defective | Percentage of defective units per batch | Variable |
| np | Number defective | Count of defective units (fixed sample size) | Fixed |
| c | Count of defects | Total defects per unit (e.g., scratches per part) | 1 unit |
| u | Defects per unit | Defect rate when sample size varies | Variable |
How to choose the right chart?
- Are your data continuous (measurable) or attribute (pass/fail)?
- Continuous → X-bar R, X-bar S, or I-MR
- Attribute → p, np, c, or u
- If continuous, how many measurements per subgroup?
- 1 measurement → I-MR
- 2 to 10 → X-bar R
- More than 10 → X-bar S
- If attribute, are you counting defectives or defects?
- Defectives (pass/fail) → p or np
- Defects (count) → c or u
Creating a chart in Rela AI
From the SPC dashboard, click "Create chart" and fill in:
- Name: a descriptive identifier (e.g., "Main shaft diameter")
- Chart type: select based on the guide above
- Source: the data source (sensor, machine) that will feed the chart
- Metric: the variable you want to monitor (e.g., temperature, pressure, diameter)
Control limit formulas
Limits are calculated automatically. Here are the reference formulas:
X-bar R
| Limit | Formula | Description |
|---|---|---|
| UCL | X̄̄ + A₂ × R̄ | Grand mean + factor × average range |
| CL | X̄̄ | Grand mean of subgroup means |
| LCL | X̄̄ − A₂ × R̄ | Grand mean − factor × average range |
Where A₂ is a statistical factor that depends on subgroup size (tabulated in ASTM E2587).
X-bar S
| Limit | Formula |
|---|---|
| UCL | X̄̄ + A₃ × S̄ |
| CL | X̄̄ |
| LCL | X̄̄ − A₃ × S̄ |
I-MR (Individuals)
| Limit | Formula |
|---|---|
| UCL | X̄ + E₂ × MR̄ |
| CL | X̄ |
| LCL | X̄ − E₂ × MR̄ |
Where E₂ = 2.660 and MR̄ is the average moving range.
You don't need to calculate these manually. Rela AI computes them automatically once you record enough subgroups (20-25 subgroups recommended for stable limits).
Out-of-control detection rules
Rela AI implements two standardized rule sets to detect abnormal patterns.
Western Electric rules (WE)
| Rule | Pattern detected | Severity |
|---|---|---|
| WE1 | 1 point beyond 3σ | High — immediate alarm |
| WE2 | 2 of 3 consecutive points beyond 2σ (same side) | Medium — warning |
| WE3 | 4 of 5 consecutive points beyond 1σ (same side) | Medium — warning |
| WE4 | 8 consecutive points on the same side of center line | Low — investigate trend |
Nelson rules (NR)
| Rule | Pattern detected | Interpretation |
|---|---|---|
| NR1 | 1 point beyond 3σ | Out-of-control point (equivalent to WE1) |
| NR2 | 9 consecutive points on the same side of CL | Process mean shift |
| NR3 | 6 consecutive points trending (up or down) | Trend or progressive wear |
| NR4 | 14 consecutive points alternating up/down | Over-adjustment or two mixed processes |
What to do when a rule triggers?
- Don't adjust the process automatically — investigate first
- Check if the point is a measurement error or incorrect data
- Look for the root cause: did an operator change? Did a raw material batch run out? Was there a recent adjustment?
- If the cause is real, correct it and document the action
- If it was a false alarm, document why and continue
Rule violations do not necessarily indicate a defect. Each violation must be investigated to determine whether it represents a real assignable cause or a false alarm.
Process capability indices
Capability indices answer the question: Is my process capable of meeting specifications?
Main indices
| Index | What does it measure? | Simplified formula | Target |
|---|---|---|---|
| Cp | Potential capability (ignores whether the process is centered) | (USL − LSL) / 6σ | ≥ 1.33 |
| Cpk | Actual capability (considers process centering) | Min of (USL − μ) / 3σ and (μ − LSL) / 3σ | ≥ 1.33 |
| Pp | Potential performance (uses total standard deviation, long-term) | (USL − LSL) / 6s | ≥ 1.33 |
| Ppk | Actual performance (long-term, considers centering) | Min of (USL − μ) / 3s and (μ − LSL) / 3s | ≥ 1.33 |
| Sigma level | How many standard deviations fit between the mean and the nearest limit | 3 × Cpk | ≥ 4.0 |
How to interpret the values?
| Cpk value | Meaning | Equivalent quality |
|---|---|---|
| < 1.00 | Incapable process — frequent defects | More than 2,700 defects per million (PPM) |
| 1.00–1.33 | Marginal process — meets spec but with little margin | 64–2,700 PPM |
| 1.33–1.67 | Capable process — acceptable margin | 0.6–64 PPM |
| > 1.67 | Excellent process — wide safety margin | Less than 0.6 PPM |
Cp and Cpk use the within-subgroup standard deviation (short-term). Pp and Ppk use the total standard deviation (long-term). If Cp ≈ Pp, the process is stable. If Cp >> Pp, there's between-batch variation not visible within each subgroup.
Process drift detection
Rela AI automatically detects when a process is drifting from its target:
- Mean shift: the process mean moves more than 1.5σ from target
- Capability drop: Cpk indices fall below the configured threshold
- Sustained trend: linear regression detects a significant slope in recent subgroups
When drift is detected, the system generates a notification for the quality team to investigate before the process goes out of specification.
Typical workflow
- Configure: Create a control chart by selecting the data source, chart type, and metric
- Collect data: Record subgroups manually or connect your sensors for automatic ingestion
- Calculate limits: With 20-25 subgroups, Rela AI calculates control limits automatically
- Monitor: Check the SPC dashboard to see each chart's status, active violations, and capability indices
- Act: When a violation is detected, investigate the root cause and take corrective action
- Improve: Use historical data to identify process improvement opportunities
SPC dashboard
The Rela AI dashboard shows:
- Summary: count of active charts and total OOC violations
- Charts table: name, type, source, metric, status, and last subgroup for each chart
- Detail view: visual control chart with the last 30 subgroups, capability indices (Cp, Cpk, Pp, Ppk), rule violations table, and a form to record new subgroups
- Deletion: from the detail view, you can delete a chart and all its associated subgroups
Quick SPC glossary
| Term | Meaning |
|---|---|
| OOC | Out Of Control — point or pattern outside statistical control |
| UCL / LCL | Upper/Lower Control Limit — limits calculated at ±3σ |
| USL / LSL | Upper/Lower Specification Limit — customer or standard requirements |
| CL | Center Line — process mean |
| Cp / Cpk | Short-term capability indices |
| Pp / Ppk | Long-term performance indices |
| Subgroup | Set of measurements taken at the same time or short period |
| Assignable cause | Identifiable and correctable variation (≠ natural variation) |
| Sigma (σ) | Standard deviation — measures process spread |