What's new
What's new

Deep hole peck drill macro help

sash1ca35

Plastic
Joined
Dec 12, 2013
Location
ontario canada
Looking to create a custom macro for deep hole peck drilling on a Fanuc 16i control. Drilled holes using G81 6" deep. Now I have to peck drill using G83 down to rest of the way another 8" deep. If I use R-6.0 and peck from there the retract isn't enough to pull the chips out. I need to retract to my R.05 but of course that's where it starts to peck drill from. Don't want to drill air, so where do I start? If anyone has one created please help me out. Thanks everyone
 
Looking to create a custom macro for deep hole peck drilling on a Fanuc 16i control. Drilled holes using G81 6" deep. Now I have to peck drill using G83 down to rest of the way another 8" deep. If I use R-6.0 and peck from there the retract isn't enough to pull the chips out. I need to retract to my R.05 but of course that's where it starts to peck drill from. Don't want to drill air, so where do I start? If anyone has one created please help me out. Thanks everyone


See Post #223 in Macro Programming Fundamentals. Ask any questions you may have.

Regards,

Bill
 
Thanks I'll give it a go. If I don't want to reduce peck or spindle speed/feed rate variable will be 0 ?

In the Macro Call Block Arguments, specifying:

1. W0.0 = No change in Peck Distance
2. H0.0 = No change in Spindle Speed
3. E and F the same value = No Change in Feed Rate

Regards,

Bill
 
Do I type in all error traps listed in post #223?
That's entirely up to you. Given that the code is listed in that Post, its not like you have to type it all out again; just Cut and Paste it.

Error trapping, and corresponding error messages, in all forms of software, are there to avoid undesirable results and to alert the user as to the error.

Most of the error traps in the example code is to ensure that required data is not omitted in the Call Block Arguments.

Regards,

Bill
 
Thanks for you help really appreciate it. Not familiar with macro programming but I'm fascinated by it now. Found Fanuc operator manual and parameter manual. Seems confusing. Are there any books available that might be less confusing to read?
 
Now if I choose to peck drill in W axis instead of Z axis. Would the following changes be; #23=Percentage reduction factor of peck value - C
#26=Final W coordinate- W
(PRE-MAIN LOOP FUNCTIONS)
#28=#5004(save initial W level)
(MAIN LOOP STARTS HERE)
G00W[#30+#2](W clearance move)
G01W#18F#9(W peck move)
N30
G00W#28(retract to initial level)
Is there anything that I'm missing? And if I could ask what a FEED MODE is? Not familiar with that. In the example G183 I95.
 
Now if I choose to peck drill in W axis instead of Z axis.

Is there anything that I'm missing? And if I could ask what a FEED MODE is? Not familiar with that. In the example G183 I95.

I assume this is "W" axis as in machines equipped with a Quill Axis, as opposed to the Incremental equivalent to the Z axis of a lathe. That being so, you would have to replace all references to:
1. the current "Z" with "W", that is currently "PERCENTAGE REDUCTION FACTOR OF PECK VALUE",
2. the current #26, Local Variable corresponding to Z Argument, with #23, Local Variable corresponding to W Argument
3. the current #23 with another Local Variable that's not being used; "C" would be OK. In this case, any reference to the current #23 in the Macro Program would have to be changed to #3.

The Feed Mode being referred to is Feed Per Minute and Feed Per Rev, G94 and G95 respectively. I included this as a Required Argument in the Calling Block to ensure the User was clear as to the type of feed method wanted. You could instead do the following, and it would be more intuitive.

G94 (or G95) G183 Z-50.0 R1.0 Q5.0 K-35.0 U0.5 V2.5 A1.0 B0.5 W0.6 E0.15 F0.25 H20. S-40. T4.

1. Delete the "I" argument in the Calling Block
2. Delete all reference to #4 in the Error Traps
3. Delete N200#3000=5(INVALID FEED MODE) from the Error Message area
4. At the top of the (PRE-MAIN LOOP FUNCTIONS) add:
#4 = #4005

If G94/G95 is omitted from just before the Macro Call Statement, #4 will take on the value of whatever Feed Method was Modal in the program prior to the Macro Program being called.


Regards,

Bill
 
Last edited:
"U" isn't described in the comments. Its in the calling block. What would "U" represent?

U is the Arguments address for Local Variable #21. #21 is not used in the Macro Program; accordingly, it can be omitted from the Call Block.
I wrote this Deep Drill Macro in a short time to answer a question from a Forum Member. I can only think that one iteration of the Macro when I was developing it, used the "U" Argument and was taken out in the Macro but I didn't omit it in the Call Block.

Regards,

Bill
 
the alarm that I'm getting is 114 FORMAT ERROR IN MACRO. Tried single block seems that the expressions containing "OR" "AND" are not being accepted. (ERROR TRAPS)
IF[[#2EQ#0]OR[#4EQ#0]OR[#9EQ#0]OR[#17EQ#0]OR[#18EQ#0]OR[#23EQ#0]]GOTO100(MISSING REQUIRED DATA ERROR)
IF[[#6NE#0]AND[#8EQ#0]]GOTO110(MISSING FEED DATA ERROR)
IF[[#19NE#0]AND[#11EQ#0]]GOTO120(MISSING SPEED DATA ERROR)
IF[[#3NE#0]AND[#22EQ#0]]GOTO130(MISSING PECK DATA ERROR)
IF[[#4LT94]OR[#4GT95]]GOTO200(INVALID FEED MODE)
Is there another way to write these? Can't find anything in the Fanuc 16i manual
 
the alarm that I'm getting is 114 FORMAT ERROR IN MACRO. Tried single block seems that the expressions containing "OR" "AND" are not being accepted. (ERROR TRAPS)
IF[[#2EQ#0]OR[#4EQ#0]OR[#9EQ#0]OR[#17EQ#0]OR[#18EQ#0]OR[#23EQ#0]]GOTO100(MISSING REQUIRED DATA ERROR)
IF[[#6NE#0]AND[#8EQ#0]]GOTO110(MISSING FEED DATA ERROR)
IF[[#19NE#0]AND[#11EQ#0]]GOTO120(MISSING SPEED DATA ERROR)
IF[[#3NE#0]AND[#22EQ#0]]GOTO130(MISSING PECK DATA ERROR)
IF[[#4LT94]OR[#4GT95]]GOTO200(INVALID FEED MODE)
Is there another way to write these? Can't find anything in the Fanuc 16i manual

Take a look at parameter bit 6006.0 (MLG). If set to "0", this will be your problem. Setting to "1" allows Logical Operators (AND, OR, XOR) to be used in Conditional Decision Statements in Custom Macros.

Regards,

Bill
 
Don't know how to find post #223, but I am pretty sure it is the post where Bill helped me. I...in turn...was trying to help someone else which required me to add a few more options to a deep drill macro I was already running. I was able to get my deep drilling program to work except for one function. Bill not only helped me get it running, but showed me a simpler way of writing the macro program. Currently it is running in 14 lathes (I believe). It will run in IPR or IPM since I also use it for live tooling which has to be in IPM on a lathe...well, any lathe we have. No way am I familiar with all lathes. :)
 








 
Back
Top