"Z" Axis Offset

I have been struggling with what to use for a “Z” axis end stop. I am currently using a mechanical end stop that I have just laying near the homing point and when I do a homing command I just bump it 2 times with my thumb. This gets it close, but I want repeatablity and hopefully a mostly hands off homing sequence. So two questions:

  1. What is the most common “Z” homing device? I would like to be able to use it when a pen / marker is installed as well as a router. This leads me to think I should have a switch that is mounted to a small platform that I can place under the pen tip or bit during he homing but then move it out of the way after homing. This leads me to the next question…

  2. If I make a switch as described above, how do I offset the “Z” axis in Marlin? The M666 command doesn’t seem to work on my machine (and I am okay with that). Because the M666 command doesn’t work, I haven’t tried the M500 command to “flash” the offset to the Arduino.

One last kicker, I don’t have a reliable computer I can use next to the CNC. The last 2 times I have needed to upload the firmware I disconnect the Ramps from the Arduino and hike over o the desktop. Shame on me…but I am too cheap to buy a decent laptop at this point.


Well, the z location is the top of the work, so the most common is a touch plate. The endstops are just switches that close a connection when at home, so you can wire the signal to the bit and the ground to a plate, and it will trip the endstop when the bit hits the plate. Ryan said just a day or so ago to also slow down the homing speeds for Z. For a pen, you’d need something the same height as the pen that is conductive. Maybe some conductive tape (the copper stuff) on the end of the pen?

The other option is an endstop at zmax if you want to home the bit out of the way. That only makes sense before doing a home on x/y so you don’t clobber stuff.

M666 only works for dual endstops and since you don’t have dual endstops on z you don’t need it here. For adjusting for the thickness of the touch plate, you would just home and then set the z height with G92. I think the z axis jumps up to 5mm after a home, so if your plate was 1.5mm thick, when the home was done, you’d be at 5mm according to Marlin, but you’re actually 6.5mm away from the surface, so you’ll do G92 Z6.5 and Marlin will think you’re at 6.5.

Actually, don’t worry about the pen. It’s not accurate enough to need a touch plate. You do know you can just move the z down slowly until you’re at a height you like, and then you can set the z=0 there.


Jeff, thanks for the help.

I am unaware of being able to set the z axis to 0 without homing. Is this something I can do on the display or is it something I have to have a computer hooked up for? Is that what the offsets are for in the display screen?

The easiest way is to move your tool to where you want x,y, and z=0. Then reset the Arduino.

There is a set home offsets in the menu that should do the same thing, but YMMV.

If you have to only set the z, got some reason, you could always just put this in a gcode file and “print from SD” it:

G92 Z0

1 Like