Skip to content
g-code.rst 79.6 KiB
Newer Older
Fabrice Salvaire's avatar
Fabrice Salvaire committed
G Codes
=======

Conventions
-----------

Conventions used in this section

Fabrice Salvaire's avatar
Fabrice Salvaire committed
In the G code prototypes the hyphen (``-``) stands for a real value and (``<>``) denotes an optional
Fabrice Salvaire's avatar
Fabrice Salvaire committed
item.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
If ``L-`` is written in a prototype the ``-`` will often be referred to as the ``L number``, and so on for
Fabrice Salvaire's avatar
Fabrice Salvaire committed
any other letter.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
In the G code prototypes the word ``axes`` stands for any axis as defined in your configuration.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
An optional value will be written like this ``<L→``.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

A real value may be:

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* An explicit number, ``4``
* An expression, ``[2+2]``
* A parameter value, ``#88``
* A unary function value, ``acos[0]``
Fabrice Salvaire's avatar
Fabrice Salvaire committed
In most cases, if ``axis`` words are given (any or all of ``X Y Z A B C U V W``), they specify a
Fabrice Salvaire's avatar
Fabrice Salvaire committed
destination point.

Axis numbers are in the currently active coordinate system, unless explicitly described as being in
the absolute coordinate system.

Where axis words are optional, any omitted axes will retain their original value.

Any items in the G code prototypes not explicitly described as optional are required.

The values following letters are often given as explicit numbers. Unless stated otherwise, the
Fabrice Salvaire's avatar
Fabrice Salvaire committed
explicit numbers can be real values. For example, ``G10 L2`` could equally well be written ``G[2*5]
L[1+1]``. If the value of parameter 100 were 2, ``G10 L#100`` would also mean the same.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
If ``L-`` is written in a prototype the ``-`` will often be referred to as the ``L number``, and so on for
Fabrice Salvaire's avatar
Fabrice Salvaire committed
any other letter.

G Code Quick Reference Table
----------------------------

==================================== ===========================================
Code                                 Description
==================================== ===========================================
Fabrice Salvaire's avatar
Fabrice Salvaire committed
`G0 <gcode_g0>`_                     Coordinated Motion at Rapid Rate
Fabrice Salvaire's avatar
Fabrice Salvaire committed
`G1 <#gcode:g1>`__                   Coordinated Motion at Feed Rate
`G2 G3 <#gcode:g2-g3>`__             Coordinated Helical Motion at Feed Rate
`G4 <#gcode:g4>`__                   Dwell
`G5 <#gcode:g5>`__                   Cubic Spline
`G5.1 <#gcode:g5.1>`__               Quadratic B-Spline
`G5.2,G5.3 <#gcode:g5.2-g5.3>`__     NURBS, add control point
`G7 <#gcode:g7>`__                   Diameter Mode (lathe)
`G8 <#gcode:g8>`__                   Radius Mode (lathe)
`G10 L1 <#gcode:g10-l1>`__           Set Tool Table Entry
`G10 L10 <#gcode:g10-l10>`__         Set Tool Table, Calculated, Workpiece
`G10 L11 <#gcode:g10-l11>`__         Set Tool Table, Calculated, Fixture
`G10 L2 <#gcode:g10-l2>`__           Coordinate System Origin Setting
`G10 L20 <#gcode:g10-l20>`__         Coordinate System Origin Setting Calculated
`G17 - G19.1 <#gcode:g17-g19.1>`__   Plane Select
`G20 G21 <#gcode:g20-g21>`__         Set Units of Measure
`G28 - G28.1 <#gcode:g28-g28.1>`__   Go to Predefined Position
`G30 - G30.1 <#gcode:g30-g30.1>`__   Go to Predefined Position
`G33 <#gcode:g33>`__                 Spindle Synchronized Motion
`G33.1 <#gcode:g33.1>`__             Rigid Tapping
`G38.2 - G38.5 <#gcode:g38>`__       Probing
`G40 <#gcode:g40>`__                 Cancel Cutter Compensation
`G41 G42 <#gcode:g41-g42>`__         Cutter Compensation
`G41.1 G42.1 <#gcode:g41.1-g42.1>`__ Dynamic Cutter Compensation
`G43 <#gcode:g43>`__                 Use Tool Length Offset from Tool Table
`G43.1 <#gcode:g43.1>`__             Dynamic Tool Length Offset
`G43.2 <#gcode:g43.2>`__             Apply additional Tool Length Offset
`G49 <#gcode:g49>`__                 Cancel Tool Length Offset
`G53 <#gcode:g53>`__                 Move in Machine Coordinates
`G54-G59.3 <#gcode:g54-g59.3>`__     Select Coordinate System (1 - 9)
`G61 G61.1 <#gcode:g61-g61.1>`__     Path Control Mode
`G64 <#gcode:g64>`__                 Path Control Mode with Optional Tolerance
`G73 <#gcode:g73>`__                 Drilling Cycle with Chip Breaking
`G74 <#gcode:g74>`__                 Left-hand Tapping Cycle with Dwell
`G76 <#gcode:g76>`__                 Multi-pass Threading Cycle (Lathe)
`G80 <#gcode:g80>`__                 Cancel Motion Modes
`G81 <#gcode:g81>`__                 Drilling Cycle
`G82 <#gcode:g82>`__                 Drilling Cycle with Dwell
`G83 <#gcode:g83>`__                 Drilling Cycle with Peck
`G84 <#gcode:g84>`__                 Right-hand Tapping Cycle with Dwell
`G85 <#gcode:g85>`__                 Boring Cycle, No Dwell, Feed Out
`G86 <#gcode:g86>`__                 Boring Cycle, Stop, Rapid Out
`G89 <#gcode:g89>`__                 Boring Cycle, Dwell, Feed Out
`G90 G91 <#gcode:g90-g91>`__         Distance Mode
`G90.1 G91.1 <#gcode:g90.1-g91.1>`__ Arc Distance Mode
`G92 <#gcode:g92>`__                 Coordinate System Offset
`G92.1 G92.2 <#gcode:g92.1-g92.2>`__ Cancel G92 Offsets
`G92.3 <#gcode:g92.3>`__             Restore G92 Offsets
`G93 G94 G95 <#gcode:g93-g94-g95>`__ Feed Modes
`G96 <#gcode:g96-g97>`__             Spindle Control Mode
`G98 G99 <#gcode:g98-g99>`__         Canned Cycle Z Retract Mode
==================================== ===========================================

G0 Rapid Move
-------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed
For rapid motion, program ``G0 axes``, where all the axis words are optional. The ``G0`` is optional if
the current motion mode is ``G0``. This will produce coordinated motion to the destination point at
the maximum rapid rate (or slower). ``G0`` is typically used as a positioning move.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Rapid Velocity Rate
~~~~~~~~~~~~~~~~~~~

The MAX_VELOCITY setting in the ini file [TRAJ] section defines the maximum rapid traverse rate. The
maximum rapid traverse rate can be higher than the individual axes MAX_VELOCITY setting during a
coordinated move. The maximum rapid traverse rate can be slower than the MAX_VELOCITY setting in the
[TRAJ] section if an axis MAX_VELOCITY or trajectory constraints limit it.

G0 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 (set absolute distance mode)
   G0 X1 Y-2.3 (Rapid linear move from current location to X1 Y-2.3)
   M2 (end program)

* See `G90 <#gcode:g90-g91>`__ & `M2 <#mcode:m2-m30>`__ sections for more information.

If cutter compensation is active, the motion will differ from the above; see the `Cutter
Compensation <#sec:cutter-compensation>`__ Section.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
If ``G53`` is programmed on the same line, the motion will also differ; see the `G53 <#gcode:g53>`__
Fabrice Salvaire's avatar
Fabrice Salvaire committed
Section for more information.

The path of a G0 rapid motion can be rounded at direction changes and depends on the `trajectory
control <#sec:trajectory-control>`__ settings and maximum acceleration of the axes.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* An axis letter is without a real value.
* An axis letter is used that is not configured

G1 Linear Move
--------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G1 axes

For linear (straight line) motion at programed `feed rate <#sec:set-feed-rate>`__ (for cutting or
Fabrice Salvaire's avatar
Fabrice Salvaire committed
not), program ``G1 ``axes````, where all the axis words are optional. The ``G1`` is optional if the
current motion mode is ``G1``. This will produce coordinated motion to the destination point at the
Fabrice Salvaire's avatar
Fabrice Salvaire committed
current feed rate (or slower).

G1 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 (set absolute distance mode)
   G1 X1.2 Y-3 F10 (linear move at a feed rate of 10 from current position to X1.2 Y-3)
   Z-2.3 (linear move at same feed rate from current position to Z-2.3)
   Z1 F25 (linear move at a feed rate of 25 from current position to Z1)
   M2 (end program)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* See `G90 <#gcode:g90-g91>`__ & `F <#sec:set-feed-rate>`__ & `M2 <#mcode:m2-m30>`__ sections for
  more information.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

If cutter compensation is active, the motion will differ from the above; see the `Cutter
Compensation <#sec:cutter-compensation>`__ Section.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
If ``G53`` is programmed on the same line, the motion will also differ; see the `G53 <#gcode:g53>`__
Fabrice Salvaire's avatar
Fabrice Salvaire committed
Section for more information.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* No feed rate has been set.
* An axis letter is without a real value.
* An axis letter is used that is not configured

G2, G3 Arc Move
---------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G2 or G3 axes offsets (center format)
   G2 or G3 axes R- (radius format)
   G2 or G3 offsets|R- <P-> (full circles)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
A circular or helical arc is specified using either ``G2`` (clockwise arc) or ``G3`` (counterclockwise
Fabrice Salvaire's avatar
Fabrice Salvaire committed
arc) at the current `feed rate <#sec:set-feed-rate>`__. The direction (CW, CCW) is as viewed from
the positive end of the axis about which the circular motion occurs.

The axis of the circle or helix must be parallel to the X, Y, or Z axis of the machine coordinate
Fabrice Salvaire's avatar
Fabrice Salvaire committed
system. The axis (or, equivalently, the plane perpendicular to the axis) is selected with ``G17``
(Z-axis, XY-plane), ``G18`` (Y-axis, XZ-plane), or ``G19`` (X-axis, YZ-plane). Planes ``17.1``, ``18.1``,
and ``19.1`` are not currently supported. If the arc is circular, it lies in a plane parallel to the
Fabrice Salvaire's avatar
Fabrice Salvaire committed
selected plane.

To program a helix, include the axis word perpendicular to the arc plane: for example, if in the
Fabrice Salvaire's avatar
Fabrice Salvaire committed
``G17`` plane, include a ``Z`` word. This will cause the ``Z`` axis to move to the programmed value during
the circular ``XY`` motion.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
To program an arc that gives more than one full turn, use the ``P`` word specifying the number of full
turns plus the programmed arc. The ``P`` word must be an integer. If ``P`` is unspecified, the behavior
is as if ``P1`` was given: that is, only one full or partial turn will result. For example, if a 180
Fabrice Salvaire's avatar
Fabrice Salvaire committed
degree arc is programmed with a P2, the resulting motion will be 1 1/2 rotations. For each P
increment above 1 an extra full circle is added to the programmed arc. Multi turn helical arcs are
supported and give motion useful for milling holes or threads.

If a line of code makes an arc and includes rotary axis motion, the rotary axes turn at a constant
rate so that the rotary motion starts and finishes when the XYZ motion starts and finishes. Lines of
this sort are hardly ever programmed.

If cutter compensation is active, the motion will differ from the above; see the `Cutter
Compensation <#sec:cutter-compensation>`__ Section.

The arc center is absolute or relative as set by `G90.1 or G91.1 <#gcode:g90.1-g91.1>`__
respectively.

Two formats are allowed for specifying an arc: Center Format and Radius Format.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* No feed rate has been set.
* The P word is not an integer.

Center Format Arcs
~~~~~~~~~~~~~~~~~~

Center format arcs are more accurate than radius format arcs and are the preferred format to use.

The end point of the arc along with the offset to the center of the arc from the current location
are used to program arcs that are less than a full circle. It is OK if the end point of the arc is
the same as the current location.

The offset to the center of the arc from the current location and optionally the number of turns are
used to program full circles.

When programming arcs an error due to rounding can result from using a precision of less than 4
decimal places (0.0000) for inch and less than 3 decimal places (0.000) for millimeters.

Incremental Arc Distance Mode

Arc center offsets are a relative distance from the start location of the arc. Incremental Arc
Distance Mode is default.

One or more axis words and one or more offsets must be programmed for an arc that is less than 360
degrees.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
No axis words and one or more offsets must be programmed for full circles. The ``P`` word defaults to
Fabrice Salvaire's avatar
Fabrice Salvaire committed
1 and is optional.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
For more information on Incremental Arc Distance Mode see the `G91.1 <#gcode:g90.1-g91.1>`__
Fabrice Salvaire's avatar
Fabrice Salvaire committed
section.

Absolute Arc Distance Mode

Arc center offsets are the absolute distance from the current 0 position of the axis.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
One or more axis words and ``both`` offsets must be programmed for arcs
Fabrice Salvaire's avatar
Fabrice Salvaire committed
less than 360 degrees.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
No axis words and both offsets must be programmed for full circles. The ``P`` word defaults to 1 and
Fabrice Salvaire's avatar
Fabrice Salvaire committed
is optional.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
For more information on Absolute Arc Distance Mode see the `G90.1 <#gcode:g90.1-g91.1>`__ section.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

XY-plane (G17)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G2 or G3 <X- Y- Z- I- J- P->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``Z`` - helix
* ``I`` - X offset
* ``J`` - Y offset
* ``P`` - number of turns
Fabrice Salvaire's avatar
Fabrice Salvaire committed

XZ-plane (G18)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G2 or G3 <X- Z- Y- I- K- P->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``Y`` - helix
* ``I`` - X offset
* ``K`` - Z offset
* ``P`` - number of turns
Fabrice Salvaire's avatar
Fabrice Salvaire committed

YZ-plane (G19)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G2 or G3 <Y- Z- X- J- K- P->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``X`` - helix
* ``J`` - Y offset
* ``K`` - Z offset
* ``P`` - number of turns
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* No feed rate is set with the `F <#sec:set-feed-rate>`__ word.
* No offsets are programmed.
* When the arc is projected on the selected plane, the distance from the current point to the center
  differs from the distance from the end point to the center by more than (.05 inch/.5 mm) OR
  ((.0005 inch/.005mm) AND .1% of radius).

Fabrice Salvaire's avatar
Fabrice Salvaire committed
Deciphering the Error message ``Radius to end of arc differs from radius to start:``
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``start`` - the current position
* ``center`` - the center position as calculated using the i, j, or k words
* ``end`` - the programmed end point
* ``r1`` - radius from the start position to the center
* ``r2`` - radius from the end position to the center
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Center Format Examples
~~~~~~~~~~~~~~~~~~~~~~

Calculating arcs by hand can be difficult at times. One option is to draw the arc with a cad program
to get the coordinates and offsets. Keep in mind the tolerance mentioned above, you may have to
change the precision of your cad program to get the desired results. Another option is to calculate
the coordinates and offset using formulas. As you can see in the following figures a triangle can be
formed from the current position the end position and the arc center.

In the following figure you can see the start position is X0 Y0, the end position is X1 Y1. The arc
center position is at X1 Y0. This gives us an offset from the start position of 1 in the X axis and
0 in the Y axis.  In this case only an I offset is needed.

G2 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G0 X0 Y0
   G2 X1 Y1 I1 F10 (clockwise arc in the XY plane)

|G2 Example|

Figure 1. G2 Example

In the next example we see the difference between the offsets for Y if we are doing a G2 or a G3
move. For the G2 move the start position is X0 Y0, for the G3 move it is X0 Y1. The arc center is at
X1 Y0.5 for both moves. The G2 move the J offset is 0.5 and the G3 move the J offset is -0.5.

G2-G3 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G0 X0 Y0
   G2 X0 Y1 I1 J0.5 F25 (clockwise arc in the XY plane)
   G3 X0 Y0 I1 J-0.5 F25 (counterclockwise arc in the XY plane)

|G2-G3 Example|

Figure 2. G2-G3 Example

In the next example we show how the arc can make a helix in the Z axis by adding the Z word.

G2 Example Helix

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G0 X0 Y0 Z0
   G17 G2 X10 Y16 I3 J4 Z-1 (helix arc with Z added)

In the next example we show how to make more than one turn using the P word.

P word Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G0 X0 Y0 Z0
   G2 X0 Y1 Z-1 I1 J0.5 P2 F25

In the center format, the radius of the arc is not specified, but it may be found easily as the
distance from the center of the circle to either the current point or the end point of the arc.

Radius Format Arcs
~~~~~~~~~~~~~~~~~~

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G2 or G3 axes R- <P->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``R`` - radius from current position
Fabrice Salvaire's avatar
Fabrice Salvaire committed

It is not good practice to program radius format arcs that are nearly full circles or nearly
semicircles because a small change in the location of the end point will produce a much larger
change in the location of the center of the circle (and, hence, the middle of the arc). The
magnification effect is large enough that rounding error in a number can produce out-of-tolerance
cuts. For instance, a 1% displacement of the endpoint of a 180 degree arc produced a 7% displacement
of the point 90 degrees along the arc. Nearly full circles are even worse. Other size arcs (in the
range tiny to 165 degrees or 195 to 345 degrees) are OK.

In the radius format, the coordinates of the end point of the arc in the selected plane are
Fabrice Salvaire's avatar
Fabrice Salvaire committed
specified along with the radius of the arc. Program ``G2`` ``axes`` ``R-`` (or use ``G3`` instead of ``G2``
Fabrice Salvaire's avatar
Fabrice Salvaire committed
). R is the radius. The axis words are all optional except that at least one of the two words for
the axes in the selected plane must be used. The R number is the radius. A positive radius indicates
that the arc turns through less than 180 degrees, while a negative radius indicates a turn of more
than 180 degrees. If the arc is helical, the value of the end point of the arc on the coordinate
axis parallel to the axis of the helix is also specified.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* both of the axis words for the axes of the selected plane are omitted
* the end point of the arc is the same as the current point.

G2 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G17 G2 X10 Y15 R20 Z5 (radius format with arc)

The above example makes a clockwise (as viewed from the positive Z-axis) circular or helical arc
whose axis is parallel to the Z-axis, ending where X=10, Y=15, and Z=5, with a radius of 20. If the
starting value of Z is 5, this is an arc of a circle parallel to the XY-plane; otherwise it is a
helical arc.

G4 Dwell
--------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - seconds to dwell (floating point)
Fabrice Salvaire's avatar
Fabrice Salvaire committed

The P number is the time in seconds that all axes will remain unmoving.
The P number is a floating point number so fractions of a second may be
used. G4 does not affect spindle, coolant and any I/O.

G4 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G4 P0.5 (wait for 0.5 seconds before proceeding)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* the P number is negative or not specified.

G5 Cubic Spline
---------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G5 X- Y- <I- J-> P- Q-

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``I`` - X incremental offset from start point to first control point
* ``J`` - Y incremental offset from start point to first control point
* ``P`` - X incremental offset from end point to second control point
* ``Q`` - Y incremental offset from end point to second control point
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G5 creates a cubic B-spline in the XY plane with the X and Y axes only.  P and Q must both be
specified for every G5 command.

For the first G5 command in a series of G5 commands, I and J must both be specified. For subsequent
G5 commands, either both I and J must be specified, or neither. If I and J are unspecified, the
starting direction of this cubic will automatically match the ending direction of the previous cubic
(as if I and J are the negation of the previous P and Q).

For example, to program a curvy N shape:

G5 Sample initial cubic spline

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 G17
   G0 X0 Y0
   G5 I0 J3 P0 Q-3 X1 Y1

A second curvy N that attaches smoothly to this one can now be made without specifying I and J:

G5 Sample subsequent cubic spline

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G5 P0 Q-3 X2 Y2

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* P and Q are not both specified
* Just one of I or J are specified
* I or J are unspecified in the first of a series of G5 commands
* An axis other than X or Y is specified
* The active plane is not G17

.. _g51-quadratic-spline:

G5.1 Quadratic Spline
---------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G5.1 X- Y- I- J-

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``I`` - X incremental offset from start point to control point
* ``J`` - Y incremental offset from start point to control point
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G5.1 creates a quadratic B-spline in the XY plane with the X and Y axis only. Not specifying I or J
gives zero offset for the unspecified axis, so one or both must be given.

For example, to program a parabola, through the origin, from X-2 Y4 to X2 Y4:

G5.1 Sample quadratic spline

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 G17
   G0 X-2 Y4
   G5.1 X2 I2 J-8

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* both I and J offset are unspecified or zero
* An axis other than X or Y is specified
* The active plane is not G17

.. _g52-g53-nurbs-block:

G5.2 G5.3 NURBS Block
---------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G5.2 <P-> <X- Y-> <L->
   X- Y- <P->
   ...
   G5.3

Warning: G5.2, G5.3 is experimental and not fully tested.

G5.2 is for opening the data block defining a NURBS and G5.3 for closing the data block. In the
lines between these two codes the curve control points are defined with both their related
Fabrice Salvaire's avatar
Fabrice Salvaire committed
``weights`` (P) and the parameter (L) which determines the order of the curve.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

The current coordinate, before the first G5.2 command, is always taken as the first NURBS control
point. To set the weight for this first control point, first program G5.2 P- without giving any X Y.

The default weight if P is unspecified is 1. The default order if L is unspecified is 3.

G5.2 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G0 X0 Y0 (rapid move)
   F10 (set feed rate)
   G5.2 P1 L3
        X0 Y1 P1
        X2 Y2 P1
        X2 Y0 P1
        X0 Y0 P2
   G5.3
   ; The rapid moves show the same path without the NURBS Block
   G0 X0 Y1
      X2 Y2
      X2 Y0
      X0 Y0
   M2

Sample NURBS Output

|Sample NURBS Output|

Fabrice Salvaire's avatar
Fabrice Salvaire committed
More information on NURBS can be found here: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?NURBS
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G7 Lathe Diameter Mode
----------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G7

Program G7 to enter the diameter mode for axis X on a lathe. When in the diameter mode the X axis
moves on a lathe will be 1/2 the distance to the center of the lathe. For example X1 would move the
cutter to 0.500” from the center of the lathe thus giving a 1” diameter part.

G8 Lathe Radius Mode
--------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G8

Program G8 to enter the radius mode for axis X on a lathe. When in Radius mode the X axis moves on a
lathe will be the distance from the center. Thus a cut at X1 would result in a part that is 2" in
diameter.  G8 is default at power up.

G10 L1 Set Tool Table
---------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L1 P- axes <R- I- J- Q->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - tool number
* ``R`` - radius of tool
* ``I`` - front angle (lathe)
* ``J`` - back angle (lathe)
* ``Q`` - orientation (lathe)
Fabrice Salvaire's avatar
Fabrice Salvaire committed
G10 L1 sets the tool table for the ``P`` tool number to the values of the words.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

A valid G10 L1 rewrites and reloads the tool table.

G10 L1 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L1 P1 Z1.5 (set tool 1 Z offset from the machine origin to 1.5)
   G10 L1 P2 R0.015 Q3 (lathe example setting tool 2 radius to 0.015 and orientation to 3)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* Cutter Compensation is on
* The P number is unspecified
* The P number is not a valid tool number from the tool table
* The P number is 0

Fabrice Salvaire's avatar
Fabrice Salvaire committed
For more information on cutter orientation used by the ``Q`` word, see the `Lathe Tool Orientation
Fabrice Salvaire's avatar
Fabrice Salvaire committed
<#lathe-tool-orientation>`__ diagram.

G10 L2 Set Coordinate System
----------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L2 P- <axes R->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - coordinate system (0-9)
* ``R`` - rotation about the Z axis
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G10 L2 offsets the origin of the axes in the coordinate system specified to the value of the axis
word. The offset is from the machine origin established during homing. The offset value will replace
any current offsets in effect for the coordinate system specified. Axis words not used will not be
changed.

Program P0 to P9 to specify which coordinate system to change.

======= ================= ======
P Value Coordinate System G code
======= ================= ======
0       Active            n/a
1       1                 G54
2       2                 G55
3       3                 G56
4       4                 G57
5       5                 G58
6       6                 G59
7       7                 G59.1
8       8                 G59.2
9       9                 G59.3
======= ================= ======

Optionally program R to indicate the rotation of the XY axis around the Z axis. The direction of
rotation is CCW as viewed from the positive end of the Z axis.

All axis words are optional.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
Being in incremental distance mode (```G91`` <#gcode:g90-g91>`__) has no effect on ``G10 L2``.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Important Concepts:

* G10 L2 Pn does not change from the current coordinate system to the one specified by P, you have
  to use G54-59.3 to select a coordinate system.
* When a rotation is in effect jogging an axis will only move that axis in a positive or negative
  direction and not along the rotated axis.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* If a ``G52`` local offset or ``G92`` origin offset was in effect before ``G10 L2``, it will continue to
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  be in effect afterwards.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* When programming a coordinate system with R, any ``G52`` or ``G92`` will be applied **after** the
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  rotation.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* The coordinate system whose origin is set by a ``G10`` command may be active or inactive at the time
  the ``G10`` is executed. If it is currently active, the new coordinates take effect immediately.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* The P number does not evaluate to an integer in the range 0 to 9.
* An axis is programmed that is not defined in the configuration.

G10 L2 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L2 P1 X3.5 Y17.2

Fabrice Salvaire's avatar
Fabrice Salvaire committed
In the above example the origin of the first coordinate system (the one selected by ``G54``) is set to
Fabrice Salvaire's avatar
Fabrice Salvaire committed
be X=3.5 and Y=17.2. Because only X and Y are specified, the origin point is only moved in X and Y;
the other coordinates are not changed.

G10 L2 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L2 P1 X0 Y0 Z0 (clear offsets for X,Y & Z axes in coordinate system 1)

The above example sets the XYZ coordinates of the coordinate system 1 to the machine origin.

The coordinate system is described in the `Coordinate System <#cha:coordinate-system>`__ Section.

G10 L10 Set Tool Table
----------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L10 P- axes <R- I- J- Q->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - tool number
* ``R`` - radius of tool
* ``I`` - front angle (lathe)
* ``J`` - back angle (lathe)
* ``Q`` - orientation (lathe)
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G10 L10 changes the tool table entry for tool P so that if the tool offset is reloaded, with the
machine in its current position and with the current G5x and G52/G92 offsets active, the current
coordinates for the given axes will become the given values. The axes that are not specified in the
G10 L10 command will not be changed. This could be useful with a probe move as described in the `G38
<#gcode:g38>`__ section.

G10 L10 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   T1 M6 G43 (load tool 1 and tool length offsets)
   G10 L10 P1 Z1.5 (set the current position for Z to be 1.5)
   G43 (reload the tool length offsets from the changed tool table)
   M2 (end program)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* See `T <#sec:select-tool>`__ & `M6 <#mcode:m6>`__, and `G43 <#gcode:g43>`__ / `G43.1
  <#gcode:g43.1>`__ sections for more information.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* Cutter Compensation is on
* The P number is unspecified
* The P number is not a valid tool number from the tool table
* The P number is 0

G10 L11 Set Tool Table
----------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L11 P- axes <R- I- J- Q->

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - tool number
* ``R`` - radius of tool
* ``I`` - front angle (lathe)
* ``J`` - back angle (lathe)
* ``Q`` - orientation (lathe)
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G10 L11 is just like G10 L10 except that instead of setting the entry according to the current
offsets, it is set so that the current coordinates would become the given value if the new tool
offset is reloaded and the machine is placed in the G59.3 coordinate system without any G52/G92
offset active.

This allows the user to set the G59.3 coordinate system according to a fixed point on the machine,
and then use that fixture to measure tools without regard to other currently-active offsets.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* Cutter Compensation is on
* The P number is unspecified
* The P number is not a valid tool number from the tool table
* The P number is 0

G10 L20 Set Coordinate System
-----------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L20 P- axes

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``P`` - coordinate system (0-9)
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G10 L20 is similar to G10 L2 except that instead of setting the offset/entry to the given value, it
is set to a calculated value that makes the current coordinates become the given value.

G10 L20 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G10 L20 P1 X1.5 (set the X axis current location in coordinate system 1 to 1.5)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* The P number does not evaluate to an integer in the range 0 to 9.
* An axis is programmed that is not defined in the configuration.

.. _g17---g191-plane-select:

G17 - G19.1 Plane Select
------------------------

These codes set the current plane as follows:

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G17`` - XY (default)
* ``G18`` - ZX
* ``G19`` - YZ
* ``G17.1`` - UV
* ``G18.1`` - WU
* ``G19.1`` - VW
Fabrice Salvaire's avatar
Fabrice Salvaire committed

The UV, WU and VW planes do not support arcs.

It is a good idea to include a plane selection in the preamble of each G code file.

The effects of having a plane selected are discussed in Section `G2 G3 Arcs <#gcode:g2-g3>`__ and
Section `G81 G89 <#gcode:g80-g89>`__

G20, G21 Units
--------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G20`` - to use inches for length units.
* ``G21`` - to use millimeters for length units.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

It is a good idea to include units in the preamble of each G code file.

.. _g28-g281-goset-predefined-position:

G28, G28.1 Go/Set Predefined Position
-------------------------------------

G28 uses the values stored in `parameters <#sub:numbered-parameters>`__ 5161-5169 as the X Y Z A B C
Fabrice Salvaire's avatar
Fabrice Salvaire committed
U V W final point to move to. The parameter values are ``absolute`` machine coordinates in the native
machine ``units`` as specified in the ini file. All axes defined in the ini file will be moved when a
Fabrice Salvaire's avatar
Fabrice Salvaire committed
G28 is issued. If no positions are stored with G28.1 then all axes will go to the `machine origin
<#sec.machine-corrdinate-system>`__.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G28`` - makes a `rapid move <#gcode:g0>`__ from the current position to the ``absolute``
  position of the values in parameters 5161-5166.
* ``G28 axes`` - makes a rapid move to the position specified by ``axes`` including any offsets,
  then will make a rapid move to the ``absolute`` position of the values in parameters 5161-5166 for
  all ``axes`` specified. Any ``axis`` not specified will not move.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G28.1`` - stores the current ``absolute`` position into parameters 5161-5166.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G28 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G28 Z2.5 (rapid to Z2.5 then to Z location specified in #5163)

It is an error if :

* Cutter Compensation is turned on

.. _g30-g301-goset-predefined-position:

G30, G30.1 Go/Set Predefined Position
-------------------------------------

G30 functions the same as G28 but uses the values stored in `parameters
<#sub:numbered-parameters>`__ 5181-5189 as the X Y Z A B C U V W final point to move to. The
Fabrice Salvaire's avatar
Fabrice Salvaire committed
parameter values are ``absolute`` machine coordinates in the native machine ``units`` as specified in
Fabrice Salvaire's avatar
Fabrice Salvaire committed
the ini file.  All axes defined in the ini file will be moved when a G30 is issued. If no positions
are stored with G30.1 then all axes will go to the `machine origin
<#sec.machine-corrdinate-system>`__.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G30`` - makes a `rapid move <#gcode:g0>`__ from the current position to the ``absolute``
  position of the values in parameters 5181-5186.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G30 axes`` - makes a rapid move to the position specified by ``axes`` including any offsets,
  then will make a rapid move to the ``absolute`` position of the values in parameters 5181-5186 for
  all ``axes`` specified. Any ``axis`` not specified will not move.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G30.1`` - stores the current absolute position into parameters 5181-5186.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G30 Example Line

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G30 Z2.5 (rapid to Z2.5 then to the Z location specified in #5i83)

It is an error if :

* Cutter Compensation is turned on

G33 Spindle Synchronized Motion
-------------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G33 X- Y- Z- K- $-

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``K`` - distance per revolution
Fabrice Salvaire's avatar
Fabrice Salvaire committed
For spindle-synchronized motion in one direction, code ``G33 X- Y- Z- K-`` where K gives the distance
moved in XYZ for each revolution of the spindle. For instance, if starting at ``Z=0``, ``G33 Z-1
K.0625`` produces a 1 inch motion in Z over 16 revolutions of the spindle. This command might be part
of a program to produce a 16TPI thread. Another example in metric, ``G33 Z-15 K1.5`` produces a
Fabrice Salvaire's avatar
Fabrice Salvaire committed
movement of 15mm while the spindle rotates 10 times for a thread of 1.5mm.

The (optional) $ argument sets which spindle the motion is synchronised to (default is zero). For
example G33 Z10 K1 $1 will move the spindle in synchrony with the spindle.N.revs HAL pin value.

Spindle-synchronized motion waits for the spindle index and spindle at speed pins, so multiple
Fabrice Salvaire's avatar
Fabrice Salvaire committed
passes line up. ``G33`` moves end at the programmed endpoint. G33 could be used to cut tapered threads
Fabrice Salvaire's avatar
Fabrice Salvaire committed
or a fusee.

All the axis words are optional, except that at least one must be used.

Technical Info

At the beginning of each G33 pass, LinuxCNC uses the spindle speed and the machine acceleration
limits to calculate how long it will take Z to accelerate after the index pulse, and determines how
many degrees the spindle will rotate during that time. It then adds that angle to the index position
and computes the Z position using the corrected spindle angle. That means that Z will reach the
correct position just as it finishes accelerating to the proper speed, and can immediately begin
cutting a good thread.

HAL Connections

Fabrice Salvaire's avatar
Fabrice Salvaire committed
The pin ``spindle.N.at-speed`` must be set or driven true for the motion to start. Additionally
Fabrice Salvaire's avatar
Fabrice Salvaire committed
spindle.N.revs must increase by 1 for each revolution of the spindle and the spindle.N.index-enable
pin must be connected to an encoder (or resolver) counter which resets index-enable once per rev.

See the Integrators Manual for more information on spindle synchronized motion.

G33 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 (absolute distance mode)
   G0 X1 Z0.1 (rapid to position)
   S100 M3 (start spindle turning)
   G33 Z-2 K0.125 (move Z axis to -2 at a rate to equal 0.125 per revolution)
   G0 X1.25 (rapid move tool away from work)
   Z0.1 (rapid move to starting Z position)
   M2 (end program)

* See `G90 <#gcode:g90-g91>`__ & `G0 <#gcode:g0>`__ & `M2 <#mcode:m2-m30>`__ sections for more
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  information.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* All axis words are omitted.
* The spindle is not turning when this command is executed
* The requested linear motion exceeds machine velocity limits due to the spindle speed

.. _g331-rigid-tapping:

G33.1 Rigid Tapping
-------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G33.1 X- Y- Z- K- I- $-

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``K`` - distance per revolution
* ``I`` - optional spindle speed multiplier for faster return move
* ``$`` - optional spindle selector
Fabrice Salvaire's avatar
Fabrice Salvaire committed
For rigid tapping (spindle synchronized motion with return), code ``G33.1 X- Y- Z- K-`` where ``K-``
Fabrice Salvaire's avatar
Fabrice Salvaire committed
gives the distance moved for each revolution of the spindle.

A rigid tapping move consists of the following sequence:

#. A move from the current coordinate to the specified coordinate, synchronized with the selected
   spindle at the given ratio and starting from the current coordinate with a spindle index pulse.
#. When reaching the endpoint, a command to reverse the spindle, and speed up by a factor set by the
   multiplier (e.g., from clockwise to counterclockwise).
#. Continued synchronized motion beyond the specified end coordinate until the spindle actually
   stops and reverses.
#. Continued synchronized motion back to the original coordinate.
#. When reaching the original coordinate, a command to reverse the spindle a second time (e.g., from
   counterclockwise to clockwise).
#. Continued synchronized motion beyond the original coordinate until the spindle actually stops and
   reverses.
#. An **unsynchronized** move back to the original coordinate.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
Spindle-synchronized motions wait for spindle index, so multiple passes line up.``G33.1`` moves end at
Fabrice Salvaire's avatar
Fabrice Salvaire committed
the original coordinate.

All the axis words are optional, except that at least one must be used.

G33.1 Example

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed

   G90 (set absolute mode)
   G0 X1.000 Y1.000 Z0.100 (rapid move to starting position)
   S100 M3 (turn on the spindle, 100 RPM)
   G33.1 Z-0.750 K0.05 (rigid tap a 20 TPI thread 0.750 deep)
   M2 (end program)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* See `G90 <#gcode:g90-g91>`__ & `G0 <#gcode:g0>`__ & `M2 <#mcode:m2-m30>`__ sections for more
  information.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* All axis words are omitted.

* The spindle is not turning when this command is executed
* The requested linear motion exceeds machine velocity limits due to the spindle speed

.. _g38n-straight-probe:

G38.n Straight Probe
--------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text