<p>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 <em>FIX_MOUNTED_PROBE</em>, which seems closest. </p>

<p>I can make it do a <code>G38.2 Z-50</code>, <code>G92 Z12.6</code> (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 <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> or <code>M851</code>.</p>

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

<p>... except it doesn't do anything with the height that it measured! Seems odd. The <code>G30</code> 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?</p>

<p>Have I misunderstood what <code>G30</code> is meant to do? I've read <a href="http://marlinfw.org/docs/gcode/G030.html" rel="noreferrer">the docs here</a>, and traced through <code>Marlin_main.cpp</code> and there really is no "outcome". Unless I've missed something?</p>

[{'answer_id': 4039, 'author': 'markshancock', 'author_id': 6417, 'author_profile': 'https://3dprinting.stackexchange.com/users/6417', 'pm_score': 3, 'selected': False, 'text': "<p>I believe <code>G30</code> is a carry-over from CNC (G-code originated for CNC not printers)\nI 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.</p>\n\n<p>Looking at Marlin 1.1.0-1 (latest release), it seems to do what you said:</p>\n\n<ol>\n<li>Move to the requested position (if selected in command, else N/C)</li>\n<li>Deploy probe</li>\n<li>Go home</li>\n<li>Stowe probe</li>\n<li>Report the requested position and probed Z position</li>\n<li>Report the current position (home?)</li>\n</ol>\n\n<p>It appears that for Marlin, there is only one reference address (home); so, it would seem a <code>G30</code> would be the same as a <code>G28</code> (go to primary reference); but, not so.</p>\n\n<p>It looks like <code>G28</code> 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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n"}, {'answer_id': 10694, 'author': 'DangV', 'author_id': 17149, 'author_profile': 'https://3dprinting.stackexchange.com/users/17149', 'pm_score': 0, 'selected': False, 'text': '<p>I’ve recently had a need to use Z-probe touch \nplate on my MPCNC + Ramps 1.4 + Marlin 1.1.5 setup.</p>\n\n<p>Thought I’d share what ended up working for me.</p>\n\n<p>In Marlin <code>Configuration.h</code>, I made the changes to enable Z-probe:</p>\n\n<pre><code>#define USE_ZMIN_PLUG\n#define Z_MIN_ENDSTOP_INVERTING     true\n#define Z_MIN_PROBE_ENDSTOP_INVERTING   true\n#define FIX_MOUNTED_PROBE\n#define PROBE_DOUBLE_TOUCH\n#define Z_MIN_POS -100\n</code></pre>\n\n<p>However, the following might be the key to your issue.<br>\n<code>G30</code> did not do anything for me as well, until I changed \nthese values to 0.  The <code>G30</code> now lowers Z until the Z probe \nis triggered. I needed to send a <code>G92</code> to set the new Z value.<br>\nWorks like a champ!</p>\n\n<pre><code>#define X_PROBE_OFFSET_FROM_EXTRUDER 0\n#define Y_PROBE_OFFSET_FROM_EXTRUDER 0\n</code></pre>\n\n<p>In case you’re interested, in ultralcd.cpp under \nlcd_prepare_menu(), I added the a menu item to perform \nthe probe.  This way I don’t need a computer to setup \nthe machine and launch a gcode file from the sd card. </p>\n\n<pre><code>  #if HAS_BED_PROBE\n        MENU_ITEM(gcode, MSG_PROBE_Z, PSTR("G30\\nG92 Z19.05"));\n  #endif\n</code></pre>\n\n<p>Hope this is helpful for you, even after a couple years late.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/4014', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/895/']