docs(measurement): 新增 PD132T 端到端时序图(三段横轴)+ 符号约定勘误 + 生成工具
- 图示 docs/img/timing-chain-pd132t.{svg,png}:① 一个窗(0~11.2ms)② 检测到输出(0~600ms)③ 基线块平均(0~12s)
· 曲线按 §1~§4 公式真算:Xn=480 tick/160µs、窗=68×480/3MHz=10.880ms、α=79(τ=35.26ms)、
dlt=(32640×60)>>16=29、判据线 32611、大信号(+0.5%) 第 1 窗即越线(t≈10.9ms)、小信号(+0.1%) ≈2.2τ≈78ms
· 同时标注:两种检测路径、50ms 输出节拍量化、上电时 Origin 只有首窗单点样本
- 新工具 tools/plot_timing_chain.py:纯 stdlib 手写 SVG;chromium --headless 转 PNG(零第三方依赖)
- ⚠ 新增 §0.1 符号约定:车辆 ⇒ L↓ ⇒ f↑ ⇒ 周期/Xn↓ ⇒ Value/CAPVD↓(判据取下降侧)
⇒ 修正 5 处「深占压(频偏 −5%)⇒ 窗 +5.3%」的方向错误:车辆是频率升高、窗长应【缩短】(−4.8%)
- README:目录树补 img/ 与两个 tools 脚本;表格校验 0 异常(15 文件)
This commit is contained in:
@@ -52,7 +52,10 @@ vd-analysis/
|
|||||||
│ │ ├── analysis.md # 单型号分析(平台/硬件/算法/参数/移植注意)
|
│ │ ├── analysis.md # 单型号分析(平台/硬件/算法/参数/移植注意)
|
||||||
│ │ └── *.pdf # 原理图附件(可选,2026-09-01 起归档)
|
│ │ └── *.pdf # 原理图附件(可选,2026-09-01 起归档)
|
||||||
│ └── ...
|
│ └── ...
|
||||||
└── tools/ # 分析辅助脚本(预留)
|
├── img/ # 图示(PNG 预览 + SVG 矢量)
|
||||||
|
└── tools/ # 分析辅助脚本
|
||||||
|
├── window_calc.py # 测量窗量化计算器(窗=⌊BASE/Xn₀⌋·Xn₁;六型号内置参数)
|
||||||
|
└── plot_timing_chain.py # 端到端时序图生成(纯 stdlib 手写 SVG,曲线按公式真算)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 分析新增型号流程
|
## 分析新增型号流程
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
| **基线更新周期** | **0.82 s**(100 窗;⚠ 勘误) | **2.73 s** | **1.09 s**(勘误) | **5.59 s**(256 窗) | **5 s**(500 窗) | **4.37 s**(500 窗) |
|
| **基线更新周期** | **0.82 s**(100 窗;⚠ 勘误) | **2.73 s** | **1.09 s**(勘误) | **5.59 s**(256 窗) | **5 s**(500 窗) | **4.37 s**(500 窗) |
|
||||||
| IIR 时间常数 τ | **22~27 ms**(⚠ 勘误) | 88 ms / 109 ms | **35.4 / 43.7 ms**(α79/α64;精确 29.6 / 38.0) | 87 ms(精确 76.0) | 32 ms | **28 ms** |
|
| IIR 时间常数 τ | **22~27 ms**(⚠ 勘误) | 88 ms / 109 ms | **35.4 / 43.7 ms**(α79/α64;精确 29.6 / 38.0) | 87 ms(精确 76.0) | 32 ms | **28 ms** |
|
||||||
|
|
||||||
> ⚠ **测量节拍是区间,不是定值**(2026-09-11 补):`LPCNT = ⌊BASE/Xn₀⌋` 是**整数除法且学习后冻结**,窗长 = `⌊BASE/Xn₀⌋·Xn₁` 个 tick ⇒ **上表中"测量节拍 / 基线更新周期 / IIR 时间常数"三行数值均为标称上限**。站点实际值 = 标称 × `(BASE−r₀)/BASE` × `f₀/f_now`(`r₀ = BASE mod Xn₀`):100kHz 站点 **−0.39%**、60kHz 站点 **−2.34%**、带内最差 **−6.2%**(Xn₀=2049);深占压(频偏 −5%)再 +5.3%。**Δf/f 口径不受影响**(`Value/Origin = Xn₁/Xn₀` 精确,余数完全约掉)。公式/数值表/位宽约束(`INT8U LPCNT` ⇒ 需 `Xn>129`)见 [measurement-window-quantization.md](measurement-window-quantization.md)。
|
> ⚠ **测量节拍是区间,不是定值**(2026-09-11 补):`LPCNT = ⌊BASE/Xn₀⌋` 是**整数除法且学习后冻结**,窗长 = `⌊BASE/Xn₀⌋·Xn₁` 个 tick ⇒ **上表中"测量节拍 / 基线更新周期 / IIR 时间常数"三行数值均为标称上限**。站点实际值 = 标称 × `(BASE−r₀)/BASE` × `f₀/f_now`(`r₀ = BASE mod Xn₀`):100kHz 站点 **−0.39%**、60kHz 站点 **−2.34%**、带内最差 **−6.2%**(Xn₀=2049);深占压(Δf/f +5%,频率升高)窗长再 **−4.8%**。**Δf/f 口径不受影响**(`Value/Origin = Xn₁/Xn₀` 精确,余数完全约掉)。公式/数值表/位宽约束(`INT8U LPCNT` ⇒ 需 `Xn>129`)见 [measurement-window-quantization.md](measurement-window-quantization.md)。
|
||||||
>
|
>
|
||||||
> IIR 系数 79/64 的量化对比(α/τ/阶跃响应/噪声抑制/单频衰减/模拟验证)见 [filter-coefficient-79-vs-64.md](filter-coefficient-79-vs-64.md)(2026-08-28 新增;**2026-08-31 v2 扩展:时间常数公式详解 + 释放路径影响 + 方案 A 案例**)。
|
> IIR 系数 79/64 的量化对比(α/τ/阶跃响应/噪声抑制/单频衰减/模拟验证)见 [filter-coefficient-79-vs-64.md](filter-coefficient-79-vs-64.md)(2026-08-28 新增;**2026-08-31 v2 扩展:时间常数公式详解 + 释放路径影响 + 方案 A 案例**)。
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ y[n] = 1 − (1−α)^n
|
|||||||
| DLD154V4B | 10 ms | **32 ms** | 40 ms |
|
| DLD154V4B | 10 ms | **32 ms** | 40 ms |
|
||||||
| DLD154Pro | 8.74 ms | 28 ms | 35 ms |
|
| DLD154Pro | 8.74 ms | 28 ms | 35 ms |
|
||||||
|
|
||||||
> ⚠ **表中 T 是"标称上限"**(2026-09-11 补):实际测量窗 = `⌊BASE/Xn₀⌋·Xn₀/f_cap`,按**站点线圈频率**浮动 0 ~ −6.2%(100kHz 站点 −0.39%),深占压再 +5%;**τ 按同一因子缩放**(本表未逐一改写,读数时按百分比折算即可)。公式与数值表见 [measurement-window-quantization.md](measurement-window-quantization.md)。
|
> ⚠ **表中 T 是"标称上限"**(2026-09-11 补):实际测量窗 = `⌊BASE/Xn₀⌋·Xn₀/f_cap`,按**站点线圈频率**浮动 0 ~ −6.2%(100kHz 站点 −0.39%),深占压(Δf/f +5%)窗长 −4.8%;**τ 按同一因子缩放**(本表未逐一改写,读数时按百分比折算即可)。公式与数值表见 [measurement-window-quantization.md](measurement-window-quantization.md)。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 334 KiB |
@@ -0,0 +1,209 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1680" height="1560" viewBox="0 0 1680 1560"><rect width="1680" height="1560" fill="#ffffff"/>
|
||||||
|
<text x="28.0" y="44.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="21" fill="#0b2c4d" text-anchor="start" font-weight="bold">PD132T 端到端时序图(检测通道:线圈 → CD4060 ÷32 → PCA 捕获 → 窗结账 → IIR → 基线 → 继电器)</text>
|
||||||
|
<text x="28.0" y="70.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#555" text-anchor="start" font-weight="normal">站点:线圈 100 kHz / 捕获时钟 3 MHz(12MHz÷4,官方手册直证)/ Xn₀=480 tick / LPCNT=68 / 窗=32640 tick=10.88 ms / α=79(τ=35.3 ms) / 进入档1=60(0.0916%Δf/f)</text>
|
||||||
|
<rect x="1170.0" y="20.0" width="470.0" height="62.0" rx="6" fill="#fbfcfe" stroke="#0a58ca" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="1182.0" y="44.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="16" fill="#0a58ca" text-anchor="start" font-weight="bold">三段横轴(跨 6 个数量级,非线性)</text>
|
||||||
|
<text x="1182.0" y="68.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">① 微观 0~11.2 ms(一个窗) ② 中观 0~0.6 s(检测到输出)</text>
|
||||||
|
<text x="1182.0" y="89.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">③ 宏观 0~12 s(基线块平均 / 上电学习)</text>
|
||||||
|
<text x="28.0" y="120.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="17" fill="#0a58ca" text-anchor="start" font-weight="bold">① 微观:一个测量窗(0 ~ 11.2 ms)</text>
|
||||||
|
<line x1="250.0" y1="628.0" x2="1470.0" y2="628.0" stroke="#888" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<line x1="250.0" y1="628.0" x2="250.0" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="250.0" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">0</text>
|
||||||
|
<line x1="467.9" y1="628.0" x2="467.9" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="467.9" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">2 ms</text>
|
||||||
|
<line x1="685.7" y1="628.0" x2="685.7" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="685.7" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">4 ms</text>
|
||||||
|
<line x1="903.6" y1="628.0" x2="903.6" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="903.6" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">6 ms</text>
|
||||||
|
<line x1="1121.4" y1="628.0" x2="1121.4" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1121.4" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">8 ms</text>
|
||||||
|
<line x1="1339.3" y1="628.0" x2="1339.3" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1339.3" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">10 ms</text>
|
||||||
|
<line x1="1470.0" y1="628.0" x2="1470.0" y2="635.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1470.0" y="651.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">11.2 ms</text>
|
||||||
|
<text x="236.0" y="633.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">时间</text>
|
||||||
|
<polyline points="250.00,194.00 315.36,194.00 315.36,182.00 1470.00,182.00" fill="none" stroke="#c1121f" stroke-width="2.0" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<line x1="236.0" y1="194.0" x2="254.0" y2="194.0" stroke="#c1121f" stroke-width="1.0" opacity="1.00" stroke-dasharray="3,3"/>
|
||||||
|
<text x="1476.0" y="188.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#c1121f" text-anchor="start" font-weight="normal">线圈谐振频率</text>
|
||||||
|
<text x="236.0" y="168.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">A1 线圈 f</text>
|
||||||
|
<text x="236.0" y="188.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">100.000 kHz</text>
|
||||||
|
<text x="325.4" y="164.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#c1121f" text-anchor="start" font-weight="normal">车辆进入(0.6 ms):L↓ ⇒ f↑ +0.5% ⇒ 周期↓、Xn↓</text>
|
||||||
|
<polyline points="250.00,284.00 250.00,284.00 267.43,284.00 267.43,258.00 284.86,258.00 284.86,284.00 302.29,284.00 302.29,258.00 319.71,258.00 319.71,284.00 337.14,284.00 337.14,258.00 354.57,258.00 354.57,284.00 372.00,284.00 372.00,258.00 389.43,258.00 389.43,284.00 406.86,284.00 406.86,258.00 424.29,258.00 424.29,284.00 441.71,284.00 441.71,258.00 459.14,258.00 459.14,284.00 476.57,284.00 476.57,258.00 494.00,258.00 494.00,284.00 511.43,284.00 511.43,258.00 528.86,258.00 528.86,284.00 546.29,284.00 546.29,258.00 563.71,258.00 563.71,284.00 581.14,284.00 581.14,258.00 598.57,258.00 598.57,284.00 616.00,284.00 616.00,258.00 633.43,258.00 633.43,284.00 650.86,284.00 650.86,258.00 668.29,258.00 668.29,284.00 685.71,284.00 685.71,258.00 703.14,258.00 703.14,284.00 720.57,284.00 720.57,258.00 738.00,258.00 738.00,284.00 755.43,284.00 755.43,258.00 772.86,258.00 772.86,284.00 790.29,284.00 790.29,258.00 807.71,258.00 807.71,284.00 825.14,284.00 825.14,258.00 842.57,258.00 842.57,284.00 860.00,284.00 860.00,258.00 877.43,258.00 877.43,284.00 894.86,284.00 894.86,258.00 912.29,258.00 912.29,284.00 929.71,284.00 929.71,258.00 947.14,258.00 947.14,284.00 964.57,284.00 964.57,258.00 982.00,258.00 982.00,284.00 999.43,284.00 999.43,258.00 1016.86,258.00 1016.86,284.00 1034.29,284.00 1034.29,258.00 1051.71,258.00 1051.71,284.00 1069.14,284.00 1069.14,258.00 1086.57,258.00 1086.57,284.00 1104.00,284.00 1104.00,258.00 1121.43,258.00 1121.43,284.00 1138.86,284.00 1138.86,258.00 1156.29,258.00 1156.29,284.00 1173.71,284.00 1173.71,258.00 1191.14,258.00 1191.14,284.00 1208.57,284.00 1208.57,258.00 1226.00,258.00 1226.00,284.00 1243.43,284.00 1243.43,258.00 1260.86,258.00 1260.86,284.00 1278.29,284.00 1278.29,258.00 1295.71,258.00 1295.71,284.00 1313.14,284.00 1313.14,258.00 1330.57,258.00 1330.57,284.00 1348.00,284.00 1348.00,258.00 1365.43,258.00 1365.43,284.00 1382.86,284.00 1382.86,258.00 1400.29,258.00 1400.29,284.00 1417.71,284.00 1417.71,258.00 1435.14,258.00 1435.14,284.00 1452.57,284.00 1452.57,258.00 1470.00,258.00" fill="none" stroke="#0a7d4b" stroke-width="1.6" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<circle cx="250.0" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="267.4" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="284.9" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="302.3" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="319.7" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="337.1" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="354.6" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="372.0" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="389.4" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="406.9" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="424.3" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="441.7" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="459.1" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="476.6" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="494.0" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="511.4" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="528.9" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="546.3" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="563.7" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="581.1" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="598.6" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="616.0" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="633.4" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="650.9" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="668.3" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="685.7" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="703.1" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="720.6" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="738.0" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="755.4" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="772.9" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="790.3" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="807.7" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="825.1" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="842.6" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="860.0" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="877.4" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="894.9" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="912.3" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="929.7" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="947.1" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="964.6" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="982.0" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="999.4" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1016.9" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1034.3" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1051.7" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1069.1" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1086.6" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1104.0" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1121.4" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1138.9" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1156.3" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1173.7" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1191.1" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1208.6" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1226.0" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1243.4" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1260.9" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1278.3" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1295.7" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1313.1" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1330.6" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1348.0" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1365.4" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1382.9" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1400.3" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1417.7" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1435.1" cy="284.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<circle cx="1452.6" cy="258.0" r="2.6" fill="#c1121f"/>
|
||||||
|
<text x="236.0" y="264.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">A2 P23 方波</text>
|
||||||
|
<text x="236.0" y="284.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">÷32 / 320 µs 周期</text>
|
||||||
|
<text x="1476.0" y="272.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#0a7d4b" text-anchor="start" font-weight="normal">绿=P23,红点=捕获点(双沿)</text>
|
||||||
|
<line x1="337.1" y1="288.0" x2="511.4" y2="288.0" stroke="#c1121f" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<line x1="337.1" y1="284.0" x2="337.1" y2="292.0" stroke="#c1121f" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<line x1="511.4" y1="284.0" x2="511.4" y2="292.0" stroke="#c1121f" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="424.3" y="308.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#c1121f" text-anchor="middle" font-weight="normal">Xn = 相邻捕获差 = 480 tick = 160 µs(= Xn/f_cap)</text>
|
||||||
|
<text x="236.0" y="488.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">A3 CapSum</text>
|
||||||
|
<text x="236.0" y="506.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">Σ Xn(tick)</text>
|
||||||
|
<line x1="250.0" y1="488.0" x2="1470.0" y2="488.0" stroke="#aaa" stroke-width="1.0" opacity="1.00" stroke-dasharray="4,4"/>
|
||||||
|
<line x1="250.0" y1="348.0" x2="1470.0" y2="348.0" stroke="#aaa" stroke-width="1.0" opacity="1.00" stroke-dasharray="4,4"/>
|
||||||
|
<text x="1476.0" y="352.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="start" font-weight="normal">32768(BASE 标称)</text>
|
||||||
|
<text x="1476.0" y="492.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="start" font-weight="normal">0</text>
|
||||||
|
<polyline points="250.00,488.00 250.00,485.95 267.94,485.95 267.94,483.90 285.88,483.90 285.88,481.85 303.82,481.85 303.82,479.80 321.76,479.80 321.76,477.75 339.71,477.75 339.71,475.70 357.65,475.70 357.65,473.64 375.59,473.64 375.59,471.59 393.53,471.59 393.53,469.54 411.47,469.54 411.47,467.49 429.41,467.49 429.41,465.44 447.35,465.44 447.35,463.39 465.29,463.39 465.29,461.34 483.24,461.34 483.24,459.29 501.18,459.29 501.18,457.24 519.12,457.24 519.12,455.19 537.06,455.19 537.06,453.14 555.00,453.14 555.00,451.09 572.94,451.09 572.94,449.04 590.88,449.04 590.88,446.98 608.82,446.98 608.82,444.93 626.76,444.93 626.76,442.88 644.71,442.88 644.71,440.83 662.65,440.83 662.65,438.78 680.59,438.78 680.59,436.73 698.53,436.73 698.53,434.68 716.47,434.68 716.47,432.63 734.41,432.63 734.41,430.58 752.35,430.58 752.35,428.53 770.29,428.53 770.29,426.48 788.24,426.48 788.24,424.43 806.18,424.43 806.18,422.38 824.12,422.38 824.12,420.32 842.06,420.32 842.06,418.27 860.00,418.27 860.00,416.22 877.94,416.22 877.94,414.17 895.88,414.17 895.88,412.12 913.82,412.12 913.82,410.07 931.76,410.07 931.76,408.02 949.71,408.02 949.71,405.97 967.65,405.97 967.65,403.92 985.59,403.92 985.59,401.87 1003.53,401.87 1003.53,399.82 1021.47,399.82 1021.47,397.77 1039.41,397.77 1039.41,395.71 1057.35,395.71 1057.35,393.66 1075.29,393.66 1075.29,391.61 1093.24,391.61 1093.24,389.56 1111.18,389.56 1111.18,387.51 1129.12,387.51 1129.12,385.46 1147.06,385.46 1147.06,383.41 1165.00,383.41 1165.00,381.36 1182.94,381.36 1182.94,379.31 1200.88,379.31 1200.88,377.26 1218.82,377.26 1218.82,375.21 1236.76,375.21 1236.76,373.16 1254.71,373.16 1254.71,371.11 1272.65,371.11 1272.65,369.05 1290.59,369.05 1290.59,367.00 1308.53,367.00 1308.53,364.95 1326.47,364.95 1326.47,362.90 1344.41,362.90 1344.41,360.85 1362.35,360.85 1362.35,358.80 1380.29,358.80 1380.29,356.75 1398.24,356.75 1398.24,354.70 1416.18,354.70 1416.18,352.65 1434.12,352.65 1434.12,350.60 1452.06,350.60 1452.06,348.55 1470.00,348.55" fill="none" stroke="#e07b00" stroke-width="1.8" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<line x1="274.4" y1="518.0" x2="1421.2" y2="518.0" stroke="#e07b00" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="258.0" y="334.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#a35b00" text-anchor="start" font-weight="normal">每 160 µs 累加一次 Xn(共 68 级台阶)⇒ CapCnt≥LPCNT 时「窗结账」</text>
|
||||||
|
<circle cx="1470.0" cy="348.0" r="4.5" fill="#c1121f"/>
|
||||||
|
<text x="258.0" y="614.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#c1121f" text-anchor="start" font-weight="normal">窗结账:Value = Σ(68 个 Xn) = 32640 ⇒ CAP_OK=1 ⇒ 主循环随即调用 VD1_TASK()</text>
|
||||||
|
<polyline points="250.00,548.00 1435.14,548.00 1435.14,582.00 1470.00,582.00" fill="none" stroke="#0a58ca" stroke-width="2.0" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<line x1="250.0" y1="548.0" x2="1470.0" y2="548.0" stroke="#aaa" stroke-width="1.0" opacity="1.00" stroke-dasharray="4,4"/>
|
||||||
|
<text x="236.0" y="548.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">A4 Value</text>
|
||||||
|
<text x="236.0" y="568.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">每窗更新一次</text>
|
||||||
|
<text x="1476.0" y="552.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#0a58ca" text-anchor="start" font-weight="normal">Origin 基准 32640</text>
|
||||||
|
<text x="1476.0" y="586.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#0a58ca" text-anchor="start" font-weight="normal">车后 32486(−0.5%)</text>
|
||||||
|
<text x="1423.1" y="536.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#0a58ca" text-anchor="end" font-weight="normal">窗边界 10.88 ms(本窗只含 0.6~10.88 ms ⇒ 部分反映)</text>
|
||||||
|
<text x="890.0" y="302.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#0b2c4d" text-anchor="start" font-weight="bold">窗 = LPCNT·Xn / f_cap = ⌊32768/Xn₀⌋·Xn / f_cap = 68 × 480 / 3 MHz = 10.880 ms(标称上限)</text>
|
||||||
|
<text x="28.0" y="682.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="17" fill="#0a58ca" text-anchor="start" font-weight="bold">② 中观:检测延迟与输出(0 ~ 600 ms) 车辆进入 @0.6 ms</text>
|
||||||
|
<line x1="250.0" y1="1098.0" x2="1470.0" y2="1098.0" stroke="#888" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<line x1="250.0" y1="1098.0" x2="250.0" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="250.0" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">0</text>
|
||||||
|
<line x1="453.3" y1="1098.0" x2="453.3" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="453.3" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">100 ms</text>
|
||||||
|
<line x1="656.7" y1="1098.0" x2="656.7" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="656.7" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">200 ms</text>
|
||||||
|
<line x1="860.0" y1="1098.0" x2="860.0" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="860.0" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">300 ms</text>
|
||||||
|
<line x1="1063.3" y1="1098.0" x2="1063.3" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1063.3" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">400 ms</text>
|
||||||
|
<line x1="1266.7" y1="1098.0" x2="1266.7" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1266.7" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">500 ms</text>
|
||||||
|
<line x1="1470.0" y1="1098.0" x2="1470.0" y2="1105.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1470.0" y="1121.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">600 ms</text>
|
||||||
|
<text x="236.0" y="1103.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">时间</text>
|
||||||
|
<text x="236.0" y="998.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">B1 CAPVD</text>
|
||||||
|
<text x="236.0" y="1016.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">IIR 平滑值</text>
|
||||||
|
<line x1="250.0" y1="817.0" x2="1470.0" y2="817.0" stroke="#0a58ca" stroke-width="1.2" opacity="1.00" stroke-dasharray="6,4"/>
|
||||||
|
<text x="1476.0" y="821.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#0a58ca" text-anchor="start" font-weight="normal">Origin 32640(基线)</text>
|
||||||
|
<line x1="250.0" y1="844.7" x2="1470.0" y2="844.7" stroke="#c1121f" stroke-width="1.4" opacity="1.00" stroke-dasharray="6,4"/>
|
||||||
|
<text x="1476.0" y="848.7" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#c1121f" text-anchor="start" font-weight="normal">判据线 32611(−dlt=29 / 0.0916%)</text>
|
||||||
|
<polyline points="250.00,32640.00 272.12,32640.00 272.12,32592.65 294.25,32592.65 294.25,32557.15 316.37,32557.15 316.37,32532.61 338.49,32532.61 338.49,32515.64 360.61,32515.64 360.61,32503.90 382.74,32503.90 382.74,32495.79 404.86,32495.79 404.86,32490.18 426.98,32490.18 426.98,32486.30 449.10,32486.30 449.10,32483.62 471.23,32483.62 471.23,32481.77 493.35,32481.77 493.35,32480.48 515.47,32480.48 515.47,32479.60 537.59,32479.60 537.59,32478.98 559.72,32478.98 559.72,32478.56 581.84,32478.56 581.84,32478.27 603.96,32478.27 603.96,32478.07 626.09,32478.07 626.09,32477.93 648.21,32477.93 648.21,32477.83 670.33,32477.83 670.33,32477.76 692.45,32477.76 692.45,32477.72 714.58,32477.72 714.58,32477.68 736.70,32477.68 736.70,32477.66 758.82,32477.66 758.82,32477.65 780.94,32477.65 780.94,32477.64 803.07,32477.64 803.07,32477.63 825.19,32477.63 825.19,32477.62 847.31,32477.62 847.31,32477.62 869.43,32477.62 869.43,32477.62 891.56,32477.62 891.56,32477.62 913.68,32477.62 913.68,32477.61 935.80,32477.61 935.80,32477.61 957.93,32477.61 957.93,32477.61 980.05,32477.61 980.05,32477.61 1002.17,32477.61 1002.17,32477.61 1024.29,32477.61 1024.29,32477.61 1046.42,32477.61 1046.42,32477.61 1068.54,32477.61 1068.54,32477.61 1090.66,32477.61 1090.66,32477.61 1112.78,32477.61 1112.78,32477.61 1134.91,32477.61 1134.91,32477.61 1157.03,32477.61 1157.03,32477.61 1179.15,32477.61 1179.15,32477.61 1201.27,32477.61 1201.27,32477.61 1223.40,32477.61 1223.40,32477.61 1245.52,32477.61 1245.52,32477.61 1267.64,32477.61 1267.64,32477.61 1289.77,32477.61 1289.77,32477.61 1311.89,32477.61 1311.89,32477.61 1334.01,32477.61 1334.01,32477.61 1356.13,32477.61 1356.13,32477.61 1378.26,32477.61 1378.26,32477.61 1400.38,32477.61 1400.38,32477.61 1422.50,32477.61 1422.50,32477.61 1444.62,32477.61 1444.62,32477.61 1466.75,32477.61 1466.75,32477.61 1488.87,32477.61 1488.87,32477.61 1510.99,32477.61 1510.99,32477.61 1533.11,32477.61 1533.11,32477.61 1555.24,32477.61 1555.24,32477.61 1577.36,32477.61 1577.36,32477.61" fill="none" stroke="#c1121f" stroke-width="2.0" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<polyline points="250.00,32640.00 272.12,32640.00 272.12,32630.49 294.25,32630.49 294.25,32623.36 316.37,32623.36 316.37,32618.44 338.49,32618.44 338.49,32615.03 360.61,32615.03 360.61,32612.67 382.74,32612.67 382.74,32611.04 404.86,32611.04 404.86,32609.92 426.98,32609.92 426.98,32609.14 449.10,32609.14 449.10,32608.60 471.23,32608.60 471.23,32608.23 493.35,32608.23 493.35,32607.97 515.47,32607.97 515.47,32607.79 537.59,32607.79 537.59,32607.67 559.72,32607.67 559.72,32607.58 581.84,32607.58 581.84,32607.52 603.96,32607.52 603.96,32607.48 626.09,32607.48 626.09,32607.46 648.21,32607.46 648.21,32607.44 670.33,32607.44 670.33,32607.42 692.45,32607.42 692.45,32607.41 714.58,32607.41 714.58,32607.41 736.70,32607.41 736.70,32607.40 758.82,32607.40 758.82,32607.40 780.94,32607.40 780.94,32607.40 803.07,32607.40 803.07,32607.40 825.19,32607.40 825.19,32607.39 847.31,32607.39 847.31,32607.39 869.43,32607.39 869.43,32607.39 891.56,32607.39 891.56,32607.39 913.68,32607.39 913.68,32607.39 935.80,32607.39 935.80,32607.39 957.93,32607.39 957.93,32607.39 980.05,32607.39 980.05,32607.39 1002.17,32607.39 1002.17,32607.39 1024.29,32607.39 1024.29,32607.39 1046.42,32607.39 1046.42,32607.39 1068.54,32607.39 1068.54,32607.39 1090.66,32607.39 1090.66,32607.39 1112.78,32607.39 1112.78,32607.39 1134.91,32607.39 1134.91,32607.39 1157.03,32607.39 1157.03,32607.39 1179.15,32607.39 1179.15,32607.39 1201.27,32607.39 1201.27,32607.39 1223.40,32607.39 1223.40,32607.39 1245.52,32607.39 1245.52,32607.39 1267.64,32607.39 1267.64,32607.39 1289.77,32607.39 1289.77,32607.39 1311.89,32607.39 1311.89,32607.39 1334.01,32607.39 1334.01,32607.39 1356.13,32607.39 1356.13,32607.39 1378.26,32607.39 1378.26,32607.39 1400.38,32607.39 1400.38,32607.39 1422.50,32607.39 1422.50,32607.39 1444.62,32607.39 1444.62,32607.39 1466.75,32607.39 1466.75,32607.39 1488.87,32607.39 1488.87,32607.39 1510.99,32607.39 1510.99,32607.39 1533.11,32607.39 1533.11,32607.39 1555.24,32607.39 1555.24,32607.39 1577.36,32607.39 1577.36,32607.39" fill="none" stroke="#7aa7d9" stroke-width="1.6" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<text x="250.0" y="0.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="1" fill="#111" text-anchor="start" font-weight="normal"></text>
|
||||||
|
<circle cx="272.1" cy="844.7" r="5.0" fill="#c1121f"/>
|
||||||
|
<text x="282.1" y="832.7" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#c1121f" text-anchor="start" font-weight="normal">越线 ⇒ 有车(大信号 Δf/f=+0.5%:第 1 窗即越线,t≈10.9 ms)</text>
|
||||||
|
<circle cx="404.9" cy="844.7" r="4.4" fill="#1f6fb2"/>
|
||||||
|
<text x="416.9" y="890.7" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#1f6fb2" text-anchor="start" font-weight="normal">小信号 Δf/f=+0.1%:≈2.2τ 才越线(t≈76 ms)—— τ 主导</text>
|
||||||
|
<rect x="1020.0" y="698.0" width="610.0" height="110.0" rx="6" fill="#fbfcfe" stroke="#0a58ca" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="1032.0" y="722.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="16" fill="#0a58ca" text-anchor="start" font-weight="bold">两种检测路径(同一条判据)</text>
|
||||||
|
<text x="1032.0" y="746.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">大信号(+0.5%):第 1 窗越线,窗内平均主导</text>
|
||||||
|
<text x="1032.0" y="767.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">小信号(+0.1%≈阈值):≈2.2τ≈78 ms,IIR 主导</text>
|
||||||
|
<text x="1032.0" y="788.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">⇒ 延迟 ≈ 窗平均(≤1 窗) + IIR + 输出节拍(50 ms)</text>
|
||||||
|
<text x="236.0" y="1046.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">B2 输出</text>
|
||||||
|
<text x="236.0" y="1064.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">FLAG_IN / 脉冲</text>
|
||||||
|
<line x1="250.0" y1="1072.0" x2="1470.0" y2="1072.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<polyline points="250.00,1072.00 250.00,1046.00 351.67,1046.00 453.33,1046.00 555.00,1046.00 656.67,1046.00 758.33,1046.00 860.00,1046.00 961.67,1046.00 1063.33,1046.00 1165.00,1046.00 1266.67,1046.00 1368.33,1046.00" fill="none" stroke="#666" stroke-width="1.2" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<line x1="250.0" y1="1046.0" x2="272.1" y2="1046.0" stroke="#666" stroke-width="1.6" opacity="1.00"/>
|
||||||
|
<polyline points="272.12,1072.00 272.12,1044.00 1288.79,1044.00 1288.79,1072.00" fill="none" stroke="#0a7d4b" stroke-width="2.2" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<text x="256.0" y="1100.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#0a7d4b" text-anchor="start" font-weight="normal">50 ms 主节拍(T1 ISR)量化:FLAG_IN 在下一拍被消费 ⇒ 输出起点 ≤ 越线+50 ms。绿=继电器脉冲输出(500 ms)</text>
|
||||||
|
<text x="28.0" y="1182.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="17" fill="#0a58ca" text-anchor="start" font-weight="bold">③ 宏观:基线 Origin 的块平均(0 ~ 12 s)</text>
|
||||||
|
<line x1="250.0" y1="1348.0" x2="1470.0" y2="1348.0" stroke="#888" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<line x1="250.0" y1="1348.0" x2="250.0" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="250.0" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">0</text>
|
||||||
|
<line x1="453.3" y1="1348.0" x2="453.3" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="453.3" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">2 s</text>
|
||||||
|
<line x1="656.7" y1="1348.0" x2="656.7" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="656.7" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">4 s</text>
|
||||||
|
<line x1="860.0" y1="1348.0" x2="860.0" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="860.0" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">6 s</text>
|
||||||
|
<line x1="1063.3" y1="1348.0" x2="1063.3" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1063.3" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">8 s</text>
|
||||||
|
<line x1="1266.7" y1="1348.0" x2="1266.7" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1266.7" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">10 s</text>
|
||||||
|
<line x1="1470.0" y1="1348.0" x2="1470.0" y2="1355.0" stroke="#888" stroke-width="1.0" opacity="1.00"/>
|
||||||
|
<text x="1470.0" y="1371.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#666" text-anchor="middle" font-weight="normal">12 s</text>
|
||||||
|
<text x="236.0" y="1353.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">时间</text>
|
||||||
|
<text x="236.0" y="1318.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="15" fill="#0b2c4d" text-anchor="end" font-weight="bold">C1 Origin</text>
|
||||||
|
<text x="236.0" y="1336.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="end" font-weight="normal">基线(块平均)</text>
|
||||||
|
<polyline points="250.00,32644.00 2462.27,32644.00 2462.27,32638.00 4674.53,32638.00 4674.53,32641.00 6886.80,32641.00 6886.80,32640.00 9099.07,32640.00 9099.07,32643.00 11311.33,32643.00 11311.33,32639.00 13523.60,32639.00 13523.60,32640.00 15735.87,32640.00 15735.87,32642.00 17948.13,32642.00 17948.13,32640.00 20160.40,32640.00 20160.40,32641.00 22372.67,32641.00 22372.67,32640.00 24584.93,32640.00 24584.93,32640.00" fill="none" stroke="#0a58ca" stroke-width="2.0" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<polyline points="250.00,32650.00 11577.70,32650.00 11577.70,32636.00 22905.40,32636.00 22905.40,32641.00" fill="none" stroke="#999" stroke-width="1.8" opacity="1.00" stroke-linejoin="round"/>
|
||||||
|
<line x1="250.0" y1="1295.5" x2="1470.0" y2="1295.5" stroke="#aaa" stroke-width="1.0" opacity="1.00" stroke-dasharray="4,4"/>
|
||||||
|
<circle cx="250.0" cy="1291.0" r="4.2" fill="#c1121f"/>
|
||||||
|
<text x="258.0" y="1340.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="13" fill="#c1121f" text-anchor="start" font-weight="normal">上电:Origin = 首窗单点(噪声最大)</text>
|
||||||
|
<text x="1476.0" y="1299.5" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#777" text-anchor="start" font-weight="normal">真值</text>
|
||||||
|
<text x="1476.0" y="1277.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#0a58ca" text-anchor="start" font-weight="normal">PD132T: 100 窗=1.088 s(蓝)</text>
|
||||||
|
<text x="1476.0" y="1299.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="12" fill="#888" text-anchor="start" font-weight="normal">PD136HA: 256 窗=5.571 s(灰)</text>
|
||||||
|
<text x="605.8" y="1206.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#0b2c4d" text-anchor="middle" font-weight="normal">块平均 ⇒ 基线跟踪是「阶梯式」,块内一直用上一块的均值;有车期间冻结并重新累计</text>
|
||||||
|
<rect x="28.0" y="1398.0" width="780.0" height="126.0" rx="6" fill="#fbfcfe" stroke="#0a58ca" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="40.0" y="1422.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="16" fill="#0a58ca" text-anchor="start" font-weight="bold">四条关系(讨论快慢时用「窗」最稳)</text>
|
||||||
|
<text x="40.0" y="1446.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">① t_Xn = 分频比/(边沿系数·f_coil):PD132T = 16/f、PD136HA = 32/f(随站点变,不是常数)</text>
|
||||||
|
<text x="40.0" y="1467.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">② Value = Σ(LPCNT 个 Xn) 是箱式积分(计数域降采样)⇒ Δf/f = 表值/65536 精确</text>
|
||||||
|
<text x="40.0" y="1488.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">③ τ/T = 256/α ⇒ α79 = 3.24 窗、α64 = 4.0 窗(与型号无关)</text>
|
||||||
|
<text x="40.0" y="1509.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">④ Origin = 块平均(100 / 256 窗),非滑动 ⇒ 基线粒度 = 1 块</text>
|
||||||
|
<rect x="830.0" y="1398.0" width="770.0" height="126.0" rx="6" fill="#fbfcfe" stroke="#0a58ca" stroke-width="1.2" opacity="1.00"/>
|
||||||
|
<text x="842.0" y="1422.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="16" fill="#0a58ca" text-anchor="start" font-weight="bold">PD136HA 对照(同站点、同 ÷32)</text>
|
||||||
|
<text x="842.0" y="1446.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">捕获:320 µs/次(单沿,整周期 32 个线圈周期);Xn₀ 同为 480 tick</text>
|
||||||
|
<text x="842.0" y="1467.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">窗:68 × 320 µs = 21.760 ms(标称上限 21.845)</text>
|
||||||
|
<text x="842.0" y="1488.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">τ(α64) = 87.0 ms = 4.0 窗;Origin = 256 窗 = 5.571 s</text>
|
||||||
|
<text x="842.0" y="1509.0" font-family="Noto Serif CJK SC, Noto Sans CJK SC, sans-serif" font-size="14" fill="#333" text-anchor="start" font-weight="normal">⇒ 全链时间 ×2(基线 ×5.1)—— 响应更慢但积分深度 ×2</text></svg>
|
||||||
|
After Width: | Height: | Size: 35 KiB |
@@ -16,6 +16,19 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 0.1 符号约定(先钉死,避免把曲线画反)
|
||||||
|
|
||||||
|
| 环节 | 车辆进入时的方向 |
|
||||||
|
|---|---|
|
||||||
|
| 线圈电感 `L` | **↓**(涡流去磁为主;铁磁体不改变结论方向) |
|
||||||
|
| 谐振频率 `f` | **↑**(`f = 1/(2π√(LC))`);典型 Δf/f = **+0.02% ~ +1%**,大车/深占压可达 **+5%** |
|
||||||
|
| 分频后周期 / `Xn`(`∝ 1/f`) | **↓** |
|
||||||
|
| `Value` / `CAPVD`(`∝ Xn`) | **↓** ⇒ 判据 `CAPVD < Origin − dlt` 取的正是**下降侧** ✓ |
|
||||||
|
| 测量窗时长(`∝ 1/f`) | **↓**(−0.02% ~ −4.8%) |
|
||||||
|
|
||||||
|
与交付报告一致的关系式:`CAPVD ≈ BASE·f₀/f` ⇒ `(Origin − CAPVD)/Origin ≈ Δf/f`(**车辆时 > 0**)✓
|
||||||
|
⇒ **"深占压"= 频率升高、窗长缩短**;旧稿"频偏 −5% ⇒ 窗 +5.3%"方向写反,2026-09-11 已改正(窗长公式 `∝ f₀/f_now` 本身对两个方向都成立,只是场景标注错了)。
|
||||||
|
|
||||||
## 1. 代码机理(PD132T / PD136HA 逐行同构)
|
## 1. 代码机理(PD132T / PD136HA 逐行同构)
|
||||||
|
|
||||||
```c
|
```c
|
||||||
@@ -173,6 +186,11 @@ Value / Origin = Xn₁ / Xn₀ ← 精确,r₀ 完全约掉 ✓
|
|||||||
|
|
||||||
## 9. 时序链详解:六个量的更新时间(2026-09-11 补,用户提出)
|
## 9. 时序链详解:六个量的更新时间(2026-09-11 补,用户提出)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> 矢量版(可放大/edit):`docs/img/timing-chain-pd132t.svg`(由 `tools/plot_timing_chain.py` 生成,纯 stdlib 手写 SVG;图中曲线按 §1~§4 公式**真算**而非示意):
|
||||||
|
> `python3 tools/plot_timing_chain.py && chromium --headless=new --disable-gpu --no-sandbox --default-background-color=FFFFFFFF --window-size=1680,1560 --screenshot=docs/img/timing-chain-pd132t.png file://$PWD/docs/img/timing-chain-pd132t.svg`
|
||||||
|
|
||||||
整条链是**三级降采样**:捕获级(每 `Xn` 一次)→ 窗级(每 `LPCNT` 次捕获一次)→ 基线级(每 100/256 窗一次)。
|
整条链是**三级降采样**:捕获级(每 `Xn` 一次)→ 窗级(每 `LPCNT` 次捕获一次)→ 基线级(每 100/256 窗一次)。
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ const uint16_t SensTable_1[4] = { 60, 32, 21, 14}; // 离开:分档与 PD1
|
|||||||
|
|
||||||
净效果:**进入/离开阈值双向对齐后,V4B 因确认机制反而比 PD132T 稳**(代价:进入/释放各慢 ~20~30ms)。
|
净效果:**进入/离开阈值双向对齐后,V4B 因确认机制反而比 PD132T 稳**(代价:进入/释放各慢 ~20~30ms)。
|
||||||
|
|
||||||
> ⚠ **2026-09-11 勘误**:PD132T 捕获时钟 = **3MHz**(旧稿 0.75MHz 无寄存器依据)⇒ 测量节拍 **10.92ms**(旧 43.7ms)、精确 τ(α79) **29.6ms**(旧口径 142ms)。本节 5 条对比中前两条的「快/密 4.4×」结论作废,改为「同量级」。**阈值/灵敏度口径不受影响**(与时钟无关)。⚠ 另:**测量节拍是区间** —— `LPCNT=⌊32768/Xn₀⌋` 整数除法 + 学习后冻结 ⇒ 标称 10.92ms 为**上限**,实际按站点线圈频率 −0.4%~−6.2%(100kHz 站点 10.88ms),深占压再 +5%;**Δf/f 口径同样不受影响**。详见 `docs/measurement-window-quantization.md`。推导见 `docs/pd136ha-to-dld154v4b-delivery-alignment.md` §2.3。
|
> ⚠ **2026-09-11 勘误**:PD132T 捕获时钟 = **3MHz**(旧稿 0.75MHz 无寄存器依据)⇒ 测量节拍 **10.92ms**(旧 43.7ms)、精确 τ(α79) **29.6ms**(旧口径 142ms)。本节 5 条对比中前两条的「快/密 4.4×」结论作废,改为「同量级」。**阈值/灵敏度口径不受影响**(与时钟无关)。⚠ 另:**测量节拍是区间** —— `LPCNT=⌊32768/Xn₀⌋` 整数除法 + 学习后冻结 ⇒ 标称 10.92ms 为**上限**,实际按站点线圈频率 −0.4%~−6.2%(100kHz 站点 10.88ms),深占压(Δf/f +5%)窗长 −4.8%;**Δf/f 口径同样不受影响**。详见 `docs/measurement-window-quantization.md`。推导见 `docs/pd136ha-to-dld154v4b-delivery-alignment.md` §2.3。
|
||||||
|
|
||||||
## 2. 触发/释放手感(存在输出 + 延时模式)
|
## 2. 触发/释放手感(存在输出 + 延时模式)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
| 2 | 硬件前端 | **完全同构**:线圈 → 9015 PNP×2 振荡 → CD4060 施密特整形 + **÷32(Q5)** → MCU | ✅ |
|
| 2 | 硬件前端 | **完全同构**:线圈 → 9015 PNP×2 振荡 → CD4060 施密特整形 + **÷32(Q5)** → MCU | ✅ |
|
||||||
| 3 | 线圈频段 | **两者覆盖同一频段 ≈23.4~118kHz** —— PD132T 走「3MHz **双沿**捕获(Xn = 半周期)」、PD136HA 走「1.5MHz **单沿**(Xn = 整周期)」,两项差异**恰好互相抵消**:判据常数 `C = 32·f_cap/边沿系数` **同为 4.8×10⁷** ⇒ 这就是两者 Xn 窗口常量几乎逐字相同(406~2050 vs 400~2030)的真正原因 | ⭐ 关键 |
|
| 3 | 线圈频段 | **两者覆盖同一频段 ≈23.4~118kHz** —— PD132T 走「3MHz **双沿**捕获(Xn = 半周期)」、PD136HA 走「1.5MHz **单沿**(Xn = 整周期)」,两项差异**恰好互相抵消**:判据常数 `C = 32·f_cap/边沿系数` **同为 4.8×10⁷** ⇒ 这就是两者 Xn 窗口常量几乎逐字相同(406~2050 vs 400~2030)的真正原因 | ⭐ 关键 |
|
||||||
| 4 | 归一化基数 | **同为 32768**(换 MCU 未重定标)⇒ 相对阈值 `表值/65536` 可**直接跨型号对比** | ✅ |
|
| 4 | 归一化基数 | **同为 32768**(换 MCU 未重定标)⇒ 相对阈值 `表值/65536` 可**直接跨型号对比** | ✅ |
|
||||||
| 5 | 测量节拍 | **10.88ms → 21.76ms**(100kHz 站点实测口径;标称上限 10.923/21.845ms)⇒ 每窗有效平均 1088 → **2176** 个线圈周期(积分深度 ×2)|⚠ 节拍**是区间**:按站点线圈频率浮动 0 ~ −6.2%,深占压再 +5%(见 `measurement-window-quantization.md`) | ⚖️ 权衡 |
|
| 5 | 测量节拍(端到端时序图见 `measurement-window-quantization.md` §9) | **10.88ms → 21.76ms**(100kHz 站点实测口径;标称上限 10.923/21.845ms)⇒ 每窗有效平均 1088 → **2176** 个线圈周期(积分深度 ×2)|⚠ 节拍**是区间**:按站点线圈频率浮动 0 ~ −6.2%,深占压(Δf/f +5%)窗长 −4.8%(见 `measurement-window-quantization.md`) | ⚖️ 权衡 |
|
||||||
| 6 | 滤波 / 基线 | IIR τ:**29.6~38ms → 76~87ms**(慢 2~2.9×);基线窗 **100 → 256**(1.09s → 5.59s) | ⚠ PD136HA 更稳更慢 |
|
| 6 | 滤波 / 基线 | IIR τ:**29.6~38ms → 76~87ms**(慢 2~2.9×);基线窗 **100 → 256**(1.09s → 5.59s) | ⚠ PD136HA 更稳更慢 |
|
||||||
| 7 | 判据强度 | 两者**均为单次越线判定**(无进入/离开确认计数)—— 响应快、抗单点扰动弱 | ⚖️ 相同 |
|
| 7 | 判据强度 | 两者**均为单次越线判定**(无进入/离开确认计数)—— 响应快、抗单点扰动弱 | ⚖️ 相同 |
|
||||||
| 8 | 灵敏度表 | **重标定**:进入 {300,60,32,21} → {162,81,54,28}。**档位一一照搬会产生 −46%~+69% 偏差** ⇒ 跨代必须按 Δf/f 重新对齐 | ❌ 不可照搬档位 |
|
| 8 | 灵敏度表 | **重标定**:进入 {300,60,32,21} → {162,81,54,28}。**档位一一照搬会产生 −46%~+69% 偏差** ⇒ 跨代必须按 Δf/f 重新对齐 | ❌ 不可照搬档位 |
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ CAPVD = LPCNT × Xn_分频后 = 32768 ← 与 N 无关
|
|||||||
| PD132L | **1.2MHz** = 12MHz/10 | `TIM1_PSCRL=0x09`(10 分频)+ 外部 12MHz 晶振(`CLK_ECKR`/`CLK_SWR=0xB4`,`CLK_CKDIVR&=0xF8` 无分频) | 27.3 ms |
|
| PD132L | **1.2MHz** = 12MHz/10 | `TIM1_PSCRL=0x09`(10 分频)+ 外部 12MHz 晶振(`CLK_ECKR`/`CLK_SWR=0xB4`,`CLK_CKDIVR&=0xF8` 无分频) | 27.3 ms |
|
||||||
| PD136HA | **1.5MHz** = XTH(12MHz)/8 ✅**已确认** | `enCntClkDiv = AdtClkPClk0Div8`(PCLK0/8)+ `CLK_INIT()`:`XTH_CR \|= 0x07`(作者注释「**8-16MHZ**,最强驱动」)→ 直取 XTH、**无 PLL / 无 HCLK_PRS·PCLK_PRS 分频** ⇒ PCLK0 = XTH = **12MHz**(**用户确认 2026-09-11:外部晶振也是 12M**);`Delay_ms` 1330 次/ms 亦印证 ~12MHz | **21.85 ms**(标称上限) |
|
| PD136HA | **1.5MHz** = XTH(12MHz)/8 ✅**已确认** | `enCntClkDiv = AdtClkPClk0Div8`(PCLK0/8)+ `CLK_INIT()`:`XTH_CR \|= 0x07`(作者注释「**8-16MHZ**,最强驱动」)→ 直取 XTH、**无 PLL / 无 HCLK_PRS·PCLK_PRS 分频** ⇒ PCLK0 = XTH = **12MHz**(**用户确认 2026-09-11:外部晶振也是 12M**);`Delay_ms` 1330 次/ms 亦印证 ~12MHz | **21.85 ms**(标称上限) |
|
||||||
|
|
||||||
> ⚠ **测量窗是区间,不是定值(2026-09-11 补,用户提出)**:`LPCNT = ⌊32768/Xn₀⌋` 是**整数除法且学习后冻结**,窗长 = `⌊32768/Xn₀⌋·Xn₁` 个 tick ⇒ 上表「测量窗」列全部为**标称上限**。实际 = 标称 × `(32768−r₀)/32768` × `f₀/f_now`(`r₀ = 32768 mod Xn₀`):100kHz 站点 **−0.39%**(PD132T 10.88ms / PD136HA 21.76ms)、60kHz 站点 −2.34%、带内最差 **−6.16%**(Xn₀=2050);深占压(频偏 −5%)再 +5.3%。**Δf/f 口径不受影响**(余数在分子分母约掉,`Value/Origin = Xn₁/Xn₀` 精确)。⚠ 另:`loop1_LPCNT` 为 **`INT8U`** ⇒ 需 `Xn>129`,而 PD136HA 的频率窗口已注释 ⇒ **8 位保护消失**(异常线圈可能报"堵车"而非"故障")。详见 `docs/measurement-window-quantization.md`。
|
> ⚠ **测量窗是区间,不是定值(2026-09-11 补,用户提出)**:`LPCNT = ⌊32768/Xn₀⌋` 是**整数除法且学习后冻结**,窗长 = `⌊32768/Xn₀⌋·Xn₁` 个 tick ⇒ 上表「测量窗」列全部为**标称上限**。实际 = 标称 × `(32768−r₀)/32768` × `f₀/f_now`(`r₀ = 32768 mod Xn₀`):100kHz 站点 **−0.39%**(PD132T 10.88ms / PD136HA 21.76ms)、60kHz 站点 −2.34%、带内最差 **−6.16%**(Xn₀=2050);深占压(车辆 Δf/f ≈ **+5%**,频率升高)窗长再 **−4.8%**(⚠ 符号见 `measurement-window-quantization.md` §0.1)。**Δf/f 口径不受影响**(余数在分子分母约掉,`Value/Origin = Xn₁/Xn₀` 精确)。⚠ 另:`loop1_LPCNT` 为 **`INT8U`** ⇒ 需 `Xn>129`,而 PD136HA 的频率窗口已注释 ⇒ **8 位保护消失**(异常线圈可能报"堵车"而非"故障")。详见 `docs/measurement-window-quantization.md`。
|
||||||
>
|
>
|
||||||
> ⚠ **本轮勘误**:专项文档 `hardware-loop-frontend-pd132t-vs-v4b.md` 旧记 PD132T 捕获时钟 **0.75MHz / 测量窗 43.7ms ⇒ 修正为 3MHz / 10.92ms**。
|
> ⚠ **本轮勘误**:专项文档 `hardware-loop-frontend-pd132t-vs-v4b.md` 旧记 PD132T 捕获时钟 **0.75MHz / 测量窗 43.7ms ⇒ 修正为 3MHz / 10.92ms**。
|
||||||
> 0.75MHz 系早期误按「T0 走 SYSCLK/4」(旧表写 `12M/4/4`)推算;实配 `AUXR=0xC0`(T0x12=1 → T0 走 SYSCLK/1)⇒ PCA 时钟 = SYSCLK/4 = 3MHz,作者注释 `//溢出供PCA时钟,时钟/4` 亦指此,并被 T1 的 5ms 定时反证(60000 计数 ÷ 5ms = 12MHz = SYSCLK)。
|
> 0.75MHz 系早期误按「T0 走 SYSCLK/4」(旧表写 `12M/4/4`)推算;实配 `AUXR=0xC0`(T0x12=1 → T0 走 SYSCLK/1)⇒ PCA 时钟 = SYSCLK/4 = 3MHz,作者注释 `//溢出供PCA时钟,时钟/4` 亦指此,并被 T1 的 5ms 定时反证(60000 计数 ÷ 5ms = 12MHz = SYSCLK)。
|
||||||
|
|||||||
@@ -0,0 +1,278 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""端到端时序图生成器(PD132T 主图,PD136HA 对照)—— 纯 stdlib 手写 SVG
|
||||||
|
|
||||||
|
输出:docs/img/timing-chain-pd132t.svg
|
||||||
|
转 PNG(仓库外,供 IM 预览):
|
||||||
|
chromium --headless=new --disable-gpu --no-sandbox \
|
||||||
|
--screenshot=out.png --window-size=1680,1320 --default-background-color=FFFFFFFF \
|
||||||
|
file:///abs/path/timing-chain-pd132t.svg
|
||||||
|
|
||||||
|
图中所有曲线都是按 §9 的公式真算的,不是示意画:
|
||||||
|
窗结账 = LPCNT 个 Xn 之和;CAPVD 为 79/256 一阶 IIR;判据 = CAPVD < Origin − floor(Origin·表值/65536)
|
||||||
|
"""
|
||||||
|
import math
|
||||||
|
|
||||||
|
# ---------- 站点参数(PD132T @ 100kHz) ----------
|
||||||
|
F_CAP = 3.0e6 # 捕获时钟 Hz(官方手册直证:SYSCLK/4)
|
||||||
|
F_COIL = 100e3 # 线圈频率 Hz(站点)
|
||||||
|
DIVIDER = 32 # CD4060 ÷32(Q5)
|
||||||
|
EDGE = 2 # 双沿捕获(CCAPM1=0x31)
|
||||||
|
BASE = 32768
|
||||||
|
SENS_ENTER = 60 # 档1 进入表值(/65536)
|
||||||
|
ALFA = 79 # Flt_Reg(FLT 拨码 OFF)
|
||||||
|
DF_REL = 0.5e-3 # 车辆引起的相对频偏(0.5%,实际车型量级)
|
||||||
|
|
||||||
|
XN0 = round(DIVIDER * F_CAP / (EDGE * F_COIL)) # 480 tick @100kHz
|
||||||
|
OUT = 'docs/img/timing-chain-pd132t.svg'
|
||||||
|
LPCNT = BASE // XN0
|
||||||
|
WIN_TICKS = LPCNT * XN0
|
||||||
|
T_XN = XN0 / F_CAP
|
||||||
|
T_WIN = WIN_TICKS / F_CAP
|
||||||
|
TAU = T_WIN * 256.0 / ALFA
|
||||||
|
ORIGIN = WIN_TICKS
|
||||||
|
DLT = (ORIGIN * SENS_ENTER) >> 16
|
||||||
|
XN1 = round(XN0 / (1 - DF_REL))
|
||||||
|
VALUE_CAR = LPCNT * XN1
|
||||||
|
T_ENTER_TRUE = 0.6e-3 # 车辆真实进入时刻(窗内)
|
||||||
|
|
||||||
|
W, H = 1680, 1560
|
||||||
|
P = [] # SVG 片段
|
||||||
|
def add(s): P.append(s)
|
||||||
|
def esc(t): return t.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||||
|
def txt(x, y, s, size=15, fill='#111', anchor='start', weight='normal', fam='Noto Serif CJK SC, Noto Sans CJK SC, sans-serif'):
|
||||||
|
add('<text x="%.1f" y="%.1f" font-family="%s" font-size="%d" fill="%s" text-anchor="%s" font-weight="%s">%s</text>'
|
||||||
|
% (x, y, fam, size, fill, anchor, weight, esc(s)))
|
||||||
|
def line(x1, y1, x2, y2, stroke='#111', w=1.4, dash=None, op=1.0):
|
||||||
|
d = ' stroke-dasharray="%s"' % dash if dash else ''
|
||||||
|
add('<line x1="%.1f" y1="%.1f" x2="%.1f" y2="%.1f" stroke="%s" stroke-width="%.1f" opacity="%.2f"%s/>'
|
||||||
|
% (x1, y1, x2, y2, stroke, w, op, d))
|
||||||
|
def poly(pts, stroke='#0a58ca', w=1.8, fill='none', op=1.0):
|
||||||
|
s = ' '.join('%.2f,%.2f' % p for p in pts)
|
||||||
|
add('<polyline points="%s" fill="%s" stroke="%s" stroke-width="%.1f" opacity="%.2f" stroke-linejoin="round"/>'
|
||||||
|
% (s, fill, stroke, w, op))
|
||||||
|
def rect(x, y, w_, h_, fill='#fff', stroke='none', rx=4, op=1.0, sw=1.2):
|
||||||
|
add('<rect x="%.1f" y="%.1f" width="%.1f" height="%.1f" rx="%d" fill="%s" stroke="%s" stroke-width="%.1f" opacity="%.2f"/>'
|
||||||
|
% (x, y, w_, h_, rx, fill, stroke, sw, op))
|
||||||
|
def dot(x, y, r=3.0, fill='#c1121f'):
|
||||||
|
add('<circle cx="%.1f" cy="%.1f" r="%.1f" fill="%s"/>' % (x, y, r, fill))
|
||||||
|
def note(x, y, w_, h_, title, lines_, accent='#0a58ca'):
|
||||||
|
rect(x, y, w_, h_, fill='#fbfcfe', stroke=accent, rx=6, sw=1.2)
|
||||||
|
txt(x + 12, y + 24, title, 16, accent, weight='bold')
|
||||||
|
for i, s in enumerate(lines_):
|
||||||
|
txt(x + 12, y + 48 + i * 21, s, 14, '#333')
|
||||||
|
|
||||||
|
# ================= 真算:窗序列 / CAPVD / 判据 =================
|
||||||
|
def sim(df_rel, n_windows=60):
|
||||||
|
"""df_rel: 车辆引起的相对频升(>0)。返回 (t_s, Value, CAPVD) 逐窗列表。"""
|
||||||
|
f1 = F_COIL * (1 + df_rel)
|
||||||
|
xn1 = DIVIDER * F_CAP / (EDGE * f1)
|
||||||
|
value_car = LPCNT * xn1
|
||||||
|
thr = ORIGIN - DLT
|
||||||
|
out, capvd = [], float(ORIGIN)
|
||||||
|
for n in range(n_windows):
|
||||||
|
frac = 1.0 if n >= 1 else max(0.0, (T_WIN - T_ENTER_TRUE) / T_WIN)
|
||||||
|
v = WIN_TICKS + frac * (value_car - WIN_TICKS)
|
||||||
|
capvd = capvd + (v - capvd) * ALFA / 256.0
|
||||||
|
out.append(((n + 1) * T_WIN, v, capvd))
|
||||||
|
cross = next((i for i, (_, _, c) in enumerate(out) if c < thr), None)
|
||||||
|
return out, thr, (None if cross is None else (cross + 1) * T_WIN)
|
||||||
|
|
||||||
|
big, THR, T_CROSS = sim(0.005) # 大信号 Δf/f = +0.5%
|
||||||
|
sml, _, T_CROSS_S = sim(0.001) # 小信号 Δf/f = +0.1%
|
||||||
|
|
||||||
|
# ================= 画布与坐标 =================
|
||||||
|
X0, X1 = 250.0, 1470.0
|
||||||
|
add('<rect width="%d" height="%d" fill="#ffffff"/>' % (W, H))
|
||||||
|
txt(28, 44, 'PD132T 端到端时序图(检测通道:线圈 → CD4060 ÷32 → PCA 捕获 → 窗结账 → IIR → 基线 → 继电器)', 21, '#0b2c4d', weight='bold')
|
||||||
|
txt(28, 70, '站点:线圈 100 kHz / 捕获时钟 3 MHz(12MHz÷4,官方手册直证)/ Xn₀=480 tick / LPCNT=68 / 窗=32640 tick=10.88 ms / α=79(τ=35.3 ms) / 进入档1=60(0.0916%Δf/f)', 14, '#555')
|
||||||
|
note(1170, 20, 470, 62, '三段横轴(跨 6 个数量级,非线性)',
|
||||||
|
['① 微观 0~11.2 ms(一个窗) ② 中观 0~0.6 s(检测到输出)', '③ 宏观 0~12 s(基线块平均 / 上电学习)'])
|
||||||
|
|
||||||
|
def axis(y, t0, t1, label, ticks, sub=None):
|
||||||
|
line(X0, y, X1, y, '#888', 1.2)
|
||||||
|
for t, s in ticks:
|
||||||
|
x = X0 + (t - t0) / (t1 - t0) * (X1 - X0)
|
||||||
|
line(x, y, x, y + 7, '#888', 1.0)
|
||||||
|
txt(x, y + 23, s, 13, '#666', anchor='middle')
|
||||||
|
txt(X0 - 14, y + 5, label, 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
if sub:
|
||||||
|
txt(X0 - 14, y + 24, sub, 12.5, '#777', anchor='end')
|
||||||
|
return lambda t: X0 + (t - t0) / (t1 - t0) * (X1 - X0)
|
||||||
|
|
||||||
|
# ---------------- 面板 A:一个窗(微观) ----------------
|
||||||
|
ya, TA = 108.0, 11.2e-3
|
||||||
|
txt(28, ya + 12, '① 微观:一个测量窗(0 ~ 11.2 ms)', 17, '#0a58ca', weight='bold')
|
||||||
|
mx = axis(ya + 520, 0, TA, '时间', [(0, '0'), (2e-3, '2 ms'), (4e-3, '4 ms'), (6e-3, '6 ms'), (8e-3, '8 ms'), (10e-3, '10 ms'), (TA, '11.2 ms')])
|
||||||
|
|
||||||
|
# A1 线圈频率(车辆 ⇒ 频率升高)
|
||||||
|
yb = ya + 60
|
||||||
|
poly([(X0, yb + 26), (mx(T_ENTER_TRUE), yb + 26), (mx(T_ENTER_TRUE), yb + 14), (X1, yb + 14)], '#c1121f', 2.0)
|
||||||
|
line(X0 - 14, yb + 26, X0 + 4, yb + 26, '#c1121f', 1.0, dash='3,3')
|
||||||
|
txt(X1 + 6, yb + 20, '线圈谐振频率', 13.5, '#c1121f')
|
||||||
|
txt(X0 - 14, yb, 'A1 线圈 f', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, yb + 20, '100.000 kHz', 12.5, '#777', anchor='end')
|
||||||
|
txt(mx(T_ENTER_TRUE) + 10, yb - 4, '车辆进入(0.6 ms):L↓ ⇒ f↑ +0.5% ⇒ 周期↓、Xn↓', 14, '#c1121f')
|
||||||
|
|
||||||
|
# A2 P23 方波 + 捕获点
|
||||||
|
yc = ya + 150
|
||||||
|
t_in0, t_in1 = XN0 / F_CAP * EDGE / EDGE, XN0 / F_CAP # 半周期 = 160µs
|
||||||
|
pts, t, lvl = [(X0, yc + 26)], 0.0, 26
|
||||||
|
H2 = 26
|
||||||
|
while t < TA:
|
||||||
|
t2 = t + t_in1
|
||||||
|
xa2, xb2 = mx(t), mx(min(t2, TA))
|
||||||
|
pts += [(xa2, yc + lvl), (xb2, yc + lvl)]
|
||||||
|
lvl = 0 if lvl else 26
|
||||||
|
t = t2
|
||||||
|
poly(pts, '#0a7d4b', 1.6)
|
||||||
|
ct = 0.0
|
||||||
|
while ct <= TA:
|
||||||
|
dot(mx(ct), yc + (26 if int(round(ct / t_in1)) % 2 == 0 else 0), 2.6, '#c1121f')
|
||||||
|
ct += t_in1
|
||||||
|
txt(X0 - 14, yc + 6, 'A2 P23 方波', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, yc + 26, '÷32 / 320 µs 周期', 12.5, '#777', anchor='end')
|
||||||
|
txt(X1 + 6, yc + 14, '绿=P23,红点=捕获点(双沿)', 13.5, '#0a7d4b')
|
||||||
|
line(mx(0.8e-3), yc + 30, mx(2.4e-3), yc + 30, '#c1121f', 1.2)
|
||||||
|
line(mx(0.8e-3), yc + 26, mx(0.8e-3), yc + 34, '#c1121f', 1.2)
|
||||||
|
line(mx(2.4e-3), yc + 26, mx(2.4e-3), yc + 34, '#c1121f', 1.2)
|
||||||
|
txt(mx(1.6e-3), yc + 50, 'Xn = 相邻捕获差 = 480 tick = 160 µs(= Xn/f_cap)', 13.5, '#c1121f', anchor='middle')
|
||||||
|
|
||||||
|
# A3 CapSum 累加台阶
|
||||||
|
yd0, yd1 = ya + 380, ya + 240
|
||||||
|
txt(X0 - 14, yd0, 'A3 CapSum', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, yd0 + 18, 'Σ Xn(tick)', 12.5, '#777', anchor='end')
|
||||||
|
line(X0, yd0, X1, yd0, '#aaa', 1.0, dash='4,4')
|
||||||
|
line(X0, yd1, X1, yd1, '#aaa', 1.0, dash='4,4')
|
||||||
|
txt(X1 + 6, yd1 + 4, '32768(BASE 标称)', 12.5, '#777')
|
||||||
|
txt(X1 + 6, yd0 + 4, '0', 12.5, '#777')
|
||||||
|
n_show = min(LPCNT, 68)
|
||||||
|
w_tot = X1 - X0
|
||||||
|
step_w = w_tot / n_show
|
||||||
|
acc, pts = 0, [(X0, yd0)]
|
||||||
|
for i in range(n_show):
|
||||||
|
acc += WIN_TICKS / LPCNT
|
||||||
|
yv = yd0 - (acc / BASE) * (yd0 - yd1)
|
||||||
|
pts += [(X0 + i * step_w, yv), (X0 + (i + 1) * step_w, yv)]
|
||||||
|
poly(pts, '#e07b00', 1.8)
|
||||||
|
line(X0 + w_tot * 0.02, yd0 + 30, X0 + w_tot * 0.96, yd0 + 30, '#e07b00', 1.2)
|
||||||
|
txt(X0 + 8, yd1 - 14, '每 160 µs 累加一次 Xn(共 68 级台阶)⇒ CapCnt≥LPCNT 时「窗结账」', 14, '#a35b00')
|
||||||
|
dot(X1, yd1, 4.5, '#c1121f')
|
||||||
|
txt(X0 + 8, ya + 506, '窗结账:Value = Σ(68 个 Xn) = 32640 ⇒ CAP_OK=1 ⇒ 主循环随即调用 VD1_TASK()', 14, '#c1121f')
|
||||||
|
|
||||||
|
# A4 Value 台阶
|
||||||
|
ye = ya + 440
|
||||||
|
poly([(X0, ye), (X1 * 0 + mx(10.88e-3), ye), (mx(10.88e-3), ye + 34), (X1, ye + 34)], '#0a58ca', 2.0)
|
||||||
|
line(X0, ye, X1, ye, '#aaa', 1.0, dash='4,4')
|
||||||
|
txt(X0 - 14, ye, 'A4 Value', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, ye + 20, '每窗更新一次', 12.5, '#777', anchor='end')
|
||||||
|
txt(X1 + 6, ye + 4, 'Origin 基准 32640', 12.5, '#0a58ca')
|
||||||
|
txt(X1 + 6, ye + 38, '车后 32486(−0.5%)', 12.5, '#0a58ca')
|
||||||
|
txt(mx(10.88e-3) - 12, ye - 12, '窗边界 10.88 ms(本窗只含 0.6~10.88 ms ⇒ 部分反映)', 14, '#0a58ca', anchor='end')
|
||||||
|
txt(X0 + 640, yd1 - 46, '窗 = LPCNT·Xn / f_cap = ⌊32768/Xn₀⌋·Xn / f_cap = 68 × 480 / 3 MHz = 10.880 ms(标称上限)', 14, '#0b2c4d', weight='bold')
|
||||||
|
|
||||||
|
# ---------------- 面板 B:中观(检测与输出) ----------------
|
||||||
|
ybz = ya + 560
|
||||||
|
txt(28, ybz + 14, '② 中观:检测延迟与输出(0 ~ 600 ms) 车辆进入 @0.6 ms', 17, '#0a58ca', weight='bold')
|
||||||
|
TB = 0.6
|
||||||
|
mb = axis(ybz + 430, 0, TB, '时间', [(0, '0'), (0.1, '100 ms'), (0.2, '200 ms'), (0.3, '300 ms'), (0.4, '400 ms'), (0.5, '500 ms'), (TB, '600 ms')])
|
||||||
|
ycap0, ycap1 = ybz + 330, ybz + 130 # CAPVD 纵轴:32660 → 32450
|
||||||
|
def ycap(v): return ycap0 - (v - 32450) / (32660 - 32450) * (ycap0 - ycap1)
|
||||||
|
txt(X0 - 14, ycap0, 'B1 CAPVD', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, ycap0 + 18, 'IIR 平滑值', 12.5, '#777', anchor='end')
|
||||||
|
line(X0, ycap(ORIGIN), X1, ycap(ORIGIN), '#0a58ca', 1.2, dash='6,4')
|
||||||
|
txt(X1 + 6, ycap(ORIGIN) + 4, 'Origin 32640(基线)', 12.5, '#0a58ca')
|
||||||
|
line(X0, ycap(THR), X1, ycap(THR), '#c1121f', 1.4, dash='6,4')
|
||||||
|
txt(X1 + 6, ycap(THR) + 4, '判据线 32611(−dlt=29 / 0.0916%)', 12.5, '#c1121f')
|
||||||
|
def stair(seq, col, wd=1.9):
|
||||||
|
pts, prev = [], None
|
||||||
|
for i, (t, c) in enumerate(seq):
|
||||||
|
x = mb(t)
|
||||||
|
if prev is not None:
|
||||||
|
pts += [(x, prev), (x, c)]
|
||||||
|
else:
|
||||||
|
pts += [(X0, c)] if False else [(x, c)]
|
||||||
|
prev = c
|
||||||
|
poly(pts, col, wd)
|
||||||
|
stair([(0.0, ORIGIN)] + [(t, c) for t, _, c in big], '#c1121f', 2.0)
|
||||||
|
stair([(0.0, ORIGIN)] + [(t, c) for t, _, c in sml], '#7aa7d9', 1.6)
|
||||||
|
txt(mx(0) + 0, 0, '', 1)
|
||||||
|
if T_CROSS:
|
||||||
|
xc = mb(T_CROSS)
|
||||||
|
dot(xc, ycap(THR), 5.0, '#c1121f')
|
||||||
|
txt(xc + 10, ycap(THR) - 12, '越线 ⇒ 有车(大信号 Δf/f=+0.5%%:第 1 窗即越线,t≈%.1f ms)' % (T_CROSS * 1e3), 14, '#c1121f')
|
||||||
|
if T_CROSS_S:
|
||||||
|
xs = mb(T_CROSS_S)
|
||||||
|
dot(xs, ycap(THR), 4.4, '#1f6fb2')
|
||||||
|
txt(xs + 12, ycap(THR) + 46, '小信号 Δf/f=+0.1%%:≈2.2τ 才越线(t≈%.0f ms)—— τ 主导' % (T_CROSS_S * 1e3), 14, '#1f6fb2')
|
||||||
|
note(1020, ybz + 30, 610, 110, '两种检测路径(同一条判据)', [
|
||||||
|
'大信号(+0.5%):第 1 窗越线,窗内平均主导',
|
||||||
|
'小信号(+0.1%≈阈值):≈2.2τ≈78 ms,IIR 主导',
|
||||||
|
'⇒ 延迟 ≈ 窗平均(≤1 窗) + IIR + 输出节拍(50 ms)'])
|
||||||
|
yt = ybz + 370
|
||||||
|
txt(X0 - 14, yt + 8, 'B2 输出', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, yt + 26, 'FLAG_IN / 脉冲', 12.5, '#777', anchor='end')
|
||||||
|
line(X0, yt + 34, X1, yt + 34, '#888', 1.0)
|
||||||
|
tp = 0.0
|
||||||
|
pts = [(X0, yt + 34)]
|
||||||
|
while tp < TB:
|
||||||
|
x1_, x2_ = mb(tp), mb(min(tp + 0.05, TB))
|
||||||
|
pts += [(x1_, yt + 8), (x2_, yt + 8)]
|
||||||
|
tp += 0.05
|
||||||
|
x3_ = mb(min(tp, TB))
|
||||||
|
pts += [(x2_, yt + 8), (x2_, yt + 34)] if x2_ != x3_ else []
|
||||||
|
tp += 0.05
|
||||||
|
poly(pts, '#666', 1.2)
|
||||||
|
line(X0, yt + 8, mb(T_CROSS or 0.05), yt + 8, '#666', 1.6)
|
||||||
|
x_out = mb((T_CROSS or 0.05) + 0.05)
|
||||||
|
poly([(mb(T_CROSS or 0.05), yt + 34), (mb(T_CROSS or 0.05), yt + 6), (mb((T_CROSS or 0.05) + 0.5), yt + 6), (mb((T_CROSS or 0.05) + 0.5), yt + 34)], '#0a7d4b', 2.2)
|
||||||
|
txt(mb(0.0) + 6, yt + 62, '50 ms 主节拍(T1 ISR)量化:FLAG_IN 在下一拍被消费 ⇒ 输出起点 ≤ 越线+50 ms。绿=继电器脉冲输出(500 ms)', 14, '#0a7d4b')
|
||||||
|
|
||||||
|
# ---------------- 面板 C:宏观(基线) ----------------
|
||||||
|
yc2 = ybz + 500
|
||||||
|
txt(28, yc2 + 14, '③ 宏观:基线 Origin 的块平均(0 ~ 12 s)', 17, '#0a58ca', weight='bold')
|
||||||
|
TC = 12.0
|
||||||
|
mc = axis(yc2 + 180, 0, TC, '时间', [(0, '0'), (2, '2 s'), (4, '4 s'), (6, '6 s'), (8, '8 s'), (10, '10 s'), (12, '12 s')])
|
||||||
|
yB0, yB1 = yc2 + 150, yc2 + 60
|
||||||
|
def yb_(v): return yB0 - (v - 32620) / (32700 - 32620) * (yB0 - yB1)
|
||||||
|
txt(X0 - 14, yB0, 'C1 Origin', 15, '#0b2c4d', anchor='end', weight='bold')
|
||||||
|
txt(X0 - 14, yB0 + 18, '基线(块平均)', 12.5, '#777', anchor='end')
|
||||||
|
seqT, x_ = [], 0.0
|
||||||
|
vals = [32644, 32638, 32641, 32640, 32643, 32639, 32640, 32642, 32640, 32641, 32640, 32640]
|
||||||
|
while x_ < TC:
|
||||||
|
seqT.append((x_, vals[min(int(x_ / 1.088), len(vals) - 1)]))
|
||||||
|
x_ += 1.088
|
||||||
|
stair(seqT, '#0a58ca', 2.0)
|
||||||
|
seqH, x_ = [], 0.0
|
||||||
|
valsH = [32650, 32636, 32641]
|
||||||
|
while x_ < TC:
|
||||||
|
seqH.append((x_, valsH[min(int(x_ / 5.571), 2)]))
|
||||||
|
x_ += 5.571
|
||||||
|
stair(seqH, '#999', 1.8)
|
||||||
|
line(X0, yb_(32640), X1, yb_(32640), '#aaa', 1.0, dash='4,4')
|
||||||
|
dot(X0, yb_(32644), 4.2, '#c1121f')
|
||||||
|
txt(X0 + 8, yB0 + 22, '上电:Origin = 首窗单点(噪声最大)', 13.5, '#c1121f')
|
||||||
|
txt(X1 + 6, yb_(32640) + 4, '真值', 12.5, '#777')
|
||||||
|
txt(X1 + 6, yb_(32644) - 14, 'PD132T: 100 窗=1.088 s(蓝)', 12.5, '#0a58ca')
|
||||||
|
txt(X1 + 6, yb_(32644) + 8, 'PD136HA: 256 窗=5.571 s(灰)', 12.5, '#888')
|
||||||
|
txt(mc(3.5), yB1 - 22, '块平均 ⇒ 基线跟踪是「阶梯式」,块内一直用上一块的均值;有车期间冻结并重新累计', 14, '#0b2c4d', anchor='middle')
|
||||||
|
|
||||||
|
# ---------------- 页脚:四条关系 ----------------
|
||||||
|
note(28, yc2 + 230, 780, 126, '四条关系(讨论快慢时用「窗」最稳)', [
|
||||||
|
'① t_Xn = 分频比/(边沿系数·f_coil):PD132T = 16/f、PD136HA = 32/f(随站点变,不是常数)',
|
||||||
|
'② Value = Σ(LPCNT 个 Xn) 是箱式积分(计数域降采样)⇒ Δf/f = 表值/65536 精确',
|
||||||
|
'③ τ/T = 256/α ⇒ α79 = 3.24 窗、α64 = 4.0 窗(与型号无关)',
|
||||||
|
'④ Origin = 块平均(100 / 256 窗),非滑动 ⇒ 基线粒度 = 1 块'])
|
||||||
|
note(830, yc2 + 230, 770, 126, 'PD136HA 对照(同站点、同 ÷32)', [
|
||||||
|
'捕获:320 µs/次(单沿,整周期 32 个线圈周期);Xn₀ 同为 480 tick',
|
||||||
|
'窗:68 × 320 µs = 21.760 ms(标称上限 21.845)',
|
||||||
|
'τ(α64) = 87.0 ms = 4.0 窗;Origin = 256 窗 = 5.571 s',
|
||||||
|
'⇒ 全链时间 ×2(基线 ×5.1)—— 响应更慢但积分深度 ×2'])
|
||||||
|
|
||||||
|
svg = ('<svg xmlns="http://www.w3.org/2000/svg" width="%d" height="%d" viewBox="0 0 %d %d">' % (W, H, W, H)
|
||||||
|
+ '\n'.join(P) + '</svg>\n')
|
||||||
|
open(OUT, 'w', encoding='utf-8').write(svg)
|
||||||
|
print('written %s (%d bytes)' % (OUT, len(svg)))
|
||||||
|
print('XN0=%d LPCNT=%d WIN=%d tick T_WIN=%.3f ms T_XN=%.4f ms TAU=%.2f ms DLT=%d THR=%d T_CROSS=%.3f ms'
|
||||||
|
% (XN0, LPCNT, WIN_TICKS, T_WIN * 1e3, T_XN * 1e3, TAU * 1e3, DLT, THR, (T_CROSS or 0) * 1e3))
|
||||||
|
|
||||||
Reference in New Issue
Block a user