[{"data":1,"prerenderedAt":322},["ShallowReactive",2],{"post-zh-engineering-driver-bridge-architecture":3,"header-article-translation-zh-engineering-driver-bridge-architecture":180,"trans-engineering-driver-architecture-zh":181},{"id":4,"title":5,"body":6,"category":150,"date":151,"description":152,"difficulty":153,"draft":154,"duration":153,"extension":155,"featured":154,"image":153,"layout":156,"locale":157,"meta":158,"navigation":159,"path":160,"references":161,"related":153,"section":173,"seo":174,"slug":175,"status":176,"stem":177,"tags":153,"translationKey":178,"updated":153,"video":153,"__hash__":179},"content\u002Fzh\u002Fengineering\u002Fdriver-bridge-architecture.md","Laetoly 驱动桥架构与 GRBL 硬件协议设计",{"type":7,"value":8,"toc":144},"minimark",[9,13,22,31,58,68,72,79,122,125],[10,11,12],"h2",{"id":12},"系统分层架构",[14,15,16,17,21],"p",{},"Laetoly 采用清晰的 ",[18,19,20],"strong",{},"云端\u002F网页工作台与本地计算控制解耦"," 架构：",[23,24,25],"blockquote",{},[14,26,27,30],{},[18,28,29],{},"状态：实验性。"," 本页描述当前内部桥接技术笔记；端点、阈值和硬件兼容范围必须以具体 Driver 与控制器版本核对为准。",[32,33,34,46,52],"ul",{},[35,36,37,40,41,45],"li",{},[18,38,39],{},"浏览器工作台（Laetoly Web）","：运行于浏览器前端（",[42,43,44],"code",{},"app.laetoly.com","）。负责 2D 矢量设计（SVG\u002FDXF 导入）、刀具库配置、工程云端存取以及三维切削仿真预览。",[35,47,48,51],{},[18,49,50],{},"本地驱动程序（Laetoly PC Driver）","：安装并运行于用户电脑的后台守护进程。它作为核心 CAM 引擎，执行复杂的刀路计算、进给与下刀量规划、后处理生成 G 代码，并通过本地 USB 串口或 Wi-Fi 维持与 CNC 机床的低延迟指令通信及真机控制。",[35,53,54,57],{},[18,55,56],{},"数控机床硬件（CNC Machine）","：运行 GRBL 固件的标准 3 轴桌面数控雕刻机。",[59,60,65],"pre",{"className":61,"code":63,"language":64},[62],"language-text","+------------------------------------+\n|       Laetoly 网页工作台 (Web)      |\n|   - 2D 矢量画布与图形导入 (SVG)     |\n|   - 3D 刀路切削与材料去除仿真       |\n|   - 刀具参数配置与项目云端存储      |\n+-----------------+------------------+\n                  | 本地安全回环 (WebSocket \u002F IPC)\n                  v\n+-----------------+------------------+\n|       Laetoly PC 驱动程序 (CAM)    |\n|   - 自研后台 CAM 刀路生成引擎       |\n|   - G 代码后处理器与流控分发        |\n|   - USB 串口 \u002F Wi-Fi 硬件连接控制   |\n+-----------------+------------------+\n                  | USB 串口 (115200 波特率) \u002F Wi-Fi\n                  v\n+-----------------+------------------+\n|       GRBL 兼容桌面数控雕刻机       |\n|   - 三轴步进电机运动驱动 (XYZ)      |\n|   - 主轴电机、限位与急停开关        |\n+------------------------------------+\n","text",[42,66,63],{"__ignoreMap":67},"",[10,69,71],{"id":70},"缓冲区管理字符计数流控法","缓冲区管理：字符计数流控法",[14,73,74,75,78],{},"批准的 Driver V2 技术笔记将 GRBL 或 FluidNC 控制器的接收环形缓冲区描述为 128 字节。为避免缓冲区溢出，Laetoly PC Driver 采用 GRBL 推荐的 ",[18,76,77],{},"字符计数（Character-Counting）"," 方法：",[80,81,82,89,99,114],"ol",{},[35,83,84,85,88],{},"在内存中维护可用缓冲变量 ",[42,86,87],{},"buffer_available","，初始值为 128 字节。",[35,90,91,92,95,96,98],{},"每发送一行指令（包含 ",[42,93,94],{},"\\r\\n","），从 ",[42,97,87],{}," 中扣除该行字节长度。",[35,100,101,102,105,106,109,110,113],{},"若 ",[42,103,104],{},"buffer_available \u003C 当前待发指令长度","，暂停发送，等待机床返回 ",[42,107,108],{},"ok"," 或 ",[42,111,112],{},"error:","。",[35,115,116,117,119,120,113],{},"收到 ",[42,118,108],{}," 响应时，将最早一条已完成指令的字符长度退还给 ",[42,121,87],{},[10,123,124],{"id":124},"实时特权指令拦截",[14,126,127,128,131,132,135,136,139,140,143],{},"诸如 ",[42,129,130],{},"!","（进给保持\u002F暂停）、",[42,133,134],{},"~","（继续切削）与 ",[42,137,138],{},"?","（实时坐标与状态查询）等单字节控制字符会优先于排队的 G 代码发送。V2 技术笔记规定 WebSocket 断开后先经过 500 ms 防抖，再触发进给保持和 ",[42,141,142],{},"M5","；端到端响应取决于操作系统、连接路径、Driver 构建版本与控制器，因此本页不作亚毫秒保证。",{"title":67,"searchDepth":145,"depth":145,"links":146},2,[147,148,149],{"id":12,"depth":145,"text":12},{"id":70,"depth":145,"text":71},{"id":124,"depth":145,"text":124},"底层架构","2026-09-08","详解免安装浏览器工作台、本地 PC 后台 CAM 引擎与数控雕刻机硬件之间的架构分工与低延迟控制设计。",null,false,"md","article","zh",{},true,"\u002Fzh\u002Fengineering\u002Fdriver-bridge-architecture",[162,166,170],{"id":163,"title":164,"url":165},"grbl-protocol","GRBL v1.1 接口基础","https:\u002F\u002Fgithub.com\u002Fgnea\u002Fgrbl\u002Fblob\u002Fmaster\u002Fdoc\u002Fmarkdown\u002Finterface.md",{"id":167,"title":168,"url":169},"rfc-6455","WebSocket 协议 RFC 6455 规范文档","https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc6455",{"id":171,"title":172},"spec-proto-01","Laetoly Driver WebSocket Bridge Protocol V2 技术架构笔记","engineering",{"title":5,"description":152},"driver-bridge-architecture","experimental","zh\u002Fengineering\u002Fdriver-bridge-architecture","engineering-driver-architecture","TOIqvMJjTjsn7ca_-8tBPTZWdNe1Z4NvoVTF8bCSWM0",{"section":173,"slug":175},{"id":182,"title":183,"body":184,"category":307,"date":151,"description":308,"difficulty":153,"draft":154,"duration":153,"extension":155,"featured":154,"image":153,"layout":156,"locale":309,"meta":310,"navigation":159,"path":311,"references":312,"related":153,"section":173,"seo":319,"slug":175,"status":176,"stem":320,"tags":153,"translationKey":178,"updated":153,"video":153,"__hash__":321},"content\u002Fen\u002Fengineering\u002Fdriver-bridge-architecture.md","Architecture of Laetoly Driver Bridge & GRBL Protocol",{"type":7,"value":185,"toc":302},[186,190,197,205,228,234,238,245,283,287],[10,187,189],{"id":188},"system-architecture","System Architecture",[14,191,192,193,196],{},"The core engineering principle of Laetoly is ",[18,194,195],{},"Physical Decoupling between Cloud\u002FBrowser Workspace and Local CAM Computation",":",[23,198,199],{},[14,200,201,204],{},[18,202,203],{},"Status: Experimental."," This page describes the current internal bridge notes. Endpoint details, thresholds, and hardware compatibility must be verified against the specific Driver and controller build.",[32,206,207,216,222],{},[35,208,209,212,213,215],{},[18,210,211],{},"Browser Workspace (Laetoly Web)",": Runs in the browser at ",[42,214,44],{},". Responsible for 2D design, vector import (SVG\u002FDXF), tool library selection, project cloud sync, and 3D simulation preview.",[35,217,218,221],{},[18,219,220],{},"Local PC Driver (CAM Engine & Hardware Bridge)",": A dedicated native daemon running on the user's PC. It executes heavy CAM toolpath generation (toolpath offsets, step-downs, feed calculations), and manages low-latency hardware communication with the CNC router over USB serial or local Wi-Fi.",[35,223,224,227],{},[18,225,226],{},"CNC Controller",": Standard 3-axis desktop CNC machine running GRBL-compatible firmware.",[59,229,232],{"className":230,"code":231,"language":64},[62],"+------------------------------------+\n|       Laetoly Web (Browser)        |\n|   - 2D Canvas & Vector Import      |\n|   - 3D Cut Preview & Simulation    |\n|   - Tool Library & Project Sync    |\n+-----------------+------------------+\n                  | Local Loopback (WebSocket \u002F IPC)\n                  v\n+-----------------+------------------+\n|       Laetoly PC Driver            |\n|   - Native CAM Toolpath Engine     |\n|   - Post-Processor & G-Code Gen    |\n|   - Serial \u002F Wi-Fi Machine Control |\n+-----------------+------------------+\n                  | USB Serial (115200 Baud) \u002F Wi-Fi\n                  v\n+-----------------+------------------+\n|       GRBL-Compatible CNC Router   |\n|   - 3-Axis Stepper Motion (XYZ)    |\n|   - Spindle & Safety Limit Switches|\n+------------------------------------+\n",[42,233,231],{"__ignoreMap":67},[10,235,237],{"id":236},"buffer-management-character-counting-protocol","Buffer Management: Character-Counting Protocol",[14,239,240,241,244],{},"The approved Driver V2 notes describe GRBL or FluidNC controllers with a 128-byte receive ring buffer. To prevent buffer overruns, the Laetoly PC Driver follows the GRBL ",[18,242,243],{},"Character-Counting"," approach:",[80,246,247,253,262,275],{},[35,248,249,250,252],{},"Maintain an integer counter ",[42,251,87],{}," initialized to 128 bytes.",[35,254,255,256,258,259,261],{},"For each outgoing command line (including ",[42,257,94],{},"), subtract its byte length from ",[42,260,87],{},".",[35,263,264,265,268,269,271,272,274],{},"If ",[42,266,267],{},"buffer_available \u003C line_length",", block until an ",[42,270,108],{}," or ",[42,273,112],{}," response is received from the hardware.",[35,276,277,278,280,281,261],{},"When ",[42,279,108],{}," is received, restore the length of the oldest completed command to ",[42,282,87],{},[10,284,286],{"id":285},"real-time-command-interception","Real-Time Command Interception",[14,288,289,290,292,293,295,296,298,299,301],{},"Non-blocking single-byte commands (such as ",[42,291,130],{}," for feed hold, ",[42,294,134],{}," for cycle resume, and ",[42,297,138],{}," for real-time status queries) are prioritized over the queued G-code stream. The V2 notes specify a 500 ms debounce before a WebSocket drop triggers feed hold and ",[42,300,142],{},"; end-to-end response depends on the operating system, connection path, Driver build, and controller, so this page makes no sub-millisecond guarantee.",{"title":67,"searchDepth":145,"depth":145,"links":303},[304,305,306],{"id":188,"depth":145,"text":189},{"id":236,"depth":145,"text":237},{"id":285,"depth":145,"text":286},"Architecture","How Laetoly bridges high-level browser design with local PC CAM computation and hardware serial control.","en",{},"\u002Fen\u002Fengineering\u002Fdriver-bridge-architecture",[313,315,317],{"id":163,"title":314,"url":165},"GRBL v1.1 Interface Basics",{"id":167,"title":316,"url":169},"The WebSocket Protocol (RFC 6455)",{"id":171,"title":318},"Technical Architecture Spec: Laetoly Driver WebSocket Bridge Protocol V2",{"title":183,"description":308},"en\u002Fengineering\u002Fdriver-bridge-architecture","E-O0l_cIvxKpoG_sIlCrxciumPMrJKNjp6R_O03eK9g",1789009347695]