[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P998M3W6SQXMNQ143YHPQ1":3,"skill-same:01M6P998M3W6SQXMNQ143YHPQ1":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":13,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6P998M3W6SQXMNQ143YHPQ1","marlin-bed-leveling",null,"Calibrates Marlin 2.x 3D printer firmware bed leveling: Unified Bed Leveling (UBL), Bilinear ABL, M420 S1 post-homing, Z-probe offsets, G26 mesh prints, and EEPROM slots. Trigger phrases: marlin bed leveling, ubl calibration, m420 s1, z probe offset, g29 bed level, first layer adhesion.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fmarlin-bed-leveling\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"marlin bed leveling","bed","leveling","manufacturing","calibration","layer","additive-manufacturing","fdm","hardware-calibration","gcode","marlin-firmware","safe","3d-printing","windsurf","printer","community","3D","firmware","mesh","gemini","2026-11-10 10:12:30",false,"---\nname: marlin-bed-leveling\ndescription: \"Calibrates Marlin 2.x 3D printer firmware bed leveling: Unified Bed Leveling (UBL), Bilinear ABL, M420 S1 post-homing, Z-probe offsets, G26 mesh prints, and EEPROM slots. Trigger phrases: marlin bed leveling, ubl calibration, m420 s1, z probe offset, g29 bed level, first layer adhesion.\"\ncategory: development\nrisk: safe\nsource: community\nsource_repo: wwewtech\u002Fmarlin-bed-leveling\nsource_type: community\ndate_added: \"2026-09-22\"\nauthor: wwewtech\ntags: [3d-printing, marlin-firmware, gcode, hardware-calibration, fdm, additive-manufacturing]\ntools: [claude, cursor, gemini, windsurf]\nlicense: \"MIT\"\n---\n\n# Marlin Bed Leveling: Deterministic Calibration & First-Layer Mesh Engineering\n\nMaster Marlin 2.x bed leveling architectures (Unified Bed Leveling UBL, Bilinear ABL, Manual Mesh MBL) to guarantee flawless first-layer adhesion through rigorous G-code phase workflows, probe offset math, and persistent EEPROM compensation.\n\n## When to Use This Skill\n\nActivate this skill when:\n- Calibrating, tuning, or troubleshooting automatic bed leveling on Marlin 2.x 3D printers (Ender 3, CR-10, Prusa clones, custom CoreXY \u002F Cartesian machines).\n- The user asks: \"How do I set up UBL in Marlin?\", \"My printer homes with G28 and ignores the mesh\", \"Calculate BLTouch Z-probe offset\", \"Generate G26 validation print G-code\", or \"Edit warped mesh points with M421\".\n- Diagnosing first-layer defects: nozzle dragging across PEI sheets, corner detachment, uneven squish, or compensation disabling after homing.\n- Sizing slicer start G-code sequences (Cura, PrusaSlicer, OrcaSlicer, Bambu Studio) with thermal soaking and mesh restoration.\n\nDo NOT use this skill when:\n- Calibrating Klipper or RepRapFirmware printers (different firmware syntax and mesh compensation systems).\n- Fixing gross mechanical skew: loose V-slot rollers, bent Z leadscrews, or wobbly gantry arms (hardware faults cannot be solved by software leveling).\n- Delta printer kinematics setup requiring radius and tower endstop adjustments before mesh probing.\n\n## Core Mental Models & Non-Negotiable Rules\n\n1. **The Post-Homing Enable Mandate (`G28` Disables Leveling)**:\n   - In Marlin firmware, executing `G28` (Home All Axes) automatically **DISABLES bed leveling compensation by default** (`RESTORE_LEVELING_AFTER_G28` is often disabled in vendor firmware).\n   - In every print start G-code, the leveling restoration command MUST be issued **strictly AFTER `G28`**:\n     ```gcode\n     G28      ; Home all axes (silently turns leveling OFF)\n     M420 S1  ; Re-enable bed leveling compensation from EEPROM mesh\n     ```\n   - Failing to include `M420 S1` (or `G29 A` for UBL) after `G28` causes the printer to execute the entire print with zero leveling compensation.\n\n2. **The 5-Phase UBL Calibration Loop**:\n   Unified Bed Leveling (UBL) is a state machine requiring five sequential phases:\n   - **Phase 1 (Probe Reachable Grid)**: `G29 P1` probes all coordinates physically reachable by the probe offset.\n   - **Phase 2 (Manual Edge Probing)**: `G29 P2` uses a paper feeler gauge for points the BLTouch cannot reach due to gantry geometry.\n   - **Phase 3 (Mathematical Extrapolation)**: `G29 P3 T0.0` fills unprobed edge coordinates by extrapolating slopes from adjacent measured points.\n   - **Phase 4 (Validation & Micro-Tuning)**: `G26 B60 H210 F1.75` prints a single-layer validation test pattern; inspect and edit coordinates with `M421 I... J... Q...`.\n   - **Phase 5 (Storage & Activation)**: `G29 S1` saves to EEPROM mesh slot 1; `G29 A` activates UBL; `M500` commits to permanent EEPROM storage.\n\n3. **Thermal Equilibrium Pre-Flight Invariant**:\n   - Aluminum build plates, magnetic stickers, and spring-steel PEI sheets expand and warp non-linearly under thermal expansion.\n   - Probing a bed at room temperature (20°C) and then printing at 60°C or 100°C bakes a $0.08\\text{--}0.20\\text{mm}$ error into every mesh point.\n   - **Mandatory Pre-Flight**: Beds MUST be heated to target operating temperature and soaked for $\\ge 5\\text{ minutes}$ prior to running `G29` probing.\n\n4. **Z-Probe Offset Sign Convention (`M851 Z...`)**:\n   - For downward-deploying probes (BLTouch, CRTouch, inductive sensors) where the probe trigger point triggers *below* the nozzle tip:\n     $$\\mathbf{Z\\text{-}Offset\\ is\\ strictly\\ NEGATIVE}\\ (e.g.,\\ \\text{M851 Z-1.85})$$\n   - A *positive* Z-offset on a downward-deploying probe instructs the firmware that the nozzle is lower than the probe trigger, driving the nozzle directly into the bed on the first move.\n   - Adjusting Z-offset with paper gauge:\n     - More resistance \u002F tighter squish $\\implies$ more negative (e.g., `-1.80` $\\to$ `-1.85`).\n     - Less resistance \u002F looser gap $\\implies$ less negative (e.g., `-1.80` $\\to$ `-1.75`).\n\n5. **Mesh Fade Height Geometry (`M420 Z...`)**:\n   - Leveling compensation must gradually fade out as Z-height increases so top surface layers print geometrically flat rather than conforming to the bed warp.\n   - Set fade height to `M420 Z10.0` (fades compensation smoothly over the first 10mm of print height). Setting `Z0` disables fade (perpetuating bed ripples to the top of the model); setting `Z > 25` is unnecessary ballast.\n\n## Named Sins & Anti-Patterns (Что категорически ЗАПРЕЩЕНО)\n\n| Anti-Pattern | Manifestation in Code\u002FWorkflow | Mandatory Production Counter-Rule |\n| :--- | :--- | :--- |\n| **The Forgotten `M420 S1`** | `G28` followed immediately by print moves. | Always place `M420 S1` (or `G29 A`) immediately after `G28`. |\n| **Cold Bed Mesh Probing** | Running `G29 P1` with bed heater at 20°C. | Heat bed to printing temperature and soak for $\\ge 5$ minutes first. |\n| **Positive Z-Probe Offset** | Setting `M851 Z+1.5` on a BLTouch probe. | Downward-deploying probes MUST have a negative Z-offset (`M851 Z-...`). |\n| **Unsaved Mesh Discard** | Probing a 7x7 mesh without running `M500`. | Always commit mesh to EEPROM via `G29 S1` followed by `M500`. |\n| **Software-Fixing Physical Tilt** | Compensating for a 2.5mm physical gantry tilt with UBL. | Physically tram bed corners (`G35` or thumb screws) before probing. |\n| **Blind Unchecked Extrapolation** | Running `G29 P3` without verifying boundary values. | Inspect extrapolated border points with `M420 V` or `G29 T`. |\n| **Cold Extruder G26 Validation** | Running G26 test without nozzle heating. | Heat nozzle to printing temperature (`G26 B60 H210 F1.75`). |\n| **Loose Probe Mount Blindness** | Probing while BLTouch bracket has physical wobble. | Check physical probe mount rigidity; probe repeatability requires $s \\le 0.005\\text{mm}$ (`M48`). |\n| **Excessive Fade Height** | Setting `M420 Z0` or `M420 Z50`. | Use `M420 Z10.0` to smoothly transition from warped bed to true flat geometry. |\n| **Blind Point Over-Editing** | Manually offsetting a single mesh point by 0.5mm via `M421`. | Clean the build plate or check for debris under PEI sheet before altering matrix. |\n\n## Concrete Archetypes \u002F Presets\n\n### Archetype 1: End-to-End Unified Bed Leveling (UBL) Calibration Macro\n```gcode\n; ==============================================================================\n; MARLIN 2.x UBL FULL CALIBRATION SEQUENCE\n; ==============================================================================\nM140 S60         ; Start heating bed to 60°C\nM190 S60         ; Wait for bed to reach 60°C\nG4 S300          ; Thermal soak for 300 seconds (5 minutes)\n\nG28              ; Home all axes\nM117 Probing Reachable Points...\nG29 P1           ; Phase 1: Automated probe of reachable grid points\n\nM117 Extrapolating Mesh Edges...\nG29 P3 T0.0      ; Phase 3: Mathematically extrapolate unprobed perimeter points\nG29 P3 T0.0      ; Second pass to ensure corner fill\n\nG29 T            ; Print ASCII topology matrix to terminal for verification\nG29 S1           ; Save calibrated mesh to EEPROM slot 1\nG29 A            ; Activate UBL leveling system\nM500             ; Save EEPROM permanently to board flash\nM117 UBL Mesh 1 Saved and Activated!\n```\n\n### Archetype 2: Production Slicer Start G-Code (Cura \u002F PrusaSlicer \u002F Orca)\n```gcode\n; ==============================================================================\n; PRODUCTION SLICER START G-CODE (MARLIN UBL \u002F BILINEAR)\n; ==============================================================================\nM140 S[first_layer_bed_temperature]    ; Start heating bed\nM104 S150                              ; Pre-heat nozzle to 150°C (prevent oozing)\nM190 S[first_layer_bed_temperature]    ; Wait for bed to stabilize\n\nG28                                    ; Home all axes (turns leveling OFF)\nM420 S1 Z10.0                          ; Restore mesh from EEPROM & set 10mm fade\n; (OR for UBL: G29 A followed by G29 L1)\n\nG1 Z50 F3000                           ; Move nozzle up to safe clearance\nM109 S[first_layer_temperature]        ; Heat nozzle to final printing temp\n\n; Priming Purge Line on bed edge\nG92 E0                                 ; Reset extruder\nG1 X0.1 Y20 Z0.28 F5000.0              ; Move to start position\nG1 X0.1 Y200.0 Z0.28 F1500.0 E15       ; Draw first purge line\nG1 X0.4 Y200.0 Z0.28 F5000.0           ; Move to side\nG1 X0.4 Y20 Z0.28 F1500.0 E30          ; Draw second purge line\nG92 E0                                 ; Reset extruder\nG1 Z2.0 F3000                          ; Z-hop before moving to print\n```\n\n### Archetype 3: Probe Repeatability & Offset Verification (`M48` & `M851`)\n```gcode\n; ==============================================================================\n; PROBE REPEATABILITY & Z-OFFSET CALIBRATION\n; ==============================================================================\nG28                     ; Home axes\nG1 X117.5 Y117.5 Z10 F5000 ; Move to center of 235x235 bed\nM48 P10 X117.5 Y117.5 V2 E L2 ; Run 10-point repeatability test\n; Standard deviation must be \u003C= 0.005 mm. If > 0.010 mm, tighten probe mount!\n\n; Manual Z-Offset adjustment with paper feeler gauge:\n; 1. Move to Z=0: G1 Z0 F1000\n; 2. Baby-step Z until paper drags with slight friction\n; 3. If nozzle moved down 0.15mm: M851 Z-1.85 (subtract 0.15 from current -1.70)\n; 4. Commit: M500\n```\n\n## The Pre-Emit Quality Gate Checklist\n\nBefore emitting any Marlin leveling advice, macro, or slicer start code:\n- [ ] **Post-Homing Verification**: `M420 S1` (or `G29 A`) placed strictly after `G28` in the execution flow.\n- [ ] **Thermal Soak Pre-Flight**: Bed heating and 5-minute soak mandated prior to `G29` probing.\n- [ ] **Negative Offset Math**: Downward-deploying probes have verified negative `M851 Z-...` values.\n- [ ] **EEPROM Commit**: `G29 S1` followed immediately by `M500` to preserve the mesh.\n- [ ] **Fade Height Limit**: `M420 Z10.0` configured for smooth transition to flat geometry.\n- [ ] **Physical Tramming Precedence**: Confirmed that manual corner leveling is performed before software compensation.\n- [ ] **Probe Repeatability**: Confirmed that `M48` probe standard deviation is $\\le 0.005\\text{mm}$.\n\n## Self-Correction & Verification Loop\n\n### Bad (Vibe-Coded AI Slop Output):\n> \"Put `G29` before `G28` in your start G-code. If your BLTouch is scraping, set `M851 Z1.5`. You don't need to heat the bed during leveling because Marlin compensates for it automatically.\"\n*Problems: Fatal G28 homing wipes out the preceding G29 mesh, positive Z-offset crashes nozzle into bed, dangerous cold probing advice.*\n\n### Good (Production Marlin Bed Leveling Output):\n> 1. Tram the four bed corners manually using `G35` or thumb screws to get mechanical variance under $\\pm 0.1\\text{mm}$.\n> 2. Heat bed to 60°C and nozzle to 150°C; let soak for 5 minutes so thermal expansion stabilizes.\n> 3. Verify probe repeatability using `M48 P10` (standard deviation must be $\\le 0.005\\text{mm}$).\n> 4. Probe grid with `G29 P1`, extrapolate unprobed corners with `G29 P3 T0.0`, save to slot 1 with `G29 S1`, and commit to flash with `M500`.\n> 5. In your slicer start G-code, place `M420 S1 Z10.0` immediately after `G28` to restore the active mesh with a 10mm fade height.\n\n## Limitations\n\n- Marlin commands and mesh behavior vary with firmware version, configuration, probe, bed geometry, and slicer. Check the exact firmware build and printer documentation before applying a macro or offset.\n- G-code can move a hot toolhead and damage equipment or cause burns. Supervise calibration, keep hands clear, use the printer's emergency stop when motion is unsafe, and verify travel limits before running generated sequences.\n- Example coordinates, temperatures, tolerances, and fade values are illustrative; measure the actual printer and follow the manufacturer’s limits.\n","# Marlin Bed Leveling: Deterministic Calibration & First-Layer Mesh Engineering\n\nMaster Marlin 2.x bed leveling architectures (Unified Bed Leveling UBL, Bilinear ABL, Manual Mesh MBL) to guarantee flawless first-layer adhesion through rigorous G-code phase workflows, probe offset math, and persistent EEPROM compensation.\n\n## When to Use This Skill\n\nActivate this skill when:\n- Calibrating, tuning, or troubleshooting automatic bed leveling on Marlin 2.x 3D printers (Ender 3, CR-10, Prusa clones, custom CoreXY \u002F Cartesian machines).\n- The user asks: \"How do I set up UBL in Marlin?\", \"My printer homes with G28 and ignores the mesh\", \"Calculate BLTouch Z-probe offset\", \"Generate G26 validation print G-code\", or \"Edit warped mesh points with M421\".\n- Diagnosing first-layer defects: nozzle dragging across PEI sheets, corner detachment, uneven squish, or compensation disabling after homing.\n- Sizing slicer start G-code sequences (Cura, PrusaSlicer, OrcaSlicer, Bambu Studio) with thermal soaking and mesh restoration.\n\nDo NOT use this skill when:\n- Calibrating Klipper or RepRapFirmware printers (different firmware syntax and mesh compensation systems).\n- Fixing gross mechanical skew: loose V-slot rollers, bent Z leadscrews, or wobbly gantry arms (hardware faults cannot be solved by software leveling).\n- Delta printer kinematics setup requiring radius and tower endstop adjustments before mesh probing.\n\n## Core Mental Models & Non-Negotiable Rules\n\n1. **The Post-Homing Enable Mandate (`G28` Disables Leveling)**:\n   - In Marlin firmware, executing `G28` (Home All Axes) automatically **DISABLES bed leveling compensation by default** (`RESTORE_LEVELING_AFTER_G28` is often disabled in vendor firmware).\n   - In every print start G-code, the leveling restoration command MUST be issued **strictly AFTER `G28`**:\n     ```gcode\n     G28      ; Home all axes (silently turns leveling OFF)\n     M420 S1  ; Re-enable bed leveling compensation from EEPROM mesh\n     ```\n   - Failing to include `M420 S1` (or `G29 A` for UBL) after `G28` causes the printer to execute the entire print with zero leveling compensation.\n\n2. **The 5-Phase UBL Calibration Loop**:\n   Unified Bed Leveling (UBL) is a state machine requiring five sequential phases:\n   - **Phase 1 (Probe Reachable Grid)**: `G29 P1` probes all coordinates physically reachable by the probe offset.\n   - **Phase 2 (Manual Edge Probing)**: `G29 P2` uses a paper feeler gauge for points the BLTouch cannot reach due to gantry geometry.\n   - **Phase 3 (Mathematical Extrapolation)**: `G29 P3 T0.0` fills unprobed edge coordinates by extrapolating slopes from adjacent measured points.\n   - **Phase 4 (Validation & Micro-Tuning)**: `G26 B60 H210 F1.75` prints a single-layer validation test pattern; inspect and edit coordinates with `M421 I... J... Q...`.\n   - **Phase 5 (Storage & Activation)**: `G29 S1` saves to EEPROM mesh slot 1; `G29 A` activates UBL; `M500` commits to permanent EEPROM storage.\n\n3. **Thermal Equilibrium Pre-Flight Invariant**:\n   - Aluminum build plates, magnetic stickers, and spring-steel PEI sheets expand and warp non-linearly under thermal expansion.\n   - Probing a bed at room temperature (20°C) and then printing at 60°C or 100°C bakes a $0.08\\text{--}0.20\\text{mm}$ error into every mesh point.\n   - **Mandatory Pre-Flight**: Beds MUST be heated to target operating temperature and soaked for $\\ge 5\\text{ minutes}$ prior to running `G29` probing.\n\n4. **Z-Probe Offset Sign Convention (`M851 Z...`)**:\n   - For downward-deploying probes (BLTouch, CRTouch, inductive sensors) where the probe trigger point triggers *below* the nozzle tip:\n     $$\\mathbf{Z\\text{-}Offset\\ is\\ strictly\\ NEGATIVE}\\ (e.g.,\\ \\text{M851 Z-1.85})$$\n   - A *positive* Z-offset on a downward-deploying probe instructs the firmware that the nozzle is lower than the probe trigger, driving the nozzle directly into the bed on the first move.\n   - Adjusting Z-offset with paper gauge:\n     - More resistance \u002F tighter squish $\\implies$ more negative (e.g., `-1.80` $\\to$ `-1.85`).\n     - Less resistance \u002F looser gap $\\implies$ less negative (e.g., `-1.80` $\\to$ `-1.75`).\n\n5. **Mesh Fade Height Geometry (`M420 Z...`)**:\n   - Leveling compensation must gradually fade out as Z-height increases so top surface layers print geometrically flat rather than conforming to the bed warp.\n   - Set fade height to `M420 Z10.0` (fades compensation smoothly over the first 10mm of print height). Setting `Z0` disables fade (perpetuating bed ripples to the top of the model); setting `Z > 25` is unnecessary ballast.\n\n## Named Sins & Anti-Patterns (Что категорически ЗАПРЕЩЕНО)\n\n| Anti-Pattern | Manifestation in Code\u002FWorkflow | Mandatory Production Counter-Rule |\n| :--- | :--- | :--- |\n| **The Forgotten `M420 S1`** | `G28` followed immediately by print moves. | Always place `M420 S1` (or `G29 A`) immediately after `G28`. |\n| **Cold Bed Mesh Probing** | Running `G29 P1` with bed heater at 20°C. | Heat bed to printing temperature and soak for $\\ge 5$ minutes first. |\n| **Positive Z-Probe Offset** | Setting `M851 Z+1.5` on a BLTouch probe. | Downward-deploying probes MUST have a negative Z-offset (`M851 Z-...`). |\n| **Unsaved Mesh Discard** | Probing a 7x7 mesh without running `M500`. | Always commit mesh to EEPROM via `G29 S1` followed by `M500`. |\n| **Software-Fixing Physical Tilt** | Compensating for a 2.5mm physical gantry tilt with UBL. | Physically tram bed corners (`G35` or thumb screws) before probing. |\n| **Blind Unchecked Extrapolation** | Running `G29 P3` without verifying boundary values. | Inspect extrapolated border points with `M420 V` or `G29 T`. |\n| **Cold Extruder G26 Validation** | Running G26 test without nozzle heating. | Heat nozzle to printing temperature (`G26 B60 H210 F1.75`). |\n| **Loose Probe Mount Blindness** | Probing while BLTouch bracket has physical wobble. | Check physical probe mount rigidity; probe repeatability requires $s \\le 0.005\\text{mm}$ (`M48`). |\n| **Excessive Fade Height** | Setting `M420 Z0` or `M420 Z50`. | Use `M420 Z10.0` to smoothly transition from warped bed to true flat geometry. |\n| **Blind Point Over-Editing** | Manually offsetting a single mesh point by 0.5mm via `M421`. | Clean the build plate or check for debris under PEI sheet before altering matrix. |\n\n## Concrete Archetypes \u002F Presets\n\n### Archetype 1: End-to-End Unified Bed Leveling (UBL) Calibration Macro\n```gcode\n; ==============================================================================\n; MARLIN 2.x UBL FULL CALIBRATION SEQUENCE\n; ==============================================================================\nM140 S60         ; Start heating bed to 60°C\nM190 S60         ; Wait for bed to reach 60°C\nG4 S300          ; Thermal soak for 300 seconds (5 minutes)\n\nG28              ; Home all axes\nM117 Probing Reachable Points...\nG29 P1           ; Phase 1: Automated probe of reachable grid points\n\nM117 Extrapolating Mesh Edges...\nG29 P3 T0.0      ; Phase 3: Mathematically extrapolate unprobed perimeter points\nG29 P3 T0.0      ; Second pass to ensure corner fill\n\nG29 T            ; Print ASCII topology matrix to terminal for verification\nG29 S1           ; Save calibrated mesh to EEPROM slot 1\nG29 A            ; Activate UBL leveling system\nM500             ; Save EEPROM permanently to board flash\nM117 UBL Mesh 1 Saved and Activated!\n```\n\n### Archetype 2: Production Slicer Start G-Code (Cura \u002F PrusaSlicer \u002F Orca)\n```gcode\n; ==============================================================================\n; PRODUCTION SLICER START G-CODE (MARLIN UBL \u002F BILINEAR)\n; ==============================================================================\nM140 S[first_layer_bed_temperature]    ; Start heating bed\nM104 S150                              ; Pre-heat nozzle to 150°C (prevent oozing)\nM190 S[first_layer_bed_temperature]    ; Wait for bed to stabilize\n\nG28                                    ; Home all axes (turns leveling OFF)\nM420 S1 Z10.0                          ; Restore mesh from EEPROM & set 10mm fade\n; (OR for UBL: G29 A followed by G29 L1)\n\nG1 Z50 F3000                           ; Move nozzle up to safe clearance\nM109 S[first_layer_temperature]        ; Heat nozzle to final printing temp\n\n; Priming Purge Line on bed edge\nG92 E0                                 ; Reset extruder\nG1 X0.1 Y20 Z0.28 F5000.0              ; Move to start position\nG1 X0.1 Y200.0 Z0.28 F1500.0 E15       ; Draw first purge line\nG1 X0.4 Y200.0 Z0.28 F5000.0           ; Move to side\nG1 X0.4 Y20 Z0.28 F1500.0 E30          ; Draw second purge line\nG92 E0                                 ; Reset extruder\nG1 Z2.0 F3000                          ; Z-hop before moving to print\n```\n\n### Archetype 3: Probe Repeatability & Offset Verification (`M48` & `M851`)\n```gcode\n; ==============================================================================\n; PROBE REPEATABILITY & Z-OFFSET CALIBRATION\n; ==============================================================================\nG28                     ; Home axes\nG1 X117.5 Y117.5 Z10 F5000 ; Move to center of 235x235 bed\nM48 P10 X117.5 Y117.5 V2 E L2 ; Run 10-point repeatability test\n; Standard deviation must be \u003C= 0.005 mm. If > 0.010 mm, tighten probe mount!\n\n; Manual Z-Offset adjustment with paper feeler gauge:\n; 1. Move to Z=0: G1 Z0 F1000\n; 2. Baby-step Z until paper drags with slight friction\n; 3. If nozzle moved down 0.15mm: M851 Z-1.85 (subtract 0.15 from current -1.70)\n; 4. Commit: M500\n```\n\n## The Pre-Emit Quality Gate Checklist\n\nBefore emitting any Marlin leveling advice, macro, or slicer start code:\n- [ ] **Post-Homing Verification**: `M420 S1` (or `G29 A`) placed strictly after `G28` in the execution flow.\n- [ ] **Thermal Soak Pre-Flight**: Bed heating and 5-minute soak mandated prior to `G29` probing.\n- [ ] **Negative Offset Math**: Downward-deploying probes have verified negative `M851 Z-...` values.\n- [ ] **EEPROM Commit**: `G29 S1` followed immediately by `M500` to preserve the mesh.\n- [ ] **Fade Height Limit**: `M420 Z10.0` configured for smooth transition to flat geometry.\n- [ ] **Physical Tramming Precedence**: Confirmed that manual corner leveling is performed before software compensation.\n- [ ] **Probe Repeatability**: Confirmed that `M48` probe standard deviation is $\\le 0.005\\text{mm}$.\n\n## Self-Correction & Verification Loop\n\n### Bad (Vibe-Coded AI Slop Output):\n> \"Put `G29` before `G28` in your start G-code. If your BLTouch is scraping, set `M851 Z1.5`. You don't need to heat the bed during leveling because Marlin compensates for it automatically.\"\n*Problems: Fatal G28 homing wipes out the preceding G29 mesh, positive Z-offset crashes nozzle into bed, dangerous cold probing advice.*\n\n### Good (Production Marlin Bed Leveling Output):\n> 1. Tram the four bed corners manually using `G35` or thumb screws to get mechanical variance under $\\pm 0.1\\text{mm}$.\n> 2. Heat bed to 60°C and nozzle to 150°C; let soak for 5 minutes so thermal expansion stabilizes.\n> 3. Verify probe repeatability using `M48 P10` (standard deviation must be $\\le 0.005\\text{mm}$).\n> 4. Probe grid with `G29 P1`, extrapolate unprobed corners with `G29 P3 T0.0`, save to slot 1 with `G29 S1`, and commit to flash with `M500`.\n> 5. In your slicer start G-code, place `M420 S1 Z10.0` immediately after `G28` to restore the active mesh with a 10mm fade height.\n\n## Limitations\n\n- Marlin commands and mesh behavior vary with firmware version, configuration, probe, bed geometry, and slicer. Check the exact firmware build and printer documentation before applying a macro or offset.\n- G-code can move a hot toolhead and damage equipment or cause burns. Supervise calibration, keep hands clear, use the printer's emergency stop when motion is unsafe, and verify travel limits before running generated sequences.\n- Example coordinates, temperatures, tolerances, and fade values are illustrative; measure the actual printer and follow the manufacturer’s limits.\n",{"name":5,"risk":29,"tags":43,"tools":44,"author":47,"source":33,"license":14,"category":48,"date_added":49,"description":7,"source_repo":50,"source_type":33},[30,28,27,26,25,24],[45,46,37,31],"claude","cursor","wwewtech","development","2026-09-22","wwewtech\u002Fmarlin-bed-leveling","main","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fmarlin-bed-leveling","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill marlin-bed-leveling",{"tool":63,"command":64},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill marlin-bed-leveling",{"tool":66,"command":67},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill marlin-bed-leveling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fmarlin-bed-leveling\u002FSKILL.md",true,[],[72,96,120,144,160,180],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[],[79,80,81,82,83,84,74,85,86,87,88,89,33,51,90,91,92,93,94,95],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","devops-security","access","configure","only","active","critical","scope","scripts","relevant","implementing",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":38},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[103,104,105,106,107,108,109,110,111,112,113,114,115,89,116,33,117,118,91,119],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":38},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[127,128,129,29,130,131,132,133,134,135,136,137,138,33,51,139,140,141,142,143],"transcript","youtube transcript","youtube","github","codex","research","license","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":38},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[],[127,128,129,151,29,37,130,131,133,152,153,154,155,136,156,33,51,157,158,159],"youtube transcript skills","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":38},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[],[129,167,168,107,29,169,170,171,172,133,154,173,174,175,176,51,177,139,178,179],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":38},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[],[187,129,188,189,29,37,152,190,191,153,154,155,136,192,156,33,51,157,193,142],"youtube full","full","google","server","dlp","credits","automatic"]