Skip to content

just1n9877/SPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPC-based Process Capability Analysis for Manufacturing Data

This project simulates a manufacturing quality dataset and applies Statistical Process Control (SPC) and process capability analysis to evaluate whether a production process is stable and capable of meeting engineering specifications.

It is structured as a portfolio-ready analytics project with reproducible data generation, modular Python source code, chart outputs, and an executive-style quality report.

Apple MDE Relevance

Apple MDE work often requires deciding whether a process is stable, capable, and ready for ramp or corrective action. This project uses SPC charts, Cp/Cpk, yield trends, defect Pareto analysis, and machine-level comparisons to surface tool drift, process centering issues, and likely improvement priorities.

Results Preview

X-bar Control Chart

X-bar Control Chart

Process Capability Analysis

Cpk Analysis

Yield Trend

Yield Trend

Defect Pareto Chart

Defect Pareto

Machine-Level Analysis

Cpk by Machine

Yield by Machine

Defects by Machine

Manufacturing Insights

  • The process achieved Cp = 1.12 and Cpk = 1.04, suggesting that the process variation is close to acceptable but the process is not well-centered.
  • Mean-shift signals appeared in the later production period, which may indicate equipment wear, tool drift, or setup change.
  • Scratch, Dimension and Surface defects accounted for the majority of observed defects, so improvement work should start from surface handling and dimensional control.
  • Machine-level comparison should be used to identify whether one machine contributes disproportionately to yield loss or dimensional shift.

Project Highlights

  • Simulates 5,000 manufacturing observations with batch, machine, operator, process settings, dimension measurements, defect types, and yield rate.
  • Calculates process capability metrics using:
Cp = (USL - LSL) / (6 * sigma)
Cpk = min((USL - mean) / (3 * sigma), (mean - LSL) / (3 * sigma))
  • Builds SPC control limits and identifies out-of-control signals, sustained trends, and mean shifts.
  • Produces four required quality visuals:
    • X-bar control chart
    • Cpk capability analysis chart
    • Yield trend chart
    • Defect Pareto chart
  • Adds machine-level analysis for Cpk, yield rate, and defect count.
  • Generates an English quality_report.md suitable for GitHub and resume discussion.

Repository Structure

.
+-- data/
|   +-- README.md
+-- reports/
|   +-- quality_report.md
|   +-- figures/
|       +-- control_chart.svg
|       +-- cpk_analysis.svg
|       +-- yield_trend.svg
|       +-- defect_pareto.svg
|       +-- machine_cpk.svg
|       +-- machine_yield.svg
|       +-- machine_defects.svg
+-- src/
|   +-- config.py
|   +-- data_simulation.py
|   +-- main.py
|   +-- report.py
|   +-- spc.py
|   +-- visualization.py
+-- tests/
|   +-- test_spc_metrics.py
+-- requirements.txt
+-- README.md

Quick Start

Install dependencies:

pip install -r requirements.txt

Run the full pipeline:

python -m src.main

The pipeline writes generated data to data/manufacturing_quality_data.csv, chart files to reports/figures/, and the final report to reports/quality_report.md.

Method Notes

For simplicity, this project estimates X-bar control limits using the empirical standard deviation of daily subgroup means. A future improvement is to implement classical X-bar/R control limits using A2, D3 and D4 constants.

Run tests:

pytest

Resume Bullet Example

Built a Python-based SPC and process capability analytics project for simulated manufacturing data, generating 5,000 production records, calculating Cp/Cpk, detecting control-limit violations and process shifts, and producing automated quality charts and an executive quality report.

About

Python-based SPC and process capability analysis for simulated manufacturing quality data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages