Posts: 4
Joined: Fri Feb 27, 2015 11:03 am

Z-Axis G-Code Offset

Sat Feb 28, 2015 8:34 pm


I was wondering what the Z-Axis G-Code Offset in S3D actually does? Will the software make the the gap between the bed and the extruder nozzle "smaller" and ignore the Z stop limit switch? Using the JPEG as an example, from my understanding it will add 0.5mm to all the z-axis measurements in the G-code, therefore will it raise the bed closer to the extruder nozzle and go beyond the z stop limit switch.

This would be helpful as I would just have to be fairly close to the gap I want between the extruder nozzle and fine tune the final distance in the software.
I would worry that I might damage the switch if I would have it compressed more than it was designed for.

S3D Z-Axis G-Code Offset.jpg

Posts: 1435
Joined: Sun Feb 16, 2014 10:52 am

Re: Z-Axis G-Code Offset

Sun Mar 01, 2015 7:46 am

Yes, a value of -0.5mm will move the nozzle 0.5mm closer to your build surface. However, if this actually happens in real life depends on your z-axis limit switch and firmware software endstops.

PS - if you rollover that z-axis offset option with your mouse, it will display a popup that tells you the same thing. They have this for every option

Posts: 4
Joined: Fri Feb 27, 2015 11:03 am

Re: Z-Axis G-Code Offset

Sun Mar 01, 2015 2:53 pm

Thanks for the reply JoeJ,

I just want to clarify your statement for myself...

1) In the jog controls, I can "by pass" Z-axis limit switch and get the bed closer to the nozzle. In the G-Code offsets, the Z-axis limit switch will trumps any settings that surpasses the physical switch?

2) I'll need to look up the firmware settings to see what my limits are on my Makergear M2.

thanks for you help!

Posts: 238
Joined: Tue Aug 26, 2014 5:23 pm

Re: Z-Axis G-Code Offset

Sun Mar 01, 2015 4:43 pm

I've been wondering about this setting as well. ABS and PLA adhere so well to PEI that it would be nice to fine-tune the initial Z to increase / decrease the initial layer squash... and therefore adhesion of the print.

Using the Z-axis Offset parameter seems to allow for that fine-tuning of squash. Positive would reduce squash by raising head, and Negative would increase squash by lowering head.

I think a properly level bed and Z0 must still be performed before using this, but it could be used used for entire setup of squash as long as all the S3D profiles reflect the off-set. Of course, just be careful you don't go crashing into the print bed.

Posts: 1435
Joined: Sun Feb 16, 2014 10:52 am

Re: Z-Axis G-Code Offset

Sun Mar 08, 2015 11:23 am

@Amphagory - I was talking about the firmware software endstops, not the hardware endstops. You can NEVER bypass the hardware endtops (otherwise, what would be the point of them?!)

The reason the firmware software endstops are important is because some firmwares won't allow you to move outside of the virtual software endstop range. For example, if the min software endstops are enabled, it's pretty likely the firmware will prevent your machine from moving to a Z-coordinate that is less than zero. If you were trying to print a 0.1mm layer and your bed was 0.2mm too low, you can see why this would be an issue. You would want to put in -0.2mm for the Z-axis gcode offset in S3D, but the firmware would see the Z-0.1 command and with min software endstops enabled in the firmware, it would clamp the movement to Z0.

So in summary, yes, everything you guys are saying about how to use Z-axis offset in S3D is correct, just keep in mind that if the bed is very badly calibrated, the hardware or firmware endstops may step in. As long as you use the S3D offset for small adjustments, you will be fine.

Posts: 1
Joined: Tue Apr 12, 2016 5:39 pm

Re: Z-Axis G-Code Offset

Tue Apr 12, 2016 5:40 pm


Will this input do a M851 and erase the z-offset firmware value?


Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Z-Axis G-Code Offset

Wed Apr 13, 2016 5:04 am

No, it doesn't send that command at all and it won't change the value that's in the firmware. It just shifts the coordinates in the gcode file.

Posts: 4
Joined: Fri Aug 24, 2018 6:03 am

Re: Z-Axis G-Code Offset

Sat Sep 22, 2018 1:25 pm

Seems this option does not do what the tool tip suggests, tool tip says a negative value will move the head down towards the build platform and it may do that (untested here) but that implies a positive value will move the head away from the build platform but nope I put .08 in and it berried the extruder in the bed. :(

Posts: 1245
Joined: Sun Jul 17, 2016 1:32 pm

Re: Z-Axis G-Code Offset

Mon Sep 24, 2018 6:51 am

Works fine for me. I generally add .1 to .15 for additional gap for ABS on mine versus my PLA settings.
Take a look to see if the Z values are inverted for your particular machine.

Posts: 3
Joined: Wed Jul 15, 2015 8:31 am

Re: Z-Axis G-Code Offset

Sat May 08, 2021 12:21 pm

I know that this is an old thread, but I thought I'd share for the people who may come across it in searches.

I use adhesive build surfaces on removable metal plates with an inductive z-sensor. Nozzle above the metal plate is my real hardware endstop (Z=0) and stored in the firmware. Then I can just measure the thickness of whatever stick-on surface I'm using and plug the number in here. My profiles all have surface/build plate combos in them and swapping surfaces is as easy as changing filaments.

Return to “General Discussion and Tips”