Appearance
SPC Detection Rules, X-bar/R and Cp/Cpk Trend
Last updated
With Enhanced SPC switched on (System > Settings → Feature Toggles → Visualization; included with every appliance but off by default) each chart card gains:
- the shield icon, Configure detection rules;
- a purple Mean line;
- orange markers and a "{n} Rule Violations Detected" list;
- an Individuals / X-bar/R (n = 5) switch above the plot;
- a collapsible Cp/Cpk Trend.
X-bar/R view
Click X-bar/R above a chart's plot to see the same samples as subgroups. Individuals goes back to the usual plot.
- Consecutive samples form subgroups of the chart's Subgroup Size (2–10, default 5; set it with the pencil). Subgroups are counted from the chart's first sample, so a sample always stays in the same subgroup; the newest samples that don't yet fill one wait for it ("{n} samples waiting for their subgroup of 5 to fill").
- The newest 50 complete subgroups are shown, labeled
#1,#2… from the first subgroup ever. - X-bar chart: each subgroup's mean, with the grand mean X̿ (purple) and UCL/LCL = X̿ ± A2·R̄ (red).
- R chart: each subgroup's range (largest minus smallest), with R̄ (purple), UCL = D4·R̄ and, from a subgroup size of 7, LCL = D3·R̄ (D3 is 0 below 7).
- A subgroup outside its limits is drawn as a red point. When every range is 0, nothing is flagged.
- Under the charts: the limits, σ within (R̄/d2, the process spread estimated from the ranges) and how many subgroups are shown.
| n | A2 | D3 | D4 | d2 |
|---|---|---|---|---|
| 2 | 1.880 | 0 | 3.267 | 1.128 |
| 3 | 1.023 | 0 | 2.574 | 1.693 |
| 4 | 0.729 | 0 | 2.282 | 2.059 |
| 5 | 0.577 | 0 | 2.114 | 2.326 |
| 6 | 0.483 | 0 | 2.004 | 2.534 |
| 7 | 0.419 | 0.076 | 1.924 | 2.704 |
| 8 | 0.373 | 0.136 | 1.864 | 2.847 |
| 9 | 0.337 | 0.184 | 1.816 | 2.970 |
| 10 | 0.308 | 0.223 | 1.777 | 3.078 |
Note: X-bar/R limits are trial limits calculated from the subgroups on screen, so they update as subgroups arrive — unlike the chart's UCL/LCL, which are fixed and belong to the Individuals view. The detection rules, the Control limits line and the stat tiles also describe the Individuals view.
Example, n = 5: subgroups 1 2 3 4 5, 2 3 4 5 6 and 3 4 5 6 7 have means 3, 4, 5 and ranges 4, 4, 4. X̿ = 4, R̄ = 4, so the X-bar limits are 4 ± 0.577 × 4 = 1.692 to 6.308, the R chart UCL is 2.114 × 4 = 8.456 and LCL 0.
API: GET /api/spc/charts/:chartId/xbar-r with optional subgroupSize (2–10; default the chart's) and subgroups (1–200, default 50) returns subgroups (number, mean, range, timestamp, meanOut, rangeOut), grandMean, rBar, xbarUcl, xbarLcl, rUcl, rLcl, sigmaWithin and pendingSamples. The chart's subgroupSize is set with PUT /api/spc/charts/:id.
Turn rules on
- Click the shield icon on a chart. Nelson Rules opens.
- Tick the rules you want. Each tick saves immediately (editor or admin).
- The panel shows "{n} rule(s) active — violations are highlighted with orange markers on the chart".
No rules are on for a new chart.
The eight rules
All eight are implemented: they are Nelson rules 1–8, stored as nelson1 to nelson8 in rulesJson. The first four used to be stored as wer1–wer4, although the Western Electric rules are different tests (for example 8 points on one side rather than 9); existing charts were converted, and the API still accepts the old ids. Western Electric's zone rules appear as Nelson 5 and 6. σ and the mean are those of the latest 200 samples.
| Nelson # | Label on screen | Fires at a point when |
|---|---|---|
| 1 | 1 point beyond 3σ (out of control) | the point is more than 3σ from the mean |
| 2 | 9 consecutive points on same side of mean | it and the 8 before it are all above, or all below, the mean |
| 3 | 6 consecutive points steadily increasing/decreasing | it and the 5 before it are strictly rising or strictly falling |
| 4 | 14 consecutive points alternating up/down | it and the 13 before it alternate direction every point |
| 5 | 2 of 3 consecutive points beyond 2σ (same side) | 2 of the last 3 are beyond 2σ on the same side |
| 6 | 4 of 5 consecutive points beyond 1σ (same side) | 4 of the last 5 are beyond 1σ on the same side |
| 7 | 15 consecutive points within 1σ (stratification) | the last 15 are all within 1σ |
| 8 | 8 consecutive points beyond 1σ on either side (mixture) | the last 8 are all more than 1σ away, on either side |
How they behave:
- Rules are measured from the mean and σ of the samples themselves, not from UCL/LCL or the Baseline Value. Rule 1 can therefore disagree with the red out-of-limit dots.
- A long run is reported at every point that completes the pattern: 12 points above the mean give four rule 2 violations.
- The list shows the first 20 messages ("...and {n} more"); messages number points within the latest 200 samples.
- A point both outside UCL/LCL and breaking a rule is drawn red, not orange.
- Nothing else happens on a violation — no alarm, notification or workflow trigger. To alarm on a measurement, use an alarm on the tag.
Cp/Cpk Trend
Click Cp/Cpk Trend under the stat tiles.
- All samples the chart has ever stored are split into 60-minute buckets (aligned to UTC hours).
- Cp and Cpk are calculated inside each bucket using the formulas in Control limits, Cp and Cpk. Buckets with fewer than 2 samples are dropped.
- The chart draws Cp (blue) and Cpk (purple) with a green reference line at 1.33. The axis shows the date and time of each bucket in your browser's local time.
- "Not enough data for trend analysis" means no bucket had a result.
- Refreshes every 2 minutes while open.
Because each bucket uses only its own samples, low-volume charts (a few parts an hour) produce noisy Cp/Cpk. Use the Cpk Trend dashboard widget with a larger Bucket (min) (e.g. 480 for a shift) for those — see Production widgets.