Süreç Yeterliliği ve SPC Analiz AracıProcess Capability & SPC Analyzer
Üretim ölçüm verisinden savunulabilir mühendislik ifadeleri üreten açık kaynak SPC aracı: Gage R&R, kontrol grafikleri, çalışma kuralları, Cp/Cpk ve Pp/Ppk, denetime hazır raporlar. Önce ölçüm sistemi, sonra kararlılık, sonra yeterlilik.An open-source SPC tool that turns production measurement data into defensible engineering statements: Gage R&R, control charts, run rules, Cp/Cpk and Pp/Ppk, audit-ready reports. Measurement system first, then stability, then capability.
- TestTests
- 890
- Çalışma kuralıRun rules
- 4 WE + 8 Nelson
- GrafikCharts
- X̄-R · X̄-S · I-MR
- RaporReports
- CSV · Excel · PDF
ProblemProblem
Küçük ve orta ölçekli tedarikçilerde Cpk hesabı çoğu zaman Excel'de, elle yapılır. Sigma hangi tahminleyiciyle bulundu, süreç kararlı mıydı, tek taraflı spesifikasyonda Cp ne anlama geliyor: bu sorular raporda görünmez. Sonuç, kararsız bir sürecin "yeterli" ilan edilebilmesidir.
Ticari paketler pahalı; ücretsiz araçların çoğu ya yalnızca grafik çiziyor ya da hangi varsayımla hesap yaptığını söylemiyor. Hedef, sayının yanında sayının hangi koşulda geçerli olduğunu da üreten bir araçtı.
At small and mid-size suppliers, Cpk is usually computed by hand in Excel. Which sigma estimator was used, whether the process was stable, what Cp means with a one-sided specification: none of this shows up in the report. The result is that an unstable process can be declared "capable".
Commercial packages are expensive; most free tools either only draw charts or do not state the assumptions behind their numbers. The goal was a tool that produces, next to every number, the conditions under which that number is valid.
YaklaşımApproach
- Önce ölçüm sistemi. Çapraz Gage R&R (ANOVA ve AIAG ortalama-aralık yöntemi): tekrarlanabilirlik, tekrar üretilebilirlik, %Study Var, %Tolerans ve ndc. Tekrarlanan okumalar önce aralık kartıyla denetlenir; tutarsız bir hücre varsa bütün sonuçlar şerhli verilir.
- Önce kararlılık. SPC kuralları yeterlilikten önce çalışır; her Cpk sonucu kararlılık hükmüyle birlikte gelir. Kararsız süreçte yüksek Cpk sessizce "yeterli" diye raporlanmaz, açıkça uyarıyla verilir.
- Doğru sabitler. Kontrol limitleri yayınlanan kontrol grafiği sabitlerinden (d₂, c₄, A₂, D₃/D₄…) hesaplanır; asla çizilen verinin ±3·stdev'inden değil.
- Grup içi ve genel sigma karıştırılmaz. Cp/Cpk için R̄/d₂, S̄/c₄, havuzlanmış ya da MR̄/d₂; Pp/Ppk için genel sigma. Tek taraflı spesifikasyonda sahte Cp/Pp üretilmez.
- Kural motoru. 4 Western Electric ve 8 Nelson kuralı ayrı setler olarak (WE4 = ardışık 8, Nelson N2 = ardışık 9); her ihlal kural kimliği, etkilenen gözlemler, yön ve açıklamayla yapısal bir kayıt. Örtüşen ihlaller korunur.
- Deterministik yorum. Kural tabanlı, tekrarlanabilir, LLM yok. İstatistiksel sonuçlar (olgu) ile mühendislik önerileri (tavsiye) ayrı listeler; her biri kararlı bir tetikleyici kodu ve önem derecesi taşır.
- Korumalar. Küçük örneklem, az alt grup, sıfır varyasyon, normallik (Shapiro-Wilk + Anderson-Darling) ve kararsızlık uyarıları: sayıları bastırmaz, yanına yazılır.
- Mimari. Bağımlılıklar yalnız aşağı yönde:
data → statistics → spc → capability / msa → interpret → reporting → ui. İstatistik çekirdeği arayüzden ve dosya sisteminden bağımsız saf Python; grafik ve raporlama hiçbir istatistiği yeniden hesaplamaz. Her formül, sabit ve kaynakdocs/FORMULAS.md'de.
- Measurement system first. Crossed Gage R&R (ANOVA and the AIAG Average & Range method): repeatability, reproducibility, %Study Var, %Tolerance and ndc. Repeat readings are checked on a range chart first; an inconsistent cell caveats every result.
- Stability first. SPC rules run before capability; every Cpk result carries the stability verdict. A high Cpk on an unstable process is never silently reported as "capable"; it is explicitly caveated.
- The right constants. Control limits come from the published control-chart constants (d₂, c₄, A₂, D₃/D₄…), never from ±3·stdev of the plotted data.
- Within and overall sigma are never interchanged. Cp/Cpk use R̄/d₂, S̄/c₄, pooled or MR̄/d₂; Pp/Ppk use overall sigma. One-sided specifications never produce a fake Cp/Pp.
- Rule engine. 4 Western Electric and 8 Nelson rules kept as distinct sets (WE4 = 8-in-a-row, Nelson N2 = 9-in-a-row); every violation is a structured record with rule ID, affected observations, direction and explanation. Overlapping violations are preserved.
- Deterministic interpretation. Rule-based, reproducible, no LLM. Statistical conclusions (facts) and engineering recommendations (advice) are separate lists, each with a stable trigger code and severity.
- Guards. Small-sample, few-subgroups, zero-variation, non-normality (Shapiro-Wilk + Anderson-Darling) and instability warnings: advisory, never suppressing the numbers.
- Architecture. Dependencies point downward only:
data → statistics → spc → capability / msa → interpret → reporting → ui. The statistical core is pure Python with no UI or I/O dependency; charts and reports never recompute a statistic. Every formula, constant and reference lives indocs/FORMULAS.md.
Sonuç ve doğrulamaResult and verification
Montgomery'nin ders kitabındaki piston segmanı verisi (200 ölçüm, 40 alt grup × 5; qcc paketinden) yayınlanmış referans değerlere sahip olduğu için uçtan uca doğrulama seti olarak kullanıldı. X̄-R, alt grup 5:
| Büyüklük | Yayınlanan | Bu uygulama |
|---|---|---|
| x̿ | 74.001 | 74.00118 |
| R̄ | 0.023 | 0.02276 |
| UCL (X̄) | 74.014 | 74.01431 |
| LCL (X̄) | 73.988 | 73.98804 |
Faz I (1–25. örnekler) kural ihlali olmadan kararlı raporlanır, Cp 1,70 / Cpk 1,66; Faz II örnekleri eklenince kayma N1/N5/N6 ile yakalanır ve yeterlilik hükmü buna göre kayıtlanır.
Gage R&R için iki referans çalışma kullanıldı. AIAG MSA el kitabının örnek çalışmasında (10 parça × 3 operatör × 3 tekrar) Minitab'ın yayınladığı değerler, Houf & Burman (1988) termal empedans verisinde SAS'ın varyans bileşenleri, yayınlandıkları basamağa kadar aynı çıkıyor:
| Büyüklük | Yayınlanan | Bu uygulama |
|---|---|---|
| %GRR, çalışma varyasyonu (Minitab) | 27.86 | 27.86 |
| %GRR, tolerans 8 (Minitab) | 22.68 | 22.68 |
| ndc (Minitab) | 4 | 4 |
| Etkileşim varyansı (SAS) | 0.72798 | 0.72798 |
890 test (Python 3.10 / 3.11 / 3.12, CI): her istatistiğin elle hesaplanmış bilinen cevaplarla doğrulanması, her WE/Nelson kuralı için üretilmiş deterministik diziler, Pp/Ppk'nin grup içi sigmadan etkilenemeyeceğini kanıtlayan test, uçtan uca CSV → analiz → yorum → CSV/Excel/PDF (PDF içeriği metin çıkarımıyla doğrulanır), Gage R&R için bağımsız bir ANOVA uygulamasıyla (statsmodels) karşılaştırma, varyans bileşeni tahminlerinin yansızlığını sınayan Monte Carlo testi ve gerçek Streamlit sayfalarının AppTest ile çalıştırılması. Kapsam yüzdesi ölçülmediği için iddia edilmiyor.
Çıktılar: tam hassasiyetli CSV, 7 sayfalı Excel çalışma kitabı, gömülü grafikli PDF raporu, PNG/SVG grafik. Streamlit arayüzünde her dışlanan satır sebebiyle listelenir; eşikler yapılandırılabilir.
Montgomery's textbook piston-ring dataset (200 measurements, 40 subgroups × 5; from the qcc package) has published reference values, so it doubles as an end-to-end check. X̄-R, subgroup size 5:
| Quantity | Published | This application |
|---|---|---|
| x̿ | 74.001 | 74.00118 |
| R̄ | 0.023 | 0.02276 |
| UCL (X̄) | 74.014 | 74.01431 |
| LCL (X̄) | 73.988 | 73.98804 |
Phase I (samples 1–25) is reported stable with no rule violations, Cp 1.70 / Cpk 1.66; once the Phase II samples are included the drift is caught as N1/N5/N6 and the capability verdict is caveated accordingly.
Gage R&R was checked on two reference studies. On the AIAG MSA manual's example study (10 parts × 3 appraisers × 3 trials) the figures Minitab publishes, and on the Houf & Burman (1988) thermal impedance data the variance components SAS publishes, match to the printed decimal:
| Quantity | Published | This application |
|---|---|---|
| %GRR, study variation (Minitab) | 27.86 | 27.86 |
| %GRR, tolerance 8 (Minitab) | 22.68 | 22.68 |
| ndc (Minitab) | 4 | 4 |
| Interaction variance (SAS) | 0.72798 | 0.72798 |
890 tests (Python 3.10 / 3.11 / 3.12 in CI): known-answer verification of every statistic against hand-computed values, crafted deterministic sequences for every WE/Nelson rule, a test proving Pp/Ppk cannot be affected by the within-subgroup sigma, full-pipeline CSV → analysis → interpretation → CSV/Excel/PDF (PDF content verified by text extraction), a comparison of the Gage R&R ANOVA with an independent implementation (statsmodels), a Monte Carlo test of the variance-component estimators' unbiasedness, and the real Streamlit pages driven through AppTest. No coverage percentage is claimed because coverage is not measured.
Outputs: full-precision CSV, a 7-sheet Excel workbook, a PDF report with embedded charts, PNG/SVG charts. The Streamlit UI lists every excluded row with its reason; thresholds are configurable.
ÖğrendiklerimWhat I learned
Bir kalite aracının en önemli çıktısı sayı değil, sayının hangi koşulda geçerli olduğu. Kararsızlık, normallik ve örneklem uyarılarını sayıları bastırmadan taşımak; Cpk ≥ 1,33 gibi eşiklerin istatistik yasası değil müşteri sözleşmesi olduğunu arayüzde açıkça söylemek gerekiyor.
Lisans seçimi bile bir mühendislik kararı: üretim kalite kararlarına girdi veren bir araç için Apache-2.0'ın açık patent hükmü ve daha kapsamlı sorumluluk reddi, MIT'ye tercih edildi.
The most important output of a quality tool is not the number but the conditions under which the number holds. Instability, normality and sample-size warnings must travel with the numbers without suppressing them, and thresholds such as Cpk ≥ 1.33 have to be labelled in the UI as customer conventions, not statistical laws.
Even the licence choice is an engineering decision: for a tool whose output informs manufacturing quality decisions, Apache-2.0's explicit patent grant and fuller liability disclaimer were preferred over MIT.