FIFTY LINETurn G-code
Online generatorOnline calculatorsReference

Machining cycle

Drilling on a CNC lathe

Axial drilling with support for peck feeding

A clickable cycle form: tap any field to see what it does.

The "Drilling" cycle form (with chip break) with parameters and a live 2D path simulator

 

Форма цикла «Сверление»

The cycle form: peck drilling shown — the drilling step and chip-break retract, with a live 2D path simulator on the right.

Drill point depth calculator →How much to add to the depth for a 118°/135°/140° drill point — blind and through holes. Free, in your browser.

The drilling cycle moves the tool along the workpiece axis to the given depth, breaking the pass into steps for chip evacuation on deep holes when needed.

Who needs this cycle

Needed for center and axial holes — from spot holes to through holes, including deep drilling with chip evacuation.

Key form parameters

  • •Drilling depth
  • •Drill diameter
  • •Feed rate
  • •Spindle speed
  • •Peck feeding (for deep drilling)

G-code example

Real output of the Drilling cycle: drilling on the part axis (Ø22 mm blank) to Z−20 with chip removal — 5 mm steps with a 3 mm retract between them. Feed 80 mm/min, 300 rpm. The hole diameter is set by the drill itself, so it does not appear in the code. The code lines were not edited by hand.

The cutting feed starts at Z−2 (the “Start Z” field): the drill rapids to that point, so it must be at or in front of the face — for example when the face was faced 2 mm back before drilling, as in the example on the Facing page. Radius mode G8; drilling runs exactly on the axis — X0.

drilling.ngc · 40 lines — Show the full program
%
(Turn G-code)
(Drilling on centre X0)
(Stock Ø: 22.0000)
(Start Z: -2.0000)
(Depth: 20.0000)
(Bottom Z: -20.0000)
(Mode: with chip removal)

G21 G18 G90 G8 G40 G80 G94
G54

G97 S300 M3
G0 Z3.0000
G0 X13.0000
G0 X0.0000

(Drilling with chip removal: step 5.0000, retract 3.0000 between steps)
(Step 1 of 4: to Z-7.0000)
G0 Z-2.0000
G1 Z-7.0000 F80.0000
G0 Z-4.0000
(Step 2 of 4: to Z-12.0000)
G0 Z-6.0000
G1 Z-12.0000 F80.0000
G0 Z-9.0000
(Step 3 of 4: to Z-17.0000)
G0 Z-11.0000
G1 Z-17.0000 F80.0000
G0 Z-14.0000
(Step 4 of 4: to Z-20.0000)
G0 Z-16.0000
G1 Z-20.0000 F80.0000
G0 Z3.0000

G0 Z3.0000
G0 X13.0000
M5
M30
%

Line-by-line breakdown

G21 G18 G90 G8 G40 G80 G94
Start: millimetres, XZ plane, absolute coordinates, radius mode for X (G8), cancel compensation and canned cycles, feed in mm/min.
G97 S300 M3 / G0 Z3.0000 / G0 X13.0000 / G0 X0.0000
300 rpm, approach to 3 mm in front of the face outside the blank (X13 — Ø26), then to the part axis X0.
G0 Z-2.0000 → G1 Z-7.0000 F80.0000 → G0 Z-4.0000
Step 1: rapid to Z−2, drill at 80 mm/min to Z−7 and back off 3 mm (Z−4) to break and clear the chip.
G0 Z-6.0000 → G1 Z-12.0000 F80.0000 → G0 Z-9.0000
Step 2: rapid back almost to the bottom — 1 mm short of Z−7 — then drill to Z−12 and back off 3 mm again. Step 3 goes to Z−17 the same way.
G0 Z-16.0000 → G1 Z-20.0000 F80.0000 → G0 Z3.0000
The last step is shorter — 3 mm to the Z−20 bottom — after which the drill fully leaves the hole to Z3.
G0 X13.0000 / M5 / M30
Retract in X, spindle stop and program end.

Comments in this program were translated from Russian; the G-code itself is unchanged.

What the codes in this program mean (G0, G1, G8, G97, M3, M5) — G- and M-code reference for lathes.

Frequently asked questions

What is peck feeding and when do I need it?

It breaks drilling into several short passes with a retract to clear chips — used for deep drilling where chips don't clear on their own.

Does it work for shallow holes too?

Yes, the cycle works both for simple through/spot holes without any stepping, and for deep drilling with staged chip evacuation.

What parameters do I need to set?

Drilling depth, drill diameter, feed rate, spindle speed and, if needed, the peck-feeding parameters.

Can I see the tool's path before generating the G-code?

Yes, the cycle form shows a live 2D toolpath simulator, including the chip-break steps for peck feeding.