From 9590cfd35bcafedbe800926a446fb921f8e9a792 Mon Sep 17 00:00:00 2001 From: dsh Date: Fri, 20 Nov 2026 16:54:32 +0800 Subject: [PATCH] mechanics: a VCR drum works as a spindle, and the numbers say only the delay line is fast enough to be a daily machine Size first, since that is the constraint. A VHS head drum is 62 mm across and spins at 1500 rpm with its own direct drive motor and a very good bearing, so it is usable -- but as a spindle, not as a medium: its own heads are for tape, and the video tape transport is exactly the complexity we do not want. Strip the heads, glue an annulus of floppy media onto the upper drum, and put two fixed heads (cassette or stripe heads) at the rim: at 62 mm one cell is 3.0 mm of circumference, so the heads can be crude and the read-modify-write pair sits 3 mm apart with no machining. A dead 2.5 inch hard disk spindle is cheaper and spins five times faster, with a floppy head (100 um track) parked open loop over a disc of floppy media. What that costs in practice is now measured rather than guessed. The 8 bit calculator session is 166348 steps: 65311 forward pointer moves and 65278 backward ones. On a 25 rev/s drum a forward move waits one cell (625 us) but a backward move waits 64-k cells, about 38 ms for the usual k, so a session is 41 minutes and the flagship tape 23 minutes. hello is 0.3 seconds. A magnetostrictive delay line has a full revolution of 0.5 ms instead of 40 ms: the same session is 32 s and the flagship 18 s, because its backward move waits at most one revolution. So the drum is an exhibit machine, and the delay line is the only mechanical memory that can be used interactively -- both because of the same property, how long one lap takes. Also recorded: what the drum needs besides the mechanism -- an index pulse, a 64x clock resynchronised to it every revolution, a plain FM channel (one clock transition per cell plus a data transition for a 1) read with a windowed latch, and the second head for read-modify-write. --- hardware/mechanics.md | 44 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/hardware/mechanics.md b/hardware/mechanics.md index 232a18c..3fe87b8 100644 --- a/hardware/mechanics.md +++ b/hardware/mechanics.md @@ -22,8 +22,8 @@ ### 2.1 `dp` 怎么做成机械 ★★★ -这是最值钱的一项:`>`/`<` 占全部步数的 **71~73%**(`tape_run --profile` 实测),也就是说这 -台机器**大部分时间在移动指针**。把它做成机械的,机器就真的在"咔哒咔哒"地走格子。 +这是最值钱的一项:`>`/`<` 占全部步数的 **78%**(8 位实测:39.3% + 39.2%;11 位是 71~73%), +也就是说这台机器**大部分时间在移动指针**。把它做成机械的,机器就真的在"咔哒咔哒"地走格子。 **先回答一个问题:数据环是电子的(6116),那 `dp` 机械起来是什么意思?** @@ -53,6 +53,46 @@ 如果手感不够、想要"记忆本身也是机械的",再上 **C**(比 B 便宜一个数量级,而且是真正的 "环"),B 留给"必须有个转动的鼓"的场合。 +#### B 的鼓从哪来(尺寸优先) + +| 件 | 直径 | 转速 | 一格 | `+`/`-` 读改写 | 评价 | +|---|---|---|---|---|---| +| **录像机磁鼓(上鼓)** | **φ62 mm** | 1500 rpm(25 圈/秒,可自己驱动加减速) | 625 µs | 周长 195 mm / 64 = **3.0 mm** 一格 ✓ 很宽松 | ✓ **能用,但只当"精密主轴"**:它自带直流电机和轴承;把磁环(软盘介质剪的圆环)粘在上鼓,**固定磁头**(收录机/磁条读头)贴在外圈 | +| **2.5" 硬盘主轴** | φ65 mm(盘片 2.5") | 4200~5400 rpm | 174 µs ✓ | 3.2 mm/格 ✓ | ✓✓ **最划算**:拆一个坏盘,留着主轴电机和底盘,粘一片软盘介质,用一个**软驱磁头**(磁道宽 ~100 µm,开环定位就够) | +| 3.5" 软驱整机 | ~90 mm 机架 | 300~360 rpm | 12.8 ms ✗ | 6 mm/格 | 慢 30 倍,除非你能改写它的主轴驱动 | +| 自制鼓 + 步进电机 | 任意 | 任意 | 任意 | 任意 | 机加工成本最高,灵活性最好 | + +**录像机磁鼓的关键点**:它自己的两个视频磁头是给**磁带**用的(螺旋扫描、贴带运行、旋转变压器 +耦合),**不要用**;我们要的是它的电机 + 轴承 + 上鼓这个"旋转平台"。拆掉/不管磁头,把上鼓 +当法兰盘:粘一圈软盘介质,外圈架两个固定磁头(相隔 3 mm,一个读一个写)。 + +**需要的电子件**(B 的真正工作量,不在鼓上): + +1. **索引脉冲**:上鼓贴一小块磁铁/反光片 + 霍尔/光电 → 每圈一个脉冲,用来复位相位计数器。 +2. **64× 时钟**:一个晶振分频到 64×圈频(25 圈/秒 → 1600 Hz × 64),每圈用索引脉冲**重新对齐** + (飞轮 + 相位校正,和磁盘控制器一个思路)。 +3. **读写通道**:用最朴素的 **FM 编码**(每格必有一个时钟跳变,写 1 时多一个数据跳变), + 读侧是磁头 → 前置放大 → 比较器 → 用第 2 条的时钟在窗口中间取样 ✓ 一个 D 触发器就够。 +4. **双磁头读改写**:读头读到一格后,数据传到写头(相隔 3 mm = 下一格),在这一格时间里 + 改好写回 —— 这就是"`+`/`-` 只要一格时间"的原理 ✓。 + +**必须先知道的一个坏消息**(数字来自实测的走位分布):`>`/`<` 占全部步数的 78%,而我们的 +代码是在**相邻格之间来回跳**(`.tp x` 然后 `.tp x-3`)。8 位计算器一次会话(`12 34 + .`, +166 348 步):`>` 65 311 次、`<` 65 278 次。转鼓上 `>` 只要等一格(625 µs),`<` 却要等 +**64-k 格**(k=1 时 ~39 ms): + +| 机器 | 计算器一次会话 | 全家桶 | `hello` | +|---|---|---|---| +| **B 转鼓**(25 圈/秒) | 65 278 × ~38 ms ≈ **41 分钟** ✗ | ~23 分钟 ✗ | 0.3 s ✓ | +| **C 延迟线**(512 bit @ 1 Mbit/s) | 65 278 × 0.49 ms ≈ **32 s** ✓ | ~18 s ✓ | 3 ms ✓ | + +1950 年代的程序员管这个叫 "optimum programming":**把数据故意摆成只往前跳**。同一招对我们也 +有效 —— 库里的格子在程序里是固定地址,理论上可以重排。但**交互使用**(计算器)在鼓上没救: +它天生就是来回跳。所以 B 的定位是**演示机**(跑 `hello`、`full_add`),C 才是"能日常用"的那 +一档 —— 差别全在"一圈有多长":鼓一圈 40 ms,延迟线一圈 0.5 ms。 + + + | A 用到的件 | 价格 | 说明 | |---|---|---| | **电话步进器(uniselector)** | ¥50~200 二手 | 64 位、棘轮 + 电磁驱动、**自带归位触点**;反向靠第二组电刷或倒转线圈 |