Skip to content
g-code.rst 79.6 KiB
Newer Older
Fabrice Salvaire's avatar
Fabrice Salvaire committed
G92 Coordinate System Offset
----------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
.. code:: text
Fabrice Salvaire's avatar
Fabrice Salvaire committed
``G92`` makes the current point have the coordinates you want (without motion), where the axis words
Fabrice Salvaire's avatar
Fabrice Salvaire committed
contain the axis numbers you want. All axis words are optional, except that at least one must be
used. If an axis word is not used for a given axis, the offset for that axis will be zero.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
When ``G92`` is executed, the `origins <#sec.machine-corrdinate-system>`__ of all coordinate systems
Fabrice Salvaire's avatar
Fabrice Salvaire committed
move. They move such that the value of the current controlled point, in the currently active
Fabrice Salvaire's avatar
Fabrice Salvaire committed
coordinate system, becomes the specified value. All of the coordinate system`s origins (G53-G59.3)
Fabrice Salvaire's avatar
Fabrice Salvaire committed
are offset this same distance.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
``G92`` uses the values stored in `parameters <#sub:numbered-parameters>`__ 5211-5219 as the X Y Z A B
C U V W offset values for each axis. 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 offset
when G92 is active. If an axis was not entered following the G92, that axis`` offset will be zero.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
For example, suppose the current point is at X=4 and there is currently no ``G92`` offset active. Then
``G92 X7`` is programmed. This moves all origins -3 in X, which causes the current point to become
Fabrice Salvaire's avatar
Fabrice Salvaire committed
X=7. This -3 is saved in parameter 5211.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
Being in incremental distance mode (G91 instead of G90) has no effect on the action of ``G92``.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
``G92`` offsets may be already be in effect when the ``G92`` is called. If this is the case, the offset
Fabrice Salvaire's avatar
Fabrice Salvaire committed
is replaced with a new offset that makes the current point become the specified value.

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

* all axis words are omitted.

LinuxCNC stores the G92 offsets and reuses them on the next run of a program. To prevent this, one
can program a G92.1 (to erase them), or program a G92.2 (to remove them - they are still stored).

Fabrice Salvaire's avatar
Fabrice Salvaire committed
See the `Coordinate System <#cha:coordinate-system>`__ Section for an overview of coordinate
systems.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

See the `Parameters <#gcode:parameters>`__ Section for more information.

.. _g921-g922-reset-g92-offsets:

G92.1, G92.2 Reset G92 Offsets
------------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G92.1`` - turn off G92 offsets and reset
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   `parameters <#sub:numbered-parameters>`__ 5211 - 5219 to zero.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G92.2`` - turn off G92 offsets but keep
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   `parameters <#sub:numbered-parameters>`__ 5211 - 5219 available.

.. _g923-restore-g92-offsets:

G92.3 Restore G92 Offsets
-------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G92.3`` - set the G92 offset to the values saved in parameters 5211 to 5219
Fabrice Salvaire's avatar
Fabrice Salvaire committed
You can set axis offsets in one program and use the same offsets in another program. Program ``G92``
in the first program. This will set parameters 5211 to 5219. Do not use ``G92.1`` in the remainder of
Fabrice Salvaire's avatar
Fabrice Salvaire committed
the first program. The parameter values will be saved when the first program exits and restored when
Fabrice Salvaire's avatar
Fabrice Salvaire committed
the second one starts up. Use ``G92.3`` near the beginning of the second program. That will restore
Fabrice Salvaire's avatar
Fabrice Salvaire committed
the offsets saved in the first program.

G93, G94, G95: Feed Rate Mode
-----------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G93`` - is Inverse Time Mode. In inverse time feed rate mode, an F word means the move should be
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  completed in [one divided by the F number] minutes. For example, if the F number is 2.0, the move
  should be completed in half a minute.

  When the inverse time feed rate mode is active, an F word must appear on every line which has a
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  G1, G2, or G3 motion, and an F word on a line that does not have G1, G2, or G3 is ignored. Being
  in inverse time feed rate mode does not affect G0 (`rapid move <#gcode:g0>`__) motions.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G94`` - is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to
  mean the controlled point should move at a certain number of inches per minute, millimeters per
  minute, or degrees per minute, depending upon what length units are being used and which axis or
  axes are moving.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G95`` - is Units per Revolution Mode In units per revolution mode, an F word is interpreted to
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  mean the controlled point should move a certain number of inches per revolution of the spindle,
  depending on what length units are being used and which axis or axes are moving.  G95 is not
  suitable for threading, for threading use G33 or G76. G95 requires that spindle.N.speed-in to be
  connected. The actual spindle to which the feed is synchronised is chosen by the $ parameter
Fabrice Salvaire's avatar
Fabrice Salvaire committed
**It is an error if:**
Fabrice Salvaire's avatar
Fabrice Salvaire committed

* Inverse time feed mode is active and a line with G1, G2, or G3 (explicitly or implicitly) does not
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  have an F word.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* A new feed rate is not specified after switching to G94 or G95

G96, G97 Spindle Control Mode
-----------------------------

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

   G96 <D-> S- <$-> (Constant Surface Speed Mode)
   G97 S- <$-> (RPM Mode)

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``D`` - maximum spindle RPM
* ``S`` - surface speed
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``$`` - the spindle of which the speed will be varied.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G96 D- S-`` - selects constant surface speed of ``S`` feet per minute (if G20 is in effect) or
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  meters per minute (if G21 is in effect). D- is optional.

  When using G96, ensure that X0 in the current coordinate system (including offsets and tool
  lengths) is the center of rotation or LinuxCNC will not give the desired ssurface speed. G96 is
  not affected by radius or diameter mode.

To achieve CSS mode on selected spindles programme successive G96 commands for each spindle prior to
issuing M3.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G97`` selects RPM mode.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

G96 Example Line

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

   G96 D2500 S250 (set CSS with a max rpm of 2500 and a surface speed of 250)

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

* S is not specified with G96
* A feed move is specified in G96 mode while the spindle is not turning

G98, G99 Canned Cycle Return Level
----------------------------------

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G98`` - retract to the position that axis was in just before this series of one or more contiguous
Fabrice Salvaire's avatar
Fabrice Salvaire committed
  canned cycles was started.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
* ``G99`` - retract to the position specified by the R word of the canned cycle.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
Program a ``G98`` and the canned cycle will use the Z position prior to the canned cycle as the Z
Fabrice Salvaire's avatar
Fabrice Salvaire committed
return position if it is higher than the R value specified in the cycle. If it is lower, the R value
will be used.  The R word has different meanings in absolute distance mode and incremental distance
mode.

G98 Retract to Origin

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

   G0 X1 Y2 Z3
   G90 G98 G81 X4 Y5 Z-0.6 R1.8 F10

The G98 to the second line above means that the return move will be to the value of Z in the first
line since it is higher that the R value specified.

Fabrice Salvaire's avatar
Fabrice Salvaire committed
The ``initial`` (G98) plane is reset any time cycle motion mode is abandoned, whether explicitly
(G80) or implicitly (any motion code that is not a cycle). Switching among cycle modes (say G81 to
G83) does NOT reset the ``initial`` plane. It is possible to switch between G98 and G99 during a
series of cycles.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

.. |G2 Example| image:: images/g2.png
.. |G2-G3 Example| image:: images/g2-3.png
.. |Sample NURBS Output| image:: images/nurbs01.png
.. |G76 Threading| image:: images/g76-threads.png
.. |G76 Example| image:: images/g76-01.png
.. |eight| image:: images/eight.png
.. |twelve| image:: images/twelve.png
.. |G80 Cycle| image:: images/G81mult.png
.. |G81ex1| image:: images/G81ex1.png
.. |G81ex2| image:: images/G81ex2.png
.. |G81| image:: images/G81.png
.. |G81a| image:: images/G81a.png