G38.2 – Straight Probe Cycle

This command is used for probing parts or fixtures. The axis specified in the G38.2 command will move until the probe touches, if the probe does not touch within the specified distance then the program stops and an alarm is displayed on the screen.

To use this G38.2 requires a Probe input be assigned which changes from Low to High when the probe is triggered.

Syntax & Parameters

  • X, Y, Z, A, B Value - specifies the axis you wish to move for probing and the maximum machine coordinate to move towards when probing. The distance value will be the current machine units in use.
  • F Value - The F value defines the feed rate at which the axis will move at.

Example program

N10 G38.2 Z-10 F100

In the above program the Z axis will move towards machine coordinate Z -10 and wait for the probe to touch. Once the probe touches, the Z axis will stop and the program will move to the next gcode line. If the probe is not touched before it reaches Z -10 location then the program stops and an alarm is displayed on the screen.

INFORMATION: The coordinate value specified is a machine coordinate.

A common use of G38.2 is in conjunction with G92 to set the initial torch height in Plasma

N10 G38.2 Z-50 
N20 G92 Z0  
N30 G0 Z1

In this example the G38.2 probes Z axis toward the surface of the material and when the touch input is triggered it will stop

G92 Z0 applies a Temporary work offset to the Z axis to set the working coordinate to Z0

G0 Z1 moves the Z axis 1 unit above the material surface.

INFORMATION: Units are defined as either inches or mm depending on your machines setup or G20 or G21 command in use.