<p><code>PROBING_MARGIN</code> and <code>MESH_INSET</code> make the effective probing area smaller, so if you want to have more area, you should reduce the value of these constants.</p>
<p>As of Marlin 2.x, the probing area isn't defined directly by the firmware configuration settings, but calculated, based on the probe offset settings. The constants you mention are reducing the probing area to keep the carriage/nozzle on the build surface.</p>
<p>If you have enough space on your printer to accommodate probing the whole bed, you could minimize the marging and define edges:</p>
<pre><code>#if PROBE_SELECTED &amp;&amp; !IS_KINEMATIC
  #define PROBING_MARGIN_LEFT PROBING_MARGIN
  #define PROBING_MARGIN_RIGHT PROBING_MARGIN
  #define PROBING_MARGIN_FRONT PROBING_MARGIN
  #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif
</code></pre>

CC BY-SA 4.0
2020-12-04T08:50:21.220Z
Thank you for the response, I did get to that setting, however it doesn't seem to work as I thought it would, somehow I've managed to cover most of the bed, but it still doesn't finish 100 points but stops at 91, however at least mesh is valid after that. 
What's the case, when it calculates probing points ( 100 ) and some of them are outside allowed area, because that's what seems to happen
uneasy
CC BY-SA 4.0
2023-03-27T09:50:16.720Z
Could be you don't have enough memory to store the points?
0scar
CC BY-SA 4.0
2020-12-04T07:57:06.023Z
2020-12-04T10:28:25.577Z
2020-12-04T10:28:25.577Z
0scar
<p>As far as I understand, this is how the limits are calculated:</p>
<ol>
<li>The probing size is first calculated from <code>X_MAX_POS</code> and <code>Y_MAX_POS</code> and your <code>NOZZLE_TO_PROBE_OFFSET</code> values. If you changed the extruder or part cooling system or added a BLTouch you will have to update these.</li>
<li>This calculated area is reduced by <code>MESH_INSET</code> if you want to make the probing area smaller. I don't really know why you'd do this so I always just set it to 0, and also it seems totally redundant with <code>PROBING_MARGIN</code>. I don't know if they are calculated any differently, it would be great if the comments in Marlin were a bit clearer here</li>
<li>This area is further reduced by the <code>PROBING_MARGIN</code> for situations like if you have bed clips around the edges, or if you're using a contactless probe which can get bad values near the edges.</li>
</ol>
<p>So basically, if you're using a contact probe like BLTouch and you don't have any clips or obstructions around the edges, you can just set both <code>MESH_INSET</code> and <code>PROBING_MARGIN</code> to 0 then provided your X and Y axis max positions have enough extra room compared to the nozzle to probe offsets, you should be able to probe all points without issue.</p>

CC BY-SA 4.0
2023-03-26T19:46:08.413Z
2023-03-26T23:38:58.333Z
2023-03-26T23:38:58.333Z
Samwise Ganges
<p>This question is related to:
<a href="https://3dprinting.stackexchange.com/questions/8153/how-to-set-z-probe-boundary-limits-in-firmware-when-using-automatic-bed-leveling">How to set Z-probe boundary limits in firmware when using automatic bed leveling?</a></p>
<p>I am trying to figure out how to set UBL In Marlin to cover as much bed as possible.
So My bed is size of 300x255 mm
<code>#define NOZZLE_TO_PROBE_OFFSET { -34, -1, -2 }</code>
My Probe can physically cover 255 mm (whole Y) and 272 mm (of X size)
Let's give it a bit of margin of the 0Y -&gt; 3 mm and from 0X -3 mm
So idea is to cover X from 3 mm to 269 mm and Y from 3 mm -&gt; 252 mm</p>
<p>How should I set
<code>#define PROBING_MARGIN</code>
and
<code>#define MESH_INSET</code>
so it covers my bed and probes 100 points ?</p>
<p>I tried different options, most of the time it stops at 57/100 and printer HALTs.</p>
<p>Only setting I got it working with was:
<code>#define PROBING_MARGIN 30</code>
<code>#define MESH_INSET 50</code>
But that does not cover whole bed. I am struggling to understand how it's calculated.
Other settings I found was commented as below.</p>
<pre><code>#if PROBE_SELECTED &amp;&amp; !IS_KINEMATIC
  // #define PROBING_MARGIN_LEFT PROBING_MARGIN
  // #define PROBING_MARGIN_RIGHT PROBING_MARGIN
  // #define PROBING_MARGIN_FRONT PROBING_MARGIN
  // #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif
</code></pre>
<p>Any suggestions ?</p>

<marlin><bed-leveling><bltouch>
UBL Marlin settings to cover whole bed
uneasy
# UBL Marlin settings to cover whole bed

(Asked by: username_0 on 2020-12-02)

This question is related to:
[How to set Z-probe boundary limits in firmware when using automatic bed leveling?](https://3dprinting.stackexchange.com/questions/8153/how-to-set-z-probe-boundary-limits-in-firmware-when-using-automatic-bed-leveling)

I am trying to figure out how to set UBL In Marlin to cover as much bed as possible.
So My bed is size of 300x255 mm
`#define NOZZLE_TO_PROBE_OFFSET { -34, -1, -2 }`
My Probe can physically cover 255 mm (whole Y) and 272 mm (of X size)
Let's give it a bit of margin of the 0Y -> 3 mm and from 0X -3 mm
So idea is to cover X from 3 mm to 269 mm and Y from 3 mm -> 252 mm

How should I set
`#define PROBING_MARGIN`
and
`#define MESH_INSET`
so it covers my bed and probes 100 points ?

I tried different options, most of the time it stops at 57/100 and printer HALTs.

Only setting I got it working with was:
`#define PROBING_MARGIN 30`
`#define MESH_INSET 50`
But that does not cover whole bed. I am struggling to understand how it's calculated.
Other settings I found was commented as below.

```
#if PROBE_SELECTED && !IS_KINEMATIC
  // #define PROBING_MARGIN_LEFT PROBING_MARGIN
  // #define PROBING_MARGIN_RIGHT PROBING_MARGIN
  // #define PROBING_MARGIN_FRONT PROBING_MARGIN
  // #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif

```

Any suggestions ?

**Tags:** marlin, bed-leveling, bltouch


---

## 2 answers

### Answer by username_1 on 2020-12-04. Score: 1

`PROBING_MARGIN` and `MESH_INSET` make the effective probing area smaller, so if you want to have more area, you should reduce the value of these constants.

As of Marlin 2.x, the probing area isn't defined directly by the firmware configuration settings, but calculated, based on the probe offset settings. The constants you mention are reducing the probing area to keep the carriage/nozzle on the build surface.

If you have enough space on your printer to accommodate probing the whole bed, you could minimize the marging and define edges:

```
#if PROBE_SELECTED && !IS_KINEMATIC
  #define PROBING_MARGIN_LEFT PROBING_MARGIN
  #define PROBING_MARGIN_RIGHT PROBING_MARGIN
  #define PROBING_MARGIN_FRONT PROBING_MARGIN
  #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif

```

> **Comments:**
> **username_0**: Thank you for the response, I did get to that setting, however it doesn't seem to work as I thought it would, somehow I've managed to cover most of the bed, but it still doesn't finish 100 points but stops at 91, however at least mesh is valid after that.  What's the case, when it calculates probing points ( 100 ) and some of them are outside allowed area, because that's what seems to happen  
> **username_1**: Could be you don't have enough memory to store the points?  

---

### Answer by username_2 on 2023-03-26. Score: 0

As far as I understand, this is how the limits are calculated:

1. The probing size is first calculated from `X_MAX_POS` and `Y_MAX_POS` and your `NOZZLE_TO_PROBE_OFFSET` values. If you changed the extruder or part cooling system or added a BLTouch you will have to update these.
2. This calculated area is reduced by `MESH_INSET` if you want to make the probing area smaller. I don't really know why you'd do this so I always just set it to 0, and also it seems totally redundant with `PROBING_MARGIN`. I don't know if they are calculated any differently, it would be great if the comments in Marlin were a bit clearer here
3. This area is further reduced by the `PROBING_MARGIN` for situations like if you have bed clips around the edges, or if you're using a contactless probe which can get bad values near the edges.

So basically, if you're using a contact probe like BLTouch and you don't have any clips or obstructions around the edges, you can just set both `MESH_INSET` and `PROBING_MARGIN` to 0 then provided your X and Y axis max positions have enough extra room compared to the nozzle to probe offsets, you should be able to probe all points without issue.


---

