{"schema_version":1,"id":"bernhardfoelk-mechanical-clock","name":{"en":"Mechanical Clock","zh":"用 ESP32-S3 同时控制六个步进电机与霍尔传感器的机械时钟。"},"summary":{"en":"A mechanical HH:MM:SS clock with six Hall-referenced stepper motors, driven by a custom PLC-style non-blocking architecture on an ESP32-S3.","zh":"用 ESP32-S3 同时控制六个步进电机与霍尔传感器的机械时钟。"},"purpose":"stepper mechanical clock","tier":"community","author":"bernhardfoelk","repository":"https://github.com/bernhardfoelk/mechanical_clock","license":"MIT","shape":"robot","scenes":["art"],"boards":[{"name":"ESP32-S3"}],"native_board":{"en":"Waveshare ESP32-S3-Pico","zh":"微雪 ESP32-S3-Pico","page":"https://esp32gallery.com/boards/waveshare-boards/"},"motion":true,"hardware":{"en":"ESP32-S3. Verify the exact board revision, wiring and power requirements in the upstream build guide.","zh":"ESP32-S3；请在上游构建文档中核对具体板型、供电与接线。"},"notes":{"en":"Six digit wheels, one per HH:MM:SS character, each turned by a NEMA 17 stepper through a TMC2209 and zeroed by its own Hall sensor. An ESP32-S3 runs the whole thing as non-blocking function blocks in the style of IEC-61131-3, with hand-written `Ton`/`Tof` timers instead of `delay()`, so no missed step pulses. A modulo wrapper around AccelStepper always advances through the shortest positive path, and homing approaches the switch at reference speed, backs off, then closes in at a tenth of that. UART diagnostics were abandoned for plain STEP/DIR with MS1/MS2 strapping at 1/64. Status is honest: one wheel of the six is running.","zh":"六个数字轮，每个 HH:MM:SS 字符一个，各由一颗 NEMA 17 步进电机通过 TMC2209 驱动，再用自己的霍尔传感器找零点。ESP32-S3 上的程序按 IEC-61131-3 那套思路写成一个个非阻塞功能块，用自己的 Ton/Tof 延时和边沿检测代替 delay()，免得漏发脉冲。步进封装会把绝对角度换算成取模后的最短正向步数，数字轮永远不用倒转；回零分两段，先按参考速度找霍尔，退开一个角度再用十分之一速度贴上去。TMC2209 的 UART 诊断折腾过后放弃，改回 STEP/DIR 加 MS1/MS2 跳线做 1/64 细分。项目坦白：六个轮子目前只跑起来一个。"},"readme_excerpts":[{"label":"Motor","quote":"NEMA 17 steppers, 200 full steps/rev (1.8°), direct-drive — no gearbox"},{"label":"Driver","quote":"TMC2209 (STEP/DIR mode, MS1/MS2 microstepping)"},{"label":"Input","quote":"Hall-effect sensors (one per digit wheel, homing only)"},{"label":"Display","quote":"128×64 SSD1306 OLED (I²C)"},{"label":"Limit","quote":"one of six digit wheels is running"}],"images":{"type":"gallery","primary":"https://esp32gallery.com/previews/bernhardfoelk-mechanical-clock/poster.jpg","poster":"https://esp32gallery.com/previews/bernhardfoelk-mechanical-clock/poster.jpg","sources":["https://esp32gallery.com/previews/bernhardfoelk-mechanical-clock/frames/view-001.jpg","https://esp32gallery.com/previews/bernhardfoelk-mechanical-clock/frames/view-002.jpg","https://esp32gallery.com/previews/bernhardfoelk-mechanical-clock/frames/view-003.jpg"]},"media_credit":{"status":"upstream-project-media","creator":"bernhardfoelk","source":"https://github.com/bernhardfoelk/mechanical_clock/tree/f1a2234b503e64b888462456c2f6e009f6414730","note":{"en":"Screenshots from the upstream README. Code and firmware were not executed. License notices are included.","zh":"来自上游 README 的真实截图；未运行代码或固件，预览包保留许可证声明。"},"reviewed":"2026-10-20"},"preview":{"browser_playable":false,"kind":"media_gallery","label":{"en":"Project screenshots","zh":"项目截图"},"width":960,"height":720,"shape":"square","source_commit":"f1a2234b503e64b888462456c2f6e009f6414730"},"stars":0,"pushed_at":"2026-11-03T12:35:01Z","added_at":"2026-10-20T14:44:01+08:00","urls":{"html":"https://esp32gallery.com/projects/bernhardfoelk-mechanical-clock/","html_zh":"https://esp32gallery.com/zh/projects/bernhardfoelk-mechanical-clock/","json":"https://esp32gallery.com/data/catalog/projects/bernhardfoelk-mechanical-clock.json","markdown":"https://esp32gallery.com/data/catalog/projects/bernhardfoelk-mechanical-clock.md"}}
