We all know that a level bed is crucial for a successful print, and therefore bed leveling is an extremely important procedure. Often, it’s discussed as either “manual” or “automatic” bed leveling, but there’s actually more to it than that. In fact, thanks to mesh bed leveling, perfect levelness might not even be necessary.

In this article, we’ll dive a little deeper into mesh bed leveling, including what it is, what it isn’t, how to set it up, and how to use it.

Back to Contents

Mesh Bed Leveling

What Is Bed Leveling?

We've all been there
We've all been there (Source: Ultimaker)

Before we can properly clear up what exactly mesh bed leveling is and isn’t, we need to clarify a few things.

Taking a step back, it’s important to note that “bed leveling” can mean different things depending on the context.

In a literal sense, it of course means leveling the bed – that is, moving the printhead around and lining the build plate up to it using knobs beneath the bed. In this case, the firmware is “unaware” of any “leveling”, although it could be responsible for moving the printhead around for you (either through LCD menu options or a custom print routine).

On the other hand, “bed leveling” has also been established to mean compensating for the build’s tilt or shape, covering most other methods. Here, it’s firmware that’s doing the compensating, so it’s “aware” of the “leveling”, although its participation may vary from one method to the next.

Matrix- (Tilt) vs. Mesh-Based Leveling

When it comes to compensating for the print bed, there are two main ways firmware can go about it:

  • Matrix-based leveling compensates for the tilt of the bed. Specifically, the bed calculates a (perfectly flat) matrix or plane, to represent the bed, and accommodates its angle by minutely adjusting the nozzle’s Z height during printing.
  • Mesh-based leveling compensates for the shape of the bed. Here, the bed is represented by a “mesh”, which can have hills and valleys according to real swells or dips in the build plate.

These two types of compensation accommodate very different aspects, and in fact, it’s good to do both kinds of bed leveling! Matrix-based leveling is no good if a built plate is warped, and mesh-based leveling can have problems at extreme tilts.

Auto- vs. Manual Leveling

The last thing that’s important to get straight about bed leveling is the difference between automatic bed leveling (ABL) and manual bed leveling. It’s easy to confuse the former with the idea that the firmware controls printhead movement, but actually, it mostly has to do with whether or not a printer has a bed leveling sensor or probe.

Example

With all of the above in mind, what someone does with a sensorless Ender 3 V2 could be called “manual, non-firmware, matrix leveling”, which is really “bed leveling” in its most literal sense.

Now, let’s look a little closer at mesh bed leveling.

Back to Contents

Advertisement
Advertisement
Advertisement
Mesh Bed Leveling

Mesh Bed Leveling (Manual Firmware Leveling)

Normally, the LCD screen will guide you through the process
Normally, the LCD screen will guide you through the process (Source: Modern Hobbyist via YouTube)

Here’s the thing: If you’ve occasionally been a bit too enthusiastic while removing a model from your bed, your bed may not be as flat as you’d like it to be. In other words, while the corners might be nice and even, the middle might still be too far from or close to the nozzle. This means your bed is warped, and no amount of thumbscrew-twisting is going to solve the problem.

If firmware is used for bed leveling (i.e. bed compensating), but no probe is used, the method will most likely be mesh-based. That is, firmware records the Z height set by you at various points, builds a mesh, and raises or lowers the printhead as necessary during printing.

In fact, the RepRap Wiki and Marlin firmware label this particular method as “mesh bed leveling”, even though there are other mesh-based techniques.

How It Works

To describe the specific process usually referred to as “mesh bed leveling”, we’ll use Marlin’s G29 procedure as an example.

Essentially, when instructed to perform mesh bed leveling, the firmware moves the printhead to a point above the print bed. The user must then adjust the Z height (through firmware) so that a piece of paper is just barely able to pass between the nozzle and the build plate. This value is then recorded, and the firmware moves the printhead to a new point, with the process repeating until the Z height has been recorded at all points. The number of points to be checked is defined by a parameter in the firmware.

This process can be carried out through an LCD screen, if available, or direct G-code commands (e.g. through OctoPrint).

What It Isn’t

Auto-bed leveling methods use a probe, like the BLTouch
Auto-bed leveling methods use a probe, like the BLTouch (Source: LongDong279 via Reddit)

To help you keep everything straight in your head, it’s useful to quickly review the remaining main types of bed leveling.

Other Mesh-Based Methods

Although “mesh bed leveling” has come to refer to the above specific method, there are two other popular mesh-based bed leveling methods:

  • Bilinear auto-bed leveling: There are several different ABL modes, with bilinear being one of them. If available, you typically select it by adjusting the printer’s firmware configuration file. Essentially, it works very much like mesh bed leveling, but the firmware does all the work and uses a probe instead of relying on the user to set Z height.
  • Unified bed leveling: This is a somewhat more complex method that combines aspects of several others. You can learn more about it in our article Marlin UBL (Unified Bed Leveling): How to Make It Work.

Non-Mesh-Based Methods

Alongside bilinear ABL, the other two main ABL modes are linear and 3-point, both of which compensate for the print bed’s tilt. Hence, they’re not mesh-based bed leveling methods.

Back to Contents

Advertisement
Advertisement
Advertisement
Mesh Bed Leveling

Setting It Up

All you need is the Configuration.h file
All you need is the Configuration.h file (Source: Jackson O'Connell via All3DP)

To set up mesh bed leveling, you’ll need to adjust your printer’s firmware. Once again, we’ll demonstrate this using the most recent version of Marlin. We only have to edit the Configuration.h file, which we can do in Microsoft VSCode, for example. Remember that messing with firmware can have unintended consequences, even for a simple procedure like this, so be careful as you go along.

If your printer’s firmware isn’t capable of mesh bed leveling, it may be possible to upgrade it. For this, you’ll need the configuration file to be compatible with your printer. A suitable copy may be available in the Example Configurations folder in the Marlin package.

If you’re totally new to firmware configuration, we’ve got a beginner’s firmware guide to get you started.

Back to Contents

Advertisement
Advertisement
Advertisement
Mesh Bed Leveling

Adjusting the Configuration File

Almost there...
Almost there... (Source: Jackson O'Connell via All3DP)

Let’s go over what you need to do and what each change does to the program.

Once in “Configuration.h”, use Ctrl+F to find the phrase “#define MESH_BED_LEVELING”, and uncomment it by removing the two slashes (“//”) in front of the phrase. Doing this enables the mesh bed leveling method on your printer, but make sure that none of the other leveling methods are activated.

Next, uncomment the phrase “#define RESTORE_LEVELING_AFTER_G28”, which should be just below the previous line. This will automatically send the G28 command to your printer before every print, restoring whatever mesh bed leveling values are set on your printer. On that note, the next step is to locate and uncomment the “#define LCD_BED_LEVELING” command, which will allow you to perform mesh bed leveling operations from your printer’s LCD screen.

Lastly, as mesh bed leveling doesn’t involve the use of a probe, you need to tell your printer that you’ll be completing the leveling process manually. You can do this by uncommenting the line “#define PROBE_MANUALLY”.

You can see three of these edits in the image above. Although you’ve now activated mesh bed leveling for your printer, it won’t work without a few extra steps, which we’ve gone over in the next section

Back to Contents

Advertisement
Advertisement
Mesh Bed Leveling

The Leveling Process

This is optional but may be useful
This is optional but may be useful (Source: Jackson O'Connell via All3DP)

Time to use a piece of paper! But this time, unlike manual, non-firmware, leveling, we’ll be adjusting Z height instead of twisting knobs below the build plate.

When you’re ready, heat up your printer for your filament of choice. Then, navigate to “Level Bed” under “Bed Leveling” in the Prepare heading of your LCD display. Each click will move the carriage towards the next location in a grid of nine points, and at each point, you’ll use the knob beside the LCD screen to raise or lower the Z-axis step by step. Make whatever adjustments are necessary to just allow your piece of paper to pass between nozzle and build surface.

When you get the message that you’re finished, print a bed test pattern. Three by three grids of squares seem especially popular for this method. The picture shows how to enable a bed test pattern in your menu if you like.

If your whole grid seems a touch consistently high or low, rather than do the whole thing again, use the Z Height menu option to take it up or down a little.

And that’s it! You’re done!

A tight and even bed test pattern
A tight and even bed test pattern (Source: Kevin Hester via Thingiverse)

Back to Contents

Advertisement
Advertisement

Lead image source: CHEP via YouTube

License: The text of "Mesh Bed Leveling – Simply Explained" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.

Stay informed with notifications from All3DP.

You get a notification when a new article is published.

You can’t subscribe to updates from All3DP. Learn more… Subscribe to updates

You can’t subscribe to updates from All3DP. Learn more…

Topics
Advertisement