Overview
Statistical Process Control (SPC) is the use of statistical methods to monitor and control manufacturing processes. When implemented correctly, SPC shifts quality management from reactive (catching defects after they're made) to proactive (detecting process drift before defects are produced).
This guide covers the practical implementation of SPC for Indian manufacturing SMBs.
1. SPC Fundamentals
1.1 The Core Concept
Every manufacturing process has natural variation. A machine that cuts metal to 50mm will produce parts that are 49.97mm, 50.01mm, 49.99mm - never exactly 50mm. This is normal variation (also called common cause variation).
SPC distinguishes between:
- •Common cause variation: Random, inherent to the process. Cannot be eliminated without changing the process.
- •Special cause variation: Non-random, caused by a specific identifiable factor (tool wear, material batch change, operator error). Can and should be eliminated.
A control chart plots measurements over time with control limits. Points outside the control limits, or non-random patterns within the limits, indicate special cause variation - a signal that something has changed and needs investigation.
1.2 Control Chart Selection
| Measurement Type | Sample Size | Chart Type |
|---|---|---|
| Variable (continuous) | n = 1 | Individuals (I-MR) chart |
| Variable (continuous) | n = 2–9 | X-bar and R chart |
| Variable (continuous) | n ≥ 10 | X-bar and S chart |
| Attribute (pass/fail) | Variable lot size | p chart |
| Attribute (pass/fail) | Fixed lot size | np chart |
| Count of defects | Variable area | u chart |
| Count of defects | Fixed area | c chart |
Most common in manufacturing: X-bar and R chart (for dimensions, weights, temperatures) and p chart (for visual defects, functional pass/fail).
2. X-bar and R Chart Implementation
2.1 Data Collection Setup
Subgroup size: Collect n = 5 measurements per subgroup. Subgroups should be collected at regular intervals (every 30 minutes, every hour, every batch).
Measurement system analysis (MSA): Before implementing SPC, verify that your measurement system is capable. Run a Gauge R&R study:
- •Have 3 operators each measure 10 parts twice
- •Calculate repeatability (same operator, same part) and reproducibility (different operators, same part)
- •Gauge R&R should be < 10% of the tolerance for the measurement system to be acceptable
2.2 Control Limit Calculation
Phase 1: Establish baseline (collect 20–25 subgroups before calculating limits)
For each subgroup i (i = 1 to k):
x̄ᵢ = mean of the subgroup
Rᵢ = range of the subgroup (max - min)
Grand mean: X̄̄ = (Σx̄ᵢ) / k
Average range: R̄ = (ΣRᵢ) / k
Control limits for X-bar chart:
UCL_x = X̄̄ + A₂ × R̄
LCL_x = X̄̄ - A₂ × R̄
Control limits for R chart:
UCL_R = D₄ × R̄
LCL_R = D₃ × R̄Control chart constants (for subgroup size n):
| n | A₂ | D₃ | D₄ |
|---|---|---|---|
| 2 | 1.880 | 0 | 3.267 |
| 3 | 1.023 | 0 | 2.574 |
| 4 | 0.729 | 0 | 2.282 |
| 5 | 0.577 | 0 | 2.114 |
| 6 | 0.483 | 0 | 2.004 |
| 7 | 0.419 | 0.076 | 1.924 |
| 8 | 0.373 | 0.136 | 1.864 |
2.3 Western Electric Rules (Out-of-Control Signals)
A process is out of control if any of the following patterns appear:
| Rule | Pattern | Action |
|---|---|---|
| Rule 1 | 1 point beyond 3σ (outside control limits) | Stop and investigate immediately |
| Rule 2 | 9 consecutive points on same side of centreline | Investigate - process mean has shifted |
| Rule 3 | 6 consecutive points trending up or down | Investigate - process is drifting (tool wear, temperature drift) |
| Rule 4 | 14 consecutive points alternating up and down | Investigate - two alternating causes (two machines, two operators) |
| Rule 5 | 2 of 3 consecutive points beyond 2σ | Warning - process may be shifting |
| Rule 6 | 4 of 5 consecutive points beyond 1σ | Warning - process may be shifting |
3. Process Capability Analysis
3.1 Cp and Cpk
Process capability measures how well the process fits within the specification limits.
Process standard deviation: σ = R̄ / d₂
(d₂ constants: n=2: 1.128, n=3: 1.693, n=4: 2.059, n=5: 2.326)
Cp = (USL - LSL) / (6σ)
Measures spread relative to tolerance. Does not account for centering.
Cpk = min[(USL - X̄̄) / (3σ), (X̄̄ - LSL) / (3σ)]
Measures capability accounting for centering. This is the key metric.Capability interpretation:
| Cpk | Interpretation | Defect Rate (approx.) |
|---|---|---|
| < 1.00 | Not capable - defects being produced | > 2,700 ppm |
| 1.00–1.33 | Marginally capable - monitor closely | 64–2,700 ppm |
| 1.33–1.67 | Capable - acceptable for most applications | 0.6–64 ppm |
| ≥ 1.67 | Highly capable - Six Sigma level | < 0.6 ppm |
Target: Cpk ≥ 1.33 for standard applications, Cpk ≥ 1.67 for safety-critical applications.
4. p Chart for Attribute Data
4.1 When to Use
Use the p chart when:
- •Inspection result is pass/fail (not a measurement)
- •Lot sizes vary between subgroups
- •Examples: visual defects, functional test pass/fail, dimensional go/no-go
4.2 Calculation
For each subgroup i:
nᵢ = number of items inspected
dᵢ = number of defective items
pᵢ = dᵢ / nᵢ (proportion defective)
Average proportion defective: p̄ = Σdᵢ / Σnᵢ
Control limits for each subgroup (variable limits because nᵢ varies):
UCL_pᵢ = p̄ + 3√(p̄(1-p̄)/nᵢ)
LCL_pᵢ = p̄ - 3√(p̄(1-p̄)/nᵢ) [set to 0 if negative]5. Digital SPC Implementation
5.1 Data Collection Options
| Method | Best For | Pros | Cons |
|---|---|---|---|
| Manual entry on tablet | Low-volume, complex measurements | Flexible, low cost | Human error, slow |
| Digital calipers/gauges with Bluetooth | Dimensional measurements | Fast, accurate, no transcription | Higher equipment cost |
| Vision systems | Surface defects, dimensional | Fully automated, 100% inspection | High cost, complex setup |
| PLC integration | Process parameters (temperature, pressure) | Real-time, no manual input | Requires PLC access |
5.2 Database Schema for SPC Data
CREATE TABLE spc_characteristics (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(200) NOT NULL, -- e.g., "Shaft diameter"
part_number VARCHAR(100),
operation VARCHAR(100),
usl DECIMAL(12,4), -- Upper Specification Limit
lsl DECIMAL(12,4), -- Lower Specification Limit
target DECIMAL(12,4),
unit VARCHAR(20),
chart_type VARCHAR(20) DEFAULT 'xbar_r',
subgroup_size INTEGER DEFAULT 5,
sample_frequency VARCHAR(50), -- e.g., "Every 30 minutes"
is_active BOOLEAN DEFAULT true
);
CREATE TABLE spc_subgroups (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
characteristic_id UUID NOT NULL REFERENCES spc_characteristics(id),
subgroup_number INTEGER NOT NULL,
collected_at TIMESTAMPTZ NOT NULL,
collected_by UUID,
machine_id VARCHAR(100),
shift VARCHAR(20),
notes TEXT
);
CREATE TABLE spc_measurements (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
subgroup_id UUID NOT NULL REFERENCES spc_subgroups(id),
sample_number INTEGER NOT NULL,
value DECIMAL(12,4) NOT NULL,
is_outlier BOOLEAN DEFAULT false
);
-- Calculated control limits (updated after each Phase 1 analysis)
CREATE TABLE spc_control_limits (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
characteristic_id UUID NOT NULL REFERENCES spc_characteristics(id),
effective_from TIMESTAMPTZ NOT NULL,
effective_to TIMESTAMPTZ,
x_bar_bar DECIMAL(12,4),
r_bar DECIMAL(12,4),
ucl_x DECIMAL(12,4),
lcl_x DECIMAL(12,4),
ucl_r DECIMAL(12,4),
lcl_r DECIMAL(12,4),
cp DECIMAL(6,3),
cpk DECIMAL(6,3),
sigma DECIMAL(12,6)
);5.3 Out-of-Control Alert Logic
function checkWesternElectricRules(points, ucl, lcl, centerline) {
const sigma = (ucl - centerline) / 3;
const violations = [];
// Rule 1: Point beyond 3σ
points.forEach((p, i) => {
if (p > ucl || p < lcl) {
violations.push({ rule: 1, index: i, value: p, severity: 'CRITICAL' });
}
});
// Rule 2: 9 consecutive points on same side
for (let i = 8; i < points.length; i++) {
const window = points.slice(i - 8, i + 1);
if (window.every(p => p > centerline) || window.every(p => p < centerline)) {
violations.push({ rule: 2, index: i, severity: 'WARNING' });
}
}
// Rule 3: 6 consecutive points trending
for (let i = 5; i < points.length; i++) {
const window = points.slice(i - 5, i + 1);
const increasing = window.every((p, j) => j === 0 || p > window[j-1]);
const decreasing = window.every((p, j) => j === 0 || p < window[j-1]);
if (increasing || decreasing) {
violations.push({ rule: 3, index: i, severity: 'WARNING' });
}
}
return violations;
}6. SPC Implementation Roadmap
| Phase | Duration | Activities |
|---|---|---|
| 1: Preparation | 2 weeks | Select characteristics, verify measurement systems (Gauge R&R), train operators |
| 2: Baseline data collection | 4 weeks | Collect 20–25 subgroups per characteristic, calculate initial control limits |
| 3: Control chart deployment | 2 weeks | Deploy digital data collection, configure alerts, train operators on out-of-control response |
| 4: Capability improvement | Ongoing | Investigate and eliminate special causes, improve Cpk, tighten control limits |
7. Common Implementation Mistakes
| Mistake | Consequence | Prevention |
|---|---|---|
| Calculating limits from < 20 subgroups | Unstable limits, false alarms | Always use 20–25 subgroups for Phase 1 |
| Including special cause data in limit calculation | Inflated limits that miss real signals | Remove out-of-control points before calculating limits |
| Not validating measurement system first | SPC measures measurement error, not process variation | Always do Gauge R&R before SPC |
| Reacting to every point near the limits | Tampering - makes the process worse | Only react to confirmed out-of-control signals |
| Using specification limits as control limits | Confuses customer requirements with process capability | Control limits come from the data, not the spec |
*See how IdeaSprout QA implements digital SPC for manufacturers →*