CNC | G37 Code | Automatic Tool Length Measurement


G37 Code Introduction

By issuing G37 code, the tool starts moving to the measurement position and keeps on moving till the approach end signal from the measurement device is output. Movement of the tool is stopped when the tool nose reaches the measurement position.

Difference between coordinate value when tool reaches the measurement position and coordinate value commanded by G37 is added to the tool length compensation amount currently used.

G37 Code Format

G92 IP_ ; Sets the workpiece coordinate system.
(It can be set with G54 to G59.)
Hxx ; Specifies an offset number for tool length compensation.
G90 G37 IP_ ; Absolute programming. G37 is valid only in the block in which it is specified. IP_ indicates the X-, Y-, Z-, or fourth axis.

G37 Example


G92 Z760.0 X1100.0 ; Sets a workpiece coordinate system with respect to the programmed absolute zero point.
G00 G90 X850.0 ; Moves the tool to X850.0. That is the tool is moved to a position that is a specified distance from the measurement position along the Z-axis.
H01 ; Specifies offset number 1.
G37 Z200.0 ; Moves the tool to the measurement position.
G00 Z204.0 ; Retracts the tool a small distance along the Z-axis.

For example, if the tool reaches the measurement position with Z198.0;, the compensation value must be corrected. Because the correct measurement position is at a distance of 200 mm, the compensation value is lessened by 2.0 mm (198.0 – 200.0 = -2.0).