本周学习目标与作业路线Learning objectives and assignment map
本周主题是统计过程控制 SPC 与工程过程控制 EPC。作业只有一个 Problem 1,里面有六项要求,全部围绕30小时的轴径数据展开。你最终需要交出 R 图、均值图、EWMA 图,以及三段有数值依据的判断。阅读材料还要求理解反馈,所以教程也解释 EPC、过程增益、自相关和积分调整。
This week covers statistical process control (SPC) and engineering process control (EPC). The assignment contains one problem with six tasks using the same 30 hourly subgroups. Required outputs are an R chart, an X-bar chart, an EWMA chart, and evidence-based interpretations. Feedback, process gain, autocorrelation and integral adjustment are covered to support the assigned reading and lecture.
这份教程按“概念 → 符号 → 单行手算 → 全部数据 → 图 → 判断 → WPS/Python复现”组织。每个新符号先定义,再进入公式。页面可切换中英文、打印,图和数据都嵌在文件里,保存后可以离线阅读。图中的红点表示超出当前选定控制限。
The learning sequence is concept → symbols → one-row calculation → full data → chart → interpretation → WPS/Python reproduction. Symbols are defined before use. Language controls and printing are available, and all data and figures are embedded for offline use. Red chart points indicate observations beyond the selected limits.
| 学习目标 / Objective | 你需要能够完成 / Observable outcome | 对应材料 / Location |
|---|---|---|
| 识别变异来源 | 解释共同原因与特殊原因,分别影响均值与离散程度 / Distinguish common and assignable variation | PPT 2–6;作业2、4、6 |
| 理解子组 | 解释每小时4件与30组的区别 / Identify n=4, m=30, N=120 | PPT 6–10;作业全部 |
| 建立 R 图 | 计算每组极差、R̄、σ̂、上下限 / Calculate ranges and limits | PPT 14、17–19;作业1–2 |
| 建立均值图 | 计算 x̄ᵢ、x̿、σ/√n 与界限 / Calculate subgroup means and limits | PPT 11–15;作业3–4 |
| 建立 EWMA 图 | 递推 zᵢ,计算随 i 变化的控制限 / Calculate zᵢ and time-varying limits | PPT 24–25;作业5–6 |
| 解释检出能力 | 解释 β、检出概率、ARL / Explain missed detection and run length | PPT 20–23 |
| 理解反馈控制 | 根据偏差和增益确定调整方向 / Relate error and process gain to correction | PPT 26–37;反馈教材第1章 |
阅读范围的层次。NIST 第6章6.1是过程控制概念,6.2是批次验收抽样,6.3是控制图。作业直接使用6.3中的变量控制图。课件标题是 Chapter 13,文件内容共37页;它与 NIST 书中的章节编号属于不同资料。
NIST Sections 6.1, 6.2 and 6.3 cover control concepts, lot acceptance sampling and control charts respectively. The assignment directly uses variables charts in Section 6.3. The 37-slide lecture is titled Chapter 13; its numbering belongs to a different source.
把之前学过的公式接起来Connections to earlier coursework
课件对应 / Slides 6–15、21–26、29–33
| 之前学过 / Earlier topic | 本周如何继续 / Connection |
|---|---|
| X-bar/R-bar、A₂、D₃、D₄ | 这周把查表系数还原成 σ̂=R̄/d₂ 和 σR=d₃σ 的含义。/ Derive the familiar constants from range moments. |
| Week 10 标准误与 t 检验 | 子组平均数也有抽样标准差 σ/√n。控制图把每次的平均数与一个固定基准比较。/ Each subgroup mean has a sampling standard deviation. |
| Week 12 不确定度与 RSS | 独立观测的方差相加,帮助推导子组均值和EWMA的方差。/ Independent-variance propagation explains the chart widths. |
| 简单线性回归的斜率 | EPC的过程增益g类似斜率,表示控制输入改变1单位时,输出平均变化多少。/ Process gain measures output response per unit input. |
| 指数分布中的 λ | 本周EWMA的 λ 是无单位的权重。先看当前公式中该符号的定义。/ EWMA lambda is a dimensionless weight. |
你以前做 t 检验时,先算估计值与假设值的差,再除以标准误。均值控制图也能这样理解。若受控均值是 μ₀,子组均值的标准差是 σ/√n,那么“离中心超过三倍标准差”等价于下面的条件。
A familiar hypothesis-testing interpretation is available. A subgroup mean is compared with a reference mean μ₀ using its sampling standard deviation σ/√n. A point beyond a three-sigma mean-chart limit satisfies the following condition.
控制图会按时间反复监测,所以还要考虑连续观测和误报频率。这里的3倍标准差是本周课件使用的控制限约定。老师要求的是观察过程随时间是否出现异常,而不是给全部轴径算一个平均值后就结束。
A control chart repeatedly monitors over time, so false-alarm frequency and time order matter. Three-sigma limits follow the lecture convention. The analysis must preserve hourly order and assess changes through the run.
SPC到底在监测什么What SPC monitors
课件对应 / Slides 2–6、16
车床即使没有异常,每一根轴也不会完全一样。材料、微小振动、温度和测量噪声都可能带来小波动。如果这些来源持续以稳定方式共同作用,就叫共同原因 common causes。刀具损坏、程序偏置、夹具松动、换料等可以成为可查明的特殊原因 assignable causes。控制图的信号说明值得调查,具体原因还需工艺证据确认。
Even a stable lathe produces variation. Small effects such as material variation, vibration, temperature and measurement noise can contribute to common-cause variation. Tool damage, program offsets, loose fixtures or material changes can introduce assignable causes. A chart signal motivates investigation; identifying the physical cause requires process evidence.
| 变化 / Change | 轴径的表现 / What changes | 主要观察 / Chart |
|---|---|---|
| 位置 location | 整体直径偏大或偏小 / The mean shifts | x̄ 图、EWMA |
| 离散程度 spread | 同一小时4根轴之间差距变大 / Within-subgroup variation changes | R 图 |
| 两者同时变化 | 中心和波动宽度都变 / Both center and spread change | 联合阅读 / Read both |
每个控制图都有三条参考线。CL是中心线,UCL是上控制限,LCL是下控制限。均值图的界限描述子组平均值在稳定过程下的统计波动范围。产品是否合格还取决于设计规格 USL、LSL。作业只给了目标直径25.000 mm,没有给产品上下规格,因此不能从这份题目计算合格率或 Cpk。
Each chart has a center line (CL), an upper control limit (UCL), and a lower control limit (LCL). Mean-chart limits describe variation in subgroup means under a reference process. Product conformance depends on specification limits USL and LSL. This assignment supplies a target diameter but no specification limits, so product yield or Cpk cannot be calculated.
读作业中的“without invoking the Nelson or Western Electric rules”,在第二项 R 图判断中,只需检查是否有点超出给定上下控制限。后续均值图也先用这一直接、可复核的判据。课件第16页的额外序列规则放在理解层面,不必用它们替代本题的逐点比较。
For the R-chart task, the instruction excluding Nelson and Western Electric rules calls for direct comparison with the control limits. The same transparent point-by-point check is used first for the mean chart. Extra run rules on slide 16 are supporting concepts.
读懂作业数据与全部符号Assignment data and notation
课件对应 / Slides 6、11–17
题目描述一家企业制造不锈钢传动轴,目标直径 μ₀=25.000 mm。历史受控过程的单件标准差 σ=0.040 mm。每小时抽4根轴,连续30小时,总共120个直径。合理子组 rational subgroup 的意思是,同组4根尽量在相近条件下取得,用来反映当时的短期波动;组与组的时间顺序帮助发现变化。
The process produces stainless-steel drive shafts with target diameter μ₀=25.000 mm and historical in-control individual standard deviation σ=0.040 mm. Four shafts are sampled each hour for 30 hours, giving 120 measurements. A rational subgroup groups observations taken under similar short-term conditions; time order between subgroups helps reveal changes.
| 符号 / Symbol | 本题数值或定义 / Meaning | 单位 / Unit |
|---|---|---|
| i | 小时或子组编号,1…30 / subgroup index | 无 / none |
| j | 同一小时内第几根轴,1…4 / within-subgroup index | 无 |
| n | 每组4根 / subgroup size = 4 | 件 |
| m | 30个子组 / number of subgroups = 30 | 组 |
| N | m×n=120个原始测量 / total individual measurements | 个 |
| xᵢⱼ | 第i小时第j根的直径 / individual observation | mm |
| x̄ᵢ | 第i小时4个直径的平均 / subgroup mean | mm |
| Rᵢ | 第i小时最大值减最小值 / subgroup range | mm |
| x̿ | 30个子组均值的平均 / grand mean | mm |
| R̄ | 30个极差的平均 / average range | mm |
| d₂、d₃ | 由子组大小决定的极差分布常数 / range constants | 无 |
| zᵢ | 第i小时的EWMA统计量 / EWMA statistic | mm |
题目表格最右一列已经给了子组均值。教程仍从4个原始直径重新求均值,便于核对。计算过程保留完整精度,表格显示适当小数位。下面先看第一小时。
The assignment provides subgroup means in the last column. This tutorial recalculates them from the four raw diameters for verification. Calculations retain full precision; displayed tables use readable rounding. Start with hour 1.
R₁ = max(25.012,24.985,25.031,24.976) − min(…)
=25.031−24.976 = 0.055 mm
R₁回答“这一小时4根轴相互差多少”。x̄₁回答“这一小时的中心在哪”。两者都从同一行数据产生,衡量的是不同方面。
R₁ measures spread among the four shafts during this hour. x̄₁ measures their center. Both come from the same row and describe different aspects of the subgroup.
为什么控制限里有√nWhy the limits contain the square root of n
课件对应 / Slides 7–10、12
如果4根轴相互独立,每根的方差都是 σ²,那么它们相加时,方差相加。最后求平均要除以4,所以平均值的方差还要除以4²。把这两个步骤写开,就能看到标准差为什么变成 σ/√4。
For four independent observations, each with variance σ², the sum has variance 4σ². Dividing the sum by four divides its variance by 4². Taking the square root gives the standard deviation of the mean.
Var(x̄)=(1/4²)×(σ²+σ²+σ²+σ²)=σ²/4
SD(x̄)=σ/√4=σ/2
一般形式 / General form Var(x̄)=σ²/n,SD(x̄)=σ/√n
用题目历史标准差 σ=0.040 mm,单件会有0.040 mm的标准差,而4件平均值的标准差是0.020 mm。做均值图和对子组均值做EWMA时,输入波动应按0.020计算。n是每组4根,不能把总数120放到这里。
Using the historical σ=0.040 mm, the standard deviation of a four-piece subgroup mean is 0.020 mm. This is the input standard deviation for a mean chart or an EWMA of subgroup means. Here n is four; the total measurement count 120 does not belong in this denominator.
Illustrative normal distributions using the historical process parameters.
若原始轴径独立且正态,子组平均值在任何n下都正态。若原始分布非正态,中心极限定理解释n增大后的近似趋势;n=4本身不足以保证任意原始分布都已近似正态。课件第7–10页的演示是在讲这个抽样分布。
Independent normal diameters give a normal subgroup mean for every n. For nonnormal populations, the central limit theorem supports an approximation as n grows; n=4 alone does not guarantee normality for arbitrary populations. Slides 7–10 illustrate this sampling-distribution idea.
建图前先选定中心与标准差Choose a baseline before calculating limits
课件对应 / Slides 11–15、24
这里需要先明确建图基准。课件第11–15页先用全部观测求中心,再用 R̄/d₂ 估计组内标准差。作业同时给了历史 σ=0.040 mm,并在第3项给 d₂=2.059。它没有明确要求把已知历史标准差替换掉,也没有明确指定EWMA的中心来源。两种常见目的都可解释这些信息,但控制限和报警小时会不同。
The chart baseline must be stated. Slides 11–15 estimate the center from all observations and within-subgroup σ from R̄/d₂. The assignment also supplies historical σ=0.040 mm and d₂=2.059. It does not explicitly specify replacing the historical σ or the EWMA center. Different charting purposes lead to different limits and signals.
| 路线 / Approach | 中心 / Center | 单件σ / Individual sigma | 学习用途 / Purpose |
|---|---|---|---|
| A 课件示例路线 / lecture example | x̿=25.015966667 | σ̂=R̄/d₂=0.019734499 | 本教程主算例,重现第11–17页的估计方法 / Main worked example |
| B 历史基准监测 / historical reference | μ₀=25.000 | 已知σ=0.040 | 用题目历史参数监测相对目标的变化 / Monitor against stated reference |
主算例完整计算路线A,因为它直接用到老师给的 d₂,并且与课件示例的取中心方式一致。后面的历史基准小节完整计算路线B,也提供可切换图。实际写答案时,在开头注明你采用的中心和σ。已经有特殊原因迹象的数据可用于回顾分析,但若要建立今后长期使用的基准,需要先调查并取得可代表稳定过程的数据。
Approach A is worked first because it uses d₂ and follows the lecture’s example center. Approach B is calculated separately and included in the interactive chart. State the center and σ in a submitted answer. Retrospective charts help investigate these data; a future monitoring baseline requires representative stable-process data after investigation.
两个结果之间的差距本身也值得看:这30组的组内σ̂约0.01973 mm,低于历史0.040 mm,同时前15小时平均为24.998267 mm,后15小时平均为25.033667 mm。数据表现为组内波动较小、组间中心上移。这里描述数据,不预先指定是哪种物理原因。
The current within-subgroup estimate is about 0.01973 mm, below the historical 0.040 mm. The first 15 subgroup means average 24.998267 mm and the last 15 average 25.033667 mm. The data show relatively small within-subgroup spread and a shift in location between parts of the run.
路线A把从当前数据估计出的中心和σ当作固定参考值代入公式,是课件示例的回顾建图做法。它没有把估计这些参考值产生的额外不确定度另加进控制限,因此不要把推导中已知参数下的精确误报概率直接当作这张估计图的保证。
Approach A plugs estimates from the current data into the limits as fixed references, following the lecture’s retrospective construction. It does not add parameter-estimation uncertainty to the limit widths, so known-parameter false-alarm probabilities should not be interpreted as exact guarantees for this estimated chart.
逐行整理数据与组内标准差Subgroup calculations and within-subgroup sigma
课件对应 / Slides 14、17
先把30行分别转成 x̄ᵢ 与 Rᵢ。每一行使用相同的平均值与最大减最小计算。然后对30个均值取平均,得到 x̿;对30个极差取平均,得到 R̄。因为各组大小相同,对120个测量直接平均也会得到同一个 x̿。
Calculate a mean and range for each of the 30 rows. Average the 30 subgroup means to obtain x-double-bar, and average the 30 ranges to obtain R-bar. Equal subgroup sizes make the grand mean equal to the mean of all 120 individual measurements.
Σx̄ᵢ = 750.479 mm; x̿=750.479/30=25.015966667 mm
σ̂=R̄/d₂=0.040633333/2.059=0.019734499 mm
| 小时 / Hour | x̄ᵢ (mm) | Rᵢ (mm) |
|---|---|---|
| 1 | 25.001000 | 0.055 |
| 2 | 24.997000 | 0.062 |
| 3 | 25.002000 | 0.072 |
| 4 | 24.985000 | 0.066 |
| 5 | 25.013000 | 0.063 |
| 6 | 24.989000 | 0.037 |
| 7 | 25.009000 | 0.054 |
| 8 | 24.984000 | 0.057 |
| 9 | 25.006000 | 0.027 |
| 10 | 24.991000 | 0.057 |
| 11 | 25.006000 | 0.050 |
| 12 | 24.984000 | 0.031 |
| 13 | 25.008000 | 0.039 |
| 14 | 24.991000 | 0.027 |
| 15 | 25.008000 | 0.041 |
| 16 | 25.027000 | 0.031 |
| 17 | 25.031000 | 0.036 |
| 18 | 25.025000 | 0.046 |
| 19 | 25.036000 | 0.041 |
| 20 | 25.029000 | 0.037 |
| 21 | 25.036000 | 0.035 |
| 22 | 25.028000 | 0.031 |
| 23 | 25.042000 | 0.031 |
| 24 | 25.031000 | 0.030 |
| 25 | 25.039000 | 0.026 |
| 26 | 25.034000 | 0.034 |
| 27 | 25.035000 | 0.025 |
| 28 | 25.038000 | 0.033 |
| 29 | 25.033000 | 0.018 |
| 30 | 25.041000 | 0.027 |
d₂解释的是正态子组极差的期望 E[R]=d₂σ。它把“平均极差”转换成“单件标准差”。d₃解释的是极差本身的标准差 SD(R)=d₃σ。d₂和d₃都没有单位。小写d₃与控制图表中的大写D₃是不同的常数,下一节会把它们连起来。
For normal subgroups, E[R]=d₂σ and SD(R)=d₃σ. Thus d₂ converts an average range into an individual standard deviation, while d₃ describes variation of the range statistic. Both are dimensionless. Lowercase d₃ differs from the uppercase D₃ chart factor introduced next.
作业第1至2项 R图与判断Tasks 1–2 R chart and interpretation
课件对应 / Slides 14、17–19
R图把每小时的Rᵢ画在纵轴,小时编号i画在横轴。路线A以 R̄ 为中心。极差统计量的标准差用 d₃σ̂ 估计,因此上限是中心加三倍极差标准差,下限是中心减三倍。极差不能小于0,所以负下限取0。
Plot each hourly range Rᵢ against hour i. Approach A centers the chart at R̄. Estimate the standard deviation of the range by d₃σ̂, then place limits three such standard deviations from the center. Truncate a negative lower range limit at zero.
CLR=R̄=0.040633333 mm
UCLR=R̄+3d₃σ̂
=0.040633333+3×0.88798×0.019734499
=0.093204854 mm
LCLR=max(0,R̄−3d₃σ̂)=0
Assignment task 1, R chart using the estimated baseline.
全部极差介于0.018和0.072 mm之间。最大极差在第3小时,为0.072 mm,仍小于上限0.093205 mm;所有极差都不小于0。因此第2项可以回答:按逐点超界判据,R图没有提供离散程度出现特殊原因的证据。这个结论只讨论组内离散程度,均值还要另看。
All ranges lie between 0.018 and 0.072 mm. The largest is 0.072 mm at hour 3, below UCL=0.093205 mm. With no point beyond either limit, the R chart provides no out-of-limit evidence of an assignable change in within-subgroup variability. The mean requires its own chart.
和以前的D₃、D₄公式对应Connect to the familiar D₃ and D₄ formulas
D₄=1+3d₃/d₂=2.293802817
LCLR=D₃R̄; UCLR=D₄R̄
本题明确给 d₃=0.88798,教程按这个值计算。常见n=4系数表给 D₄≈2.282,对应的d₃与题目数值不同;若直接查表替换,UCL会略有不同。交作业时保留题给值,写出你使用的公式即可。
The assignment explicitly supplies d₃=0.88798, which is used here. Common n=4 tables list D₄≈2.282, based on a different d₃ value. Substituting the tabulated D₄ would slightly change the UCL. Retain the supplied constant and show the formula used.
可用于作答的英文。All subgroup ranges fall within the control limits of 0 and 0.093205 mm. Using only points beyond the limits, there is no evidence of an assignable cause affecting within-subgroup variability during the 30-hour run.
This interpretation uses the estimated baseline and the task’s restriction on additional run rules.
作业第3至4项 均值图与判断Tasks 3–4 X-bar chart and interpretation
课件对应 / Slides 11–15
均值图每小时只画一个点 x̄ᵢ。路线A采用 x̿ 作中心,单件标准差用 σ̂=R̄/d₂。由于画的是4件平均值,控制限的标准差是σ̂/2。
The X-bar chart plots one subgroup mean per hour. Approach A uses x-double-bar as center and σ̂=R̄/d₂ as the individual standard deviation estimate. Because each point averages four pieces, its standard deviation is σ̂/2.
CLx̄=x̿=25.015966667 mm
UCLx̄=x̿+3σ̂/√n=25.045568415 mm
LCLx̄=x̿−3σ̂/√n=24.986364918 mm
UCLx̄=x̿+A₂R̄; LCLx̄=x̿−A₂R̄
Assignment task 3. Hourly order is preserved, and red points are below the LCL.
| 小时 / Hour | x̄ᵢ | 与LCL=24.986364918比较 / Comparison |
|---|---|---|
| 4 | 24.985 | 低0.001364918 mm / below |
| 8 | 24.984 | 低0.002364918 mm / below |
| 12 | 24.984 | 低0.002364918 mm / below |
因此按路线A,第4项的答案是存在均值变化的统计信号。第4、8、12小时低于LCL。后半段整体处于较高位置,这和前低后高的中心变化一致,但它本身不能直接说明刀具磨损、操作偏置等具体物理原因。图中中心由整段数据估计,前段数据相对这个中心会显得偏低。
Under Approach A, hours 4, 8 and 12 fall below the LCL, providing signals of a change in process location. Later observations occupy a higher level. Since the center is estimated from the entire run, early observations are low relative to that overall center. The physical cause still requires investigation.
可用于作答的英文。Using the grand mean and σ̂=R̄/d₂, subgroup means at hours 4, 8 and 12 fall below the lower control limit of 24.986365 mm. This provides evidence of a change in process location and warrants investigation.
State the estimated baseline with this answer. The historical-reference answer is given later because its limits differ.
先把EWMA递推算清楚Calculate the EWMA recursion step by step
课件对应 / Slides 24–26
EWMA全称 Exponentially Weighted Moving Average,中文为指数加权移动平均。把每小时新的子组均值和上一个平滑值加权平均,就得到新的zᵢ。λ=0.2表示新的这一小时占20%,前面的平滑结果占80%。初始值z₀设为选定的受控中心。路线A使用z₀=x̿;路线B使用z₀=μ₀。
EWMA stands for exponentially weighted moving average. Each new statistic combines the current subgroup mean with the preceding smoothed statistic. With λ=0.2, the current subgroup receives 20% weight and the previous EWMA 80%. Initialize z₀ at the chosen reference center: x-double-bar for Approach A, μ₀ for Approach B.
本题 / Here zᵢ=0.2x̄ᵢ+0.8zᵢ₋₁
先别急着算控制限。只要把这个递推公式做熟,就能得到EWMA曲线。z₀是初始化值,不是新测的一根轴,也不是第0小时的数据。
First focus on the recursion. It alone produces the smoothed EWMA series. The initial z₀ is a reference value, not an additional observed shaft or a measured hour-zero subgroup.
z₁=0.2×25.001+0.8×25.015966667=25.012973333
z₂=0.2×24.997+0.8×25.012973333=25.009778667
z₃=0.2×25.002+0.8×25.009778667=25.008222933
z₄=0.2×24.985+0.8×25.008222933=25.003578347
为什么叫指数加权Why the weights are exponential
=λx̄₂+λ(1−λ)x̄₁+(1−λ)²z₀
zᵢ=λΣj=1…i(1−λ)i−jx̄ⱼ+(1−λ)ⁱz₀
λ=0.2时,最近几次观测的系数依次为0.2、0.16、0.128、0.1024……每往前一个小时,就再乘0.8。历史影响逐渐变小。若许多小时都比基准略高,这些小偏移会持续把zᵢ向上推。
For λ=0.2, recent observation weights are 0.2, 0.16, 0.128 and 0.1024. Each extra hour of age multiplies the weight by 0.8. Older observations progressively fade. A sequence of slightly elevated means steadily pushes the EWMA upward.
推导EWMA的标准差与控制限EWMA variance and time-varying limits
课件对应 / Slides 24
公式中的标准差必须属于EWMA的输入。本题把子组平均值 x̄ᵢ 输入EWMA,所以设 sin=σ̂/√n。课件第24页直接写σ,是因为它用xᵢ表示输入观测;把观测换成子组均值时,要把σ对应到子组均值的标准差。
The standard deviation in an EWMA limit must describe its input. This assignment feeds subgroup means into the EWMA, so s_in=σ̂/√n. Slide 24 writes σ for the standard deviation of its generic input xᵢ. When that input is a subgroup mean, use the subgroup-mean standard deviation.
Var(zᵢ)=sin² × [λ/(2−λ)] × [1−(1−λ)2i]
SD(zᵢ)=sin√{[λ/(2−λ)][1−(1−λ)2i]}
UCLᵢ=center+L×SD(zᵢ)
LCLᵢ=center−L×SD(zᵢ)
本题只指定了λ=0.2,没有另外指定EWMA的L。教程采用L=3,与课件前面三倍标准差控制限一致,并明确记录这个选择。σ̂与n已经确定,因此第i小时只需要代入i。
The assignment specifies λ=0.2 but no separate EWMA limit multiplier L. This tutorial uses L=3, consistent with the preceding three-sigma convention, and records that choice. Once σ̂ and n are fixed, only the hour index changes in the startup limit.
把方差推导和上周RSS联系起来Connect the variance derivation to independent-variance propagation
Var(zᵢ)=λ²sin²+a²Var(zᵢ₋₁)
=λ²sin²[1+a²+a⁴+…+a2(i−1)]
=λ²sin²[1−a2i]/(1−a²)
1−a²=1−(1−λ)²=λ(2−λ)
所以 / Hence Var(zᵢ)=sin²[λ/(2−λ)][1−(1−λ)2i]
上一步用到了当前子组与过去子组独立,因此当前x̄ᵢ与zᵢ₋₁协方差为0。zᵢ与zᵢ₋₁本身共享历史,所以它们通常相关。EWMA点相关是递推本身的结果,控制限推导假设独立的是输入子组。
The derivation assumes the current subgroup is independent of previous subgroups, making its covariance with the preceding EWMA zero. Successive EWMA statistics share history and are generally correlated. It is the input subgroups that are assumed independent.
SD(z₁)=(0.019734499/2)√{(0.2/1.8)(1−0.8²)}
=0.001973450 mm
UCL₁=25.021887016; LCL₁=25.010046317
稳态 / Steady state SD(z∞)=sin√(0.2/1.8)=sin/3
UCL∞=25.025833916; LCL∞=25.006099417
开始时z₀固定,累积的随机输入少,所以控制限较窄;随着历史增加,方差逐渐逼近稳态值。本教程画随i变化的控制限。用稳态常数画水平线也常见,但前几小时的报警结果可能改变,所以要写清使用哪种。
Startup limits are narrower because the initial EWMA is fixed and relatively few random inputs have accumulated. The variance approaches a steady value over time. This tutorial uses time-varying startup limits. Constant steady-state limits are also common but can change early signals.
作业第5至6项 EWMA图与判断Tasks 5–6 EWMA chart and interpretation
课件对应 / Slides 24–25
EWMA with estimated baseline, subgroup-mean variance and time-varying limits.
计算到第4小时,z₄=25.003578347,而LCL₄≈25.006965118,已经低于下限。因此本路线在第4小时首次报警。低于下限的小时为4至16;超过上限的小时为23至30。第16小时虽然新观测的均值已经升高,但EWMA还保留前段较低水平的历史影响,所以z₁₆仍略低于下限。
At hour 4, z₄=25.003578347 falls below LCL₄≈25.006965118. The first signal is therefore at hour 4. Hours 4–16 are below the lower limits, while hours 23–30 exceed the upper limits. At hour 16 the current mean has risen, but the EWMA still carries the influence of the earlier lower observations.
| 小时 / Hour | x̄ᵢ | zᵢ | LCLᵢ | UCLᵢ | 超界 / Signal |
|---|---|---|---|---|---|
| 1 | 25.001000 | 25.012973 | 25.010046 | 25.021887 | — |
| 2 | 24.997000 | 25.009779 | 25.008385 | 25.023548 | — |
| 3 | 25.002000 | 25.008223 | 25.007491 | 25.024442 | — |
| 4 | 24.985000 | 25.003578 | 25.006965 | 25.024968 | Low / 低 |
| 5 | 25.013000 | 25.005463 | 25.006644 | 25.025289 | Low / 低 |
| 6 | 24.989000 | 25.002170 | 25.006444 | 25.025489 | Low / 低 |
| 7 | 25.009000 | 25.003536 | 25.006319 | 25.025614 | Low / 低 |
| 8 | 24.984000 | 24.999629 | 25.006239 | 25.025694 | Low / 低 |
| 9 | 25.006000 | 25.000903 | 25.006189 | 25.025745 | Low / 低 |
| 10 | 24.991000 | 24.998922 | 25.006156 | 25.025777 | Low / 低 |
| 11 | 25.006000 | 25.000338 | 25.006136 | 25.025797 | Low / 低 |
| 12 | 24.984000 | 24.997070 | 25.006123 | 25.025811 | Low / 低 |
| 13 | 25.008000 | 24.999256 | 25.006114 | 25.025819 | Low / 低 |
| 14 | 24.991000 | 24.997605 | 25.006109 | 25.025824 | Low / 低 |
| 15 | 25.008000 | 24.999684 | 25.006106 | 25.025828 | Low / 低 |
| 16 | 25.027000 | 25.005147 | 25.006103 | 25.025830 | Low / 低 |
| 17 | 25.031000 | 25.010318 | 25.006102 | 25.025831 | — |
| 18 | 25.025000 | 25.013254 | 25.006101 | 25.025832 | — |
| 19 | 25.036000 | 25.017803 | 25.006100 | 25.025833 | — |
| 20 | 25.029000 | 25.020043 | 25.006100 | 25.025833 | — |
| 21 | 25.036000 | 25.023234 | 25.006100 | 25.025833 | — |
| 22 | 25.028000 | 25.024187 | 25.006100 | 25.025834 | — |
| 23 | 25.042000 | 25.027750 | 25.006100 | 25.025834 | High / 高 |
| 24 | 25.031000 | 25.028400 | 25.006100 | 25.025834 | High / 高 |
| 25 | 25.039000 | 25.030520 | 25.006099 | 25.025834 | High / 高 |
| 26 | 25.034000 | 25.031216 | 25.006099 | 25.025834 | High / 高 |
| 27 | 25.035000 | 25.031973 | 25.006099 | 25.025834 | High / 高 |
| 28 | 25.038000 | 25.033178 | 25.006099 | 25.025834 | High / 高 |
| 29 | 25.033000 | 25.033143 | 25.006099 | 25.025834 | High / 高 |
| 30 | 25.041000 | 25.034714 | 25.006099 | 25.025834 | High / 高 |
第6项的解释应写明具体依据,不能只写“EWMA更灵敏”。在路线A下,早段和晚段相对整段中心处于不同水平,EWMA出现连续超界,支持过程均值在运行期间发生变化,需要调查。EWMA的首次报警时间是相对你选定的基准和限宽而言的。
An interpretation should identify actual signals rather than merely state that EWMA is more sensitive. Under Approach A, the early and late portions occupy different levels relative to the whole-run center. Repeated EWMA limit violations support a change in process location and warrant investigation. First-signal time depends on the baseline and limit width.
可用于作答的英文。With λ=0.2, L=3 and z₀=x-double-bar, the EWMA first falls below its time-varying lower control limit at hour 4. Hours 4–16 are below the lower limits and hours 23–30 are above the upper limits. These signals provide evidence of a change in process location.
Use this wording with the estimated-baseline chart, and retain the specified initialization and three-sigma choice.
使用题给历史参数时怎样计算Calculations using the stated historical parameters
课件对应 / Slides 12、17、24
现在把中心设为题目目标25.000 mm,单件标准差直接使用历史0.040 mm。三种图都必须沿用这套基准。已知σ时,极差的期望为d₂σ,极差的标准差为d₃σ。下面的R图中心采用历史模型的期望值。
For historical monitoring, use center 25.000 mm and individual σ=0.040 mm consistently. With known σ, the normal-subgroup range has expected value d₂σ and standard deviation d₃σ. The R-chart center below is the range expectation under that historical model.
UCLR=d₂σ+3d₃σ=0.188917600 mm
LCLR=max(0,d₂σ−3d₃σ)=0
CLx̄=25.000;SD(x̄)=0.040/2=0.020 mm
UCLx̄=25.060;LCLx̄=24.940 mm
Rᵢ没有超界,x̄ᵢ也没有超界。若只按单点超出3σ界限判断,这两张历史基准Shewhart图没有触发信号。数据前后水平差仍可见;它是否能被指定规则检出,与是否超出这两条均值界限是不同的检验。
No range or subgroup mean exceeds the historical Shewhart limits. Under the single-point three-sigma rule, these charts do not signal. The change in observed levels across the run remains visible; testing a run pattern is a separate decision from crossing these particular mean limits.
UCLᵢ=25.000+3(0.040/√4)√{(0.2/1.8)(1−0.82i)}
LCLᵢ=25.000−3(0.040/√4)√{(0.2/1.8)(1−0.82i)}
稳态限 / Steady-state limits 24.980 与 / and 25.020 mm
| 小时 / Hour | zᵢ | UCLᵢ | 比较 / Comparison |
|---|---|---|---|
| 20 | 25.019858624 | 25.019998671 | 尚未超上限 / below UCL |
| 21 | 25.023086899 | 25.019999149 | 首次超上限 / first upper signal |
| 30 | 25.034694280 | 25.019999985 | 持续超上限 / above UCL |
Approach B with the stated historical parameters. The X-bar chart has no individual violations; EWMA first signals at hour 21.
可用于历史基准作答的英文。Using μ₀=25.000 mm and the historical σ=0.040 mm, all ranges and subgroup means are within their three-sigma limits. The EWMA of subgroup means, initialized at μ₀ with λ=0.2 and L=3, first exceeds its upper control limit at hour 21 and remains above the limit through hour 30.
This answer describes the historical-reference interpretation. It should be paired with those specific limits, rather than with the estimated-baseline limits.
亲手调节EWMA权重Explore the EWMA weight interactively
课件对应 / Slides 24–25
下面可以切换建图基准,并调整λ,看同一组数据的EWMA怎样变化。主算例对应“课件估计”与λ=0.20。图中的控制限会同时按相同λ重新计算。较小λ会平滑更多历史,但反应也会变慢;它不保证在每一条具体样本路径上都更早报警。
Switch the baseline and change λ to see how the EWMA and its limits respond on the same data. The main worked example uses the estimated baseline and λ=0.20. Smaller λ retains more history and smooths more strongly, while also slowing the immediate response. First-signal timing depends on the realized data and settings.
蓝线为zᵢ,红虚线为控制限,绿线为中心。红点为超界点。/ Blue: EWMA. Red dashed: limits. Green: center. Red dots: signals.
λ=1时,zᵢ=x̄ᵢ,EWMA退化成均值图。同样的输入标准差与3σ倍数会给出同样的控制限。λ接近0时,每次只吸收很少新信息。课件中的λ与上周指数失效分布的λ作用不同,这里它是0到1之间的平滑权重。
At λ=1, zᵢ=x̄ᵢ and the EWMA reduces to the mean chart with the same input standard deviation and three-sigma limits. Near zero, little new information is incorporated each period. This λ is a dimensionless smoothing weight between zero and one.
在WPS中逐格复现作业Reproduce the assignment cell by cell in WPS
WPS里先把原题放到 A1:E31。第1行是标题,A列为小时,B到E列为4个原始直径。F列开始算统计量。在页面上方的“下载原始数据CSV”按钮可以直接获得这120个测量,导入WPS后前五列就是下面假设的布局。
Place the original data in A1:E31, with headers in row 1, hour in column A, and four diameters in B:E. Calculated statistics start in F. The raw-data CSV download at the top supplies exactly this five-column layout.
| 位置 / Cell | 标签或公式 / Label or formula | 说明 / Meaning |
|---|---|---|
| P2 / Q2 | n / 4 | 每组数量 |
| P3 / Q3 | Target / 25 | 目标直径 |
| P4 / Q4 | Historical sigma / 0.04 | 历史单件标准差 |
| P5 / Q5 | d2 / 2.059 | 题给值 |
| P6 / Q6 | d3 / 0.88798 | 题给值 |
| P7 / Q7 | lambda / 0.2 | EWMA权重 |
| P8 / Q8 | L / 3 | 控制限倍数 |
| P10 / Q10 | Grand mean / =AVERAGE(F2:F31) | x̿ |
| P11 / Q11 | Rbar / =AVERAGE(G2:G31) | R̄ |
| P12 / Q12 | Sigma estimate / =Q11/Q5 | σ̂ |
| P13 / Q13 | Active center / =Q10 | 路线A中心 |
| P14 / Q14 | Active sigma / =Q12 | 路线A单件σ |
| P15 / Q15 | R center / =Q11 | 路线A极差中心 |
| P16 / Q16 | R UCL / =Q15+Q8*Q6*Q14 | R图上限 |
| P17 / Q17 | R LCL / =MAX(0,Q15-Q8*Q6*Q14) | R图下限 |
| P18 / Q18 | Xbar UCL / =Q13+Q8*Q14/SQRT(Q2) | 均值上限 |
| P19 / Q19 | Xbar LCL / =Q13-Q8*Q14/SQRT(Q2) | 均值下限 |
第1行的F到M列标题依次写 Mean、Range、EWMA、EWMA UCL、EWMA LCL、R signal、Xbar signal、EWMA signal。然后输入下面公式。带$的Q单元格引用固定住参数,向下填充时不会错位。
Use headers Mean, Range, EWMA, EWMA UCL, EWMA LCL, R signal, Xbar signal and EWMA signal in F:M. Dollar signs anchor parameter cells so references remain fixed when formulas are filled down.
| 单元格 / Cell | 公式 / Formula | 复制范围 / Fill |
|---|---|---|
| F2 | =AVERAGE(B2:E2) | 向下至F31 |
| G2 | =MAX(B2:E2)-MIN(B2:E2) | 向下至G31 |
| H2 | =$Q$7*F2+(1-$Q$7)*$Q$13 | 仅第1小时,使用z₀ / first hour only |
| H3 | =$Q$7*F3+(1-$Q$7)*H2 | 向下至H31 |
| I2 | =$Q$13+$Q$8*($Q$14/SQRT($Q$2))*SQRT($Q$7/(2-$Q$7)*(1-(1-$Q$7)^(2*A2))) | 向下至I31 |
| J2 | =$Q$13-$Q$8*($Q$14/SQRT($Q$2))*SQRT($Q$7/(2-$Q$7)*(1-(1-$Q$7)^(2*A2))) | 向下至J31 |
| K2 | =IF(OR(G2>$Q$16,G2<$Q$17),1,0) | 向下至K31 |
| L2 | =IF(OR(F2>$Q$18,F2<$Q$19),1,0) | 向下至L31 |
| M2 | =IF(OR(H2>I2,H2<J2),1,0) | 向下至M31 |
第一行EWMA公式使用初始化中心,后面的行引用上一行H。若把H2直接一路向下填,所有行都会用同一个初始值,递推就断了。先单独写H2,再把H3向下填。
The first EWMA formula uses the initialization center, while later rows reference the previous H cell. Write H2 separately, then fill H3 downward so the recursion retains the preceding EWMA.
怎样在WPS切换到历史路线Switch to the historical baseline in WPS
Q14 改为 / set to =Q4
Q15 改为 / set to =Q5*Q4
其他列会跟着这三个参数重新计算。检查结果应为Q18=25.060、Q19=24.940,EWMA第21小时开始报警。第21小时在工作表第22行,因为第1行是表头。
All dependent formulas update from these three controls. Expected checks are Q18=25.060 and Q19=24.940, with the first EWMA signal at hour 21. Hour 21 is worksheet row 22 because row 1 contains headers.
怎样把数值画成作业要求的图Create the required plots
R图需要小时、极差、CL、UCL、LCL五列。为三条控制线建立辅助列,每行分别引用Q15、Q16、Q17,然后选这些列插入带数据标记的折线图或数值型散点连线图。均值图同样画F列,加Q13、Q18、Q19三条线。EWMA画H、I、J列,并加Q13中心线。图上写清横轴Hour、纵轴mm,以及所用基准。
For an R chart, plot hour, range, CL, UCL and LCL. Add helper columns repeating Q15, Q16 and Q17 down the rows, then create a line chart with markers or an XY chart with lines. For X-bar, plot F and repeat Q13, Q18 and Q19. For EWMA, plot H, I and J with the Q13 center. Label hour, millimeters and the chosen baseline.
读数显示六位小数即可,单元格内部保留原始精度。先用第1、4、21、30小时的手算和本教程表格核对,再判断超界,避免四舍五入恰好把点推到界限另一侧。
Six displayed decimals are sufficient for reading, while cells should retain underlying precision. Check hours 1, 4, 21 and 30 before interpreting signals, particularly when a point lies close to a limit.
用Python复现与核对Reproduce and verify the charts in Python
以下Python程序包含原题全部120个测量。它会分别计算路线A和路线B,打印控制限与超界小时,保存两张三联控制图和一个完整计算表CSV。代码中的λ、μ和σ都采用当前章节的定义。
The Python program embeds all 120 assignment measurements. It calculates both baseline approaches, prints limits and signal hours, and saves two three-panel chart images plus a complete calculation CSV. Its symbols follow the definitions used in this tutorial.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install numpy matplotlib
python week13_spc_epc.py如果已经激活可用虚拟环境,只需安装缺少的包并运行。顶部“下载Python程序”按钮会把下方完整代码保存成 week13_spc_epc.py。代码和数据随教程一起离线保存。
If an appropriate virtual environment is already active, install any missing packages and run the script. The Python download button saves the complete embedded program as week13_spc_epc.py. Both code and data remain available offline in this tutorial.
import csv
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
DATA = np.array([
[25.012, 24.985, 25.031, 24.976],
[24.96, 25.022, 24.991, 25.015],
[25.041, 24.988, 25.01, 24.969],
[24.975, 24.952, 25.018, 24.995],
[25.029, 25.044, 24.981, 24.998],
[24.992, 24.968, 25.005, 24.991],
[25.015, 25.033, 24.979, 25.009],
[24.955, 24.984, 25.012, 24.985],
[25.008, 25.021, 24.994, 25.001],
[24.98, 24.962, 25.019, 25.003],
[25.035, 24.99, 25.014, 24.985],
[24.971, 25.002, 24.989, 24.974],
[25.019, 24.996, 25.028, 24.989],
[24.988, 24.977, 25.004, 24.995],
[25.024, 25.011, 24.983, 25.014],
[25.042, 25.011, 25.038, 25.017],
[25.015, 25.051, 25.022, 25.036],
[24.998, 25.039, 25.044, 25.019],
[25.055, 25.028, 25.014, 25.047],
[25.012, 25.031, 25.049, 25.024],
[25.04, 25.018, 25.033, 25.053],
[25.021, 25.046, 25.015, 25.03],
[25.039, 25.058, 25.027, 25.044],
[25.019, 25.034, 25.022, 25.049],
[25.048, 25.025, 25.051, 25.032],
[25.016, 25.041, 25.029, 25.05],
[25.035, 25.022, 25.047, 25.036],
[25.052, 25.038, 25.019, 25.043],
[25.027, 25.045, 25.031, 25.029],
[25.044, 25.029, 25.056, 25.035]
], dtype=float)
SUBGROUP_SIZE = DATA.shape[1]
D2 = 2.059
D3 = 0.88798
LAMBDA = 0.2
LIMIT_MULTIPLIER = 3.0
TARGET = 25.000
HISTORICAL_SIGMA = 0.040
OUTPUT = Path("week13_results")
OUTPUT.mkdir(exist_ok=True)
hours = np.arange(1, len(DATA) + 1)
means = DATA.mean(axis=1)
ranges = np.ptp(DATA, axis=1)
grand_mean = means.mean()
rbar = ranges.mean()
sigma_estimate = rbar / D2
def calculate(center, sigma, range_center):
previous = center
ewma = []
for subgroup_mean in means:
previous = LAMBDA * subgroup_mean + (1 - LAMBDA) * previous
ewma.append(previous)
ewma = np.array(ewma)
input_sd = sigma / np.sqrt(SUBGROUP_SIZE)
width = LIMIT_MULTIPLIER * input_sd * np.sqrt(
LAMBDA / (2 - LAMBDA) * (1 - (1 - LAMBDA) ** (2 * hours))
)
return {
"center": center,
"sigma": sigma,
"range_center": range_center,
"range_lower": max(0, range_center - LIMIT_MULTIPLIER * D3 * sigma),
"range_upper": range_center + LIMIT_MULTIPLIER * D3 * sigma,
"mean_lower": center - LIMIT_MULTIPLIER * input_sd,
"mean_upper": center + LIMIT_MULTIPLIER * input_sd,
"ewma": ewma,
"ewma_lower": center - width,
"ewma_upper": center + width,
}
def print_results(name, result):
range_flags = (ranges < result["range_lower"]) | (ranges > result["range_upper"])
mean_flags = (means < result["mean_lower"]) | (means > result["mean_upper"])
ewma_flags = (result["ewma"] < result["ewma_lower"]) | (result["ewma"] > result["ewma_upper"])
print(f"\n{name}")
print(f"Center = {result['center']:.9f}, sigma = {result['sigma']:.9f}")
print(f"R limits = {result['range_lower']:.9f}, {result['range_upper']:.9f}")
print(f"X-bar limits = {result['mean_lower']:.9f}, {result['mean_upper']:.9f}")
print("R signal hours:", hours[range_flags].tolist())
print("X-bar signal hours:", hours[mean_flags].tolist())
print("EWMA signal hours:", hours[ewma_flags].tolist())
def save_plot(name, result):
fig, axes = plt.subplots(3, 1, figsize=(11, 10), sharex=True)
entries = [
(ranges, result["range_lower"], result["range_upper"], result["range_center"], "R chart"),
(means, result["mean_lower"], result["mean_upper"], result["center"], "X-bar chart"),
(result["ewma"], result["ewma_lower"], result["ewma_upper"], result["center"], "EWMA chart"),
]
for ax, (values, lower, upper, center, title) in zip(axes, entries):
lower_line = np.broadcast_to(lower, means.shape)
upper_line = np.broadcast_to(upper, means.shape)
ax.plot(hours, values, "o-", color="#24556f", markersize=4)
ax.plot(hours, lower_line, "--", color="#b34735", label="LCL")
ax.plot(hours, upper_line, "--", color="#b34735", label="UCL")
ax.axhline(center, color="#718270", label="Center")
flags = (values < lower_line) | (values > upper_line)
ax.scatter(hours[flags], values[flags], color="#b34735", zorder=4)
ax.set_title(title)
ax.set_ylabel("mm")
ax.ticklabel_format(axis="y", style="plain", useOffset=False)
ax.grid(alpha=0.2)
ax.legend(loc="best", fontsize=8)
axes[-1].set_xlabel("Subgroup hour")
fig.suptitle(f"{name}: lambda = {LAMBDA}, L = {LIMIT_MULTIPLIER}")
fig.tight_layout()
fig.savefig(OUTPUT / f"{name}_charts.png", dpi=160)
plt.close(fig)
estimated = calculate(grand_mean, sigma_estimate, rbar)
historical = calculate(TARGET, HISTORICAL_SIGMA, D2 * HISTORICAL_SIGMA)
print(f"Subgroups = {len(DATA)}, subgroup size = {SUBGROUP_SIZE}, measurements = {DATA.size}")
print(f"Grand mean = {grand_mean:.9f}, Rbar = {rbar:.9f}")
for name, result in [("estimated", estimated), ("historical", historical)]:
print_results(name, result)
save_plot(name, result)
with (OUTPUT / "week13_calculations.csv").open("w", newline="", encoding="utf-8-sig") as stream:
writer = csv.writer(stream)
writer.writerow([
"Hour", "x1", "x2", "x3", "x4", "Mean", "Range",
"Estimated_EWMA", "Estimated_LCL", "Estimated_UCL",
"Historical_EWMA", "Historical_LCL", "Historical_UCL",
])
for i in range(len(DATA)):
writer.writerow([
int(hours[i]), *DATA[i], means[i], ranges[i],
estimated["ewma"][i], estimated["ewma_lower"][i], estimated["ewma_upper"][i],
historical["ewma"][i], historical["ewma_lower"][i], historical["ewma_upper"][i],
])
print(f"\nSaved results to {OUTPUT.resolve()}")
OC曲线与平均运行长度Operating characteristics and average run length
课件对应 / Slides 20–23
课件第21–23页问的是:如果过程均值真的变化了,下一次子组平均值能有多大概率越界?设变化为kσ,σ仍然是单件标准差。新的均值μ₁=μ₀+kσ,均值图使用μ₀±Lσ/√n。
Slides 21–23 ask how likely the next subgroup mean is to signal after a real mean shift. Let the shift be kσ, where σ is the individual standard deviation. The shifted mean is μ₁=μ₀+kσ, and the chart limits are μ₀±Lσ/√n.
=Φ[(UCL−μ₁)/(σ/√n)]−Φ[(LCL−μ₁)/(σ/√n)]
=Φ(L−k√n)−Φ(−L−k√n)
单次检出概率 / Per-subgroup detection probability p=1−β
Φ是标准正态分布的累计概率函数,WPS里可用NORMDIST(value,0,1,TRUE)。β是发生变化后仍未报警的概率。OC曲线把k画在横轴,β画在纵轴;变化越大,漏检通常越小。
Φ denotes the standard normal cumulative distribution function, available as NORMDIST(value,0,1,TRUE) in WPS. β is the probability of remaining within limits despite a shift. An OC curve plots β against shift size k.
| k,单件σ的倍数 | β 漏检 / Miss probability | 1−β 检出 / Detection | ARL₁ 子组数 / Subgroups |
|---|---|---|---|
| 0 | 0.997300 | 0.002700 | 370.398 |
| 0.5 | 0.977218 | 0.022782 | 43.895 |
| 0.75 | 0.933189 | 0.066811 | 14.968 |
| 1 | 0.841344 | 0.158656 | 6.303 |
| 1.5 | 0.500000 | 0.500000 | 2.000 |
| 2 | 0.158655 | 0.841345 | 1.189 |
表中使用n=4、L=3。若均值上移1个单件σ,单次检出概率约0.15866。独立、持续且大小固定的变化下,直到首次报警的子组数服从几何等待分布,平均为1/p,约6.303组。每小时一组,对应约6.303小时的平均等待。实际某一次可能更早,也可能更晚。
The table uses n=4 and L=3. A shift of one individual σ gives per-subgroup detection probability about 0.15866. For independent subgroups and a persistent fixed shift, the waiting count to first signal is geometric with mean 1/p≈6.303 subgroups, or about 6.303 hours at hourly sampling.
α=2[1−Φ(3)]≈0.002699796
ARL₀=1/α≈370.398 子组 / subgroups
课件第22页ARL₀=1/α和你之前学的几何分布平均值是同一个结构。这些简单倒数公式依赖独立的逐点Shewhart报警事件和固定概率。EWMA点之间相关,不能直接把某小时的边际尾概率取倒数来当EWMA的ARL。
The ARL₀=1/α formula has the same structure as the mean of a geometric distribution. This simple reciprocal calculation assumes independent Shewhart signal events with a fixed probability. EWMA statistics are correlated, so their ARL requires a different analysis.
把阅读清单里的验收抽样与图表分类读明白Acceptance sampling and the wider reading scope
阅读清单还包括NIST 6.2,主题是验收抽样。它处理一批货能否接受。用单次计数方案(n,c)举例,抽n件,若不合格件数D≤c就接受该批。假设各件独立且不合格概率p相同,D可以用二项分布建模。
The assigned NIST Section 6.2 covers lot acceptance sampling. In a single-sampling plan (n,c), sample n items and accept the lot when the defect count D≤c. Independent items with common defect probability p give a binomial model for D.
例如抽5件、允许最多1件不合格,即n=5、c=1。若p=0.1,则接受概率=0.9⁵+5×0.1×0.9⁴=0.91854。这条接受概率随p变化的曲线也叫OC曲线,但这里纵轴是接受一批的概率,上一节均值图的β则是漏检均值变化的概率。读符号时要同时看事件定义。
For n=5 and c=1, with p=0.1, acceptance probability is 0.9⁵+5(0.1)(0.9⁴)=0.91854. Its curve against p is also an OC curve. Here the event is lot acceptance; the previous section’s β refers to failing to detect a process mean shift.
| 图或方法 / Method | 数据 / Input | 判断对象 / Decision |
|---|---|---|
| x̄、R、EWMA | 连续测量值 / continuous measurements | 均值或离散程度是否变化 |
| p图 / p chart | 样本内不合格比例 / fraction nonconforming | 不合格率是否变化,可允许样本量不同 |
| np图 / np chart | 样本内不合格件数 / count nonconforming | 固定样本量下的不合格件数 |
| c图 / c chart | 固定检查机会下的缺陷个数 / defect count | 缺陷个数变化 |
| u图 / u chart | 单位检查机会缺陷数 / defects per unit | 检查机会不同情况下的缺陷率 |
| 多变量图 / multivariate charts | 多个相关质量指标 / correlated characteristics | 联合变化,例如Hotelling T² |
| 验收抽样 / acceptance sampling | 一批中随机抽出的项目 / random lot sample | 该批接受或拒收 |
本周数值作业测的是轴径,因此主计算使用变量图。上表用于读懂NIST 6.3的分类。题目没有提供批次验收规则或规格区间,验收抽样示例是阅读补充。
The numerical assignment measures diameter and therefore uses variables charts. The table helps organize the broader NIST Section 6.3 reading. The acceptance example is supplementary because no lot-acceptance plan or diameter specification interval is supplied in the assignment.
理解SPC与EPC的分工SPC monitoring and EPC feedback regulation
课件对应 / Slides 26–29、37
SPC的典型工作是从数据判断过程是否出现需要调查的变化。EPC则把测量结果反馈给控制器,控制器根据模型计算调整量,驱动执行机构改变过程。课件第27–28页用离散产品抽样与连续过程作对比,帮助说明两类应用。工程实践中,SPC也可用于连续过程,EPC也能控制离散系统;更一般的区分是统计监测与反馈调节的目的。
SPC identifies process changes that merit investigation. EPC feeds measurements into a controller that computes an adjustment and acts on the process. Slides 27–28 contrast sampled discrete production with continuous processing as representative applications. More generally, the distinction concerns statistical monitoring versus feedback regulation, rather than an absolute restriction to discrete or continuous systems.
| 方面 / Aspect | SPC | EPC |
|---|---|---|
| 核心问题 / Question | 过程是否改变?/ Has the process changed? | 如何调整使输出接近目标?/ How should the input change? |
| 主要输出 / Output | 图和信号,支持调查 / charts and investigation signals | 控制动作 / control action |
| 典型时间结构 / Timing | 按子组、按抽样计划监测 / subgroup sampling | 重复测量和闭环更新 / repeated closed-loop updates |
| 课件中的作用 / Lecture role | 识别并消除特殊原因 / detect and eliminate causes | 预测并抵消扰动 / predict and counteract disturbances |
在你熟悉的嵌入式系统里,可以把控制器理解为周期执行的程序。它读取传感器,计算目标与当前状态的偏差,再输出一个执行量。以巡航控制作直观例子,目标是车速,测量是实际车速,动作是驱动力调整,上坡是扰动。反馈环路中的每个量都有时间顺序,测量之后的动作影响后续输出。
In an embedded implementation, the controller can be a periodically executed program that reads a sensor, compares the output with a target, and computes an actuator command. In a cruise-control example, the target is speed, the measurement is vehicle speed, the command adjusts driving force, and a slope acts as a disturbance. Current measurements inform actions that influence later outputs.
T
计算调整 / Compute
x → y
反馈到控制器 / Feedback
Åström与Murray第1章要求建立的直觉是,反馈把系统输出重新用于决定输入。这样可以减弱扰动和参数变化的影响,但需要考虑动态响应、传感噪声和稳定性。教程后面的积分例题把这个想法写成与你以前的回归斜率相连的代数。
The introductory feedback reading connects measured output back to input decisions. Feedback can reduce the effects of disturbances and parameter variation, while dynamic response, sensor noise and stability remain design considerations. The integral-control example below expresses this idea using a process gain related to a regression slope.
用过程增益理解积分控制Process gain and integral control
课件对应 / Slides 29、32–35
先看一个静态近似模型,输入x是可以改变的控制量,输出y是测量量。课件把目标写为T,把过程增益写为g。若输入增加1单位,输出期望增加g单位,g就对应你熟悉的回归斜率。若基准工作点不是零,可用工作点附近的增量Δx、Δy描述同一个关系。
In a static local model, x is an adjustable input and y is the measured output. The lecture denotes the target by T and process gain by g. Increasing the input by one unit changes expected output by g units, analogous to a regression slope. Around a nonzero operating point, the same relation can be expressed using deviations Δx and Δy.
g=输出变化/输入变化 / output change per input change
xt=−N̂t+1/g (g≠0)
N表示扰动,例如原料变化或外部负载。假设g=0.5,预期扰动会使输出高0.4,那么要产生−0.4的输出变化,输入应设成−0.4/0.5=−0.8。先检查符号,再计算大小。若g为负,输入的调整方向也会改变。
N represents a disturbance such as material changes or an external load. If g=0.5 and the predicted disturbance raises output by 0.4, input −0.4/0.5=−0.8 produces the compensating output change. The sign of the gain determines the adjustment direction.
EWMA怎样变成积分调整How EWMA leads to integral adjustment
定义 / Define et=Nt−N̂t
⇒ N̂t+1−N̂t=λet
xt−xt−1=−(N̂t+1−N̂t)/g
⇒ xt=xt−1−(λ/g)et
累加 / Accumulate xt=x₀−(λ/g)Σeⱼ
“积分”在这里可以先理解成把过去的偏差不断累加。每次若输出仍偏高,正的偏差会再推一次负向调整;当扰动抵消后,偏差接近0,调整量保持在能够补偿扰动的位置。这个推导使用静态增益和一步时序模型,真实系统的延迟、执行器限制和动态需要另外建模。
Here integral action means accumulating past errors. A persistently high output produces repeated corrective increments. Once the disturbance is compensated, the error approaches zero and the input remains near the level that balances the disturbance. This derivation uses the lecture’s static-gain, one-step model; dynamic delays and actuator limits require additional modeling.
下面是教程自编的小例子,用T=25、g=0.5、λ=0.2。第1步扰动从0跳到+0.4后保持。表中输入是本次测量之前已经施加的xt−1,测完再按递推式计算下一次输入。它用于看清调整时序,不是作业的轴径实验数据。
The following illustrative example uses T=25, g=0.5 and λ=0.2. A disturbance steps to +0.4 at time 1 and remains there. The input shown is the previously applied x_(t−1). After measuring the output, the recursion computes the next input. These are teaching values, separate from the shaft data.
| t | 扰动 Nt | 已施加 xt−1 | 输出 yt | 偏差 y−T |
|---|---|---|---|---|
| 0 | 0.000 | 0.000000 | 25.000000 | 0.000000 |
| 1 | 0.400 | -0.000000 | 25.400000 | 0.400000 |
| 2 | 0.400 | -0.160000 | 25.320000 | 0.320000 |
| 3 | 0.400 | -0.288000 | 25.256000 | 0.256000 |
| 4 | 0.400 | -0.390400 | 25.204800 | 0.204800 |
| 5 | 0.400 | -0.472320 | 25.163840 | 0.163840 |
| 6 | 0.400 | -0.537856 | 25.131072 | 0.131072 |
第1次偏差0.4,使下一输入增量=−(0.2/0.5)×0.4=−0.16。下一次输出变成25+0.4+0.5×(−0.16)=25.32。偏差由0.4减小到0.32。之后每步按同样方法计算。
The initial error 0.4 gives the next input increment −(0.2/0.5)(0.4)=−0.16. The following output is 25+0.4+0.5(−0.16)=25.32, reducing the error from 0.4 to 0.32. Subsequent steps apply the same recursion.
读懂P、I、D与有成本的调整P, I, D and adjustments with costs
课件对应 / Slides 26、36
课件第26页在EWMA形式之后提到比例、积分、微分调整。它们分别使用当前偏差、偏差累计、偏差变化率。为了先建立清楚的符号,本段定义 e=T−y;这时正偏差表示输出偏低。前面课件积分推导的e是扰动预测残差,使用时必须同时看误差定义与模型符号。
Slide 26 introduces proportional, integral and derivative adjustments after the EWMA form. They use current error, accumulated error and error rate of change. In this paragraph define e=T−y, so positive error means output is low. The preceding lecture derivation used a disturbance-prediction residual; the error definition and process sign must be read together.
| 项 / Term | 数学意义 / Meaning | 直观作用 / Interpretation |
|---|---|---|
| P | 当前e乘系数 / gain times current error | 偏差大,当前动作大 / immediate response |
| I | 累计过去e / accumulated error | 持续偏差会持续积累调整 / sustained correction |
| D | e变化的速度 / rate of change | 根据变化趋势调整,对测量噪声敏感 / reacts to trend and noise |
本周数值作业并没有让你整定PID参数。你需要能读懂课件为什么从EWMA走到反馈,以及第33页的积分增量如何得到。第36页进一步考虑调整有成本的情况:bounded adjustment 在超出界限时才动作;rounded adjustment 按偏差区间采用不同级别的调整。
The numerical assignment does not require PID tuning. The relevant learning goal is understanding how smoothing supports feedback and how slide 33 obtains the integral increment. Slide 36 adds adjustment costs: bounded adjustment acts after a boundary is crossed, while rounded adjustment uses different action levels for different deviation zones.
过程为什么会记住上一次的状态Autocorrelation and the stirred-tank example
课件对应 / Slides 28、30–31
连续过程有“记忆”:这一刻的温度、浓度等状态往往来不及在下一次采样前完全变化,所以相邻测量可能相关。自相关 autocorrelation 衡量同一序列相隔若干时间步的相关程度。相隔k步称为lag k。
Continuous processes retain state. Temperature or concentration may change only gradually between samples, creating correlation between neighboring readings. Autocorrelation measures dependence within one series at a lag of k sampling intervals.
如果相邻原始观测正相关,平均4次未必像独立情况那样有效减少噪声。把Week 12的协方差项保留下来,可以得到下面更一般的均值方差。
With positive correlation among raw observations, averaging four readings may reduce variation less than under independence. Retaining the covariance terms from uncertainty propagation gives the more general variance expression.
课件第31页的搅拌罐说明这种动态。V是罐内容积,f是等量流入流出的体积流率,w是入口浓度,x是均匀混合后的出口浓度。假设体积固定,浓度的质量平衡为“积累=流入−流出”。
The stirred-tank example on slide 31 illustrates process memory. V is fixed tank volume, f is equal inflow and outflow rate, w is inlet concentration, and x is the well-mixed outlet concentration. A mass balance states accumulation equals inflow minus outflow.
dx/dt=(f/V)(w−x)=(w−x)/Tc
Tc=V/f
入口固定为w₀时 / For constant inlet w₀
x(t)=w₀+[x(0)−w₀]e−t/Tc
x(0)=0 ⇒ x(t)=w₀(1−e−t/Tc)
这里把时间常数写成Tc,避免和前面目标值T混淆。课件第31页用T表示时间常数。离散采样间隔为Δt时,令ρ=e−Δt/Tc,一阶动态可写成下面的递推。
The time constant is denoted T_c here to distinguish it from the control target T. Slide 31 uses T for the time constant. With sampling interval Δt and ρ=e^(−Δt/T_c), the first-order sampled dynamics have the following recursion.
ρ=e−Δt/Tc
Tc=10 min,Δt=1 min ⇒ ρ≈0.904837
Δt=10 min ⇒ ρ≈0.367879
在相应的稳态一阶模型中,若w是独立的随机输入创新,一阶自相关为ρ。仅看递推中的系数并不能推出任意输入序列的实际相关系数。作业三张图沿用独立子组的标准假设;持续均值变化也会制造显著样本相关,所以不能不经调查就把全部时间结构当成稳定自相关噪声。
For a corresponding stationary first-order model driven by independent random innovations, lag-one autocorrelation is ρ. An arbitrary correlated input need not yield that same correlation. The assignment charts use standard independent-subgroup assumptions. A mean shift can itself produce apparent sample autocorrelation, so the entire time pattern should not automatically be treated as stationary correlated noise.
读课件时容易出错的细节Notation and calculation details to check
| 位置 / Location | 课件或题目中的细节 / Detail | 阅读时采用的解释 / Working interpretation |
|---|---|---|
| PPT 12 | 表格文本与公式的x̄符号易混淆 | 均值图中心是整个基准的x̿,绘图点是每小时x̄ᵢ。/ Distinguish grand and subgroup means. |
| PPT 15 | 把300×99.73%=299.19用于说明均值图点数 | 该示例有60个子组均值,应以60个绘图点算预期超界数,约60×0.0027=0.162。/ Use plotted subgroup count. |
| PPT 17 | LCL首个等号后写成加号,代入却用了减号 | LCL应为R̄−3d₃σ̂,负值截为0。/ Lower limit subtracts. |
| PPT 18–19 | 小n的极差分布偏斜 | R图的“3σ”尾概率一般不会精确等于正态的0.0027。/ Range limits are moment-based. |
| PPT 24 | 方差一行左边写σzᵢ,右边是σ²乘因子 | 该行应理解为Var(zᵢ)=σzᵢ²,标准差另开根号。/ Distinguish variance and SD. |
| PPT 24用于本作业 | 课件xᵢ为输入,作业输入是每组均值 | EWMA使用σ/√4作为输入标准差。/ Use subgroup-mean SD. |
| PPT 31 | T作为时间常数,其他页T作为目标 | 本教程记时间常数为Tc,保留目标T。/ Read symbols in context. |
| PPT 33 | 抵消扰动那行x=+N̂/g,与该页模型及后续负增量不一致 | 由y−T=e+N̂+gx推得x=−N̂/g。/ Use the negative compensating input. |
| 作业常数 | 给出的d₃=0.88798与常见n=4系数表不同 | 按题给值计算,并注明来源。/ Retain supplied constant. |
| 作业EWMA参数 | 只给λ=0.2,没有另外给L | 本教程采用L=3并明确说明。/ State the three-sigma convention. |
| 建图基准 | 题给历史σ,同时给d₂,课件用数据估计中心与σ | 教程并列计算两种基准,作答时写明选择。/ State center and sigma. |
这些说明用于保证公式内部一致。数值计算以题目原始测量和明确写出的基准为依据。课件中的“evidence”是统计证据层面的判断,物理原因仍须查找生产记录、设备状态和量测系统。
These notes maintain internal consistency between models, units and calculations. Numerical results use the original measurements and stated baselines. Statistical evidence of a change should be followed by investigation of production records, equipment and measurement conditions.
作业交付内容与答案核对表Assignment checklist and numerical answer sheet
| 要求 / Task | 需要交出的内容 / Deliverable | 路线A课件估计 / Estimated | 路线B历史参数 / Historical |
|---|---|---|---|
| 1 R图 | 30个Rᵢ,CL、UCL、LCL | 0.040633333;0.093204854;0 | 0.082360;0.188917600;0 |
| 2 R图判断 | 按超界判据说明 / limit comparison | 全部在界内 / no signals | 全部在界内 / no signals |
| 3 均值图 | 30个x̄ᵢ,CL、UCL、LCL | 25.015966667;25.045568415;24.986364918 | 25.000;25.060;24.940 |
| 4 均值判断 | 列出超界小时 / signal hours | 4、8、12低于LCL | 无单点超界 / none |
| 5 EWMA图 | λ=0.2,L=3,z₀,动态限 | z₀=25.015966667;输入SD=0.009867249 | z₀=25.000;输入SD=0.020 |
| 6 EWMA判断 | 首次、方向、持续区间 / first signal and direction | 第4小时起低;4–16低、23–30高 | 第21小时起高;21–30高 |
推荐的作答顺序是先写所用基准,再给R图与解释,然后给均值图与解释,最后给EWMA与解释。每张图写清mm与小时。若使用路线A,可在最后补一句历史参数监测的对照结论,展示你理解已知σ与估计σ的区别;如果老师指定了其中一种,就按指定基准报告主结果。
A readable submission states its baseline first, then presents the R chart and interpretation, the mean chart and interpretation, and finally the EWMA chart and interpretation. Label millimeters and hours. If Approach A is used, a brief historical-reference comparison can clarify the effect of known versus estimated sigma. Follow any further baseline instruction from the instructor.
自测与手算检查Practice and calculation checks
先尝试口头回答,再展开答案。能把每一步的单位、标准差对象和中心来源说清楚,就已经抓住本周主要计算。
Try answering aloud before expanding the solutions. Focus on units, which quantity a standard deviation describes, and where each center comes from.
为什么n=4而不是120? / Why is n four?
每个绘图点是4件的子组平均。120是全部原始测量总数。/ Each plotted mean averages four pieces; 120 is the total measurement count.
R图没有超界,均值图还能报警吗? / Can the mean signal when the range does not?
能。把同组4个数都加0.03,最大减最小不变,但均值增加0.03。/ Adding 0.03 to every item leaves the range unchanged and shifts the mean by 0.03.
为什么本题σ̂约0.01973,历史σ却0.040? / Why do sigma values differ?
一个来自本次30组的组内极差估计,一个是题给历史参数。它们的统计来源不同,应分别说明。/ One is estimated from current within-subgroup ranges, the other is a supplied historical reference.
若把0.040直接放入对子组均值做EWMA的标准差项,会怎样? / What if individual sigma is used directly?
界限半宽会比正确的0.040/√4大2倍,可能漏掉信号。/ It doubles the half-width relative to the correct subgroup-mean input SD.
λ=1会怎样? / What happens at lambda one?
zᵢ=x̄ᵢ,EWMA成为均值图,输入SD和倍数一致时界限相同。/ EWMA becomes the subgroup-mean chart.
控制图能说明哪些轴径不符合设计吗? / Does the chart establish individual conformance?
还需要USL与LSL。控制限衡量统计稳定性,本题没有给规格区间。/ Individual conformance requires specification limits, which are absent here.
g=0.5,预测扰动+0.4,要怎样补偿? / How do you offset a +0.4 disturbance?
x=−0.4/0.5=−0.8,代回gx+N=0核对。/ Apply −0.8 and verify gx+N=0.
看到连续偏移后,是否能每小时把中心改为最新均值? / Should the center be reset every hour?
需要稳定且有依据的基准。随意追随数据移动中心会改变比较标准,削弱检测变化的作用。/ A monitoring reference should be justified and stable; moving it with each observation changes what is being tested.
课件与阅读来源Course materials and references
Christopher Slon,Chapter 13 – EPC and SPC,37页,用户提供的课程课件。
Christopher Slon, Chapter 13 – EPC and SPC, 37 supplied lecture slides.
ISE/SYS 5517 Problem Set – Week 13,Problem 1,30组×4件。
ISE/SYS 5517 Problem Set – Week 13, Problem 1, 30 subgroups of four.
ISE/SYS 5517 Reading List – Week 13。
Supplied Week 13 reading list.
NIST第6章,6.1–6.3为阅读清单指定范围。
NIST Chapter 6, Sections 6.1–6.3 are assigned.
NIST,Shewhart X-bar and R and S Control Charts,核对均值图和极差图公式。
NIST reference for range moments and chart construction.
https://www.itl.nist.gov/div898/handbook/pmc/section3/pmc321.htm
NIST,EWMA Control Charts,核对递推、历史基准和稳态界限。
NIST reference for EWMA recursion and steady-state limits.
https://www.itl.nist.gov/div898/handbook/pmc/section3/pmc324.htm
NIST,What are Variables Control Charts,核对控制限、规格限和基准概念。
NIST reference for variable charts and control-versus-specification limits.
https://www.itl.nist.gov/div898/handbook/pmc/section3/pmc32.htm
NIST,What is Acceptance Sampling。
NIST introduction to lot acceptance sampling.
https://www.itl.nist.gov/div898/handbook/pmc/section2/pmc21.htm
Åström与Murray,Feedback Systems,第1章公开版本。
Åström and Murray, Feedback Systems, publicly available introductory chapter.
https://www.cds.caltech.edu/~murray/books/AM08/pdf/am08-intro_19Jul11.pdf
作者提供的2020完整书与分章链接目录。
Author-hosted directory of the 2020 text and chapter links.
阅读清单书目信息写2008,链接文件名是2020完整版本。本教程反馈入门核对了作者公开的2011年第1章版本,并以用户课件为本周公式的主要依据。2020大PDF未通过网页检索工具完整读取,所以不声称逐页核对了该版本。本教程的作业数字从原始120个数据重新计算,EPC的小表是明确标示的教学例子。
The reading list cites 2008 while linking a 2020 full-text file. The feedback introduction was checked against the author-hosted 2011 introductory chapter, with the supplied slides as the main source for this week’s equations. The large 2020 PDF could not be fully retrieved by the web tool, so that version has not been checked page by page. Assignment numbers were recalculated from all 120 measurements; the EPC table is an explicitly labeled teaching example.