G92 and Z height question

Using Estlcam for a while now to generate the gcode for my mpcnc (ramps/marlin), I always manually edit the beginning of the gcode to change the G00 to G92 as below:

M03 S24000
G00 X0.0000 Y0.0000 Z0.0000 F2100
G00 Z20.0000 F480

M03 S24000
G92 X0.0000 Y0.0000 Z0.0000 F2100
G00 Z20.0000 F480

Is there a place in Estlcam settings where i can have it done automatically?

Second question, I use a custom Z-probe for homing Z (0.5mm feeler gauge), so i manually lower my Z by 0.5mm after homing and before starting the job, again, is there an entry in the settings for this?

Thanks for your help!

I’m only an occasional EstlCAM user, but, assuming you always use a touch plate to set your Z height to the top of the stock as described, then you can solve both of your problems by putting a G92 X0 Y0 Z0.5 at the your g-code script and leave the G00 alone. You can add edit what gets added to the top of every script by going to Setup->CNC Programs->Texts->Program Start.

If your setting home varies, then things get a bit more complicated. Let me know where you are trigging the Z homing from.

1 Like

Thanks for your reply, basically, I use the Home X/Y command in marlin, then move manually X/Y where I want to start the job, and finally home Z at the top the stock…

You say “in marlin.” Are you triggering your homing sequence from the V1 Custom menu on the LCD or elsewhere?

yes, from the V1 custom commands on the lcd controller (I use the SD card)

What I would do is to not put the offset into the EstlCAM start script. Instead you have two choices. If you are comfortable flashing firmware to your board, then you can add the needed code to the V1 Custom menu. If you don’t want to modify the firmware, then simply write a g-code file (text file with a ‘.gcode’ extension) for homing Z and run it like you would any other g-code file on the SD card. The script I run came from Ryan’s store page for his touch plate:

G28 Z       ;  Home Z
G92 Z0.5    ;  Set current offset to 0.5 for Z
G0 Z5 F480  ;  Lift Z to allow touch plate to be removed

Note that if you use this code, you would leave the G00 alone in the g-code generated by EstlCAM so that the bit gets moved to the home position.

If you want to modify the V1 Custom menu to do this same thing, let me know and I’ll show you what line in configuration_adv.h has to be changed to encorporate these three lines of g-code.

thanks, I will try later on today with the .gcode and let you know!
Thank you for your help!

I’m not sure if/how the files on the SD card are sorted for display. If they are sorted by name, the put an underscore or tilda at the front so that the home script always appears at the top of the files list. For example, name your file “_HomeZ.gcode” or “~HomeZ.gcode”.

Where would that be?

Just to be clear, this is a modification to whatever version of Marlin you are running and you have to re-flash the firmware after making the change. In configruation_adv.h, search for this line to identify the section to be modified:


This is the menu item to be modified:

  #define USER_DESC_2 "Home Z Axis"
  #define USER_GCODE_2 "G28 Z"

The second line gets changed to:

#define USER_GCODE_2 "G28 Z\nG92 Z0.5\nG0 Z5 F480"

Note that the 0.5 is the thickness of the touch plate, and the “G0 Z5 F480” lifts the bit off the touch plate and is optional.

1 Like