# LinuxCNC G10 L2

Instructions · `G10 L2` · verification: source checked

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.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G10 L2 |
| Group | coordinate system |
| Syntax | G10 L2 P- <axes R-> |
| Dialect | LinuxCNC |

### Parameters

| Name | Data type | Description |
|---|---|---|
| P | integer | Coordinate system (0-9). P0 is the active system; P1-P9 correspond to G54-G59.3. |
| axes |  | Axis 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. |
| R |  | Optional rotation of the XY axis around the Z axis; direction is CCW as viewed from the positive end of the Z axis. |

## 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.

## 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.

## Sources

1. [G-Codes](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g10-l2) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/gcode-g10-l2  
JSON: https://machineschema.com/instruction/gcode-g10-l2.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
