<p>In additional to Sergey's answer <code>M420 S1</code> should be put into custom start G-code. By default Marlin disables autobed after <code>G28</code> unless specifically configured otherwise</p>
<pre><code>/**
* Normally G28 leaves leveling disabled on completion. Enable
* this option to have G28 restore the prior leveling state.
*/
#define RESTORE_LEVELING_AFTER_G28
</code></pre>

CC BY-SA 4.0
2019-10-31T07:38:21.203Z
2023-07-10T00:00:03.137Z
2023-07-10T00:00:03.137Z
Everett Wenzel
<p>Bed leveling is disabled by default. So the mesh was scanned but is not apllied after G29 command. To apply the mesh we need to enable bed leveling using </p>

<pre><code>M420 S1 
</code></pre>

<p>command</p>

CC BY-SA 3.0
2017-06-20T11:56:08.577Z
2017-06-20T11:56:08.577Z
Sergey Kravchenko
<p>I configured Marlin 1.1.3 for auto-leveling with a fix mounted sensor connected to the Z end-stop pin.</p>

<p>I have the following settings in my config:</p>

<pre><code>#define X_PROBE_OFFSET_FROM_EXTRUDER 25  
#define Y_PROBE_OFFSET_FROM_EXTRUDER 20  
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES  5 // Z Clearance between probe points

#define AUTO_BED_LEVELING_BILINEAR

#define GRID_MAX_POINTS_X 7
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

// The Z probe minimum outer margin (to validate G29 parameters).
#define MIN_PROBE_EDGE 10

// Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 25
#define RIGHT_PROBE_BED_POSITION 150
#define FRONT_PROBE_BED_POSITION 30
#define BACK_PROBE_BED_POSITION 180
</code></pre>

<p>I enter <code>M111 S38</code> to enable LEVELING+INFO+ERROR debugging.
Then I enter <code>G28</code> to home all axes and then enter <code>G29</code> to start auto-leveling.</p>

<p>The auto-leveling starts successfully and after finishing I see the scan grid in console:</p>

<pre><code>12:41:35.983 : Bilinear Leveling Grid:
12:41:35.983 : 0      1      2      3      4      5      6
12:41:35.983 : 0 -3.127 -3.405 -3.405 -3.292 -3.595 -3.487 -3.537
12:41:35.983 : 1 -3.110 -3.367 -3.337 -3.220 -3.470 -3.350 -3.365
12:41:35.983 : 2 -3.138 -3.367 -3.330 -3.215 -3.442 -3.345 -3.385
12:41:35.984 : 3 -3.013 -3.225 -3.182 -3.047 -3.225 -3.132 -3.150
12:41:35.984 : 4 -2.970 -3.165 -3.097 -2.972 -3.160 -3.045 -3.065
12:41:35.984 : 5 -2.875 -3.075 -3.005 -2.847 -2.990 -2.872 -2.875
12:41:35.984 : 6 -2.680 -2.845 -2.755 -2.615 -2.753 -2.617 -2.622
12:41:35.985 : G29 uncorrected Z:10.00
12:41:35.985 : corrected Z:12.85
12:41:35.985 : &lt;&lt;&lt; gcode_G29
12:41:35.985 : X:120.00 Y:160.00 Z:12.85 E:0.00 Count X:9600 Y:12800 Z:4000
12:41:35.985 : current_position=(120.00, 160.00, 12.85) : sync_plan_position
</code></pre>

<p>So the auto-leveling scanning seems to be successful.</p>

<p>Here is a visual of the leveling grid (but upside down to make it easier to view):</p>

<p><a href="https://i.sstatic.net/TOas7.jpg" rel="noreferrer" title="Inverted visual of the leveling grid"><img src="https://i.sstatic.net/TOas7.jpg" alt="Inverted visual of the leveling grid" title="Inverted visual of the leveling grid"></a></p>

<p>Naturally I <strong>DO NOT</strong> enter <code>G28</code> after the scanning. </p>

<p>I enter <code>G0 Z1</code> to down nozzle almost to table. But when I enter for example <code>G0 X25 Y30</code> and look at level and then I enter <code>G0 X150 Y150</code> I see the big difference between nozzle levels relatively to table. So it seems that height compensation does not work. I expect that Z axis would lift up or down depending on auto-leveling results but Z motor do not work when I move X/Y. </p>

<p>By the way I tried 3 point autoleveling. It was pretty rough but Z axis corrected it's level when I moved axes using <code>G0</code> commands.
And to avoid questions "why my table is inclined so much?" I deliberately inclined the table to be sure that auto leveling works. By the way, I tried different <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> so the current 0 setting is not actual but situation is the same with any value of this option.</p>

<p>What I am doing wrong?</p>

CC BY-SA 3.0
2017-06-20T01:24:52.577Z
I plotted your leveling grid and the axis that is opposite your incline is going up and down quite a bit.  Could your table be wobbling/rocking and this is throwing off the auto-level?
markshancock
CC BY-SA 3.0
2017-06-20T04:30:10.950Z
hmm, i didn' thought abot it, will check
Sergey Kravchenko
CC BY-SA 3.0
2017-06-20T19:17:22.053Z
btw what software did you use to visualize the mesh?
Sergey Kravchenko
CC BY-SA 3.0
2017-06-21T02:01:27.937Z
I created the visualization using Excel.
markshancock
<marlin><bed-leveling>
Auto leveling with Marlin and RAMPS 1.4 does not work
Sergey Kravchenko
# Auto leveling with Marlin and RAMPS 1.4 does not work

(Asked by: username_0 on 2017-06-19)

I configured Marlin 1.1.3 for auto-leveling with a fix mounted sensor connected to the Z end-stop pin.

I have the following settings in my config:

```
#define X_PROBE_OFFSET_FROM_EXTRUDER 25  
#define Y_PROBE_OFFSET_FROM_EXTRUDER 20  
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES  5 // Z Clearance between probe points

#define AUTO_BED_LEVELING_BILINEAR

#define GRID_MAX_POINTS_X 7
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

// The Z probe minimum outer margin (to validate G29 parameters).
#define MIN_PROBE_EDGE 10

// Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 25
#define RIGHT_PROBE_BED_POSITION 150
#define FRONT_PROBE_BED_POSITION 30
#define BACK_PROBE_BED_POSITION 180

```

I enter `M111 S38` to enable LEVELING+INFO+ERROR debugging.
Then I enter `G28` to home all axes and then enter `G29` to start auto-leveling.

The auto-leveling starts successfully and after finishing I see the scan grid in console:

```
12:41:35.983 : Bilinear Leveling Grid:
12:41:35.983 : 0      1      2      3      4      5      6
12:41:35.983 : 0 -3.127 -3.405 -3.405 -3.292 -3.595 -3.487 -3.537
12:41:35.983 : 1 -3.110 -3.367 -3.337 -3.220 -3.470 -3.350 -3.365
12:41:35.983 : 2 -3.138 -3.367 -3.330 -3.215 -3.442 -3.345 -3.385
12:41:35.984 : 3 -3.013 -3.225 -3.182 -3.047 -3.225 -3.132 -3.150
12:41:35.984 : 4 -2.970 -3.165 -3.097 -2.972 -3.160 -3.045 -3.065
12:41:35.984 : 5 -2.875 -3.075 -3.005 -2.847 -2.990 -2.872 -2.875
12:41:35.984 : 6 -2.680 -2.845 -2.755 -2.615 -2.753 -2.617 -2.622
12:41:35.985 : G29 uncorrected Z:10.00
12:41:35.985 : corrected Z:12.85
12:41:35.985 : <<< gcode_G29
12:41:35.985 : X:120.00 Y:160.00 Z:12.85 E:0.00 Count X:9600 Y:12800 Z:4000
12:41:35.985 : current_position=(120.00, 160.00, 12.85) : sync_plan_position

```

So the auto-leveling scanning seems to be successful.

Here is a visual of the leveling grid (but upside down to make it easier to view):

[![Inverted visual of the leveling grid](https://i.sstatic.net/TOas7.jpg "Inverted visual of the leveling grid")](https://i.sstatic.net/TOas7.jpg "Inverted visual of the leveling grid")

Naturally I **DO NOT** enter `G28` after the scanning.

I enter `G0 Z1` to down nozzle almost to table. But when I enter for example `G0 X25 Y30` and look at level and then I enter `G0 X150 Y150` I see the big difference between nozzle levels relatively to table. So it seems that height compensation does not work. I expect that Z axis would lift up or down depending on auto-leveling results but Z motor do not work when I move X/Y.

By the way I tried 3 point autoleveling. It was pretty rough but Z axis corrected it's level when I moved axes using `G0` commands.
And to avoid questions "why my table is inclined so much?" I deliberately inclined the table to be sure that auto leveling works. By the way, I tried different `Z_PROBE_OFFSET_FROM_EXTRUDER` so the current 0 setting is not actual but situation is the same with any value of this option.

What I am doing wrong?

**Tags:** marlin, bed-leveling

> **Comments:**
> **username_1**: I plotted your leveling grid and the axis that is opposite your incline is going up and down quite a bit.  Could your table be wobbling/rocking and this is throwing off the auto-level?  
> **username_0**: hmm, i didn' thought abot it, will check  
> **username_0**: btw what software did you use to visualize the mesh?  
> **username_1**: I created the visualization using Excel.  

---

## 2 answers

### Answer by username_0 on 2017-06-20. Score: 3 | Accepted answer

Bed leveling is disabled by default. So the mesh was scanned but is not apllied after G29 command. To apply the mesh we need to enable bed leveling using

```
M420 S1 

```

command


---

### Answer by username_2 on 2019-10-31. Score: 3

In additional to username_0's answer `M420 S1` should be put into custom start G-code. By default Marlin disables autobed after `G28` unless specifically configured otherwise

```
/**
* Normally G28 leaves leveling disabled on completion. Enable
* this option to have G28 restore the prior leveling state.
*/
#define RESTORE_LEVELING_AFTER_G28

```


---

