linuxcnc Post-Processor

Overview

The linuxcnc Post-Processor writes G-code for the LinuxCNC control. The linuxcnc Post is a machine-based Post. This page gives only the features that are specific to the linuxcnc Post. Postprocessor Customization gives the properties and the output rules that all machine-based Posts have.

The linuxcnc Post writes a tilted Work Plane with the lines G68.2, G53.1 and G69.

The linuxcnc Post writes a tapping cycle that is marked rigid as G33.1; the section Drill cycles and tapping of Post Process gives the details.

Make sure that the LinuxCNC control accepts the tilted Work Plane lines before you run the program. The syntax of these lines follows draft LinuxCNC work and can change.

Defaults of the common properties

The linuxcnc Post changes the defaults of these common properties.

Property Default

file_extension

ngc

supports_tool_radius_compensation

true

preamble

G17 G54 G40 G49 G80 G90

postamble

Three lines: M05, G17 G54 G90 G80 G40, M2

safetyblock

G40 G49 G80

The linuxcnc Post adds the blend command to the end of the preamble. With the default values, the last preamble line is G17 G54 G40 G49 G80 G90 G64. The Path Blending Mode and Blend Tolerance properties select the blend command. Postprocessor Customization gives the values of these two properties.

Rotation Strategy

The linuxcnc Post writes a tilted Work Plane only with the TWP Rotation Strategy (value twp). The linuxcnc Post sets the class attribute ROTATION_STRATEGIES to ("twp",). The LinuxCNC control does not have the function that the DWO Rotation Strategy uses. Thus the linuxcnc Post does not write output for the DWO Rotation Strategy (value dwo).

The Rotation Strategy field of the Machine Editor gives the strategy of the Machine. The entry for the TWP Rotation Strategy is Tilted work plane (TWP). The entry for the DWO Rotation Strategy is Dynamic work offset (DWO).

The Tool Axis of an Operation is tilted when the local Z axis of its Placement is different from the world Z axis.

The export stops with an error when these two conditions are true:

  • An Operation in the export has a tilted Tool Axis.

  • The Rotation Strategy of the Machine is Dynamic work offset (DWO).

The error message has this text:

<Operation> is on a tilted work plane, and this post-processor cannot emit the DWO strategy machine '<Machine>' declares.

<Operation> is the label of the Operation. <Machine> is the name of the Machine.

The export of a Machine set to DWO does not stop with this error when no Operation in the export has a tilted Tool Axis.

Tilted Work Plane output

The linuxcnc Post uses the G68.2 Plane Command. The Post sets the class attribute PLANE_COMMAND to PlaneCommand.G68_2. The Plane Command has three lines.

Line Default text Function

Declare line

G68.2 X Y Z I J K

Gives the origin and the orientation of the tilted Work Plane.

Align line

G53.1

Points the Tool Bit along the normal of the declared plane.

Cancel line

G69

Cancels the declared plane.

Declare line

The Post writes a declare line only for an Operation that has a tilted Tool Axis. The X, Y and Z words give the origin of the Work Plane. The I, J and K words give intrinsic Z-X'-Z'' Euler angles.

After the declare line, the Post writes the moves of the Operation in the coordinates of the Work Plane.

A Work Plane parallel to the table gets no declare line. The Post writes the Toolpath of such an Operation in world coordinates.

Align line

The Post writes the align line after the declare line when Tilted work plane: control positions the rotaries is checked, which is the default. The common Tilted work plane properties control the align line; Machine gives these properties.

The Tilted work plane: align property (twp_align) gives the text of the align line.

  • An empty value gives the line G53.1.

  • A value that is not empty replaces the complete align line. The Post writes the text as it is given.

The value G53.1 P1 Q1 gives the line G53.1 P1 Q1, and the output has no line with only G53.1. G53.6 is not a default of the Post. To get a G53.6 align line, write G53.6 in twp_align.

The Post does not examine the text of twp_align.

Cancel line

When a plane is declared, the Post writes the cancel line in these conditions:

  • Before each tool change.

  • Before each Fixture (a G54 to G59.9 selection).

  • Before a change of pose: before the declare line of a different tilted Work Plane, and before an Operation on a Work Plane parallel to the table.

  • At the end of each output section.

LinuxCNC does not accept a change of coordinate system while a plane is active.

A Job with the Fixtures G54 and G55 and one tilted Operation gives two declare lines and two G69 lines. One G69 line is before the G55 line. One declare line is after the G55 line.

Sequence of the output

This sequence applies when Tilted work plane: control positions the rotaries (twp_control_positions_rotaries) is checked. For one tilted Operation with Pre-Rotary Move (pre_rotary_move) set, the output has this sequence:

  1. The preamble, with the blend command at the end of its last line.

  2. The Pre-Rotary Move block.

  3. The declare line.

  4. The align line.

  5. The moves of the Operation, in the coordinates of the Work Plane.

  6. The cancel line.

This output has no G0 line with a rotary axis word. The control positions the rotary axes at the align line.

Kinematics select line

The linuxcnc Post adds the Tilted work plane: kinematics select property to the common properties.

Property Label Scope Type Default

twp_kinematics_select

Tilted work plane: kinematics select

Machine

string

empty

The Post writes the text of twp_kinematics_select as one new line after the preamble when these two conditions are true:

  • The value has characters other than space characters.

  • One Operation of the Job has a tilted Tool Axis.

The Post examines all Operations of the Job, not only the Operations in the export. For a Dressup, the Post examines the Placement of the Operation that the Dressup changes.

The kinematics select line comes directly after the preamble line that has the blend command. The kinematics select line is before the first declare line.

With the value G12.1 P1 and a tilted Operation, the line after G17 G54 G40 G49 G80 G90 G64 is G12.1 P1. A Job with no tilted Operation has no G12.1 P1 line.

The Post does not examine the text of twp_kinematics_select.