By default, G30 and G30.1 their NIST stored-position behavior when GRBL mode and [motion control] nist_G30 are both enabled.
On CNC mills it can be used to:
On a 3D printer it can be used to:
To probe in other axes like X and Y, see the
The command is used as such:
G30
Which means: move (in the Z axis) until the probe is triggered, then report what distance was traveled.
You can also do:
G30 Z10
Which means: move (in the Z axis) until the probe is triggered, then set the current Z position to 10 (using
This is useful for example if you want to use the probe to measure the distance between something else on the actuator and what is touched, and you know the distance between the probe’s height and that thing’s height.
It is also possible to specify a speed at which to move with:
G30 F100
| Parameter | Usage | Example |
|---|---|---|
Z |
Once the probe hits, set the Z position to this value | |
F |
Move at this speed in millimeters/minute |
The F parameter sets the movement speed for this move.
It sets the speed only for this specific move and is not modal.
It temporarily overrides the
Enable the alternate behavior in the motion-control section:
[motion control]
nist_G30 = true
You must also enable GRBL mode. With both settings active, G30.1 records the current machine position and G30 returns to it.
G28 ; home the machine first
G0 X100 Y50 Z20
G30.1 ; remember this machine position
M500 ; optional: keep it across resets
G30 ; return to the saved position
G30.1 without arguments requires the machine to be homed. It records X and Y, plus Z when Z can be homed. G30 reports an error if no saved position exists or the machine has not been homed.
Axis values on G30 tell Smoothie to make a relative rapid move before going to the stored position:
G30 Z5
This first moves Z by +5 mm from its current position. Smoothie then moves to the saved Z position, followed by the saved X/Y position. This differs from LinuxCNC’s interpretation, so check generated programs before running them.
Add a P argument when you need the normal probe command while NIST mode is enabled:
G30 P1 Z0 F100
The P value selects the probing path by its presence; P1 is the common form. $P also runs the simple probe command regardless of GRBL mode.
The probe behavior uses the Zprobe module. The V2 stored-position behavior uses nist_G30 in [motion control], as described above.
V1 Zprobe Configuration:
The basic zprobe settings include:
Example V1 configuration:
zprobe.enable true
zprobe.probe_pin 1.28!^
zprobe.slow_feedrate 5
zprobe.fast_feedrate 100
zprobe.probe_height 5
zprobe.return_feedrate 0
zprobe.max_z 200
V2 Zprobe Configuration:
V2 uses INI-style configuration with additional options for advanced probing behavior:
[zprobe]
enable = true
probe_pin = 1.28!^
slow_feedrate = 5
fast_feedrate = 100
probe_height = 5
return_feedrate = 0
max_z = 200
debounce_ms = 0
reverse_z = false
dwell_before_probing = 0
Key V2 Settings:
These resources are used as references for Gcode: