User Tools

Site Tools


gcode:macros:macro-o110

o110 - Probe

Probes axis and takes measurement.

By customizing parameters like H, E, D, F, I, etc., you can measure surfaces or edges in any axis direction and have the macro automatically compute and store the final position for further CNC operations.

Syntax

G65 P110 H<axis> E<direction> Q<check_probe> D<distance> K<back> J<probe_size> F<probe_speed> I<low_speed> R<return_flag>

Parameters

H Axis number to probe:
  • 0 = X
  • 1 = Y
  • 2 = Z
E Probe direction:
  • 1 = positive direction
  • -1 = negative direction
Must be either +1 or −1.
Q Probe check mode:
  • 0 = checks only the probe pins
  • 1 = checks both pins and probe type
Default: 1 (in the macro, it calls G65 P109 Q…)
R Return to start position:
  • 0 = remain at end of probe
  • 1 = return to the start position
Default: If omitted, macro does not return.
D Maximum probing distance in the specified direction Default: 10000

If Z‐axis negative direction then default is #<_probe_length>.

K Back‐off distance after initial probe contact Default: #<_probe_swdist>
J Probe tip size (used to offset the measured position) Default: #<_probe_size_axis>
F Probe feed rate (speed) for the first pass Default: #<_probe_speed>
I Low‐speed feed rate for a second, more precise pass

(If I > 0, a second slow probe pass is performed)

Default: #<_probe_speed_low>

Special Global Parameters

The macro also uses certain global parameters. These are defined in settings.

  • #<_probe_length>: A typical safe distance for probing in the Z‐ direction.
  • #<_probe_swdist>: Default “switch distance” or back‐off distance.
  • #<_probe_size_axis|X/Y/Z>: The radius (or offset) of the probe tip in each direction.
  • #<_probe_off_axis|X/Y/Z>: Additional probe offset obtained with probe calibration.
  • #<_probe_speed>: Default feed rate for the main probe pass.
  • #<_probe_speed_low>: Default feed rate for the second slow pass.

Using the Macro in Practice

Prepare the Machine

  • Make sure your probe is connected and recognized by the controller (probe pins read OK).
  • Zero or set up your coordinate system as needed.

Call the Macro

Use G65 P110 … with the parameters you need. For example:

( Probe the top of a part along Z- )
G65 P110 H2 E-1 D20 F100 I50 R1
  • H2 → Z‐axis
  • E-1 → Negative direction (downward)
  • D20 → Max distance is 20 mm
  • F100 → Probe feed rate is 100 mm/min
  • I50 → Low‐speed probe feed is 50 mm/min (performs a second pass)
  • R1 → Return to start position after probing

Check the Results

  • After a successful probe, the macro sets #<_measure> = 1.
  • The measured Z coordinate (including the probe radius/offset) is placed in #<_measure_z>.
  • The variable #<_return> also holds the final measured coordinate on the probed axis.
  • If something went wrong, the macro prints a message and stops.

Use the Measured Value

  • You can read #<_measure_z> (or #<_measure_axis|2>) to set a work offset, or to record the part’s surface location, etc. For instance:
G10 L20 P1 Z[#<_measure_z>]  (set work offset so that measured point is Z=0)

Common Examples

Edge Probing in X

(Probe an edge along +X)
G65 P110 H0 E1 D10 F100 K1 R1
  • Probes X+ for up to 10 mm at 100 mm/min.
  • After contact, backs off 1 mm.
  • Returns to start position.
  • Stores the measured coordinate in #<_measure_x> and #<_return>.

Edge Probing in Y

(No Return, Single Pass)

(Probe an edge along -Y)
G65 P110 H1 E-1 R0 D5 F50
  • Probes Y– for up to 5 mm at 50 mm/min.
  • Does not return to the start.
  • Only one pass because I (low speed) is not provided.

Surface Probing in Z

(Using default distances)

(Probe downward in Z with default _probe_length)
G65 P110 H2 E-1 R1
  • Automatically uses _probe_length as the distance if not specified.
  • Returns to the start position (R1).

Key Takeaways

  • Axis (H) and Direction (E) are mandatory.
  • Distance (D) can be large to ensure contact is found, or can default to _probe_length if Z–.
  • Speeds (F / I) control how quickly the probe moves. Using a second slower pass (I) increases accuracy.
  • Probe radius offsets (J) ensure the final measurement accounts for the physical radius of the probe tip. If you do not specify J, the macro automatically uses the _probe_size_axis|#<axis> plus _probe_off_axis|#<axis>.
  • The measured position is stored in both #<_measure_axis|#<axis» and #<_return>.

Further Tips

  • Make sure you understand how your controller handles the built‐in probing cycle G38.2.
  • Always test with a safe distance to avoid a crash if your probe is not detected.
  • Consider adding your own error checks or messages if your machine or macros differ.
  • Combine this macro with a coordinate system shift (G10 L20 P…) to automatically zero your work offset at the probed surface.
gcode/macros/macro-o110.txt · Last modified: 2025/03/08 19:33 by andrej

Page Tools