G Code Offsets

KMotionCNC supports G Code Fixture Offsets (G54 through G59.9) as well as a Global Offset (G92). So there are two methods that may be used to offset a G Code Program. Both may be used concurrently.

The following formula is used:

Tool Position = Programmed Position + Currently Selected Fixture Offset + Global Offset

Fixture Offsets are specified in a straightforward manner by using the G10 L2 Pn command to specify the value of the offset. The system has memory to remember 9 fixture offsets. Any of the fixture offsets may then be selected for use using the G54 - G59.9 commands. One and only one fixture offset is always in use (one exception to this is a line containing the G53 command, which temporarily causes no offsets whatsoever to be used for that one line only).

The Global Offset is specified in an indirect manner by using the G92 command to declare the current tool position to be a specified programmed position. The specified position may be zero or any location. For example, if it is known that a particular G Code program expects a particular location on the part to be (-1,-1,-1), then the tool could be physically moved to that point on the part and the command:

G92 X-1 Y-1 Z-1

could be entered. The system will then automatically calculate the appropriate Global Offset to make the current programmed position (-1,-1,-1). No physical motion will occur. The Displayed Position will change to the position specified (-1,-1,-1). Any current Fixture Offset will be taken into consideration as well

Example:

Consider the program shown below. Initially there are no offsets.

After line N1 is executed,

Tool Position (-0.1,-0.2,-0.3) = Programmed Position (-0.1,-0.2,-0.3) + Fixture Offset (0,0,0) + Global Offset (0,0,0)

After line N2 is executed, no physical motion occurs but a Global Offset of (-0.1,-0.2,-0.3) is calculated and:

Tool Position (-0.1,-0.2,-0.3) = Programmed Position(0,0,0) + Fixture Offset (0,0,0) + Global Offset (-0.1,-0.2,-0.3)

After line N3 movement to programmed position of (1,2,3) occurs and:

Tool Position (0.9,1.8,2.7) = Programmed Position(1,2,3) + Fixture Offset (0,0,0) + Global Offset (-0.1,-0.2,-0.3)

After lines N3 and N4 specify a fixture offset and select it for use, no motion occurs but the program (displayed) position changes to:

Tool Position (0.9,1.8,2.7) = Programmed Position(0.5,1.3,2.1) + Fixture Offset (0.5,0.7,0.9) + Global Offset (-0.1,-0.2,-0.3)

After line N5 is executed motion to programmed position (1,1,1) occurs and:

Tool Position (1.4,1.5,1.6) = Programmed Position(1,1,1) + Fixture Offset (0.5,0.7,0.9) + Global Offset (-0.1,-0.2,-0.3)

N1 G00 X-0.1 Y-0.2 Z-0.3 (move somewhere)
N2 G92 X0 Y0 Z0 (declare where we are to be zero)
N3 G00 X1 Y2 Z3
N4 G10 L2 P2 X0.5 Y0.7 Z0.9 (Set G55 - fixture offset #2)
N5 G55 (Set to use fixture offset #2)
N6 G00 X1 Y1 Z1
N7 G53 X0 Y0 Z0