Σ
SDCalc
中級實務應用·14 min

管制圖與製程管控

掌握利用管制圖進行統計製程管制 (SPC)。學習如何使用標準差設定管制界限、套用 Western Electric 規則,以及偵測製程偏移。

統計製程管制:品質的基石

管制圖是統計製程管制 (SPC) 的核心工具,使用標準差來監控製程隨時間的穩定性。由華特·休哈特在 1920 年代於貝爾實驗室開發,這些強大的工具能區分共同原因變異(製程固有的變異)和特殊原因變異(需要注意的問題)。

管制圖的精妙之處在於其簡潔性:隨時間繪製你的測量值,加上基於標準差的管制界限,然後觀察是否有超出界限的點或異常模式。這種即時監控能在缺陷發生前就預防,而不是事後才透過檢驗發現。

現代製造業、醫療和服務業都依賴管制圖來維護品質。從需要奈米精度的半導體製造到醫院感染率,SPC 提供了一個通用的製程改善框架。

共同原因 vs 特殊原因

共同原因變異是任何製程中自然、預期的變異性。特殊原因變異則表示有什麼改變了——新的操作員、磨損的工具或受污染的原材料。管制圖幫助你區分這兩者。

管制圖的類型

不同的資料類型需要不同的管制圖。選擇正確的圖表才能確保準確的製程監控:

圖表類型資料類型適用情境
X̄-R(平均數-全距圖)連續資料,子組 n≤10製造測量
X̄-S(平均數-標準差圖)連續資料,子組 n>10大批次抽樣
I-MR(個別值-移動全距圖)個別測量值昂貴/破壞性測試
p 管制圖不良品比例合格/不合格檢驗
c 管制圖缺陷計數每單位缺陷數

對於連續型資料(如長度、重量、溫度等測量值),X̄-R 圖最為常用。你收集子組樣本,在一張圖上繪製平均數 (X̄),在另一張圖上繪製全距 (R)。兩者一起監控製程的中心位置和變異性。

計算管制界限

管制界限定義了預期變異的範圍。它們設定在中心線 ±3 個標準差處,當製程在管制狀態時涵蓋 99.73% 的點:

管制界限

UCL = x̄ + 3σ, CL = x̄, LCL = x̄ - 3σ

對於使用全距法的 X̄ 圖,公式變為:

X̄ 圖管制界限

UCL = X̿ + A₂R̄, LCL = X̿ - A₂R̄

其中 X̿ 是總平均數,R̄ 是平均全距,A₂ 是依子組大小而定的常數(例如 n=5 時 A₂ = 0.577)。

管制界限 ≠ 規格界限

管制界限是從你的資料計算得出的,反映製程實際的表現。規格界限是由客戶/工程師設定的,反映製程應該達到的要求。一個製程可以在管制狀態內,但仍然生產出超規格的產品。

管制界限常數

nA₂D₃D₄
21.88003.267
31.02302.574
40.72902.282
50.57702.114

Western Electric 規則:偵測問題

單一點超出管制界限並非問題的唯一訊號。Western Electric 規則透過將圖表按標準差劃分為不同區域,來偵測更微妙的模式:

  • C 區:在中心線 1σ 範圍內
  • B 區:在中心線 1σ 到 2σ 之間
  • A 區:在中心線 2σ 到 3σ 之間

四大主要規則

1

規則 1:單點

一個點超出 3σ(A 區或更遠)。這在自然狀態下出現的機率只有 0.27%。
2

規則 2:連續 9 點

9 個連續點落在中心線的同一側。表示製程平均數發生偏移。
3

規則 3:連續 6 點趨勢

6 個連續點持續上升或下降。暗示製程偏移或工具磨損。
4

規則 4:區域模式

連續 3 點中有 2 點落在 A 區或更遠(同一側)。偏移的早期警示。

識別常見模式

有經驗的從業者會學習辨認指示特定問題的視覺模式:

模式外觀可能原因
偏移水平突然改變新操作員、原料批次變更、設備調整
趨勢逐漸向上/向下偏移工具磨損、溫度飄移、疲勞
週期重複的上下波動班次輪換、環境週期、輪替排程
緊靠中心點聚集在中心附近管制界限不正確、資料被四捨五入/編輯
分層點避開中心混合來源、多台機器

Python 實作

建立 X̄-R 管制圖並自動檢查規則:

python
import numpy as np
import matplotlib.pyplot as plt

def create_xbar_chart(data, subgroup_size=5):
    """Create X-bar control chart with control limits."""
    # Reshape data into subgroups
    n_subgroups = len(data) // subgroup_size
    subgroups = data[:n_subgroups * subgroup_size].reshape(n_subgroups, subgroup_size)

    # Calculate subgroup means and ranges
    xbar = subgroups.mean(axis=1)
    R = subgroups.max(axis=1) - subgroups.min(axis=1)

    # Control chart constants (for n=5)
    A2 = 0.577
    D3, D4 = 0, 2.114

    # Calculate control limits
    xbar_bar = xbar.mean()
    R_bar = R.mean()

    UCL = xbar_bar + A2 * R_bar
    LCL = xbar_bar - A2 * R_bar

    # Check for out-of-control points
    ooc = (xbar > UCL) | (xbar < LCL)

    # Plot
    plt.figure(figsize=(12, 5))
    plt.plot(xbar, 'b-o', markersize=4)
    plt.axhline(xbar_bar, color='g', linestyle='-', label='CL')
    plt.axhline(UCL, color='r', linestyle='--', label='UCL')
    plt.axhline(LCL, color='r', linestyle='--', label='LCL')
    plt.scatter(np.where(ooc)[0], xbar[ooc], color='red', s=100, zorder=5)
    plt.xlabel('Subgroup')
    plt.ylabel('X-bar')
    plt.title('X-bar Control Chart')
    plt.legend()
    plt.show()

    return {'xbar': xbar, 'UCL': UCL, 'LCL': LCL, 'ooc': ooc}

# Example: Monitor a manufacturing process
np.random.seed(42)
# Simulate 100 measurements (20 subgroups of 5)
measurements = np.random.normal(100, 2, 100)
# Add a shift at subgroup 15
measurements[75:] += 3

result = create_xbar_chart(measurements)

Further Reading

How to Read This Article

A statistics tutorial is a practical interpretation guide, not just a formula dump. It refers to the assumptions, notation, and reporting language that analysts need when they explain a result to a teacher, manager, client, or reviewer. The article body covers the specific topic, while the sections below create a common interpretation frame that readers can reuse across related metrics.

Reading goalWhat to focus onCommon mistake
DefinitionWhat the metric is and what quantity it summarizesTreating the formula as self-explanatory
Formula choiceSample versus population assumptions and notationUsing n when n-1 is required or vice versa
InterpretationWhether the result indicates concentration, spread, or riskCalling a large value good or bad without context

Frequently Asked Questions

How should I interpret a high standard deviation?

A high standard deviation means the observations are spread farther from the mean on average. Whether that spread is acceptable depends on the context: wide dispersion might signal risk in finance, instability in manufacturing, or genuine natural variation in scientific data.

Why do some articles mention n while others mention n-1?

The denominator reflects the difference between population and sample formulas. Population variance and population standard deviation use N because the full dataset is known. Sample variance and sample standard deviation often use n-1 because Bessel’s correction reduces bias when estimating population spread from a sample.

What is a statistical interpretation guide?

A statistical interpretation guide is a page that moves beyond arithmetic and explains meaning. It tells you what a metric is, when the formula applies, and how to describe the result in plain English without overstating certainty.

Can I cite this article in a report?

You should cite the underlying authoritative reference for formal work whenever possible. This page is best used as an explanatory bridge that helps you understand the concept before quoting the original standard or handbook.

Why include direct citations on every article page?

Direct citations give readers a route to verify the definition, notation, and assumptions. That improves trust and reduces the chance that a simplified explanation is mistaken for the entire technical standard.

Authoritative References

These sources define the concepts referenced most often across our articles. Bessel's correction is a sample adjustment, variance is a squared measure of spread, and standard deviation is the square root of variance expressed in the same units as the data.