This question is related to: 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.


Any suggestions ?


2 Answers 2


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:

  • 1
    $\begingroup$ 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 $\endgroup$
    – uneasy
    Dec 4, 2020 at 8:50
  • $\begingroup$ Could be you don't have enough memory to store the points? $\endgroup$
    – 0scar
    Mar 27 at 9:50

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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .