# Calibrate Bed Mesh

This section explains how to run a Bed Mesh Calibration. The Bed Mesh module may be used to compensate for bed surface irregularities to achieve a better first layer across the entire bed. It should be noted that software based correction will not achieve perfect results, it can only approximate the shape of the bed. Bed Mesh also cannot compensate for mechanical and electrical issues. If an axis is skewed or a probe is not accurate then the bed\_mesh module will not receive accurate results from the probing process.

{% hint style="info" %}
Prior to starting this calibration, remove any filament completely from your printer and ensure your nozzle does not have any extruded filament hardened on the nozzle. This will ensure a proper bed mesh calibration.
{% endhint %}

* From the MainsailOS web interface;
  * Click the <mark style="color:red;">`Home All`</mark> button in the <mark style="color:red;">`Controls`</mark> section;

![Home All](/files/DL9bwZq5EG0qMQOE3i7J)

* Send a <mark style="color:red;">`BED_MESH_CALIBRATE`</mark> command in the <mark style="color:red;">`Console`</mark>;

{% hint style="info" %}
The <mark style="color:red;">`[bed_mesh]`</mark> section in the <mark style="color:red;">`printer.cfg`</mark> file has been preconfigured to run a 25 point bed mesh calibration by default.

As long as your <mark style="color:red;">`z_offset calibration`</mark> was done properly, the printer should register all 25 points (5x5) and provide output at the end of the process.

If at any point the print head stops moving and you get a 'No trigger on probe after full movement' message, you can restart this section from the beginning and try again.

If you are not able to complete a <mark style="color:red;">`BED_MESH`</mark>*<mark style="color:red;">`_`</mark>*<mark style="color:red;">`CALIBRATE`</mark>, go back and redo the [Calibrate Probe Z Offset](/klipper-installation-for-anycubic-vyper/initial-tuning/calibrate-probe-z-offset.md) section and then try again.
{% endhint %}

![Bed Mesh Calibrate](/files/KYsOpQacvfHGH7W0cxsB)

* Once the <mark style="color:red;">`bed_mesh`</mark> finishes probing all 25 points, you should get a <mark style="color:red;">`Mesh Bed Leveling Complete`</mark> message in the <mark style="color:red;">`Console`</mark>;
* Send a <mark style="color:red;">`SAVE_CONFIG`</mark> command in the <mark style="color:red;">`Console`</mark>;
  * This will update the <mark style="color:red;">`printer.cfg`</mark> file with the new <mark style="color:red;">`bed_mesh`</mark> settings and restart Klipper;

![SAVE\_CONFIG](/files/qzwNbS9HPPQSB74zmkRZ)

* Checking the <mark style="color:red;">`printer.cfg`</mark> file to ensure the new <mark style="color:red;">`bed_mesh`</mark> settings are updated:
  * From the MainsailOS web interface, click <mark style="color:red;">`Machine`</mark>, then click on <mark style="color:red;">`printer.cfg`</mark>

![Machine > printer.cfg](/files/txyxPDqJltjsEM0OY6VE)

* The <mark style="color:red;">`printer.cfg`</mark> file should load into an editor window;
* Scroll down to the very bottom of the <mark style="color:red;">`printer.cfg`</mark> file until you reach the;
  * <mark style="color:red;">`#*# <---------------------- SAVE_CONFIG ---------------------->`</mark> section;
  * A new <mark style="color:red;">`[bed_mesh default]`</mark> section should be present, along with the new <mark style="color:red;">`bed_mesh`</mark>  settings;

![\[bed\_mesh default\]](/files/oLZZIIL7ldPjzIa4tcJ6)

* Once you have confirmed these settings;
  * Close the <mark style="color:red;">`printer.cfg`</mark> file by clicking the <mark style="color:red;">`X`</mark> near the top right of editor;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sean-dearing.gitbook.io/klipper-installation-for-anycubic-vyper/initial-tuning/calibrate-bed-mesh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
