Question about G30 command



  • From reading the g-code wiki (https://duet3d.com/wiki/G-code#G30:_Single_Z-Probe) I got the impression that the following command:

    G30 X0 Y0

    …would use the G31 configured offset to move a z-probe to the absolute 0,0 location, perform a probe, and when the probe hits threshold, set absolute Z to match the Z specified in G31 (the probe trigger height.)

    What I'm finding is that the X and Y parameters are being ignored with the above command and the probe is performed in the "current" X/Y location.

    In contrast, when I use "G30 P0 X0 Y0 Z-999999", the probe moves to position itself over absolute 0,0.

    Am I misunderstanding what G30 is supposed to do? (I'm using firmware 1.21RC1)

    Thank you
    Gary



  • …another G30 question:

    When using "G30" (no parameters) to probe for Z, the firmware seems to require that I first home X and Y.

    Why is that?


  • administrators

    @garyd9:

    …another G30 question:

    When using "G30" (no parameters) to probe for Z, the firmware seems to require that I first home X and Y.

    Why is that?

    To make sure you know where you are probing, so that the Z probe is likely to be over the bed.


  • administrators

    @garyd9:

    From reading the g-code wiki (https://duet3d.com/wiki/G-code#G30:_Single_Z-Probe) I got the impression that the following command:

    G30 X0 Y0

    …would use the G31 configured offset to move a z-probe to the absolute 0,0 location, perform a probe, and when the probe hits threshold, set absolute Z to match the Z specified in G31 (the probe trigger height.)

    What I'm finding is that the X and Y parameters are being ignored with the above command and the probe is performed in the "current" X/Y location.

    In contrast, when I use "G30 P0 X0 Y0 Z-999999", the probe moves to position itself over absolute 0,0.

    Am I misunderstanding what G30 is supposed to do? (I'm using firmware 1.21RC1)

    Thank you
    Gary

    I didn't write the specification of G30, and it is rather complicated. Basically, G30 Xxx Yyy Zzz doesn't actually probe, but tells the firmware that the probe would trigger at height zz at XY coordinates xx and yy. In conjunction with a P parameter, this can be used to implement bed compensation even if you don't have a Z probe.

    But there are exceptions:

    • G30 with no Z parameter performs a probe at the current location (X and Y are ignored);
    • G30 with a "silly" Z value moves to the specified XY position at the specified Z dive height and then probes.


  • @dc42:

    • G30 with no Z parameter performs a probe at the current location (X and Y are ignored);
    • G30 with a "silly" Z value moves to the specified XY position at the specified Z dive height and then probes.

    That sounds interesting. I'll have to play with "silly" values and see what happens. If a person wants to home Z at "0,0", they would currently have to use G1 to move a tool to X(0-probeXoffset), Y(0-probeYoffset) and run G30. In my case, that looks like:

    T1 P0 ; need to select the right tool so I know the offset to the probe
    G1 X74.3 Y0.8 F6000 ; position the probe over 0,0 - if I ever move the probe, I have to remember to change this as well as the G31 specified offsets in config.g
    G30

    Being that the firmware already knows what the offsets are (assuming G31 was set properly), it'd be significantly easier to type and read:

    G30 X0 Y0 ZsillyValue

    Thank you - again.
    Gary



  • In testing (while X/Y are homed)

    G30 ; probed in place, left 'Z' as the trigger height from G31
    G30 X0 Y0 ; exact same as above
    G30 X0 Y0 Z-999 ; exact same as above
    G30 X0 Y0 Z-999999 ; exact same as above
    G30 X0 Y0 Z0 ; exact same as above

    What would a good "silly" value for Z be?

    Thanks
    Gary


  • administrators

    I was wrong. When there is no P parameter, G30 probes from the current position, and the only other parameters that are significant are S and H.


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.