<p>The Prusa printers can do this, based on the maximum and minimum values of X and Y the G-code of the sliced object; <code>M555</code> will set the bounds of the probing area. However, you need a Prusa printer and use PrusaSlicer. This is a feature in Prusa's custom firmware.</p>
<p>Note that you can do this as well in Marlin firmware printers, but a little differently, this only works for Bilinear Levelling only.</p>
<p>See e.g. the manual entry for <a href="https://marlinfw.org/docs/gcode/G029-abl-bilinear.html" rel="nofollow noreferrer">G29 - Bed Leveling (Bilinear)</a> where <code>G29 Fxxx Bxxx Lxxx Rxxx</code> describe the area to probe.</p>
<blockquote>
<p>Meanwhile, with ABL Bilinear there is already G29 F B L R to choose the probing area, although it always probes the same number of points (which keeps the planner code simpler).</p>
</blockquote>
<p><em>Reference: <a href="https://github.com/MarlinFirmware/Marlin/issues/25660#issuecomment-1502334011" rel="nofollow noreferrer">@thinkyhead</a></em></p>

CC BY-SA 4.0
2024-10-14T21:41:59.817Z
2024-10-15T20:31:51.590Z
2024-10-15T20:31:51.590Z
0scar
<p>I am using Marlin to control a PCB mill and figured this was the best place to ask.</p>
<p>I need to be able to level only a portion of the bed that is chosen at runtime. This is because I need to use a conductivity probe (i.e. the tip of the bit) and there's no certainty that the whole copper board is conductive (If part of it has already been milled out).</p>
<p>I know in <code>configuration_adv.h</code> there is the option to specify constants (<code>MESH_MIN_X</code> e.t.c) but I do not want to recompile and reupload the firmware every time I want to use the mill.</p>
<p>I was hoping there was either a macro I could use even if I had to send the G-Code for each  specific point I wanted to level (I haven't figured out a way to do this) or modify the firmware to accept a command like</p>
<pre><code>G29 J4 X30.70 Y50.80
</code></pre>
<p>Where the number after the decimal point (of X &amp; Y) specifies the max position and the whole number specifies the minimum position.</p>
<p>If the latter was the only possible method I was hoping to be directed on how I would modify the firmware to accept new variations of G-code.</p>

<marlin><bed-leveling><g-code><calibration><cnc>
Levelling a portion of the bed at runtime using Marlin
glassGlobe
# Levelling a portion of the bed at runtime using Marlin

(Asked by: username_0 on 2024-10-12)

I am using Marlin to control a PCB mill and figured this was the best place to ask.
I need to be able to level only a portion of the bed that is chosen at runtime. This is because I need to use a conductivity probe (i.e. the tip of the bit) and there's no certainty that the whole copper board is conductive (If part of it has already been milled out).
I know in configuration_adv.h there is the option to specify constants (MESH_MIN_X e.t.c) but I do not want to recompile and reupload the firmware every time I want to use the mill.
I was hoping there was either a macro I could use even if I had to send the G-Code for each  specific point I wanted to level (I haven't figured out a way to do this) or modify the firmware to accept a command like
G29 J4 X30.70 Y50.80

Where the number after the decimal point (of X & Y) specifies the max position and the whole number specifies the minimum position.
If the latter was the only possible method I was hoping to be directed on how I would modify the firmware to accept new variations of G-code.

**Tags:** marlin, bed-leveling, g-code, calibration, cnc

---

## 1 answers

### Answer by username_1 on 2024-10-14. Score: 1 | Accepted answer

The Prusa printers can do this, based on the maximum and minimum values of X and Y the G-code of the sliced object; `M555` will set the bounds of the probing area. However, you need a Prusa printer and use PrusaSlicer. This is a feature in Prusa's custom firmware.

Note that you can do this as well in Marlin firmware printers, but a little differently, this only works for Bilinear Levelling only.

See e.g. the manual entry for [G29 - Bed Leveling (Bilinear)](https://marlinfw.org/docs/gcode/G029-abl-bilinear.html) where `G29 Fxxx Bxxx Lxxx Rxxx` describe the area to probe.

> Meanwhile, with ABL Bilinear there is already G29 F B L R to choose the probing area, although it always probes the same number of points (which keeps the planner code simpler).

*Reference: [@thinkyhead](https://github.com/MarlinFirmware/Marlin/issues/25660#issuecomment-1502334011)*


---

