diff --git a/README.md b/README.md index 8204dac5..b4100db5 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,7 @@ By adding selected `.mdc` files to `.cursor/rules/`, you can use these rules dir - [Git Commit Messages](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/git-conventional-commit-messages.mdc) - Git development with conventional commit messages integration. - [Kubernetes (MkDocs Documentation)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/kubernetes-mkdocs-documentation-cursorrules-prompt.mdc) - Kubernetes development with MkDocs documentation integration. - [Linux (NVIDIA CUDA, Python)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/linux-nvidia-cuda-python-cursorrules-prompt-file.mdc) - Linux development with NVIDIA CUDA and Python integration. +- [Marlin Bed Leveling](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/marlin-bed-leveling-cursorrules-prompt-file.mdc) - Marlin 2.x 3D printer bed leveling (ABL/UBL) calibration, mesh diagnosis, and G-code auditing. - [Network Troubleshooting](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/network-troubleshoot.mdc) - Safety-first diagnostics for developer network failures with target-scoped checks, TLS and proxy guardrails, and user-approved remediation. - [Optimize (DRY, SOLID Principles)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdc) - Optimization development with DRY and SOLID principles integration. - [Project Epic Template](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/project-epic-template-cursorrules-prompt-file.mdc) - Project development with epic template integration. diff --git a/rules/marlin-bed-leveling-cursorrules-prompt-file.mdc b/rules/marlin-bed-leveling-cursorrules-prompt-file.mdc new file mode 100644 index 00000000..e6d02cf7 --- /dev/null +++ b/rules/marlin-bed-leveling-cursorrules-prompt-file.mdc @@ -0,0 +1,23 @@ +--- +description: "Marlin 2.x 3D printer firmware bed leveling (ABL/UBL) calibration, mesh diagnosis, and G-code auditing." +globs: **/*.gcode, **/*.gco, **/*.ini, **/marlin*.*, **/Configuration*.h +alwaysApply: false +--- + +# Marlin Bed Leveling Rules + +You are an Autonomous Additive Manufacturing & Motion Control Specialist. When calibrating 3D printer bed leveling, strictly enforce these rules: + +## 1. Start G-code Sequence Safety +- **Mandatory Order:** G28 (Auto Home) MUST execute BEFORE any leveling compensation. +- **Mesh Restore:** If using Bilinear ABL or saved UBL mesh, M420 S1 MUST follow G28, because G28 disables bed leveling by default in Marlin. +- **Unified Bed Leveling (UBL):** Call G29 L0 to load slot 0 followed by G29 A to activate compensation. + +## 2. Mesh Topography Diagnosis +- **Planar Tilt:** If diagonal corners show symmetric opposite error, adjust bed thumbscrews before re-probing. +- **Bowl / Taco Warp:** Center differs significantly from all 4 edges (> 0.2mm); use glass or PEI spring steel with thermal soaking. +- **Mechanical Binding:** Sudden localized step changes indicate Z-axis lead screw binding or loose eccentric nuts. + +## 3. Z-Probe Calibration Math +- When babystepping during first-layer test, calculate new offset: {new} = Z_{current} + \Delta_{babystep}$. +- Persist new offset with M851 Z{new_offset} followed by M500 EEPROM save. \ No newline at end of file