# LinuxCNC G64

Instructions · `G64` · verification: source checked

G64 is a LinuxCNC path control mode that blends motion for speed instead of stopping exactly at each programmed point. Programmed with a P tolerance, the actual path may deviate from the programmed endpoint by no more than P, and velocity is reduced as needed to hold that deviation. An optional Q value turns on the Naive CAM Detector, which collapses nearly collinear feed moves into a single linear move.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G64 |
| Group | path control |
| Syntax | G64 <P- <Q->> |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| P | Motion blending tolerance: the actual path will be no more than P away from the programmed endpoint. |
| Q | Naive CAM tolerance: a non-zero value turns on the Naive CAM Detector; zero disables it. |

## Connected

- Related: [LinuxCNC G02](https://machineschema.com/instruction/gcode-g02.md)

## Study notes

- G64 without P keeps the best speed possible, no matter how far away from the programmed point the path ends up.
- G64 P- blends between best speed and the deviation tolerance; velocity is reduced if needed to maintain the path.
- With Q set to a non-zero value, a series of linear XYZ feed moves at the same feed rate that are less than Q away from being collinear are collapsed into a single linear move.
- In the G17 (XY) plane, when the maximum deviation of an arc from a straight line is less than the G64 P tolerance, the arc is broken into two lines (start to midpoint, midpoint to end) which are then subject to the naive CAM algorithm for lines.
- Line-arc, arc-arc, arc-line and line-line cases all benefit from the Naive CAM Detector, simplifying the path and improving contouring performance.
- If Q is not specified, behavior is as before and the value of P is used; set Q to zero to disable the Naive CAM Detector.
- It is OK to program for the mode that is already active.
- The document recommends including a path control specification in the preamble of each G-code file.

## Sources

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

---

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