G92 is a G-code used to set the current position of the machine as a new reference point. It allows you to change the zero point of the machine’s coordinate system to any location. It is commonly used to make a temporary offset or to adjust the workpiece to a new position without physically moving it.
Usage format
The general format of G92 is:
G92 X~ Y~ Z~ A~
where X~, Y~, Z~, and A~ are the coordinates of the new reference point in the current work coordinate system. The axis words are optional, except that at least one must be used. If an axis word is not used for a given axis, the coordinate on that axis of the current point is not changed.
Explanation
G92 works by shifting the current work coordinate system (such as G54, G55, etc.) by the difference between the current position and the specified position. For example, if the current position is X10 Y20 Z30 A40 in G54, and the command G92 X0 Y0 Z0 A0 is executed, then the G54 coordinate system will be shifted by -10, -20, -30, and -40 units along the X, Y, Z, and A axes, respectively. This means that the new reference point (X0 Y0 Z0 A0) will coincide with the current position (X10 Y20 Z30 A40), and the machine origin (X0 Y0 Z0 A0 in G53) will be at X10 Y20 Z30 A40 in G54.
G92 is a non-modal command, which means that it only affects the current block of code. It must be used in every block where a move in the shifted coordinate system is desired. G92 can be canceled by programming another G92 command to change the current work offset back to the original value, or by using G92.1, G92.2, or G92.3 commands.
Example
Suppose we have a part with four identical holes at different locations, as shown in the diagram below. We want to use a subprogram to drill each hole, starting from the center of the hole. We can use G92 to set a local reference point for each hole, and then call the subprogram with the same code.
% O1000 (MAIN PROGRAM)
G90 G54 G0 X10 Y10 (MOVE TO FIRST HOLE)
G92 X0 Y0 (SET LOCAL REFERENCE POINT)
M98 P1001 (CALL SUBPROGRAM)
G92 X-10 Y-10 (CANCEL G92 SHIFT)
G0 X30 Y10 (MOVE TO SECOND HOLE)
G92 X0 Y0 (SET LOCAL REFERENCE POINT)
M98 P1001 (CALL SUBPROGRAM)
G92 X-30 Y-10 (CANCEL G92 SHIFT)
G0 X30 Y30 (MOVE TO THIRD HOLE)
G92 X0 Y0 (SET LOCAL REFERENCE POINT)
M98 P1001 (CALL SUBPROGRAM)
G92 X-30 Y-30 (CANCEL G92 SHIFT)
G0 X10 Y30 (MOVE TO FOURTH HOLE)
G92 X0 Y0 (SET LOCAL REFERENCE POINT)
M98 P1001 (CALL SUBPROGRAM)
G92 X-10 Y-30 (CANCEL G92 SHIFT)
M30 (END PROGRAM)
%
% O1001 (SUBPROGRAM)
G91 G1 Z-5 F100 (DRILL HOLE)
G0 Z5 (RETRACT TOOL)
M99 (RETURN FROM SUBPROGRAM)
%
The diagram below shows the coordinate systems and the positions of the holes and the tool.
Y
^
|
| G54
| +-----------------+
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| +-----------------+
| 0 40
+-------------------------> X
0 10 20 30 40
G54
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+
0 40
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+
-10 30
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+
-30 10
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+
-30 -10
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+
-10 -30
G54
+-----------------+
| |
| |
| |
| |
| |
| |
| O |
| | |
| | |
| | |
| | |
+-----------------+
0 40
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| O |
| | |
| | |
| | |
| | |
+-----------------+
-10 30
G54
+-----------------+
| |
| |
| |
| |
| |
| |
| O |
| | |
| | |
| | |
| | |
+-----------------+
0 40
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| O |
| | |
| | |
| | |
| | |
+-----------------+
-30 10
G54
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| O |
| | |
+-----------------+
0 40
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| O |
| | |
+-----------------+
-30 -10
G54
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| O |
| | |
+-----------------+
0 40
G92
+-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| O |
| | |
+-----------------+
-10 -30