G38.2 (Straight Probe)
Program G38.2 X... Y... Z... A... to perform a straight probe operation. The rotational axis words are allowed, but it is better to omit them. If rotational axis words are used, the numbers must be the same as the current position numbers so that the rotational axes do not move. The linear axis words are optional, except that at least one of them must be used. The tool in the spindle must be a probe.
It is an error if:
- The current point is less than 0.254 millimeters or 0.01 inches from the programmed point
- G38.2 is used in inverse time feed rate mode
- Any rotational axis is commanded to move
- No X, Y, or Z-axis word is used
In response to this command, the machine moves the controlled point (which should be at the end of the probe tip) in a straight line at the current feed rate toward the programmed point. If the probe trips, the probe is retracted slightly from the trip point at the end of the command execution. If the probe does not trip even after overshooting the programmed point slightly, an error is signaled.
After successful probing, variables #5061 to #5066 will be set to the program coordinates of the location of the controlled point at the time the probe tripped. Variables #5051 to #5056 will contain the machine coordinates. Useful for measuring tools in absolute machine positions. G53 G38.2 will move in machine coordinates.
Using the straight probe command, if the probe shank is kept nominally parallel to the Z-axis (i.e., any rotational axes are at zero) and the tool length offset for the probe is used so that the controlled point is at the end of the tip of the probe:
- Without additional knowledge about the probe, the parallelism of a face of a part to the XY-plane may, for example, be found.
- If the probe tip radius is known approximately, the parallelism of a face of a part to the YZ or XZ-plane may, for example, be found.
- If the shank of the probe is known to be well-aligned with the Z-axis and the probe tip radius is known approximately, the center of a circular hole, may, for example, be found.
- If the shank of the probe is known to be well-aligned with the Z-axis and the probe tip radius is known precisely, more uses may be made of the straight probe command, such as finding the diameter of a circular hole.
If the straightness of the probe shank cannot be adjusted to high accuracy, it is desirable to know the effective radii of the probe tip in at least the +X, -X, +Y, and -Y directions. These quantities can be stored in variables either by being included in the variables file or by being set in an RS274/NGC program.
Using the probe with rotational axes not set to zero is also feasible. Doing so is more complex than when rotational axes are at zero, and we do not deal with it here.
As a usable example, the code for finding the center and diameter of a circular hole is shown below. For this code to yield accurate results, the probe shank must be well-aligned with the Z-axis, the cross-section of the probe tip at its widest point must be very circular, and the probe tip radius (i.e., the radius of the circular cross-section) must be known precisely. If the probe tip radius is known only approximately (but the other conditions hold), the location of the hole center will still be accurate, but the hole diameter will not.
In the code below, an entry of the form <description of number> is meant to be replaced by an actual number that matches the description of the number. After this section of code has been executed, the X-value of the center will be in variable #1041, the Y-value of the center in variable #1022, and the diameter in variable #1034. In addition, the diameter parallel to the X-axis will be in variable #1024, the diameter parallel to the Y-axis in variable #1014, and the difference (an indicator of circularity) in variable #1035. The probe tip will be in the hole at the XY center of the hole.
The example does not include a tool change to put a probe in the spindle. Add the tool change code at the beginning, if needed.