I wrote this macro on a Citizen swiss machine; it allowed me to do a 'regressive' peck cycle... each peck is slightly less than the previous one. This let me keep the bore clear of chips, keep oil on the drill, and eliminated broken drills.
This will work for a 'long-hand' peck cycle without actually requiring 128K of rapid/feed moves to be programmed. Just set the variables and go!
As I said, this was on a Citizen control, so I had to reverse the Z direction, but it should work on any control that has a Fanuc 'look and feel'.
(Fadal users, I can convert it to use V/R variables if need be.)
Set the following values in your program before moving to the first hole.
Set #534 to 1.00 for a 'standard' peck cycle,
Otherwise, it will reduce the length of each peck by a percentage (in this case, 85%)... this is good for really deep holes, where chips, coolant, etc are a concern.
If you do use a regressive peck, make sure #533 is valid for the drill you are using.
(SET-CONDITIONS)
#531=4.361(DEPTH-TO-DRILL)
#532=0.160(FIRST-PECK-DEPTH)
#533=0.010(MIN-PECK-DEPTH)
#534=0.850(REGRESSION-PERCENT)
#535=0.1(Z-START-POSITION)
#536=0(RESERVED)
#537=0(RESERVED)
Then, move to the X/Y hole location, and give it a "M98 H310" on the next line.
Then, for each hole, do an X/Y move, then another "M98 H310"
Finally, at the end of your program, add this:
N310(REGRESSIVE-PECK-CYCLE)
#536=#535
#537=#532
N320(HERE-WE-GO!)
#536=[#536-#537]
IF[#536LE#531]GOTO330(DONE)
G1Z#536F.0016(DRILL-NEXT-DEPTH)
G0Z#535(RETRACT)
G0Z[#536+.005](CLEAR)
#537=[#537*#534](REDUCE-PECK)
IF[#537GE#533]GOTO325
#537=#533(NOT-TOO-SMALL)
N325GOTO320
N330G1Z#531
G0Z#535
M99
Gives you a LOT of control, with no canned cycles, and very little extra code! |