Custom Macro for Variable peck drilling cycle
Problem : Write Custom Macro “B” (for FANUC Oi Mate TB system) program for variable peck drilling cycle : A hole of dia. 11 mm is to be drilled thru’ for the depth of 50 mm. Since the hole is having L/D ratio of > 4, it is desirable to program for variable (i.e. uniformly reducing depth type) pecks. Program the operation while referring to the following data.
ii) Decrement by which the subsequent pecks should uniformly reduce = 0.5 mm
iii) Retraction Amount after each peck = 1.5 mm.
iv) The drill should withdraw fully after every three pecks and it should dwell for 5.0
seconds for coolant blow to clean up the chips clogged on the cutting edges and the
v) Dwell at the end of each peck = 2.0 seconds.
O2222 (VARIABLE PECK DRILLING CYCLE);
G28 U0 W0;
G97 S1600 M03;
G0 Z20.0 M08;
#99 = 7.0;
#100 = 7.0;
#101 = -2.0;
#102 = 0.0;
IF [ #100 GT 51.0 ] GOTO 30;
G1 Z-#100 F0.05;
#101 = #100 1.5
#99 = #99 0.5;
#100 = #100 + #99;
#102 = #102 + 1;
IF [ #102 EQ 3 ] GOTO 20;
#102 = 0;
G0 Z2.0 M09;
G28 U0 W0;
Explanation of what exactly is happening to the variables after each iteration :
Definition of Each variable :
#101 1st value = Positioning of the drill tip before the peck has started.
#101 2nd value = Positioning of the drill tip after the peck has completed; this
value is followed before the start of the next peck as well.
#99 = Decrementing value which is to be added to the previous peck depth.
#100 = Depth of each peck.
#102 = Counter set to count 3 pecks after which the drill will get withdrawn to
Z2.0 and dwell for 5 seconds.
Note : The 1st value of #101 for the first iteration is specified as = -2.0
because only during first iteration, the position of the drill tip should be
at Z-(-2.0) = Z+2.0. For subsequent iterations the value will be calculated
from within the loop.
Jasmin C. Shah
CNC Application Engineering Consultant
Date : 4th September, 2006