<p><em>The issues/questions raised about the automatic bed leveling using e.g. a BLTouch probe at this stack require a more in depth description of the automatic leveling functionality in general, this answers aims on describing how this works.</em></p>
<hr />
<h3>Definition of &quot;bed leveling&quot;</h3>
<p>Let us begin with saying that such sensors systems alone will <em><strong>never level your bed</strong></em>, this is a misconception that is easily concluded from the terms being used (terms like Auto Bed Leveling, ABL). Using such sensors will not physically change the &quot;level&quot; of your bed.<em><sup>1)</sup></em> Furthermore, the process of leveling your build surface/heated bed is commonly known as <em>tramming</em>.</p>
<blockquote>
<p><strong>Tramming</strong> is the process of adjusting the build surface to be parallel to the X-axis and Y-axis of the 3D printer.</p>
</blockquote>
<p>But, <a href="/a/13471">when do you need such a functionality</a><em><sup>2)</sup></em>? What if the bed surface isn't completely flat/square? Tramming such a surface is difficult and that surface will not be perpendicular to the X-Y plane of the nozzle... Why a bed is not perfectly flat can be caused by the manufacturing process, handling (during shipment, dropping tools on the surface, etc.), the way the bed is mounted and thermal stresses of non-uniform heating.</p>
<h3>Basics</h3>
<p>Many printers use endstops to determine the origin of the printer, these aren't essential for the printer, but very useful for the operator. Endstops allow for setting the reference from a known position to the origin of the printer. In fact, the sophisticated leveling sensors are nothing more than the simple Z-endstop except that the sensor is mounted onto the print head, it allows for probing the bed in more positions than an endstop limit switch mounted on the frame’s Z-axis.</p>
<p>In order to be able to print consistently, you should provide a bed that is properly trammed (to aid adhesion/prevent objects to not stick to the build plate). But, if for some reason, the surface contains imperfections, the normal tramming of the build surface using just the Z-endstop and the leveling screws might not be sufficient.</p>
<h3>What does this so-called &quot;leveling&quot; do?</h3>
<p>Using the ABL features from firmware will enable the use of a sensor to scan the surface of the build surface/heated bed to create a digital representation of the topology of the surface. This scanned surface includes the imperfections of the surface (this is depending on the option to process the measurement points of the scanning process, the more probing points the better the geometry can be mapped). E.g. just scanning 3 points will only result in a tilted plane (e.g. Ultimaker), but, scanning multiple points in a grid style process, the surface can be mapped to a complex surface describing the shape. So, if a surface isn't fully flat/square, the scanned surface provides a digital copy of the shape of the build plate.</p>
<h3>How is the scanned surface applied?</h3>
<p>Note that this scanning of the surface is generally done at a distance from the actual nozzle (except for pressure sensor systems where the nozzle is used as the probe), the images below show this for a BLTouch sensor and an inductive/capacitive sensor. For an inductive sensor this is the distance of detecting metal (minus the distance to the nozzle), for a BLTouch this is based on the triggering point of the extendable probe, see <a href="/a/5858">this answer</a> (the image below depict the terminology). The operator of the printer needs to determine at which distance this bed has been scanned. This is commonly known as determining the Z-offset. The Z-offset can be set using a terminal or through the display. Setting this Z-offset is described in detail in &quot;<a href="/q/9820">Specifying Z offset in Marlin firmware</a>&quot;.</p>
<p>Once the shape of the bed is captured (G-code command <a href="https://reprap.org/wiki/G-code#G29:_Detailed_Z-Probe" rel="nofollow noreferrer"><code>G29</code></a>) and <a href="https://reprap.org/wiki/G-code#M500:_Store_parameters_in_non-volatile_storage" rel="nofollow noreferrer">stored</a> and the correct distance (Z-offset) set with <code>M851 Zx.xx</code> (or through the display), the <a href="https://3dprinting.stackexchange.com/a/13872/5740">use of the shape needs to be activated</a> in the starting G-code section of the G-code file of the print.</p>
<p>The nozzle will now be following the bed shape to improve the bed adhesion, this compensation is by default set to be <a href="/a/6905/">smeared out in 10 mm</a>, but can be disabled or changed to any other value using <a href="https://reprap.org/wiki/G-code#M420:_Leveling_On.2FOff.2FFade_.28Marlin.29" rel="nofollow noreferrer"><code>M420 Zxx</code></a>. The nozzle will print in the X-Y plane without compensation after the compensation distance. If you do not tram the bed correctly, the bottom of that print object will thus not be square to the height! See question &quot;<a href="/q/6904">Does auto leveling result in sheared prints?</a>&quot;.</p>
<hr />
<p><a href="https://i.sstatic.net/wdto7.png" rel="nofollow noreferrer" title="BLTouch or 3DTouch sensor Z-offset definition"><img src="https://i.sstatic.net/wdto7.png" alt="BLTouch or 3DTouch sensor Z-offset definition" title="BLTouch or 3DTouch sensor Z-offset definition" /></a></p>
<p><a href="https://i.sstatic.net/2sGwU.png" rel="nofollow noreferrer" title="Inductive/capacitive proximity sensor Z-offset definition"><img src="https://i.sstatic.net/2sGwU.png" alt="Inductive/capacitive proximity sensor Z-offset definition" title="Inductive/capacitive proximity sensor Z-offset definition" /></a></p>
<hr />
<p><em><sup>1)</sup></em> <em>Do note that actual leveling the bed is possible in some firmware flavors, but this is only possible if more individual controlled Z-steppers are used to move the bed/nozzle assembly!</em></p>
<p><em><sup>2)</sup> Please note that firmware development has progressed over the years, e.g. using a recent version of Marlin, you can change the firmware to use UBL (see question <a href="/q/18451/">What is ABL or UBL? Is this the same?</a>). With UBL you technically do not need a leveling sensor, but, this is a laborious process to do this manually.</em></p>

CC BY-SA 4.0
2021-06-23T19:11:53.143Z
This is an excellent answer, and I'd give it more than one upvote if I could.
Zeiss Ikon
CC BY-SA 4.0
2021-06-23T13:21:36.157Z
2023-11-06T15:05:11.737Z
2023-11-06T15:05:11.737Z
0scar
<p>A frequently discussed update to a 3D printer is the so-called leveling sensor; this sensor can be inductive, capacitive, optical or mechanical (i.e pressure or physically touching, like a BLTouch).</p>
<p>It is supposed to level your bed, providing  improved first layer adherence and thus less failed prints.</p>
<p>How does this automatic bed leveling work?</p>

<bltouch><knowledgebase><inductive-sensor><automatic-bed-leveling>
Automatic Bed Leveling (ABL) with a sensor (BLTouch, inductive, capacitive), how does it work?
0scar
# Automatic Bed Leveling (ABL) with a sensor (BLTouch, inductive, capacitive), how does it work?

(Asked by: username_0 on 2021-06-23)

A frequently discussed update to a 3D printer is the so-called leveling sensor; this sensor can be inductive, capacitive, optical or mechanical (i.e pressure or physically touching, like a BLTouch).

It is supposed to level your bed, providing improved first layer adherence and thus less failed prints.

How does this automatic bed leveling work?

**Tags:** bltouch, knowledgebase, inductive-sensor, automatic-bed-leveling


---

## 1 answers

### Answer by username_0 on 2021-06-23. Score: 9 | Accepted answer

*The issues/questions raised about the automatic bed leveling using e.g. a BLTouch probe at this stack require a more in depth description of the automatic leveling functionality in general, this answers aims on describing how this works.*

---

### Definition of "bed leveling"

Let us begin with saying that such sensors systems alone will ***never level your bed***, this is a misconception that is easily concluded from the terms being used (terms like Auto Bed Leveling, ABL). Using such sensors will not physically change the "level" of your bed.*1)* Furthermore, the process of leveling your build surface/heated bed is commonly known as *tramming*.

> **Tramming** is the process of adjusting the build surface to be parallel to the X-axis and Y-axis of the 3D printer.

But, [when do you need such a functionality](/a/13471)*2)*? What if the bed surface isn't completely flat/square? Tramming such a surface is difficult and that surface will not be perpendicular to the X-Y plane of the nozzle... Why a bed is not perfectly flat can be caused by the manufacturing process, handling (during shipment, dropping tools on the surface, etc.), the way the bed is mounted and thermal stresses of non-uniform heating.

### Basics

Many printers use endstops to determine the origin of the printer, these aren't essential for the printer, but very useful for the operator. Endstops allow for setting the reference from a known position to the origin of the printer. In fact, the sophisticated leveling sensors are nothing more than the simple Z-endstop except that the sensor is mounted onto the print head, it allows for probing the bed in more positions than an endstop limit switch mounted on the frame’s Z-axis.

In order to be able to print consistently, you should provide a bed that is properly trammed (to aid adhesion/prevent objects to not stick to the build plate). But, if for some reason, the surface contains imperfections, the normal tramming of the build surface using just the Z-endstop and the leveling screws might not be sufficient.

### What does this so-called "leveling" do?

Using the ABL features from firmware will enable the use of a sensor to scan the surface of the build surface/heated bed to create a digital representation of the topology of the surface. This scanned surface includes the imperfections of the surface (this is depending on the option to process the measurement points of the scanning process, the more probing points the better the geometry can be mapped). E.g. just scanning 3 points will only result in a tilted plane (e.g. Ultimaker), but, scanning multiple points in a grid style process, the surface can be mapped to a complex surface describing the shape. So, if a surface isn't fully flat/square, the scanned surface provides a digital copy of the shape of the build plate.

### How is the scanned surface applied?

Note that this scanning of the surface is generally done at a distance from the actual nozzle (except for pressure sensor systems where the nozzle is used as the probe), the images below show this for a BLTouch sensor and an inductive/capacitive sensor. For an inductive sensor this is the distance of detecting metal (minus the distance to the nozzle), for a BLTouch this is based on the triggering point of the extendable probe, see [this answer](/a/5858) (the image below depict the terminology). The operator of the printer needs to determine at which distance this bed has been scanned. This is commonly known as determining the Z-offset. The Z-offset can be set using a terminal or through the display. Setting this Z-offset is described in detail in "[Specifying Z offset in Marlin firmware](/q/9820)".

Once the shape of the bed is captured (G-code command [`G29`](https://reprap.org/wiki/G-code#G29:_Detailed_Z-Probe)) and [stored](https://reprap.org/wiki/G-code#M500:_Store_parameters_in_non-volatile_storage) and the correct distance (Z-offset) set with `M851 Zx.xx` (or through the display), the [use of the shape needs to be activated](https://3dprinting.stackexchange.com/a/13872/5740) in the starting G-code section of the G-code file of the print.

The nozzle will now be following the bed shape to improve the bed adhesion, this compensation is by default set to be [smeared out in 10 mm](/a/6905/), but can be disabled or changed to any other value using [`M420 Zxx`](https://reprap.org/wiki/G-code#M420:_Leveling_On.2FOff.2FFade_.28Marlin.29). The nozzle will print in the X-Y plane without compensation after the compensation distance. If you do not tram the bed correctly, the bottom of that print object will thus not be square to the height! See question "[Does auto leveling result in sheared prints?](/q/6904)".

---

[![BLTouch or 3DTouch sensor Z-offset definition](https://i.sstatic.net/wdto7.png "BLTouch or 3DTouch sensor Z-offset definition")](https://i.sstatic.net/wdto7.png "BLTouch or 3DTouch sensor Z-offset definition")

[![Inductive/capacitive proximity sensor Z-offset definition](https://i.sstatic.net/2sGwU.png "Inductive/capacitive proximity sensor Z-offset definition")](https://i.sstatic.net/2sGwU.png "Inductive/capacitive proximity sensor Z-offset definition")

---

*1)* *Do note that actual leveling the bed is possible in some firmware flavors, but this is only possible if more individual controlled Z-steppers are used to move the bed/nozzle assembly!*

*2) Please note that firmware development has progressed over the years, e.g. using a recent version of Marlin, you can change the firmware to use UBL (see question [What is ABL or UBL? Is this the same?](/q/18451/)). With UBL you technically do not need a leveling sensor, but, this is a laborious process to do this manually.*

> **Comments:**
> **username_1**: This is an excellent answer, and I'd give it more than one upvote if I could.  

---

