Control of Manufacturing Control of Manufacturing
ProcessesProcesses
Subject 2.830
Spring 2004Spring 2004
Lecture #10Lecture #10
Advanced SPCAdvanced SPC
Moving Average ApproachesMoving Average Approaches
March 9, 2004March 9, 2004
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
2
Beyond XbarBeyond Xbar
•• Good PointsGood Points
–– Simple and “transparent”Simple and “transparent”
–– Enforces AssumptionsEnforces Assumptions•• Normality (via Central Limit)Normality (via Central Limit)
•• Independent (via long sampling times)Independent (via long sampling times)
•• LimitationsLimitations
–– n>1 to get Xbar and Sn>1 to get Xbar and S
–– arlarl isis typciallytypcially largelarge•• Not very Not very sensitivbesensitivbe to small changesto small changes
–– Slow time responseSlow time response
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
3
Beyond XbarBeyond Xbar
•• What if n=1?What if n=1?
–– Have a Lot of DataHave a Lot of Data
–– Want Fast Response to ChangesWant Fast Response to Changes
•• How to Compute Control Chart Statistics?How to Compute Control Chart Statistics?
–– Running Chart and Running Variance?Running Chart and Running Variance?
–– Running Average and Running Variance?Running Average and Running Variance?
–– Running Average with Forgetting FactorRunning Average with Forgetting Factor
•• How to Increase Sensitivity to Small, How to Increase Sensitivity to Small, Persistent Mean Shift?Persistent Mean Shift?
–– Integrate the ErrorIntegrate the Error
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
4
Chart Design:Chart Design:
n=1 Designs n=1 Designs -- Running AveragesRunning Averages
•• Sensitivity: Ability to detect small Sensitivity: Ability to detect small
changes (e.g. mean shifts)changes (e.g. mean shifts)
•• Time Response: Ability to Catch Time Response: Ability to Catch
Changes QuicklyChanges Quickly
•• Noise Rejection: Reduction of Variance; Noise Rejection: Reduction of Variance;
increase S/N increase S/N
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
5
Parallels with Linear Discrete Parallels with Linear Discrete
System DynamicsSystem Dynamics•• Dynamics of Sampled Data SystemsDynamics of Sampled Data Systems
Step1
z+0.5
Discrete
1
s+1
Continuous
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
6
Parallels with Linear Discrete Parallels with Linear Discrete
System DynamicsSystem Dynamics•• Filtering of “Noisy” SignalsFiltering of “Noisy” Signals
Random
Number 0.5
z-0.5
Discrete
1
s+1
Continuous
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
7
Xbar “Filtering”Xbar “Filtering”
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96
Run Data
Xbar n=4
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
8
FilteringFiltering
•• Reduced PeaksReduced Peaks
•• Hides intermediate dataHides intermediate data
•• Reduces the “frequency content” of the Reduces the “frequency content” of the
outputoutput
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
9
Independence and Independence and
CorrelationCorrelation
•• Independence: Current output does not Independence: Current output does not
depend on priordepend on prior
•• Correlation: Measure of IndependenceCorrelation: Measure of Independence
–– e.g. auto correlation functione.g. auto correlation function
Rxx( ) E[x( t)x(t )]
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
10
CorrelationCorrelation
Rxx( ) E[x( t)x(t )]
0
0.2
0.4
0.6
0.8
1
-4 -3 -2 -1 0 1 2 3 4
Tmin Tmax
For a linear 1st order system
T~ 1 sec:
For an uncorrelated
process
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
11
Sampling: Frequency and Sampling: Frequency and
Distribution of SamplesDistribution of Samples
0
0.2
0.4
0.6
0.8
1
-4 -3 -2 -1 0 1 2 3 4
Tmin Tmax
0
0.2
0.4
0.6
0.8
1
-4 -3 -2 -1 0 1 2 3 4
Tmin Tmax
0
0.2
0.4
0.6
0.8
1
-4-3-2-101234
TmT
SAMPLE TIME
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
12
Correlation and SamplingCorrelation and Sampling
Correlated
Samples
Uncorrelated
Samples
Correlation
Time (e.g.)
•Taking samples beyond correlation
time guarantees independence
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
13
Sampling and AveragingSampling and Averaging
•• Sampling Frequency AffectsSampling Frequency Affects
–– Time ResponseTime Response
–– CorrelationCorrelation
•• AveragingAveraging
–– Filters DataFilters Data
–– Slows ResponseSlows Response
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
14
Alternative ChartsAlternative Charts
Running AveragesRunning Averages
n measurements
at sample j
xRj
1
nxi
i j
j n
SR j
2 1
n 1(xi
i j
j n
xRj )2
Running Average
Running Variance
• More averages/Data
• Can use run data alone and
average for S only
• Can use to improve resolution
of mean shift
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
15
Specific Case: Specific Case:
Weighted AveragesWeighted Averages
yj a1x j 1 a2x j 2 a3 xj 3 ...
•• How should we weight How should we weight
measurements??measurements??
–– All equally? (as with Running Average)All equally? (as with Running Average)
–– Based on how recent?Based on how recent?
•• e.g. Most recent are more relevant than e.g. Most recent are more relevant than
less recent?less recent?
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
16
0
0.05
0.1
0.15
0.2
0.25
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Consider an Exponential Consider an Exponential
Weighted AverageWeighted Average
Define a weighting function
Wt i r (1 r )i
Exponential Weights
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
17
Exponentially Weighted Exponentially Weighted
Moving Average Statistic: Moving Average Statistic:
(EWMA):(EWMA):Ai rxi (1 r)Ai 1 Recursive EWMA
Ax
2
n
r
2 r1 1 r
2t
UCL, LCL x 3 Afor large tfor large t
Ax
2
n
r
2 r
time
Effect of r on Effect of r on multipliermultiplier
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
plot of (r/(2-r)) vs. r
wider control limits
r
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
19
SO WHAT???SO WHAT???
•• The variance will be less than with xbar, The variance will be less than with xbar,
•• n=1 case is validn=1 case is valid
•• If r=1 we have “unfiltered” dataIf r=1 we have “unfiltered” data
–– Run data stays run dataRun data stays run data
–– Sequential averages remain Sequential averages remain
•• If r<<1 we get long weighting and long delaysIf r<<1 we get long weighting and long delays
–– “Stronger” filter; longer response time“Stronger” filter; longer response time
Ax
n
r
2 rx
r
2 r
Mean Shift SensitivityMean Shift Sensitivity
EWMA and Xbar comparisonEWMA and Xbar comparison
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
xbar
EWMA
UCL
EWMA
LCL
EWMA
Grand
Mean
UCL
LCL
3/6/03
Mean shift = 1 S
r=0.1
Effect of rEffect of r
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
xbar
EWMA
UCL
EWMA
LCL
EWMA
Grand
Mean
UCL
LCL
r=0.3
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
22
Small Mean ShiftsSmall Mean Shifts
•• What if What if xx is small wrt is small wrt xx ??
•• But it is “persistent”But it is “persistent”
•• How could we detect?How could we detect?
–– arl for xbar would be too largearl for xbar would be too large
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
23
Another Approach: Another Approach:
Cumulative SumsCumulative Sums•• Add up deviations from meanAdd up deviations from mean
–– A Discrete Time IntegratorA Discrete Time Integrator
•• Since E{Since E{xx-- }=0 this sum should stay }=0 this sum should stay
near zeronear zero
•• Any bias in Any bias in xx will show as a trendwill show as a trend
C j (xi
i 1
j
x)
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
24
Mean Shift Sensitivity: Mean Shift Sensitivity:
CUSUMCUSUM
-1
0
1
2
3
4
5
6
7
81 3 5 7 9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
Mean shift = 1S
Slope due to
mean shift
Ci (xii 1
t
x )
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
25
Control Limits for CUSUMControl Limits for CUSUM
•• Significance of Slope Changes?Significance of Slope Changes?
–– Detecting Mean ShiftsDetecting Mean Shifts
•• Use of vUse of v--maskmask
–– Slope Test with DeadbandSlope Test with Deadband
d
Upper decision line
Lower decision line
d2
ln1
x
x
tan1 x
2k
where
k scale factor for plot
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
26
Use of MaskUse of Mask
-1
0
1
2
3
4
5
6
7
8
1 3 5 7 9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
=tan-1( /2k)
k=4:1; =0.25 (1 )
tan( ) = 0.5 as plotted
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
27
An AlternativeAn Alternative
•• Define the Normalized StatisticDefine the Normalized Statistic
•• And the CUSUM statisticAnd the CUSUM statistic
Zi
Xi x
x
Si
Zii 1
t
t
Which has an
expected mean of 0
and variance of 1
Which has an
expected mean of 0
and variance of 1
Can Chart with Centerline =0 and Limits = ±3
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
28
Example for Mean Shift = 1Example for Mean Shift = 1
-1
0
1
2
3
4
5
1 3 5 7 9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
Normalized CUSUM
Mean Shift = 1
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
29
Tabular CUSUMTabular CUSUM
•• Create Threshold Variables: Create Threshold Variables:
Ci max[0, xi ( 0 K) Ci 1 ]
Ci max[0,( 0 K) xi Ci 1 ]
K= threshold or slack value
K2
mean shift to detect
H : alarm level (typically 5
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
30
Threshold PlotThreshold Plot
0.495
0.170
k= /2 0.049
h=5 0.848
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
31
SummarySummary
•• Noisy Data Need Some FilteringNoisy Data Need Some Filtering
•• Sampling Strategy Can Guarantee Sampling Strategy Can Guarantee
IndependenceIndependence
•• Linear Discrete Filters have Been Linear Discrete Filters have Been
ProposedProposed
–– EWMAEWMA
–– Running IntegratorRunning Integrator
•• Choice Depends on Nature of Process Choice Depends on Nature of Process
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
32
Summary of Part IISummary of Part II
•• Consider Process a Random ProcessConsider Process a Random Process
–– Can never predict precise valueCan never predict precise value
•• Model with Model with P(x)P(x) oror p(x)p(x)
–– AssumeAssume p(x,t) = p(x)p(x,t) = p(x)
•• Shewhart HypothesisShewhart Hypothesis
–– InIn-- control = purely random outputcontrol = purely random output•• Normal, independent stationaryNormal, independent stationary
•• “The best you can do!”“The best you can do!”
–– Not in Not in -- controlcontrol•• NonNon--random behaviorrandom behavior
•• Source can be found and eliminatedSource can be found and eliminated
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
33
Summary of Part IISummary of Part II
•• P(x) normalP(x) normal
–– M and s only to defineM and s only to define
•• Find Sample StatisticsFind Sample Statistics
–– Xbar and SXbar and S
•• Plot SequentiallyPlot Sequentially
•• Look for unexpected behaviorLook for unexpected behavior
–– Confidence IntervalsConfidence Intervals
–– Mean Shift hypothesisMean Shift hypothesis
–– ……
3/9/04 Lecture 101 © D.E. Hardt, all rights
reserved
34
The SPC HypothesisThe SPC Hypothesis
...
...
In-Control
Not
In-Control
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Sample Number
ProcessY
p(y)