Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Equipment >> CNC Machine

Custom Fanuc Macro for Precise Peck Drilling on Lathes

Fanuc Peck Drilling Macro

Move the tool beforehand along the X- and Z-axes to the position where a drilling cycle starts. Specify Z or W for the depth of a hole, K for the depth of a cut, and F for the cutting feedrate to drill the hole.

Following Custom Macro works on Fanuc cnc controls like FANUC Series 30i/31i/32i-MODEL A

Programming

G65 P9100 Z K F

OR

G65 P9100 W K F
ParameterDescription
ZHole depth (absolute programming)
WHole depth (incremental programming)
KCutting amount per cycle
FCutting feedrate

Custom Fanuc Macro for Precise Peck Drilling on Lathes

Custom Macro

Main Program

G50 X100.0 Z200.0 ;
G00 X0 Z102.0 S1000 M03 ;
G65 P9100 Z50.0 K20.0 F0.3 ;
G00 X100.0 Z200.0 M05 ;
M30

Macro program

O9100;
#1=0; (Clear the data for the depth of the current hole.)
#2=0; (Clear the data for the depth of the preceding hole.)
IF [#23 NE #0] GOTO 1; (If incremental programming, specifies the jump to N1.)
IF [#26 EQ #0] GOTO 8; (If neither Z nor W is specified, an error occurs.)
#23=#5002-#26;         (Calculates the depth of a hole.)
N1 #1=#1+#6;           (Calculates the depth of the current hole.)
IF [#1 LE #23] GOTO 2; (Determines whether the hole to be cut is too deep?)
#1=#23;                (Clamps at the depth of the current hole.)
N2 G00 W-#2;           (Moves the tool to the depth of the preceding hole at the cutting feedrate.)
G01 W- [#1-#2] F#9;    (Drills the hole.)
G00 W#1;               (Moves the tool to the drilling start point.)
IF [#1 GE #23] GOTO 9; (Checks whether drilling is completed.)
#2=#1;                 (Stores the depth of the current hole.)
N9 M99
N8 #3000=1;            (NOT Z OR U COMMAND Issues an alarm.)

CNC Machine

  1. New Alpha X Series Lathes Feature Custom Controls for Superior Performance
  2. Efficient Peck Drilling on a Fanuc CNC Lathe Using G74 Cycle
  3. Master G83 Deep Hole Peck Drilling on Haas CNC for Precision & Efficiency
  4. Fanuc G83 Peck Drilling Cycle – Deep Hole Drilling Guide
  5. Siemens Sinumerik CYCLE83: Advanced Deep‑Hole Peck Drilling for CNC Machining
  6. Fanuc G73 High-Speed Peck Drilling: Efficient Chip Break Cycle for CNC Milling
  7. Master Fanuc G71 Turning & G74 Peck Drilling on CNC Lathes: A Practical Programming Exercise
  8. Master the Fanuc G83 Peck Drilling Cycle for Deep‑Hole Efficiency
  9. Fanuc BHC Macro – Custom Bolt Hole Circle Tooling for CNC
  10. Fanuc G87 Side Drilling Canned Cycle: Efficient CNC Lathe Operation