If you’re looking to upgrade your 3D printer, one of the most popular ways to do it is by changing the firmware. The two most popular options for this, Klipper and Marlin, offer a great deal of customizability and features that can be personalized to your use case.
More and more users every day are changing the printer’s default firmware to Klipper. This requires another round of new calibrations, and bed mesh isn’t an exception. This crucial feature can sometimes mean the difference between a successful print and a failure, so getting it right before printing is therefore a must. In a nutshell, if a bed surface is irregular – with bumps or dips, or if it’s in any way askew – then a bed mesh calibration will make up for this unevenness, avoiding issues with the first (and subsequent) layers.
It all sounds almost magical on paper, but how difficult is it actually? If you’ve already done it in Marlin, good news: it’s practically the same process with slightly different names.
In this article, we’ll go over how to set up the configuration file, how to execute the calibration procedure, and finally look into a few more advanced settings you might find helpful when working with Klipper. Stick around to learn more!
In essence, bed mesh compensation comes down to three steps:
Before we go deeper into this, let’s take a closer look to understand what makes bed med compensation so effective and why you should calibrate it.
Even if squared to the gantry, no build surface is perfectly flat. It has lower and higher points, and this affects the first layer. The nozzle will inevitably be further away in some points and too close in others, resulting in uneven deposition of filament. This will cause all sorts of problems, like poor first layer adhesion, warping, uneven bottom layers, and much more.
To prevent this, the mesh compensation uses a set of values and coordinates to account for such imperfections. The nozzle is moved up and down to follow the profile of the bed and extrude at a constant distance from the surface.
Klipper offers two options for calibrating the bed:
Whatever method you choose, it won’t affect how the mesh is processed or compensated for.
Also, remember that this is just compensation. It doesn’t fix mechanical or squaring issues and it has its limits. An extremely warped bed will be more complicated to adjust for, and a skewed X-axis will inevitably reflect in the mesh. Before starting the procedure, remember to level your bed, as well as check that your gantry is squared.
Now that you’re set and ready to calibrate, let’s dive into the steps to take. For reference, we’ll be using Mainsail for the interface, but Fluidd or OctoKlipper will work too.
This method has several entry points: You can use the Calibrate button in the Heightmap menu, create a macro to run it, or send each command via the Console. Again, the execution doesn’t have any effect on how the mesh itself will be measured. It’s only a matter of interfaces and buttons.
The first step is always to create the [bed_mesh]
section in the config file. In this section, you will have to define:
For example, it could look like this:
[bed_mesh]
mesh_min: 5, 5
mesh_max: 215, 215
probe_count: 7, 7
speed: 80
Everything is explained in detail in Klipper’s Configuration Reference. Make sure to check it out beforehand.
The included Calibration button under the Heightmap (or Bed Mesh in Fluidd) menu will execute whatever you have set in [bed_mesh]
. This fire-and-forget option will work fine for a rapid automatic calibration.
Alternatively, you can also create a macro in the config file. This will allow you to manipulate the calibration sequence, for example, by homing the printer first or by heating the bed. This way, you can also run it automatically at the start of every print.
To learn more about Klipper macros, you can read the corresponding Command Templates.
For example, a macro that heats the bed and nozzle before printing could look like this:
[gcode_macro probe_mesh] gcode: # Set extruder and bed temperature M109 S120 M190 S60 # Home all axis G28 # Start probing BED_MESH_CALIBRATE PROFILE=mesh1 METHOD=automatic # Turn off heaters afterward TURN_OFF_HEATERS
Finally, you could also simply give the command via the Console terminal to execute the calibration. You can follow this structure:
BED_MESH_CALIBRATE PROFILE=<name> METHOD=[automatic] [<probe_parameter>=<value>] [<mesh_parameter>=<value>]
probe_parameter
and mesh_parameter
indicate the aforementioned values to set. Use MESH_MIN
, MESH_MAX
, and PROBE_COUNT
to define them. Here’s an example:
BED_MESH_CALIBRATE PROFILE=mesh1 METHOD=automatic MESH_MIN=5,5 MESH_MAX=215,215 PROBE_COUNT=7,7 PROBE_SPEED=80
Always remember to save your mesh!
After you’ve created the [bed_mesh]
section in the config file, you can proceed with issuing the command via the Console or a macro, this time using METHOD=manual
.
Once you’re done, you need to save our mesh.
Always use the SAVE_CONFIG
command to store the mesh and restart Klipper. The values will be saved at the bottom of the config file, under the SAVE_CONFIG
section. You should not be editing that part.
To be effective, the mesh has to be recalled before starting a print. You can do so by adding a few lines at the end of your start G-code, directly in the slicer, or in your START_PRINT
macro. Here’s how that looks in practice:
BED_MESH_PROFILE LOAD=<name>
This will restore the mesh state from the profile matching the supplied name. It’s needed to activate compensation.
BED_MESH_PROFILE REMOVE=<name>
This can be used in the end G-code to delete the mesh stored. SAVE_CONFIG
is needed afterward.
Remember that you need to set an appropriate Z offset to have reliable adhesion. You can learn more in our article on how to make Klipper and BLTouch work together.
While the aforementioned configuration will work fine, you might want to dive deeper into what the mesh module can do. In fact, Klipper includes a series of parameters and tools that might come in handy for more expert users:
For more on all of these settings and how to use them, always refer to Klipper’s configuration documents.
Some users have come up with very clever bed calibration macros that you simply add to your configuration file (with extremely light modifications). Among the most useful ones are these:
License: The text of "Klipper: Bed Mesh – Simply Explained" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.