Statistical Process Control (SPC) Chart Back
Quality Control / SPC

Statistical Process Control (SPC) Chart

Generate random sample data to display X-bar control chart, R-chart, and process capability histogram across three tabs. Automatically calculate Cp/Cpk process capability indices and detect out-of-control points.

Parameters

Results
Grand mean X̄̄
Average range R̄
Cp
Cpk
Xbar
Cap

Theory & Key Formulas
$$C_p = \frac{USL - LSL}{6\hat{\sigma}}$$ $$C_{pk}= \min\!\left(\frac{USL-\bar{\bar{x}}}{3\hat{\sigma}},\;\frac{\bar{\bar{x}}-LSL}{3\hat{\sigma}}\right)$$

$\hat{\sigma}=\bar{R}/d_2$ (range method)
Target: $C_{pk}\geq 1.33$

What is an SPC Control Chart?

🙋
At the factory, I was told to "stamp the control chart every hour," but what exactly am I looking at?
🎓
Roughly speaking, it's a graph that checks in time series whether the process is still stable. For example, if you're manufacturing screw lengths, sampling 5 pieces every hour and plotting the average, that's an X-bar chart. The lines drawn above and below (UCL/LCL) are statistically calculated boundaries indicating "normal within this range." If a point jumps out, it's an alarm that "something might be wrong." Try increasing the "drift intensity" in the simulator. You should see the points approaching the control limits toward the latter half.
🙋
Oh, when I actually apply drift, the points in the latter half do drift upward. So this is a sign of "process abnormality." And I often hear about Cp/Cpk, but how are they different from control charts?
🎓
Good question. Control charts look at "is it stable now?" while Cp/Cpk are numerical values showing "how much margin does the stable process have against customer requirements (specifications)?" Try narrowing USL and LSL in the simulator. The control chart doesn't change at all, but the Cpk value drops sharply, right? This is a state where "the process is stable, but the specifications are too tight, just barely." Generally, Cpk ≥ 1.33 is the target; below this, the risk of defective products increases.
🙋
Looking at the histogram in the "Process Capability" tab, the relationship between the USL/LSL lines and the distribution is clear at a glance. How do you use the R chart?
🎓
While the X-bar chart looks at "variation in the average," the R chart looks at "the magnitude of variation within subgroups." For example, as tool wear progresses, machining variation increases. This is hard to notice on the X-bar chart (average), but can be detected early by a rising trend in the R chart. In practice, it's basic to always check both together. Try increasing σ; you should see the points on the R chart rise and approach the UCL.
🙋
I see! Only by looking at control charts and Cp/Cpk together can we understand both the "stability" and "capability" of the process.
🎓
Exactly. A common pitfall is people who say "Cpk is good, so it's fine" and don't look at the control chart. Even if Cpk is high, if there's a trend like 7 consecutive points on one side (Westinghouse Rule) on the control chart, the process is not "in control." It could be a precursor to defects later. It's important to develop the habit of reading the "movement of points" on the control chart, not just the numbers.

Control Limit Formulas

X-bar control chart — center line and upper/lower control limits:

$$CL_{\bar{X}} = \bar{\bar{x}}, \quad UCL_{\bar{X}} = \bar{\bar{x}} + A_2 \bar{R}, \quad LCL_{\bar{X}} = \bar{\bar{x}} - A_2 \bar{R}$$

$\bar{\bar{x}}$: mean of subgroup averages, $\bar{R}$: average range, $A_2$: constant determined by subgroup size $n$ (for example, $A_2=0.577$ when $n=5$)

R control chart — center line and upper/lower control limits:

$$CL_R = \bar{R}, \quad UCL_R = D_4 \bar{R}, \quad LCL_R = D_3 \bar{R}$$

$D_3, D_4$: constants determined by subgroup size $n$ ($LCL_R=0$ for $n\leq 6$). Process capability indices are calculated using the process standard deviation estimate $\hat{\sigma}=\bar{R}/d_2$.

Practical Application Examples

Automotive parts manufacturing: Sample engine-part diameters in subgroups of five and monitor them hourly with control charts. Maintaining high capability such as Cpk≥1.67 helps drive assembly defects close to zero.

Semiconductor manufacturing: Wafer film thickness requires nanometer-level control. Control charts identify process shifts early, enabling maintenance before Cpk falls and improving yield.

Food filling: Monitor soft-drink fill volume with control charts. R charts detect rising filler variation early, reducing both overfill cost and underfill compliance risk.

Frequently Asked Questions

Control limits (UCL/LCL) are statistically calculated lines based on the natural variation of the process, representing the boundary within which points should fall when the process is stable. Specification limits (USL/LSL) are the boundaries required by the customer. These are different; even within control limits, a point can be out of specification (when Cpk<1). You can verify this by changing only USL/LSL in the simulator.
Typically n=4 to 5 is recommended. It is important to group items produced on the same equipment, under the same conditions, and in a close time period into one subgroup. Larger subgroup sizes narrow the control limits (A₂ value), making it easier to detect small shifts. Variation between subgroups (over time) is captured by the X-bar chart, while variation within subgroups is captured by the R chart.
Cpk=1.33 means the specification width is equivalent to 8 times the process standard deviation (±4σ). Assuming a normal distribution, this corresponds to a defect rate of about 64 ppm (64 defects per million). In the automotive industry (IATF 16949), new processes may require Cpk≥1.67 (equivalent to ±5σ). You can observe how Cpk improves as σ is reduced in the simulator.
According to WECO (Western Electric Company) rules, in addition to a single point beyond UCL/LCL, there are rules such as "7 consecutive points on one side (a one-sided trend)," "6 consecutive points increasing or decreasing," and "14 points alternating up and down." For example, even if the average is within control limits, if 7 consecutive points lie above the center line, it is highly likely that some shift has occurred in the process, and it should be treated as a problem. Setting a drift in the simulator reproduces such trends.
For variable data (continuous quantities), there are X-bar&R charts, X-bar&S charts (direct estimation of σ), and X&MR charts (individual values). For attribute data, there are p-charts and np-charts for defect counts, and c-charts and u-charts for nonconformity counts. This simulator supports the most basic X-bar&R chart.
In practice, Cpk is always emphasized. Cp evaluates only the potential of the process (smallness of variation), but it can show a high value even if the process mean is off-center from the specification. Cpk indicates the "actual process capability" including the effect of centering. If Cp≫Cpk, it means the process variation is small but the centering is poor. You can verify this by slightly shifting μ in the simulator: Cp remains the same while Cpk decreases.

What is Statistical Process?

Statistical Process is a fundamental topic in engineering and applied physics. This interactive simulator lets you explore the key behaviors and relationships by directly manipulating parameters and observing real-time results.

By combining numerical computation with visual feedback, the simulator bridges the gap between abstract theory and physical intuition — making it an effective learning tool for students and a rapid-verification tool for practicing engineers.

Physical Model & Key Equations

The simulator is based on the governing equations behind Statistical Process Control (SPC) Chart. Understanding these equations is key to interpreting the results correctly.

Each parameter in the equations corresponds to a slider in the control panel. Moving a slider changes the equation's solution in real time, helping you build a direct connection between mathematical expressions and physical behavior.

Real-World Applications

Engineering Design: The concepts behind Statistical Process Control (SPC) Chart are applied across mechanical, structural, electrical, and fluid engineering disciplines. This tool provides a quick way to estimate design parameters and sensitivity before committing to full CAE analysis.

Education & Research: Widely used in engineering curricula to connect theory with numerical computation. Also serves as a first-pass validation tool in research settings.

CAE Workflow Integration: Before running finite element (FEM) or computational fluid dynamics (CFD) simulations, engineers use simplified models like this to establish physical scale, identify dominant parameters, and define realistic boundary conditions.

Common Misconceptions and Points of Caution

Model assumptions: The mathematical model used here relies on simplifying assumptions such as linearity, homogeneity, and isotropy. Always verify that your real system satisfies these assumptions before applying results directly to design decisions.

Units and scale: Many calculation errors arise from unit conversion mistakes or order-of-magnitude errors. Pay close attention to the units shown next to each parameter input.

Validating results: Always sanity-check simulator output against physical intuition or hand calculations. If a result seems unexpected, review your input parameters or verify with an independent method.

How to Use

  1. Enter Upper Specification Limit (USL) and Lower Specification Limit (LSL) in engineering units (mm, microns, etc.)
  2. Set process mean (mu) and number of subgroups (k) — typical manufacturing uses k=25–30 subgroups of n=5 samples each
  3. Click Generate to produce X-bar chart, R-chart, and capability histogram; control limits auto-calculate at ±3 sigma
  4. Inspect for points beyond control limits or non-random patterns indicating process drift or instability

Worked Example

Automotive crankshaft diameter: USL=50.05 mm, LSL=49.95 mm, mu=50.00 mm, sigma=0.015 mm. With k=25 subgroups and n=5 samples per subgroup, the X-bar chart shows UCL=50.025 mm and LCL=49.975 mm. If one sample mean plots at 50.035 mm, the process signals out-of-control. R-chart with D4=2.114 gives UCL≈0.064 mm. Process capability Cpk=(50.00−49.95)/(3×0.015)=1.11, marginally acceptable for six-sigma goals.

Practical Notes

  1. Subgroup size n=5 is SPC standard for most continuous processes (machining, injection molding); n=3–4 for high-speed lines
  2. Western Electric rules flag process problems: 2 of 3 points beyond 2-sigma, 4 of 5 beyond 1-sigma, or 8 consecutive points on one side of center line
  3. Cpk below 1.0 requires immediate adjustment; Cpk>1.33 indicates robust process for aerospace/medical device tolerance
  4. Use stratified sampling across machine, operator, and material batch to detect assignable causes