:lang: en
:toc:

[[cha:lathe-configuration]]
= Lathe Configuration

// Custom lang highlight
// must come after the doc title, to work around a bug in asciidoc 8.6.6
:ini: {basebackend@docbook:'':ini}
:hal: {basebackend@docbook:'':hal}
:ngc: {basebackend@docbook:'':ngc}

== Default Plane

When LinuxCNC's interpreter was first written, it was designed for mills.
That is why the default plane is XY (G17). A normal lathe only uses the
XZ plane (G18). To change the default plane place the following line in
the INI file in the RS274NGC section.

[source,{ini}]
----
RS274NGC_STARTUP_CODE = G18
----

The above can be overwritten in a G-code program so always set important things
in the preamble of the G-code file.

== INI Settings

The following INI settings are needed for lathe mode in Axis in addition to
or replacing normal settings in the INI file. These historical settings use
identity kinematics (trivkins) and 'three' joints (0,1,2) corresponding to
coordinates x, y, z.  The joint 1 for the unused y axis is required but not used
in these historical configurations.  Simulated lathe configs may use these
historical settings.
GMOCCAPY also uses the mentioned settings, but does offer additional settings,
check the <<cha:gmoccapy,GMOCCAPY>> section for details.

[source,{ini}]
----
[DISPLAY]
DISPLAY = axis
LATHE = 1
...

[KINS]
KINEMATICS = trivkins
JOINTS = 3

[TRAJ]
COORDINATES = X Z
...

[JOINT_0]
...
[JOINT_2]
...
[AXIS_X]
...
[AXIS_Z]
...
----

With joints_axes incorporation, a simpler configuration can be made with just
the two required joints by specifying trivkins with the 'coordinates='
parameter:

[source,{ini}]
----
[DISPLAY]
DISPLAY = axis
LATHE = 1
...

[KINS]
KINEMATICS = trivkins coordinates=xz
JOINTS = 2

[TRAJ]
COORDINATES = X Z
...

[JOINT_0]
...
[JOINT_1]
...
[AXIS_X]
...
[AXIS_Z]
...
----

// vim: set syntax=asciidoc:
