<p>Basically there are two problems to address: first - bed inclination and second - uneven bed surface.</p>

<p>There are different algorithms dealing with one or both problems.
Most specialists insist that bed should be flat and most people use glass as the top to achieve this. And this eliminates second problem and require to solve only the first one.</p>

<p>To find bed inclination - autolevel algorithm usually do three points test and get transformation matrix. This matrix then used to transform XY motion to be parallel to the surface.</p>

<p>For uneven bed surface more complex algorithms used. But usually bilinear mesh used that could be looked as the whole square surface subdivided into smaller ones with individual inclinations. Basically algorithm from XY coordinates determines the sub-square and then applies corresponded transformation for it's inclination.</p>

<p>The transformation fade out with the Z going up and usually applied within first 10mm over the bed level.</p>

<p>There is UBL (Universal Bed Leveling) algorithm that deals with two problems simultaneously. Only once it probes the whole bed with many points to produce two dimensional mesh to address second problem.
And for each next auto level it does three points test to find the whole bed inclination. Then it combines measured inclination with the mesh information stored in memory. UBL assumes that surface do not change but only it's inclination could change.</p>

<p>In all cases this is all about to guarantee that the first levels of filament will lay on the bed evenly and will stick to it.</p>

CC BY-SA 4.0
2018-08-31T23:12:31.440Z
2018-08-31T23:12:31.440Z
Serge Rabyking
<p>A probe or even manual (e.g. through LCD panel) leveling results in either a reference plane or mesh. This depends on the firmware and the options set in the firmware. Basically, this process maps the geometry of your build plate. Once it knows this geometry, printing an object results in the head following the height contours of the mapped build plate. Generally the following of the height contours is levelled out in the first few millimeters, which is also set in the firmware. This means that after a few millimeters of printing the height is not adjusted anymore, but is kept at a single level.</p>

CC BY-SA 4.0
2018-08-27T20:22:41.260Z
2018-08-27T20:22:41.260Z
0scar
<p>Last first:  use of a raft has nothing to do with bed levelling. It depends only on the features/shape/etc of the object being printed.</p>

<p>Now, as to what the auto-levelling does: the answer is, sadly "it depends."  A simple algorithm will just find the Z-height of the four corners and apply a bilinear correction to Z as a function of {x,y} coordinates.  A really good algorithm would map the entire build plate to some designated precision (perhaps 5 mm) and create a 2-dimensional lookup table to adjust Z over a curved build plate.     What your printer's levelling software does is more likely the former. </p>

<p>Why? because if you try to correct over curves &amp; bumps, then you will end up distorting your entire printed object (basically forcing every layer to follow those distorted axes).  Far better to have some flattened or "fat" spots in the first layer printed, and then print proper planar layers after that.  </p>

<p>Example: I know my bed (AnetA8 aluminum) is slightly bowed, peak in the center; so after levelling the overall bed I try to set the Z-zero so the outer extremes of my object have good adhesion, even if the center region of the first couple layers ends up non-extruding because the nozzle touches the bed.  </p>

CC BY-SA 4.0
2018-08-27T14:55:49.333Z
2018-08-27T14:55:49.333Z
Carl Witthoft
<p>I get the concept of automatic bed leveling...the printer moves around the bed and uses a sensor to identify high and low spots, then "software compensates for differences". </p>

<p>But what exactly does "compensates" mean? </p>

<p>It is extruding more material in the low spots to build them up and thinning out the high spots? Is it adding or removing layers? Is it shifting layers as it goes up to compensate tilt? Or...? </p>

<p>In what ways will this affect the final outcome? Would it be valid to say that if you wanted an automatically leveled bed and dimensional accuracy you should always print to a raft?</p>

CC BY-SA 4.0
2018-08-27T19:24:25.530Z
it just sets the floor to a non-zero Z value, layers are all bumped up uniformly. iow, if you had 1mm layers, and 5 layers, it could use 1-6 instead of 0-5. it's more precise, but that's the main idea: min z height
dandavis
CC BY-SA 4.0
2019-03-28T01:36:31.800Z
This is a great question and I would really like to see some citations in some of these excellent answers.
linhartr22
CC BY-SA 4.0
2021-05-21T15:28:28.117Z
Let's say your bed is tilted 5 degrees from the northwest corner to the southeast corner. This extreme example is to help with mental visualization. Will the ABL compensate to the point that all faces that are perpendicular to the XY plane in 3d space will be adjusted so they remain perpendicular to the build plate? I think the question about the raft is an excellent one and it does matter. A raft could potentially build up a truly flat surface that is parallel to the XY plane of the print head.  I turned ABL off since I'm fine with leveling the bed before every print.
Jim Berg
<bed-leveling><rafts>
What exactly does automatic bed leveling do?
Steve In CO
# What exactly does automatic bed leveling do?

(Asked by: username_0 on 2018-08-27)

I get the concept of automatic bed leveling...the printer moves around the bed and uses a sensor to identify high and low spots, then "software compensates for differences".

But what exactly does "compensates" mean?

It is extruding more material in the low spots to build them up and thinning out the high spots? Is it adding or removing layers? Is it shifting layers as it goes up to compensate tilt? Or...?

In what ways will this affect the final outcome? Would it be valid to say that if you wanted an automatically leveled bed and dimensional accuracy you should always print to a raft?

**Tags:** bed-leveling, rafts
> **Comments:**
> **username_1**: it just sets the floor to a non-zero Z value, layers are all bumped up uniformly. iow, if you had 1mm layers, and 5 layers, it could use 1-6 instead of 0-5. it's more precise, but that's the main idea: min z height  
> **username_2**: This is a great question and I would really like to see some citations in some of these excellent answers.  
> **username_3**: Let's say your bed is tilted 5 degrees from the northwest corner to the southeast corner. This extreme example is to help with mental visualization. Will the ABL compensate to the point that all faces that are perpendicular to the XY plane in 3d space will be adjusted so they remain perpendicular to the build plate? I think the question about the raft is an excellent one and it does matter. A raft could potentially build up a truly flat surface that is parallel to the XY plane of the print head.  I turned ABL off since I'm fine with leveling the bed before every print.  

---

## 3 answers

### Answer by username_6 on 2018-08-27. Score: 5 | Accepted answer

Last first: use of a raft has nothing to do with bed levelling. It depends only on the features/shape/etc of the object being printed.

Now, as to what the auto-levelling does: the answer is, sadly "it depends." A simple algorithm will just find the Z-height of the four corners and apply a bilinear correction to Z as a function of {x,y} coordinates. A really good algorithm would map the entire build plate to some designated precision (perhaps 5 mm) and create a 2-dimensional lookup table to adjust Z over a curved build plate. What your printer's levelling software does is more likely the former.

Why? because if you try to correct over curves & bumps, then you will end up distorting your entire printed object (basically forcing every layer to follow those distorted axes). Far better to have some flattened or "fat" spots in the first layer printed, and then print proper planar layers after that.

Example: I know my bed (AnetA8 aluminum) is slightly bowed, peak in the center; so after levelling the overall bed I try to set the Z-zero so the outer extremes of my object have good adhesion, even if the center region of the first couple layers ends up non-extruding because the nozzle touches the bed.


---

### Answer by username_4 on 2018-08-31. Score: 5

Basically there are two problems to address: first - bed inclination and second - uneven bed surface.

There are different algorithms dealing with one or both problems.
Most specialists insist that bed should be flat and most people use glass as the top to achieve this. And this eliminates second problem and require to solve only the first one.

To find bed inclination - autolevel algorithm usually do three points test and get transformation matrix. This matrix then used to transform XY motion to be parallel to the surface.

For uneven bed surface more complex algorithms used. But usually bilinear mesh used that could be looked as the whole square surface subdivided into smaller ones with individual inclinations. Basically algorithm from XY coordinates determines the sub-square and then applies corresponded transformation for it's inclination.

The transformation fade out with the Z going up and usually applied within first 10mm over the bed level.

There is UBL (Universal Bed Leveling) algorithm that deals with two problems simultaneously. Only once it probes the whole bed with many points to produce two dimensional mesh to address second problem.
And for each next auto level it does three points test to find the whole bed inclination. Then it combines measured inclination with the mesh information stored in memory. UBL assumes that surface do not change but only it's inclination could change.

In all cases this is all about to guarantee that the first levels of filament will lay on the bed evenly and will stick to it.


---

### Answer by username_5 on 2018-08-27. Score: 4

A probe or even manual (e.g. through LCD panel) leveling results in either a reference plane or mesh. This depends on the firmware and the options set in the firmware. Basically, this process maps the geometry of your build plate. Once it knows this geometry, printing an object results in the head following the height contours of the mapped build plate. Generally the following of the height contours is levelled out in the first few millimeters, which is also set in the firmware. This means that after a few millimeters of printing the height is not adjusted anymore, but is kept at a single level.


---

