<p>Setting any offset will move the whole print (&quot;effectively shifts the coordinate space&quot;) - so you can set up for printing above or below bed, or shifting several cm to the right, for example - and then your print may not actually fit the printing space. For example: my frame is blocking X moves at the top, I can set the 20 mm X offset to avoid accident when printing high (so shift the print). Or when setting the new print on top of another print, thus shifting the position, etc. If you call <code>M428</code> in any position, then current position will become the new offset. Current offset settings is reported by <code>M503</code> (or <code>M206</code> without parameters).</p>
<p>Also <code>G92</code> is used as ad-hoc operation when relative positioning is used. It makes sense for extruder movements, but is not used for moving the printing head in practice. I would say that any such calls for X,Y,Z sound like some hacking, and you should know exactly what you are doing for tricking printer's logic this way. I would avoid this at all.</p>
<p>Normally (0,0,0) for cartesian printers is nearest-bottom-left point of the bed.  If properly zero the printer is what you are trying to achieve, then you should:</p>
<ul>
<li>zero any X,Y,Z offsets: <code>M206 X0 Y0 Z0</code> (unless some is justified like in the frame example)</li>
<li>save this setting for future: <code>M500</code></li>
<li>home the printer - it zero the position, and then automiaticall backoff to some &quot;safe distance&quot; (programmed in firmware)</li>
<li>use LCD to move carriage back to zero: at least for the Z axis</li>
<li>regulate bed screws to fit the zero position of printing head</li>
</ul>
<p>There are settings in <a href="https://marlinfw.org/docs/configuration/configuration.html#homing" rel="nofollow noreferrer">Marlin's file Configuration_adv.h</a>:</p>
<ul>
<li><p>Marlin 1.1:</p>
<pre><code>#define X_HOME_BUMP_MM 5
#define Y_HOME_BUMP_MM 5
#define Z_HOME_BUMP_MM 2
</code></pre>
</li>
<li><p>Marlin 2.x:</p>
<pre><code>#define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump
</code></pre>
</li>
</ul>
<p>They do not change the zero (do not set offset), but force the carriage to move away from zero during homing operation and (Marlin 1.1) after homing, becuse usually it is convenient. Marlin 2.x offers separate parameter for final backoff:</p>
<pre><code>//#define HOMING_BACKOFF_MM { 2, 2, 2 }
</code></pre>
<p>If you would like to center the head after homing, I would suggest to use these settings.</p>

CC BY-SA 4.0
2021-01-17T21:24:09.517Z
2021-01-31T04:02:39.723Z
2021-01-31T04:02:39.723Z
octopus8
<p>So the new silicone buffers raised the bed by 5 mm? When this happens, you should raise the endstop also with 5 mm. Else the printer will go down to the Z endstop that is effectively 5 mm below the level of the bed. I guess the buffers cannot be compressed by 5 mm, so you need to move the endstop up to the level your buffer compression is in reach of.</p>
<p>No software offset will work (for your current setup: homing on the bed surface does not work as the switch need to be triggered prior to having any offset in play) other than a hardware change or compression of the buffers of 5 mm. It would only be possible to use a software offset when the nozzle homes off the bed surface (next to the bed). The only thing you would have had to do is add in your start G-code:</p>
<pre><code>G0 Z5   ; Move the head to 5 mm 
G92 Z0  ; Call this Z = 0 
</code></pre>
<p>If <code>#define Z_SAFE_HOMING</code> is enabled, you should comment the line in the configuration file to make it home Z at the homed X, Y position.</p>
<p>I will not go into all G-codes, details are read on the <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">G-codes Wiki pages</a> and <a href="https://marlinfw.org/docs/gcode/" rel="nofollow noreferrer">Marlin firmware G-codes</a>, these won't be able to help you out unless you fix the homing on the bed surface. Currently, you need to do a hardware fix, your endstop is below the surface level of the bed. Alternative is to remove homing Z above the bed surface and redefine the Z offset. A hardware fix is a better solution, and if you manage to print a fancy Z endstop holder and counterpart with a screw you will be able to level the bed more easily.</p>
<p>E.g. <a href="https://marlinfw.org/docs/gcode/M428.html" rel="nofollow noreferrer"><code>M428</code></a> can set an offset, yes, but, it needs a reference; that reference is the homing reference or the current position. The current position of a printer that is just turn on is meaningless, it can be everywhere in the print volume. So you need to trigger the endstops first, that is not possible when it is not reachable (without compressing the bed).</p>

CC BY-SA 4.0
2021-01-18T19:22:10.037Z
@0scar♦ So in conclusion, all I need to do is get rid of my homing-in-center-of-bed (by uncommenting #define BED_CENTER_AT_0_0 in my firmware, I suppose?), and then all my troubles are over and my offsets will work?
Pixie
CC BY-SA 4.0
2021-01-18T20:40:58.953Z
I agree with all 0scar advices. Bit funny idea: I would say that there is an alternative solution, but still hardware and I never tried to do that: (1) add the second (upper) endstop for Z (or move & reverse the existing one), (2) change your firmware to reverse Z homing direction (find the highest point, and probably disable Z backoff too), and then in G-Code assume this position to be exact high value (e.g. use `G92 Z250` to fix that). Then your actual offset is applied without homing down into bed! I would like to see proof of concept :)
octopus8
CC BY-SA 4.0
2021-01-18T20:54:47.970Z
@Pixie, "get rid of my homing-in-centerbed" --> not only, you need to target Z outside of the bed. You would need to ensure homing order (first X or Y, then Z) and backoff to move carriage behind the bed (like -30 or 250, I do not know Anet A6!). Configuring such backoff may not be possible. Firmware may have settings enabled to block it at all. Or you can home each axis separately (e.g. `G28 X`) and trick the firmware - e.g. after X=0 you call `G92 X50` and then can move outside bed (and crash into the frame?), then home Z. Very exaggerted, tricky method, error prone, not worth effort at all.
octopus8
CC BY-SA 4.0
2021-01-19T22:24:06.677Z
@Pixie your bed center cannot be in the middle, only a few printers have that. SAFE_HOMING should be in comments. As BED_CENTER_AT_0_0 should be in comments as well.
0scar
CC BY-SA 4.0
2021-01-17T22:50:11.460Z
2021-01-18T18:45:33.507Z
2021-01-18T18:45:33.507Z
0scar
<p>After watching every possible YouTube video on the subject and reading any source available, and although I'm a PhD and quite computer savvy, I still can't make my Anet A6 (no probe) behave in terms of Z offset. I upgraded to silicone bed buffers instead of the stock springs; now my bed is ~5 mm raised, and I don't know how to proceed. Some observations:</p>
<ul>
<li><p><strong>G28</strong> makes the nozzle go to the center of the bed. Display says X 111 and Y 111. Is it preferable to set the home to the bottom-left corner, or is the center just fine?</p>
</li>
<li><p><strong>G28</strong> makes the nozzle squish the bed ~5 mm deep.</p>
</li>
<li><p>I've tried the <strong>G92</strong> approach and the <strong>M428</strong> approach. I can't quite understand what's the difference between them. Can anyone explain why sometimes the former is used and sometimes the latter?</p>
</li>
<li><p>I had high hopes for <strong>M428</strong>. What could be simpler? You physically guide the nozzle to where you want it to be, send the command, and that's your new 0,0,0. But I guess not. Since my &quot;home&quot; is at 111,111 and apparently M428 can only be used at a maximum of 20 mm from 0, I get a &quot;too far from reference&quot; error message.</p>
</li>
<li><p>At any rate, both approaches (also <strong>M206</strong>) haven't helped. When I <strong>G28</strong>, the nozzle still squishes the bed. The display either says Z 5 or Z -5 or whatever I've played with, but the nozzle still squishes the poor bed.</p>
</li>
<li><p>In my LCD menu (Marlin 1.1.9), I don't have Control -&gt; Motion -&gt; Z offset. Since many videos recommend using this, this is quite sad. Can anyone tell me why this option is absent?</p>
</li>
<li><p>On a very conceptual level, I can't quite understand why in all the video guides the bed screws are completely ignored when discussing Z offset. One guy showed how he's correcting his Z offset 0.3 mm using G-code. But he could've easily done it by adjusting his screws... They all say &quot;Z offset means the distance between your nozzle and bed, and here is how to adjust it&quot;. Now comes G-code, or LCD menu, etc. But why is everyone forgetting that you can adjust the distance between your bed and nozzle using the screws?! I can't seem to wrap my head around this. In my case, of course, I can't use the screws -- they've reached their limit, so I need to add extra using G-code. But nobody seems to really explain this nicely...</p>
</li>
</ul>
<p><strong>Summary:</strong> I urgently need a walkthrough for 6-year-olds. Make that 4-year-olds.</p>

<marlin><g-code><bed-leveling><anet-a6><print-axis-offset>
How do I set my Z offset?
Pixie
# How do I set my Z offset?

(Asked by: username_0 on 2021-01-17)

After watching every possible YouTube video on the subject and reading any source available, and although I'm a PhD and quite computer savvy, I still can't make my Anet A6 (no probe) behave in terms of Z offset. I upgraded to silicone bed buffers instead of the stock springs; now my bed is ~5 mm raised, and I don't know how to proceed. Some observations:

* **G28** makes the nozzle go to the center of the bed. Display says X 111 and Y 111. Is it preferable to set the home to the bottom-left corner, or is the center just fine?
* **G28** makes the nozzle squish the bed ~5 mm deep.
* I've tried the **G92** approach and the **M428** approach. I can't quite understand what's the difference between them. Can anyone explain why sometimes the former is used and sometimes the latter?
* I had high hopes for **M428**. What could be simpler? You physically guide the nozzle to where you want it to be, send the command, and that's your new 0,0,0. But I guess not. Since my "home" is at 111,111 and apparently M428 can only be used at a maximum of 20 mm from 0, I get a "too far from reference" error message.
* At any rate, both approaches (also **M206**) haven't helped. When I **G28**, the nozzle still squishes the bed. The display either says Z 5 or Z -5 or whatever I've played with, but the nozzle still squishes the poor bed.
* In my LCD menu (Marlin 1.1.9), I don't have Control -> Motion -> Z offset. Since many videos recommend using this, this is quite sad. Can anyone tell me why this option is absent?
* On a very conceptual level, I can't quite understand why in all the video guides the bed screws are completely ignored when discussing Z offset. One guy showed how he's correcting his Z offset 0.3 mm using G-code. But he could've easily done it by adjusting his screws... They all say "Z offset means the distance between your nozzle and bed, and here is how to adjust it". Now comes G-code, or LCD menu, etc. But why is everyone forgetting that you can adjust the distance between your bed and nozzle using the screws?! I can't seem to wrap my head around this. In my case, of course, I can't use the screws -- they've reached their limit, so I need to add extra using G-code. But nobody seems to really explain this nicely...

**Summary:** I urgently need a walkthrough for 6-year-olds. Make that 4-year-olds.

**Tags:** marlin, g-code, bed-leveling, anet-a6, print-axis-offset

---

## 2 answers

### Answer by username_2 on 2021-01-17. Score: 2 | Accepted answer

So the new silicone buffers raised the bed by 5 mm? When this happens, you should raise the endstop also with 5 mm. Else the printer will go down to the Z endstop that is effectively 5 mm below the level of the bed. I guess the buffers cannot be compressed by 5 mm, so you need to move the endstop up to the level your buffer compression is in reach of.
No software offset will work (for your current setup: homing on the bed surface does not work as the switch need to be triggered prior to having any offset in play) other than a hardware change or compression of the buffers of 5 mm. It would only be possible to use a software offset when the nozzle homes off the bed surface (next to the bed). The only thing you would have had to do is add in your start G-code:
G0 Z5   ; Move the head to 5 mm 
G92 Z0  ; Call this Z = 0 

If #define Z_SAFE_HOMING is enabled, you should comment the line in the configuration file to make it home Z at the homed X, Y position.
I will not go into all G-codes, details are read on the G-codes Wiki pages and Marlin firmware G-codes, these won't be able to help you out unless you fix the homing on the bed surface. Currently, you need to do a hardware fix, your endstop is below the surface level of the bed. Alternative is to remove homing Z above the bed surface and redefine the Z offset. A hardware fix is a better solution, and if you manage to print a fancy Z endstop holder and counterpart with a screw you will be able to level the bed more easily.
E.g. M428 can set an offset, yes, but, it needs a reference; that reference is the homing reference or the current position. The current position of a printer that is just turn on is meaningless, it can be everywhere in the print volume. So you need to trigger the endstops first, that is not possible when it is not reachable (without compressing the bed).

> **Comments:**
> **username_0**: @0scar♦ So in conclusion, all I need to do is get rid of my homing-in-center-of-bed (by uncommenting #define BED_CENTER_AT_0_0 in my firmware, I suppose?), and then all my troubles are over and my offsets will work?  
> **username_1**: I agree with all 0scar advices. Bit funny idea: I would say that there is an alternative solution, but still hardware and I never tried to do that: (1) add the second (upper) endstop for Z (or move & reverse the existing one), (2) change your firmware to reverse Z homing direction (find the highest point, and probably disable Z backoff too), and then in G-Code assume this position to be exact high value (e.g. use `G92 Z250` to fix that). Then your actual offset is applied without homing down into bed! I would like to see proof of concept :)  
> **username_1**: @Pixie, "get rid of my homing-in-centerbed" --> not only, you need to target Z outside of the bed. You would need to ensure homing order (first X or Y, then Z) and backoff to move carriage behind the bed (like -30 or 250, I do not know Anet A6!). Configuring such backoff may not be possible. Firmware may have settings enabled to block it at all. Or you can home each axis separately (e.g. `G28 X`) and trick the firmware - e.g. after X=0 you call `G92 X50` and then can move outside bed (and crash into the frame?), then home Z. Very exaggerted, tricky method, error prone, not worth effort at all.  
> **username_2**: @Pixie your bed center cannot be in the middle, only a few printers have that. SAFE_HOMING should be in comments. As BED_CENTER_AT_0_0 should be in comments as well.  

---

### Answer by username_1 on 2021-01-17. Score: 0

Setting any offset will move the whole print ("effectively shifts the coordinate space") - so you can set up for printing above or below bed, or shifting several cm to the right, for example - and then your print may not actually fit the printing space. For example: my frame is blocking X moves at the top, I can set the 20 mm X offset to avoid accident when printing high (so shift the print). Or when setting the new print on top of another print, thus shifting the position, etc. If you call M428 in any position, then current position will become the new offset. Current offset settings is reported by M503 (or M206 without parameters).
Also G92 is used as ad-hoc operation when relative positioning is used. It makes sense for extruder movements, but is not used for moving the printing head in practice. I would say that any such calls for X,Y,Z sound like some hacking, and you should know exactly what you are doing for tricking printer's logic this way. I would avoid this at all.
Normally (0,0,0) for cartesian printers is nearest-bottom-left point of the bed.  If properly zero the printer is what you are trying to achieve, then you should:

zero any X,Y,Z offsets: M206 X0 Y0 Z0 (unless some is justified like in the frame example)
save this setting for future: M500
home the printer - it zero the position, and then automiaticall backoff to some "safe distance" (programmed in firmware)
use LCD to move carriage back to zero: at least for the Z axis
regulate bed screws to fit the zero position of printing head

There are settings in Marlin's file Configuration_adv.h:

Marlin 1.1:
#define X_HOME_BUMP_MM 5
#define Y_HOME_BUMP_MM 5
#define Z_HOME_BUMP_MM 2


Marlin 2.x:
#define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump



They do not change the zero (do not set offset), but force the carriage to move away from zero during homing operation and (Marlin 1.1) after homing, becuse usually it is convenient. Marlin 2.x offers separate parameter for final backoff:
//#define HOMING_BACKOFF_MM { 2, 2, 2 }

If you would like to center the head after homing, I would suggest to use these settings.


---

