algo-mfg-spc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Statistical Process Control

统计过程控制(SPC)

Overview

概述

SPC uses control charts to monitor process stability over time. Upper and Lower Control Limits (UCL/LCL) are set at ±3σ from the process mean. Points within limits = common cause variation (stable). Points outside or showing patterns = special cause variation (investigate). Primary charts: X-bar/R, X-bar/S, I-MR, p-chart, c-chart.
SPC通过控制图随时间监控过程稳定性。上控制限(UCL)和下控制限(LCL)设置为偏离过程均值±3σ的位置。控制限内的点代表普通原因变异(过程稳定)。超出控制限或呈现特定模式的点代表特殊原因变异(需展开调查)。主要控制图类型包括:X-bar/R图、X-bar/S图、I-MR图、p图、c图。

When to Use

适用场景

Trigger conditions:
  • Monitoring production process for stability and detecting shifts
  • Setting statistically-based control limits for quality metrics
  • Distinguishing normal variation from assignable causes
When NOT to use:
  • For process capability assessment (use Cpk)
  • For root cause analysis of known problems (use fishbone/5-why)
触发条件:
  • 监控生产过程稳定性并检测偏移
  • 为质量指标设置基于统计方法的控制限
  • 区分正常变异与可查明原因的变异
不适用场景:
  • 用于过程能力评估(应使用Cpk)
  • 用于已知问题的根本原因分析(应使用鱼骨图/5Why法)

Algorithm

算法

IRON LAW: Control Limits Are NOT Specification Limits
Control limits (±3σ) describe what the process IS doing.
Specification limits describe what the process SHOULD do.
A process can be in statistical control (stable) but still produce
out-of-spec products (incapable). Conversely, a capable process may
be out of control (drifting). Monitor control FIRST, then assess capability.
IRON LAW: Control Limits Are NOT Specification Limits
Control limits (±3σ) describe what the process IS doing.
Specification limits describe what the process SHOULD do.
A process can be in statistical control (stable) but still produce
out-of-spec products (incapable). Conversely, a capable process may
be out of control (drifting). Monitor control FIRST, then assess capability.

Phase 1: Input Validation

阶段1:输入验证

Collect: 25+ subgroups of measurements (5 per subgroup typical for X-bar/R). Verify: measurement system is adequate (gauge R&R < 10%), data collected in time order. Gate: Sufficient subgroups, time-ordered data, measurement system verified.
收集25个以上的测量子组(X-bar/R图通常每个子组包含5个样本)。验证:测量系统足够可靠(测量系统分析R&R < 10%),数据按时间顺序收集。 准入条件: 子组数量充足、数据按时间排序、测量系统已验证。

Phase 2: Core Algorithm

阶段2:核心算法

X-bar/R Chart (subgroup data):
  1. Compute subgroup means (X̄) and ranges (R)
  2. Compute grand mean (X̄̄) and average range (R̄)
  3. UCL_X̄ = X̄̄ + A₂×R̄, LCL_X̄ = X̄̄ - A₂×R̄ (A₂ from statistical tables by subgroup size)
  4. UCL_R = D₄×R̄, LCL_R = D₃×R̄
  5. Plot points, apply Western Electric rules for out-of-control signals
X-bar/R图(子组数据):
  1. 计算子组均值(X̄)和极差(R)
  2. 计算总均值(X̄̄)和平均极差(R̄)
  3. UCL_X̄ = X̄̄ + A₂×R̄,LCL_X̄ = X̄̄ - A₂×R̄(A₂为根据子组大小从统计表格中获取的常数)
  4. UCL_R = D₄×R̄,LCL_R = D₃×R̄
  5. 绘制数据点,应用Western Electric规则识别失控信号

Phase 3: Verification

阶段3:验证

Check for: points outside limits, runs (7+ consecutive on one side), trends (7+ consecutive increasing/decreasing), 2 of 3 beyond 2σ, 4 of 5 beyond 1σ. Gate: Chart constructed, out-of-control signals identified.
检查是否存在以下情况:点超出控制限、连续7个点位于均值单侧、连续7个点呈上升/下降趋势、3个点中有2个超出2σ范围、5个点中有4个超出1σ范围。 准入条件: 已完成图表构建、已识别失控信号。

Phase 4: Output

阶段4:输出

Return control chart data with signals and stability assessment.
返回包含失控信号和稳定性评估结果的控制图数据。

Output Format

输出格式

json
{
  "chart": {"type": "xbar_r", "center_line": 50.2, "ucl": 52.1, "lcl": 48.3},
  "signals": [{"subgroup": 18, "rule": "point_beyond_ucl", "value": 52.8}],
  "stability": "out_of_control",
  "metadata": {"subgroups": 30, "subgroup_size": 5}
}
json
{
  "chart": {"type": "xbar_r", "center_line": 50.2, "ucl": 52.1, "lcl": 48.3},
  "signals": [{"subgroup": 18, "rule": "point_beyond_ucl", "value": 52.8}],
  "stability": "out_of_control",
  "metadata": {"subgroups": 30, "subgroup_size": 5}
}

Examples

示例

Sample I/O

示例输入输出

Input: 25 subgroups of 5 measurements each, all within ±3σ, no patterns Expected: Process in control. No signals triggered.
输入: 25个各含5个测量值的子组,所有数据均在±3σ范围内,无异常模式 预期结果: 过程处于受控状态,未触发任何信号。

Edge Cases

边缘情况

InputExpectedWhy
One point just outside UCLSignal, but may be false alarm~0.27% chance per point even when in control
Gradual upward trendTrend rule triggeredProcess drifting, investigate
All points near centerSuspicious — check dataMay indicate data manipulation or measurement issue
输入预期结果原因
一个点略微超出UCL触发信号,但可能为误报即使过程受控,每个点仍有约0.27%的概率超出控制限
缓慢上升趋势触发趋势规则过程正在偏移,需展开调查
所有点均接近中心线存在异常——需检查数据可能表明数据被篡改或测量系统存在问题

Gotchas

注意事项

  • Rational subgrouping: Subgroups must be collected under similar conditions (same shift, machine, operator). Poor subgrouping inflates within-group variation, making limits too wide.
  • Recalculating limits: Don't recalculate limits every time you add data. Establish limits from a stable baseline period and keep them fixed until a known process change.
  • Chart type selection: Variables data (measurements) → X-bar/R or I-MR. Attribute data (counts/proportions) → p-chart, np-chart, c-chart, u-chart. Wrong chart type = wrong limits.
  • Normality assumption: X-bar chart is robust to non-normality (central limit theorem). Individual charts (I-MR) require approximate normality — check with histogram.
  • Over-adjustment: Reacting to every small variation (tampering) INCREASES variability. Only investigate special cause signals, not common cause variation.
  • 合理子组划分:子组必须在相似条件下收集(如同一班次、同一机器、同一操作员)。子组划分不当会扩大组内变异,导致控制限过宽。
  • 控制限重算:不要每次添加数据都重算控制限。应基于稳定的基线周期建立控制限,除非已知过程发生变更,否则保持控制限固定。
  • 图表类型选择:计量型数据(测量值)→ X-bar/R图或I-MR图。计数型数据(数量/比例)→ p图、np图、c图、u图。错误的图表类型会导致控制限错误。
  • 正态性假设:X-bar图对非正态性具有鲁棒性(中心极限定理)。单值图(I-MR)要求数据近似正态分布——需通过直方图验证。
  • 过度调整:对每一次微小变异都做出反应(干预)会增加变异程度。仅针对特殊原因信号展开调查,不要干预普通原因变异。

References

参考资料

  • For control chart constants tables, see
    references/chart-constants.md
  • For Western Electric rules and pattern detection, see
    references/we-rules.md
  • 控制图常数表格,请参阅
    references/chart-constants.md
  • Western Electric规则与模式检测,请参阅
    references/we-rules.md