LinuxCNC G10 L2

G10 L2 sets the origin of a numbered coordinate system in LinuxCNC by writing axis offsets measured from the machine origin established during homing. The P word selects the coordinate system (0 to 9) and the axis words give the new offset values, which replace existing offsets for the axes named; optional R sets rotation of the XY axes about Z. It only writes the offsets and does not switch the active coordinate system.

Source checked10/10 values · 2026-10-26

Specification

1 source
Languagegcode
CodeG10 L2
Groupcoordinate system
SyntaxG10 L2 P- <axes R->
DialectLinuxCNC

Parameters

NameData typeDescription
PintegerCoordinate system (0-9). P0 is the active system; P1-P9 correspond to G54-G59.3.
axesAxis words (X Y Z A B C U V W) giving the offset of the origin from the machine origin. Axis words not used are not changed.
ROptional rotation of the XY axis around the Z axis; direction is CCW as viewed from the positive end of the Z axis.

Study notes

  • G10 L2 makes the origin of the selected coordinate system equal to the axis values given, referenced to the machine origin established during homing.
  • G10 L2 Pn does not change the active coordinate system; G54-G59.3 must be used to select the coordinate system specified by P.
  • Being in incremental distance mode (G91) has no effect on G10 L2.
  • A G52 local offset or G92 origin offset in effect before G10 L2 continues in effect afterwards; when R is programmed, any G52 or G92 is applied after the rotation.
  • The coordinate system set by G10 L2 may be active or inactive when the command runs; if it is active, the new coordinates take effect immediately.
  • When a rotation is in effect, jogging an axis moves only that axis in a positive or negative direction, not along the rotated axis.
  • Example: G10 L2 P1 X3.5 Y17.2 sets the origin of coordinate system 1 (selected by G54) to X=3.5 and Y=17.2, leaving the other coordinates unchanged.
  • Example: G10 L2 P1 X0 Y0 Z0 clears the X, Y and Z offsets of coordinate system 1, putting it at the machine origin.

Safety

  • It is an error if the P number does not evaluate to an integer in the range 0 to 9.
  • It is an error if an axis is programmed that is not defined in the configuration.
↑↓ navigate↵ openesc close