Back to guides
4
7 min

Quality Control

SPC, Six Sigma & AI-Powered Defect Detection

The Cost of a Bad Part

A single defective turbocharger housing leaves a Tier 1 automotive supplier's plant in Michigan. It passes through assembly at the OEM and makes it into a production vehicle. Three months later, a field failure. The recall costs the supplier $4.2 million — inspection, replacement, logistics, warranty claims, and the hardest cost to quantify: customer confidence. The root cause? A machining parameter drifted 0.015 mm over two shifts, and the control chart was only reviewed at end of shift. An AI system monitoring in real time would have flagged the drift within 20 parts.

Quality is not just about catching defects — it is about preventing them. This chapter covers the foundational tools of quality engineering (SPC, FMEA, Six Sigma) and shows how AI amplifies each one, turning reactive quality inspection into proactive quality assurance.

Statistical Process Control (SPC)

SPC is the practice of using control charts to monitor process stability. Developed by Walter Shewhart at Bell Labs in the 1920s, it remains the backbone of manufacturing quality worldwide. Every IATF 16949 (automotive) and AS9100 (aerospace) certified facility runs SPC on critical characteristics.

Control Chart Basics

A control chart plots individual measurements (or subgroup averages) over time against three reference lines:

  • UCL (Upper Control Limit) — typically mean + 3 standard deviations
  • CL (Centre Line) — the process mean
  • LCL (Lower Control Limit) — typically mean - 3 standard deviations
  • As long as points fall randomly between UCL and LCL with no patterns, the process is "in statistical control." When points fall outside the limits or show non-random patterns (trends, runs, clusters), something has changed — and it needs investigation.

    Western Electric Rules

    Beyond simple limit violations, SPC uses pattern rules to detect subtle shifts:

    RulePatternIndicates
    Rule 1One point beyond 3-sigmaObvious special cause
    Rule 2Two of three points beyond 2-sigma (same side)Process shift beginning
    Rule 3Four of five points beyond 1-sigma (same side)Small sustained shift
    Rule 4Eight consecutive points on same side of centreProcess mean has shifted
    Rule 5Six points in a row steadily increasing or decreasingTrend (tool wear, drift)

    AI Enhancement of SPC

    Traditional SPC requires a human to review charts, spot patterns, and investigate. AI automates this entirely:

  • Real-time pattern detection — all Western Electric rules checked on every data point, across every characteristic, on every machine
  • Automatic root cause correlation — when a chart triggers, AI cross-references tool change logs, material batch changes, operator changes, and environmental data to suggest likely causes
  • Predictive SPC — instead of waiting for a rule violation, AI models the trajectory and alerts before the process goes out of control
  • Process Capability: Cp and Cpk

    Control charts tell you if the process is stable. Capability indices tell you if it is good enough.

    Cp (Process Capability)

    Cp measures the spread of the process relative to the specification width:

    Cp = (USL - LSL) / (6 x sigma)

    A Cp of 1.0 means the process spread exactly fills the specification. A Cp of 1.33 (the minimum for most automotive and aerospace requirements) means the specification is 33% wider than the process spread — providing a safety margin.

    Cpk (Process Capability Index)

    Cpk accounts for how centred the process is within the specification:

    Cpk = minimum of [(USL - mean) / (3 x sigma), (mean - LSL) / (3 x sigma)]

    A process can have a high Cp (narrow spread) but low Cpk (off-centre). Cpk is always the number customers and auditors want to see.

    Cpk ValueMeaningDefect Rate
    0.67Marginal~4.6% (46,000 ppm)
    1.00Minimum acceptable~0.27% (2,700 ppm)
    1.33Automotive standard~63 ppm
    1.67Aerospace / safety critical~0.6 ppm
    2.00Six Sigma target~0.002 ppm

    Open data/production-log.csv in the code panel. You will find 500 measurements from a CNC turning operation — bore diameter on a hydraulic valve body. Calculate the Cp and Cpk yourself, or ask AI to do it. Notice how the process drifts after measurement 350 — that is when the tool insert was wearing. AI would have flagged the trend at measurement 310 and recommended tool change.

    Six Sigma DMAIC

    Six Sigma is a structured methodology for process improvement, used extensively at GE, Honeywell, 3M, Caterpillar, and across the Fortune 500. DMAIC provides a five-phase framework:

    PhasePurposeAI Role
    DefineDefine the problem, scope, and goalsAI analyses historical data to quantify the problem and set data-driven targets
    MeasureEstablish baseline capability (Cpk)AI automates gauge R&R, capability studies, and measurement system analysis
    AnalyseIdentify root causesAI runs multi-variable correlation, DOE analysis, and pattern detection across process data
    ImproveImplement and validate solutionsAI models predict the effect of parameter changes before implementation
    ControlSustain the improvementAI monitors control charts and alerts on regression — the "autopilot" phase

    FMEA: Failure Mode and Effects Analysis

    FMEA is a systematic method for identifying potential failure modes, their effects, and their causes — then prioritizing them for action. Required by IATF 16949 and widely used in aerospace (AS9100), medical devices (ISO 13485), and process industries.

    Risk Priority Number (RPN)

    Each potential failure mode is scored on three dimensions:

  • Severity (S) — how bad is the effect if it happens? (1-10)
  • Occurrence (O) — how likely is it to happen? (1-10)
  • Detection (D) — how likely are you to catch it before it reaches the customer? (1-10)
  • RPN = S x O x D (range 1-1000, higher = more critical)

    AI enhances FMEA by:

  • Analysing historical failure data to provide evidence-based occurrence scores instead of subjective estimates
  • Cross-referencing similar components across plants to identify failure modes you might not have considered
  • Automatically updating RPN scores as process data accumulates — a living FMEA, not a static document
  • OEE: Overall Equipment Effectiveness

    OEE is the gold standard metric for manufacturing productivity. It combines three factors:

    OEE = Availability x Performance x Quality

    FactorCalculationWorld-Class Target
    Availability(Run time) / (Planned production time)> 90%
    Performance(Actual output) / (Theoretical max output at run speed)> 95%
    Quality(Good parts) / (Total parts produced)> 99.9%

    World-class OEE is considered to be 85% or higher. The average across US manufacturing is closer to 60%. AI identifies the specific losses dragging OEE down — whether it is changeover time (availability), minor stoppages (performance), or scrap (quality) — and prioritises improvement efforts by financial impact.

    Open data/defect-catalog.json in the code panel to explore a catalog of 40 common manufacturing defect types across machining, welding, casting, and assembly — each with typical root causes, detection methods, and AI-recommended prevention strategies.

    Key Takeaways

  • SPC is the foundation of quality, and AI makes it real-time. Traditional end-of-shift chart reviews miss developing trends. AI monitors every data point across every characteristic and alerts immediately when patterns emerge.
  • Cpk is the number that matters. It tells you whether your process can consistently produce parts within specification. Know your Cpk for every critical characteristic — and use AI to track it continuously.
  • Six Sigma DMAIC gives you the structure. AI supercharges each phase — from data-driven problem definition to automated control monitoring. The combination of structured methodology and AI analytics is more powerful than either alone.
  • FMEA should be a living document. AI keeps FMEAs current by continuously updating occurrence and detection scores based on real data, not annual reviews.
  • OEE tells the whole story. If you are only tracking quality, you are missing availability and performance losses. AI decomposes OEE into specific loss categories and prioritises by dollar impact.
  • This is chapter 4 of AI for Engineers (Global).

    Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.

    View course details