Zero Offset Shifts
A range of zero offset shifts are available in TwinCAT NC I. They describe the distance between the origins of the workpiece and of the machine.
Zero shift suppression
Command |
G53 |
Cancellation |
The zero shift is suppressed modally with G53. The suppression affects both the adjustable and the programmable zero shift.
Adjustable zero offset shift
Command | G54 G55 G56 G57 |
Cancellation | or selection of another configurable zero offset shift |
The commands G54 to G57 can be used within the NC program to switch back and forth between the zero offset shifts.
Parameterization
The configurable zero offset shift can be parameterized in different ways
- PLC function block ItpWriteZeroShiftEx (recommended standard)
- System Manager
- from the DIN program (from TwinCAT V2.9 Build 1031)
The parameters are saved for each interpolation channel. This means that the adjustable zero offset shifts are channel dependent.
The selection of a zero offset shift must be made in its own block. In order for the movement corresponding to the shift to be actually made it is necessary that at least the axes involved are named in a following geometrical block. |
Sample 1:
N10 G01 X100 Y0 Z0 F6000
N20 G54 (activates adjustable zero offset shift (NPV))
N30 G01 X Y Z
N40 M30
In example 1, line 30 mentions all the axes involved. The effect of this is that the zero offset shifts are applied to all the axes.
Sample 2:
N10 G01 X100 Y0 Z0 F6000
N20 G54 (activates adjustable zero offset shift (NPV))
N30 G01 X200 Y
In line 30 of sample 2 the X axis is taken to position 200 + shift in the X direction. The Y axis only moves to accommodate the shift, and the Z axis is not moved.
Parameterization from the DIN program
from TwinCAT V2.9, Build 1031
Command |
#set paramZeroShift( G<n>; <value x>; <value y>; <value z> )# |
Parameter G<n> |
Zero shift to be parameterized (G54..G59) |
Parameter <value> |
Coordinates of the zero shift |
'#set paramZeroShift(..)#' parameterizes the zero shift but does not activate it. This requires explicit programming of the G-Code.
Sample 3:
N10 G01 X100 Y0 Z0 F6000
N20 R12=200
N30 #set paramZeroShift( G54; 100.0; R12; -20)#
N40 G54 (activates adjustable zero offset shift (NPV))
N50 G01 X200 Y Z
Programmable zero shift
Command |
G58 or G59 |
Cancellation |
Programmable zero shifts exist in addition to the adjustable ones. This type of zero shift is directly described from the NC program.
Addition of zero shifts The programmable zero shift is only effective when the adjustable zero shift is active. This means that the total shift is the sum of • set zero shift (G54, G55, G56 or G57) • first programmable zero shift (G58) • second programmable zero shift (G59) |
Sample 4:
N10 G01 X100 Y0 Z0 F6000
N20 G54 (activates adjustable zero offset shift (NPV))
N30 G58 X0.5 Y0.5 Z0.5 (1st prg. zero offset shift)
N50 X Y Z (movements for the zero offset shift)
...
M30
Behavior with incremental dimension notation
Default behavior, independent of TwinCAT version
Changing the origin also affects the incremental dimension.
Sample 5:
N10 G01 X100 Y0 Z0 F6000
N20 G54 (activates adjustable zero offset shift (NPV))
N25 G58 X10 Y10 Z0
N30 G91 (Incr. dimensions)
N40 G01 X200 Y0
N50 ...
In N40 Y moves to 10 in the basic coordinate system. A shift in origin also shifts the point of reference for incremental dimension programming, resulting in a travel path for Y.
In this way a contour, which is fully programmed based on the incremental dimension, can be positioned at any point through a zero shift.
from TwinCAT version 2.10 Build 1308
The characteristic can be parameterized under G91 from this version onwards.
Command |
Description |
ZeroShiftIncOn |
The zero shifts are also applied under G91 once the axis is named |
ZeroShiftIncOff |
The zero shift is not applied under G91 |
Sample 6:
N10 G01 X100 Y0 Z0 F6000
N15 ZeroShiftIncOff
N20 G54 (activates adjustable zero offset shift (NPV))
N25 G58 X10 Y10 Z0
N30 G91 (Incr. dimensions)
N40 G01 X200 Y
N50 ...
Since 'ZeroShiftIncOff' is set in example 6 , the X-axis in N40 is moved by 200 mm independently of the new zero shift. The Y-axis does not move as no target coordinate is programmed for it.
See also ToolOffsetIncOn/Off