0% found this document useful (0 votes)
657 views2 pages

Custom Macro Variable Peck Drilling Cycle Macro

Macro Programming

Uploaded by

Relu Chiru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
657 views2 pages

Custom Macro Variable Peck Drilling Cycle Macro

Macro Programming

Uploaded by

Relu Chiru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Custom macro Variable peck drilling cycle macro

1 of 2

http://www.machinetoolhelp.com/Applications/macro/Variable_peck_dr...

LLC.

The Ultimate online resource for CNC machinery

BACK TO MAIN INDEX


Applications & Programming
RS232 communications
Macro programming
Macro variable list
Programming safety code
Coolant mix water problems
Finish, chatter problems
Tapping problems
Common Parameter changes
Drill tap chart
Tool presetter calibration
Create a new NC program
Fixture design considerations
Tool breakage detection
Unit conversion software
End mill training education
Touch or tool probe systems
G10 parameter change
G codes, M codes List (General)
Okuma G & M codes list
Haas G code, M code list
**Forums**
Search
CNC Book Store
Machine shop Store

Fanuc CNC Custom


Macros
Peter Smid
Best Price $40.60
or Buy New $40.60

Privacy Information

Custom Macro for Variable peck drilling cycle

Problem : Write Custom Macro B (for FANUC Oi Mate TB system) program for va
drilling cycle : A hole of dia. 11 mm is to be drilled thru for the depth of 50 mm. Sin
is having L/D ratio of > 4, it is desirable to program for variable (i.e. uniformly redu
type) pecks. Program the operation while referring to the following data.
Data :
i) Length of the first peck = 7.0 mm
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 t
flutes.
v) Dwell at the end of each peck = 2.0 seconds.
Program :
O2222 (VARIABLE PECK DRILLING CYCLE);
N1;
T0000;
G28 U0 W0;
T0101;
G50 S1600;
G97 S1600 M03;
G0 Z20.0 M08;
X0.0;
Z2.0;
#99 = 7.0;
#100 = 7.0;
#101 = -2.0;
#102 = 0.0;
N10;
IF [ #100 GT 51.0 ] GOTO 30;
G0 Z-#101;
G1 Z-#100 F0.05;
G04 X2.0;
#101 = #100 1.5
G0 Z-#101;
#99 = #99 0.5;
#100 = #100 + #99;
#102 = #102 + 1;
IF [ #102 EQ 3 ] GOTO 20;
GOTO 10;
N20;
#102 = 0;
G0 Z2.0;
G04 X5.0;
GOTO 10;
N30;
G0 Z2.0 M09;
G97 M05;
G28 U0 W0;
M30;
%

Explanation of what exactly is happening to the variables after each iteration

Value of each variable at each iteration while execution of the program proceeds :

Iteration no.
1
2

#101- 1st
value
-2.0
5.5

#99

#100

7.0
6.5

7.0
13.5

#101 2nd
value
5.5
12.0

18.12.2007 07:28

Custom macro Variable peck drilling cycle macro

2 of 2

http://www.machinetoolhelp.com/Applications/macro/Variable_peck_dr...

12.0

6.0

19.5

18.0

The drill will be withdrawn to Z2.0, will dwell for 5 seconds and will plunge in rapid to Z-18

4
5
6

18.0
23.5
28.5

5.5
5.0
4.5

25.0
30.0
34.5

23.5
28.5
33.0

The drill will be withdrawn to Z2.0, will dwell for 5 seconds and will plunge in rapid to Z-33

7
8
9

33.0
37.0
40.5

4.0
3.5
3.0

38.5
42.0
45.0

37.0
40.5
43.5

The drill will be withdrawn to Z2.0, will dwell for 5 seconds and will plunge in rapid to Z-43

10
11
12

43.5
45.0
48.0

2.5
2.0
1.5

47.5
49.5
51.0

45.0
48.0
49.5

The drill will be withdrawn to Z2.0, will dwell for 5 seconds

13
13th

49.5

1.0

52.0

50.5

iteration will not be executed, the drill will remain out to Z2.0 and the program will en

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; t
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
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
at Z-(-2.0) = Z+2.0. For subsequent iterations the value will be calcul
from within the loop.

________________
Jasmin C. Shah
CNC Application Engineering Consultant
Date : 4th September, 2006

Fanuc CNC Custom


Macros
Peter Smid
Best Price $40.60
or Buy New $40.60

Privacy Information

Back to top
home | purchasing | options & automation | program & applications | installation | Preventative maintenance | troubleshoot | repair | learning | forums | information
Machinetoolhelp.com all rights Reserved copyright 2003-2007
Privacy policy | Terms of use | Disclaimer

x
CNC

18.12.2007 07:28

You might also like