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)

Hide the file drop box

Example:

2 Blank and tool

Show the blank and tools
Blank

The same as the material in card 3 (Feeds and speeds): pick it here or there, and the recommended speeds and feeds follow it.

Length is from the chuck to the end face of the blank (X0); it is shown as a dimension on the preview. With a drawn blank every tool path starts from its shape: the turning only cuts where it has metal, and the boring starts from its hole (no drill needed).

Tool tip (T1)

Loading the bar (T1 as a bar stop)

After T1 is fitted the program stops at safe; start takes T1 to the bar stop (X first, then in along Y), where it stops again. Push the bar out against the tool, tighten the chuck and press start: the tool backs straight off the bar end along X to safe X, then out to safe Y, and stops there again so you can run the spindle up; start then begins the cutting. The bar end is then in front of X0 by about the bar stop X (where T1's nose meets it), and the facing passes take that off in equal steps, each from outside the bar in to the centre, the last to X0. These passes come first in the passes table (their feeds and stops can be changed there).

Additional tools
Show the additional tools
#ToolOffset X from T1 (mm, + toward the face)Offset Y from T1 (mm, + toward the back)Finishing

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. The offsets and nose radii are kept in the tool offset library below. With more than one tool, the picture draws them all on top of each other at their offsets from T1, as a check. 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.

Finishing: tick the tools that finish. The others rough, leaving the finishing allowance. With more than one ticked, the first (T1, T2… order) makes the finishing pass and the next finishes whatever it couldn't reach, in each section (or face to chuck, see Finish each section before the next in card 4). T1 unticked and no other tool ticked: the other tools finish anyway (T1 only if there is no other turning tool, with a warning). Tools not ticked only rough, leaving the allowance: they never finish. A new tool starts ticked.

Tool offset library
Show the library
ToolIn useNose R (mm)Offset X from T1 (mm, + toward the face)Offset Y from T1 (mm, + toward the back)

Every tool's offset and nose radius are stored once (an empty nose radius is the one drawn; the round inserts can be given another insert radius too). Change T1 to the tool you've zeroed the controller on (test piece) and all the other offsets, including the drill and the rear tool, are re-worked from it. Leave a box empty if that tool hasn't been measured. If you have more than one holder of the same type, add another and it gets its own offset (#2, #3…). ✕ deletes a tool you don't use (not while it is T1 or in the additional tools); add it again to bring it back.

Drill
UseDrill Ø (mm)Offset X (mm)Offset Y (mm)Feed (mm/min)Peck (mm)Depth (mm)

The drill is not driven: the work turns, so it only ever drills on the centre line. Set up each drill you have once, with its own offsets: where its tip sits from T1's zero point when it is in the drill chuck in the tool post (X usually minus, Y about +14). Tick Use on the drills for this hole: with more than one, the smaller ones go first (pilots), each to the same depth, and each is a tool change (M0 at safe to fit it). Feed and peck left empty are the ones recommended for the material in card 3, at the drill's own spindle speed, which the M0 that fits it gives; pecks are halved once the hole is deeper than 3 × Ø. Each drill goes to the hole depth unless it has a depth of its own: left empty, a drill bigger than a step in the drawing's bore stops where its point meets the step (the greyed figure), and you can type any depth. Coming right out after each peck lets the brush get to the drill: it comes out to the distance given and waits there for the pause (G4), so the flutes can be brushed clean and loaded with oil before it goes back in. Each drill goes to safe with its own tip at Safe X and Y, so it is always in front of the face. The program always stops at safe with an M0 to fit each drill, and again to refit the turning tool, as at every tool change.

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. Extend past centre line takes a part-off that far beyond the centre (e.g. 0.5) so it doesn't leave a pip; grooves are not affected. Cuts are made in order from the face, pecking in and backing off by the back-off distance between pecks.

3 Feeds and speeds

Show the feeds and speeds

Starting points for carbide inserts (HSS for the drill) from the usual published tables, at the gentle end for a manual lathe and slowed for cutting oil brushed on rather than flood coolant (acetal and brass cut dry). They follow the material, the slider, the blank and part diameters, how far the work sticks out of the chuck (blank length), and the tools in card 2: the smallest nose radius sets the feeds, the smallest insert the depth of cut. The spindle speed is the roughing speed on the full blank, kept between your lowest and highest speeds; type the speed you'll actually set and the feeds (mm/min) are worked out from it. The speed isn't sent to the machine: it is written as a comment at the top of the G-code when ticked. Ticked, the depths and feeds go into card 4 and follow any change here; changing one of them in card 4 unticks it.

4 Cutting

Show the cutting settings

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. With Finish the face end first ticked, the app also splits at the top of every shoulder (where the diameter gets bigger toward the chuck), so each diameter is roughed and finished before the next one is started; those splits have no M0. Untick Finish each section before the next to rough the sections only and then finish the whole length in one cut from the face end to the chuck.

Spindle speed is set on the machine (card 3 recommends one). Feeds can be changed for each pass in the passes table.

5 Program setup

Show the program setup
Safe position (absolute)

6 Preview

Hide the preview

Import a profile to see it here.

    Blank and tool paths, chuck on the left, tool at the front (below the centre line). Only the tool in the tool post is drawn (one at a time, the drill chuck too); the rear tool, fixed on the saddle, is drawn faint when not cutting. Scroll to zoom on the mouse · drag to pan · double-click to fit.

    7 Passes

    Show the 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.

    8 G-code

    Show the 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.