<p>You should add <code>M420 S</code> command after <code>G28</code> to Start G-code.</p>
<p>According to <a href="https://marlinfw.org/docs/gcode/M420.html" rel="nofollow noreferrer">Marlin docs</a>, <code>G28</code> command disables bed leveling by default.</p>
<blockquote>
<p><code>G28</code> disables bed leveling. Follow with <code>M420 S</code> to turn leveling on, or use <code>RESTORE_LEVELING_AFTER_G28</code> to automatically keep leveling on after <code>G28</code>.</p>
</blockquote>
<p>Alternatively, you can change the <code>RESTORE_LEVELING_AFTER_G28</code> value to <code>true</code> in firmware.</p>

CC BY-SA 4.0
2023-04-06T19:12:56.803Z
2023-04-06T19:12:56.803Z
kosteklvp
<p>So, the G-code preppended to my slicer output (by Cura itself) looks like this:</p>
<pre><code>; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
M104 S{material_standby_temperature} ; Start heating up the nozzle most of the way
M190 S{material_bed_temperature_layer_0} ; Start heating the bed, wait until target temperature reached
M109 S{material_print_temperature_layer_0} ; Finish heating the nozzle
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
;G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
;G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
;G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
;G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
;G92 E0 ; Reset Extruder
;G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
;G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
</code></pre>
<p>But this code seems to be causing issues where it ignores the ABL (auto bed leveling.)</p>
<p>In my case, this means that the extruder starts clicking, and I suspect that with the particular hotend I have, this causes issues.  For now, I have commented out all the code to draw the primer lines, as you can see.</p>
<p>Is there a way to make them respect auto-leveling?</p>

<creality-ender-3><bed-leveling><g-code><automatic-bed-leveling>
CURA prints some primer lines, but they don't seem to respect bed automatic bed leveling
user1833028
# CURA prints some primer lines, but they don't seem to respect bed automatic bed leveling

(Asked by: username_0 on 2023-04-06)

So, the G-code preppended to my slicer output (by Cura itself) looks like this:

```
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
M104 S{material_standby_temperature} ; Start heating up the nozzle most of the way
M190 S{material_bed_temperature_layer_0} ; Start heating the bed, wait until target temperature reached
M109 S{material_print_temperature_layer_0} ; Finish heating the nozzle
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
;G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
;G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
;G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
;G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
;G92 E0 ; Reset Extruder
;G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
;G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish

```

But this code seems to be causing issues where it ignores the ABL (auto bed leveling.)

In my case, this means that the extruder starts clicking, and I suspect that with the particular hotend I have, this causes issues. For now, I have commented out all the code to draw the primer lines, as you can see.

Is there a way to make them respect auto-leveling?

**Tags:** creality-ender-3, bed-leveling, g-code, automatic-bed-leveling


---

## 1 answers

### Answer by username_1 on 2023-04-06. Score: 1 | Accepted answer

You should add `M420 S` command after `G28` to Start G-code.

According to [Marlin docs](https://marlinfw.org/docs/gcode/M420.html), `G28` command disables bed leveling by default.

> `G28` disables bed leveling. Follow with `M420 S` to turn leveling on, or use `RESTORE_LEVELING_AFTER_G28` to automatically keep leveling on after `G28`.

Alternatively, you can change the `RESTORE_LEVELING_AFTER_G28` value to `true` in firmware.


---

