1. About
  2. Features
  3. Explore

I'm using Marlin 1.1.0RC8 to control an MPCNC, using a RAMPS1.4. We've just added a touch-plate to do Z-probing, which works nicely for a single probe (I just want calibrated height for variant bit-lengths, not bed-leveling, but I think it amounts to the same thing). I've set it up in Marlin as FIX_MOUNTED_PROBE, which seems closest.

I can make it do a G38.2 Z-50, G92 Z12.6 (which sets Z to the height of the touch-plate, 12.6mm), which is ok to be going on with, but it seems I'm having to hard-code the Z offset, which I'm sure should really be set by eg Z_PROBE_OFFSET_FROM_EXTRUDER or M851.

My feeling was that I should be able to invoke a G-code G30, and it would do a nice fast-slow double tap, do the equivalent of a G92 Z+zzz to set that height and then withdraw to a safe height. And after a bit of config, it does exactly that...

... except it doesn't do anything with the height that it measured! Seems odd. The G30 code seems to be an elaborate way to move the head up by the clearance amount, via a touch-plate (with the added excitement of being able to crash the bed if anything goes wrong)! What's the point?

Have I misunderstood what G30 is meant to do? I've read the docs here, and traced through Marlin_main.cpp and there really is no "outcome". Unless I've missed something?

1 Answer 1

I believe G30 is a carry-over from CNC (G-Code originated for CNC not printers) I believe it is for going to a secondary reference (home) position and includes an optional by-way-of address that can be included in the command.

Looking at Marlin 1.1.0-1 (latest release), it seems to do what you said: 1. Move to the requested position (if selected in command, else N/C) 2. Deploy probe 3. Go home 4. Stowe probe 5. Report the requested position and probed z position 6. Report the current position (home?)

It appears that for Marlin, there is only one reference address (home); so, it would seem a G30 would be the same as a G28 (go to primary reference); but, not so.

It looks like G28 is a home of a different color. It looks like it homes the axis one-at-a-time and does not support a by-way-of location. Note that you can select which axis to home by adding the letters 'X' 'Y' and/or 'Z' to the command.

I am not sure what benefit this command has for a 3D Printer other than allowing you to alter the printer's path to home.

Note: Unfortunately I do not have Marlin code up and running on my printer now so I cannot confirm what I am seeing in the code.