Accounting for Z-probe height error



  • My Z-probe is the type where the hot end pivots up a tiny bit when the nozzle hits the bed and opens an NC switch. I configured my probe with
    M558 P5 X0 Y0 Z1 H3 I0 F120 T18000, and I've got it working pretty reliably with
    G30 X115 Y115 H-0.7 Z-99999 ; Single Z-probe at center of bed (H is Z-probe height error)

    The problem is that I have 7 instances of this G30 code in three different .g files, so if I want to change the error from 0.7mm to 0.65mm, I have a lot of editing to do.

    Then I read up on G31:

    If the probe is a touch probe and generates a simple 0/1 off/on signal, then G31 Z0.7 will tell the RepRap machine that it is at a height of 0.7mm (as configured by Z0.7 in this example) when the probe is triggered.

    But when I add G31 Z-0.7 to my config.g file, G30 probe commands don't seem to use it - it's the same as if G31 Z-0.7 wasn't there.

    Does anyone know what I'm doing wrong or if there's a better way to put the Z-probe height error in one place instead of 7?



  • Bump. So is no one responding because this is a problem that no one else has, or is it a obvious/dumb question that I wouldn't need to ask if I'd RTFM?

    Seems like it might be a problem others would run into…


  • administrators

    G30 does use the probe offset that you set in the G31 Z parameter. If you use G31 in config.g, make sure the command comes after the M558 command in config.g and make sure that it isn't getting overridden in config-override.g. Alternatively, send the G31 command manually, then send M500 to save the G31 command in config-override.g.

    The H parameters on the G30 command are only intended to account for variation in trigger height with XY position, which is common in delta printers.



  • That was it - I had the G31 line right before M558 in config.g. Thanks again, David!



  • Can you make a macro called probe.g and just call it with M98 Pprobe.g. You can change the values in probe.g and then call it from the 7 locations where you need it.


Log in to reply