Lathe G-code

DXF / DWG half profile → turning program · tool at the front · X = length (X0 = face, − toward chuck) · Y = radius (Y0 = centre, − = bigger Ø) · mm, absolute (G90) · How to use

1 Finished part (half profile)

Example:

2 Blank and tool

Blank
Tool tip (T1)

Additional tools
#ToolNose R (mm)Offset X from T1 (mm, + toward the face)Offset Y from T1 (mm, + toward the back)

T1 is the tool above: the controller is zeroed on it. For each additional tool give where its zero point sits from T1's zero point (zeroed the same way), X + toward the face, Y + toward the back. Pick the tool for each pass in the passes table; each change is made at the safe position with an M0 to fit the tool.

Rear parting-off / grooving tool
#Finished size: X0 to the cut (mm)Finish Ø (mm, 0 = part off)

The parting tool is fixed to the saddle behind the work. Its datum is the corner of the cutting edge on the face nearest the chuck; the offset is from the front tool's zero point to that corner. Each cut is one plunge of the blade: the finished size is from X0 to the blade's other face (so its datum face is at the finished size + width); leave it empty for the end of the part. Ø0 parts off, a bigger Ø makes a groove. Cuts are made in order from the face, pecking in and backing off by the back-off distance between pecks.

3 Cutting

Sections keep the bar stiff: the part is roughed and finished from X0 to the first distance, then on to the next, with the rest of the bar left at full size until its turn. Each section ends with Safe + M0 (untick it in the passes table if not wanted). The planes show as dashed lines in the preview.

Spindle speed is set on the machine. Feeds can be changed for each pass in the table below.

4 Program setup

Safe position (absolute)

5 Preview

Import a profile to see it here.

    Blank and tool paths, chuck on the left, tool at the front (below the centre line). All tools are drawn in their places on the saddle: the one cutting solid, the others faint. Scroll to zoom · drag to pan · double-click to fit.

    6 Passes

    Tick Stop to return to the safe position and pause with M0 after that pass, so the swarf can be cleared. Press cycle start to carry on.

    No passes yet.

    7 G-code

    Controller not yet confirmed: output uses only G0/G1/G17/G21/G90/G94/M0/M30. Y is the radius (no diameter mode); nose radius is allowed for, so no G41/G42. Always dry-run clear of the work first.