# Fanuc G83 Peck Drilling Cycle Code Generator for CNC Mills

> Source: https://netray.co/tools/fanuc-g83-peck-drilling-cycle-code-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Generate a G83 deep hole peck drilling block with tool call, coolant, R plane and cancel, ready to paste into a program.

## Category

manufacturing

## Industry

Machining

## Audience

- CNC programmer
- CNC machinist
- Manufacturing engineer

## Tool

**Kind:** template

**Output:** code

**Language:** text

**Fields:**

#### Program number

**Key:** prog

**Type:** text

**Default:** 2083

#### Operation description

**Key:** desc

**Type:** text

**Default:** DRILL 8.5 MM X 40 DEEP

#### Work offset

**Key:** wcs

**Type:** select

**Options:**

- G54
- G55
- G56
- G57

**Default:** G54

#### Tool number

**Key:** tool

**Type:** text

**Default:** 5

#### Spindle speed (rpm)

**Key:** rpm

**Type:** text

**Default:** 3000

#### Hole X

**Key:** x

**Type:** text

**Default:** 25.0

#### Hole Y

**Key:** y

**Type:** text

**Default:** 40.0

#### Final depth Z (negative)

**Key:** z

**Type:** text

**Default:** -42.5

#### R plane (retract)

**Key:** r

**Type:** text

**Default:** 2.0

#### Peck depth Q (mm)

**Key:** q

**Type:** text

**Default:** 4.0

#### Feed (mm/min)

**Key:** f

**Type:** text

**Default:** 300

#### Coolant code

**Key:** coolant

**Type:** select

**Options:**

- M08
- M07
- M88

**Default:** M08

#### Return mode

**Key:** retract

**Type:** select

**Options:**

- G98
- G99

**Default:** G98

**Blocks:**

#### Fanuc G83 peck drilling program

**Body:** O{{prog}} ({{desc}})
G21 G17 G40 G49 G80 G90
T{{tool}} M06
{{wcs}} G00 X{{x}} Y{{y}}
G43 H{{tool}} Z50.0
S{{rpm}} M03
{{coolant}}
{{retract}} G83 X{{x}} Y{{y}} Z{{z}} R{{r}} Q{{q}} F{{f}}
(ADD MORE HOLES HERE AS X Y ONLY)
G80
M09
G91 G28 Z0
G90
M05
M30

#### Address reference

**Body:** Z{{z}} is the final hole depth, R{{r}} is the rapid plane above the part, Q{{q}} is the depth of each peck, and F{{f}} is the feed. {{retract}} chooses whether the tool returns to the initial plane (G98) or the R plane (G99) between holes. G80 cancels the canned cycle.

**Notes:** Check the code against your control manual: some controls need Q as a positive value without a decimal, and Haas uses G83 with an optional I, J, K set for variable peck. For through-spindle coolant, use the M code defined by your machine builder. Include the point length in the depth if the hole must be full diameter to the bottom.

## Content

**Intro:** G83 is the standard peck drilling cycle for deep holes on Fanuc style mills and machining centers. This generator builds the full block, with tool call, coolant and cancel code, from your hole data.

**Sections:**

#### How to use the generator

**Body:** Enter the hole position, the final depth (a negative Z in the work coordinate system), the R plane just above the part and the peck depth Q. Set the spindle speed and feed from your tooling data. If you have several holes, copy the generated G83 line and keep only X and Y on the following lines, because the cycle stays active until G80. Paste the block into your editor and review before running.

**Bullets:**

- R plane is usually 2 to 5 mm above the part surface.
- Q is the depth of each peck, not the total depth.
- G80 must cancel the cycle before any other movement.

#### How G83 works

**Body:** G83 drills to the first peck depth, then retracts fully to the R plane to clear chips and let coolant reach the bottom of the hole, then rapids back to just above the last depth and drills the next peck. This full retract is the difference from G73, which only pulls back a small distance to break the chip. G83 is slower but safer for deep holes in sticky material such as stainless or aluminium, where chips pack the flutes.

#### Worked example

**Body:** For an 8.5 mm drill and a 40 mm deep hole, the drill point adds roughly 0.3 times the diameter, or about 2.5 mm, so a Z of minus 42.5 gives full diameter to 40 mm. At 3000 rpm and a feed of 0.1 mm per rev, the feed is 300 mm per minute. A peck of 4 mm, about half the drill diameter, is a common starting point for a hole depth of 4 to 5 times the diameter.

#### Common mistakes

**Body:** Frequent errors are forgetting G80 so the next move drills a hole, leaving G98 on and plunging into a clamp, setting the R plane below the part surface and rubbing the feed, and ignoring the point length. Always dry run on a spare vice, and check that tool length offsets are active with G43 before the first G83. Log the peck and feed in the setup sheet so the next operator can tune them.

**Cta:** If your drilling parameters are scattered across setup sheets, Netray can help you store and version NC programs and tooling data alongside the routing in your ERP.

**Faq:**

#### What is the difference between G83 and G73?

**Answer:** G83 retracts fully to the R plane between pecks to evacuate chips. G73 only retracts a small amount to break the chip. Use G83 for deep holes and sticky chips, and G73 for shallower holes where speed matters more.

#### What does Q mean in G83?

**Answer:** Q is the depth of each peck, the distance the drill advances before it retracts. It is a positive number in the work coordinate system units and does not include the sign of the final Z.

#### What is the difference between G98 and G99?

**Answer:** G98 returns the tool to the initial plane after each hole, which clears clamps and fixtures. G99 returns only to the R plane, which saves time when moving between holes on a flat surface.

#### How deep should I peck?

**Answer:** A common starting point is 0.5 to 1 times the drill diameter per peck for holes deeper than three diameters, going shallower in stainless or when chips pack. Through-coolant drills often run much deeper pecks or none.

## Search terms

g83 peck drilling cycle, g83 example fanuc, g83 code format, peck drilling g code, g83 vs g73, cnc drilling cycle generator, g83 q value, deep hole drilling program

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
