Zero Offsets Introduction
G codes right from G54 to G59 are called zero offsets. Zero offsets are used to define a new origin with respect to machine zero.
Types of Zero Offsets
There are two types of zero offsets :
a. Settable zero offsets or adjustable zero offsets. G54, G55, G56, G57 are the settable zero offsets.
b. Programmable zero offsets. G58 and G59 are the programmable zero offsets.
Settable Zero Offsets
Zero offset data of the new origin can be directly entered into these zero offset memory locations. The stored offset values can be altered any time.
The offset values of the new origin can be entered into any of the zero offset locations. When the relevant zero offset number is selected in the program, CNC refers to the corresponding zero offset location and shifts the machine zero to the new origin position by the amount of offset value stored for each axis.
N50 G55 ;
When CNC reads the block number N50 the machine origin gets shifted by the amount of offset value stored in G55 location.
When zero offset data is selected, by using the soft key menu, CRT displays the following data.
|X Z (G54)|
|X Z (G55)|
|X Z (G56)|
|X Z (G58)|
Offset data of the new origin is stored into any of the above zero offset memory locations. Generally settable zero offsets are used to define the work zero. Since work piece axis is in line with spindle axis, there is no offset along X-axis, and since the work piece zero is in front of machine zero, it has a particular amount of offset along Z-axis.
A new origin O is defined in the figure. With respect to machine zero, the offsets of the new origin are X0 Z200.
If the data (i.e. Z0 Z200) is stored in G57 memory location, whenever G57 is used in the program, offset data entered in G57 is considered by CNC.
Offset data stored in G57 is displayed as below;
X0 Z200 (G57)
The tool is to be positioned at point P (X40,Z-30) with respect to G57.
The program is;
N50 G57 ;
N60 G00 X40 Z-30 ;
To position tool at P from an existing position P1, control calculates the distance to be traveled in both the axes considering the offset values of the present position with respect to machine zero, offset value of G57 origin with respect to machine zero, and offset position of P with respect to G57 origin.
Distance to be traveled from P1 to position tool at P :
Along X-axis =
X offset of P with respect to G57 + X offset of G57 origin with respect to machine zero – X offset of P1 with respect to machine zero.
= 20 + 0 – 50 = -30
Along Z-axis =
Z offset of P with Respect to G57 + Z offset of G58 origin with respect to machine zero – Z offset of P1 with respect to machine zero.
= 30 + 200 – 250 = -80
Programmable Zero Offsets
These offsets are similar to settable offset values except that zero offset data cannot be directly entered into these zero offset memory locations. In order to enter zero offset data into these offset locations, the zero offset data is programmed under the relevant G code.
When the program is executed, after reading the block in which the zero data is programmed, CNC transfers the offset values into the corresponding zero offset memory location, and the machine zero gets shifted to the new origin position.
To enter offset data into programmable zero offsets the following program is written.
N50 G58 X0 Z200 ;
When CNC reads N50, the data programmed under G58 is loaded into G58 memory location, and the machine zero gets shifted to new origin.
To cancel programmable zero offsets the following program is written.
N100 G58 X0 Z0 ;
Zero offset values are additive i.e. when more than one zero offset code (G code) are used in a program, CNC takes sum of all the offset values into consideration, in order to shift the machine zero to new zero position.
Things to Know
a. G54 is the default function i.e. there is no need to program G54 code, in order to shift the machine zero to new position, when a zero offset data is entered into G54 memory location.
b. Also when a zero offset location other than G54 is used, in order to enter the zero offset data, care should be taken to keep the G54 memory location empty. Otherwise, as G54 is the default, and the zero offsets are additive, whenever a G code other than G54 is programmed, zero offset value stored in G54 memory location is added to that value stored in the zero offset location of the programmed G code.