<h3>Z-offset persitently stored in memory?</h3>
<p>Maybe the value of <code>-2.97</code> for the <code>Z_PROBE_OFFSET_FROM_EXTRUDER </code> is retained in the EEPROM memory when you upload new firmware.</p>
<p>You could try to send the G-code <a href="https://reprap.org/wiki/G-code#M502:_Read_parameters_from_.22configuration.h.22" rel="noreferrer"><code>M502</code></a> to the machine to re-load the values from the firmware overwriting currently stored values.</p>
<h3>Alternative Z-offset using G-code commands</h3>
<p>Note that there is a different (and more common) solution to set the Z-offset using G-code <a href="https://reprap.org/wiki/G-code#M851:_Set_Z-Probe_Offset" rel="noreferrer"><code>M851</code></a>, you can do this after you uploaded the firmware to the printer. Sending G-code commands can be done using printer software and a USB connection to the printer through a so-called <strong>terminal</strong> interface. This can be done in OctoPrint, Repetier-Host, Pronterface (Printrun software suite), and probably many more. Alternatively, you could make seperate G-code (basically text files with extension <code>.g</code>) files with each step in a single file and &quot;print&quot; the files through the SD interface of the printer menu.</p>
<p>The following strategy must be followed to specify the Z offset:</p>
<ul>
<li>Heat your printer up to your printing temperature and allow a few minutes for it to expand and settle</li>
<li>Reset the existing Z-offset to zero <code>M851 Z0</code></li>
<li>Home all axes <code>G28</code></li>
<li>Move the nozzle to the middle of the bed <code>G1 X110 Y110</code> (if your bed is 220 x 220)</li>
<li>Turn off the software endstops with <code>M211 S0</code></li>
<li>Move the nozzle down so it is just gripping a piece of standard printer paper</li>
<li>Set the Z-offset to the displayed value. E.g. if the printer displays a Z-Value of <code>-1.23</code> enter <code>M851 Z-1.23</code></li>
<li>Store it to the EEPROM <code>M500</code></li>
<li><strong>Important notice!</strong> Enable the endstops again with <code>M211 S1</code> or the printer head will collide with the bed on the next <code>G28</code> command</li>
</ul>

CC BY-SA 4.0
2019-05-01T19:10:33.357Z
Thank you very much. This helped. I used Repetier-Host and was able to calculate the new z offset and store it. After that, I printed something and it was successful!
Rosalie W
CC BY-SA 4.0
2019-04-30T06:37:15.173Z
2019-04-30T09:45:05.933Z
2020-06-18T08:29:41.667Z
0scar
<p>I need to set a Z offset for the Flying bear P902. I calculated the offset (-2.98). But, every time when I try to input this using the LCD screen of my 3D printer, the value jumps to either -2.99 or -2.97. As -2.97 is just a little bit too far from the bed and -2.99 is just a little bit too close to the bed (and -2.98 is perfect), I really want to input this specific value. I have tried many times on the LCD screen and also in the firmware itself. </p>

<p>But, even after uploading the firmware, it still displays -2.97. </p>

<p>This is the line of code I was changing: </p>

<pre><code>#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.98 // Z offset: -below +above  [the nozzle]
</code></pre>

<p>Is there a way I can input -2.98?</p>

CC BY-SA 4.0
2019-04-30T06:32:01.987Z
I really doubt that 1/100 of a mm would make that effect on adhesion, the deviation of the positioning accuracy is most probable even higher than that!
0scar
<marlin><calibration><firmware><z-probe>
Specifying Z offset in Marlin firmware
Rosalie W
# Specifying Z offset in Marlin firmware

(Asked by: username_0 on 2019-04-30)

I need to set a Z offset for the Flying bear P902. I calculated the offset (-2.98). But, every time when I try to input this using the LCD screen of my 3D printer, the value jumps to either -2.99 or -2.97. As -2.97 is just a little bit too far from the bed and -2.99 is just a little bit too close to the bed (and -2.98 is perfect), I really want to input this specific value. I have tried many times on the LCD screen and also in the firmware itself. 
But, even after uploading the firmware, it still displays -2.97. 
This is the line of code I was changing: 
#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.98 // Z offset: -below +above  [the nozzle]

Is there a way I can input -2.98?

**Tags:** marlin, calibration, firmware, z-probe
> **Comments:**
> **username_1**: I really doubt that 1/100 of a mm would make that effect on adhesion, the deviation of the positioning accuracy is most probable even higher than that!  

---

## 1 answers

### Answer by username_1 on 2019-04-30. Score: 16 | Accepted answer

### Z-offset persitently stored in memory?

Maybe the value of `-2.97` for the `Z_PROBE_OFFSET_FROM_EXTRUDER`  is retained in the EEPROM memory when you upload new firmware.

You could try to send the G-code [`M502`](https://reprap.org/wiki/G-code#M502:_Read_parameters_from_.22configuration.h.22) to the machine to re-load the values from the firmware overwriting currently stored values.

### Alternative Z-offset using G-code commands

Note that there is a different (and more common) solution to set the Z-offset using G-code [`M851`](https://reprap.org/wiki/G-code#M851:_Set_Z-Probe_Offset), you can do this after you uploaded the firmware to the printer. Sending G-code commands can be done using printer software and a USB connection to the printer through a so-called **terminal** interface. This can be done in OctoPrint, Repetier-Host, Pronterface (Printrun software suite), and probably many more. Alternatively, you could make seperate G-code (basically text files with extension `.g`) files with each step in a single file and "print" the files through the SD interface of the printer menu.

The following strategy must be followed to specify the Z offset:

* Heat your printer up to your printing temperature and allow a few minutes for it to expand and settle
* Reset the existing Z-offset to zero `M851 Z0`
* Home all axes `G28`
* Move the nozzle to the middle of the bed `G1 X110 Y110` (if your bed is 220 x 220)
* Turn off the software endstops with `M211 S0`
* Move the nozzle down so it is just gripping a piece of standard printer paper
* Set the Z-offset to the displayed value. E.g. if the printer displays a Z-Value of `-1.23` enter `M851 Z-1.23`
* Store it to the EEPROM `M500`
* **Important notice!** Enable the endstops again with `M211 S1` or the printer head will collide with the bed on the next `G28` command

> **Comments:**
> **username_0**: Thank you very much. This helped. I used Repetier-Host and was able to calculate the new z offset and store it. After that, I printed something and it was successful!  

---

