Specifying Z offset in Marlin firmware
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?
Z-offset persitently stored in memory?
Maybe the value of
Z_PROBE_OFFSET_FROM_EXTRUDERis retained in the EEPROM memory when you upload new firmware.
You could try to send the G-code
M502to 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, 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
- Home all axes
- 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
- 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
- Store it to the EEPROM
- Important notice! Enable the endstops again with
M211 S1or the printer head will collide with the bed on the next