523,805 active members*
3,975 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > how to rapid in a hole then peck drill coming out of the hole to clear
Results 1 to 19 of 19
  1. #1
    Registered
    Join Date
    Mar 2011
    Posts
    0

    how to rapid in a hole then peck drill coming out of the hole to clear

    My question... How do you program a peck drill cycle that starts at the bottom of a hole?

    I have an Okuma control where I can do this in one line:
    G73 X0 Z-2(feed distance) K-.95(rapid in distance) L.05(retract to start position after this amount) D.05(peck amount)

    This line will rapid to z-.95, then drill z-.05 more, retract to start position, rapid back within parameter setting of previous depth, then repeat this sequence until Z distance is met.

    What is the best way to do this on a fanuc lathe?
    Thanks

  2. #2
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    To the best of my knowledge you can not do this on a fanuc lathe with a standard canned cycle. You will have to either long hand the code or write a macro.

    Stevo

  3. #3
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    The closest is Back Boring Cycle (G87) for a single-point tool, but it has continuous feed and available on milling machines only.

  4. #4
    Registered
    Join Date
    Aug 2009
    Posts
    677
    Program each peck as a separate drilling cycle?

    DP

  5. #5
    Registered
    Join Date
    Mar 2011
    Posts
    0
    christinandavid Program each peck as a separate drilling cycle?


    I have been using this method, and was hoping that someone had a better method...

    Does anyone know how to do something like this in a macro?

  6. #6
    Registered
    Join Date
    Aug 2009
    Posts
    677
    Lets say you start at Z-100 and want to drill to Z-200 in 5mm pecks...

    #1=100.
    WHILE[#1LT200.]DO1
    G0Z[#1+1.]
    G1Z[#1-5.]F100
    G0Z0.
    #1=#1+5.
    END1

    Of course, you could go further and make it as easy to alter as a pecking cycle if you feel the need. Let us know if you need that flexibility.

    DP

  7. #7
    Registered
    Join Date
    Mar 2011
    Posts
    0
    This sounds like it might work. Can you please explain each line for me?
    Why do you start with a positive 100 value for #1?

    Could you explain how to make it as easy to alter as a peck cycle?

    Thank you for your response!

  8. #8
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    Quote Originally Posted by bilbo2 View Post
    My question... How do you program a peck drill cycle that starts at the bottom of a hole?

    I have an Okuma control where I can do this in one line:
    G73 X0 Z-2(feed distance) K-.95(rapid in distance) L.05(retract to start position after this amount) D.05(peck amount)

    This line will rapid to z-.95, then drill z-.05 more, retract to start position, rapid back within parameter setting of previous depth, then repeat this sequence until Z distance is met.

    What is the best way to do this on a fanuc lathe?
    Thanks
    For some strange reason, I thought you want to drill by advancing (pecking) in positive Z-direction! You perhaps want to drill from, say, Z-100 to Z-200, and want to avoid pecking up to Z-100. If so, this can be very easily done by manipulating the R-point. Pecking would start from R-point.

    From a book:

    Position of R-point
    In G-code system B and C, depending on certain parameter settings, R would either always be incremental distance from the initial level (irrespective of G90/G91), or it can be either absolute coordinate or incremental distance from the initial level (depending on G90 and G91, respectively). In system A, which we are following, this is again parameter dependent; it can be either absolute coordinate or incremental distance from the initial level. Since parameter settings are going to vary on different machines, the best way would be to execute a program on the machine, in a safe working zone, to find out whether R is absolute or incremental. Another way would be to set the parameter 5102#6 to 0, which would force R to always be the incremental distance from initial level, in all the three G-code systems. The incremental distance would always be negative in this case.

    Another issue regarding its value, in side drilling (in front drilling, it is always the actual distance), is that whether it would be a diameter value (in diameter programming) or a radius value (even in diameter programming), depending on parameters. Therefore, either conduct an experiment on the machine to find out what it is, or set parameter 5102#7 to 0 which would always force it to be a radius value.

  9. #9
    Registered
    Join Date
    Aug 2009
    Posts
    677
    Sinha, I believe the need is to retract beyond the R-point in this case, ie back to the I-point as such. I would be surprised if a G83 could be defined in a way that produces this result. Saying that, I've never had the need to try it...

    Please be aware bilbo that I have no idea regarding the difference in capabilities between your control and mine, but this would be my more flexible approach (my first example was simplified to portray the concept): -

    In your main program: -

    G0 G90 X0 (Or whatever command puts your drill in position)
    #1=? (Input your Retract Z)
    #2=? (Input your Start Drilling Z)
    #3=? (Input your Final Z Depth)
    #4=? (Input your Peck)
    #5=? (Input your Feed)

    WHILE[#2GT#3]DO1 (Pecking Loop Start)
    #6=#2-#4 (Current Peck Depth)
    IF[#6LT#3]THEN #6=#3 (Sets Peck Depth to Final Depth if it overshoots)
    G0 Z#2+1. (stands off a mil)
    G1 Z#6 F#5
    G0 Z#1
    #2=#2-#4 (Resets Hole Depth for next pass)
    END1 (Pecking Loop End)

    Pgm continues once depth is reached.....

    Notice that this example is a little more foolproof than the previous example. The next step would be to save the loop in a separate program and set up a G-code to call that program from your main programs. Basically you input the G code value into a parameter then create a program with a number that relates to that parameter. I'm sure someone will chip in to the conversation with the exact parameters and procedure for you.

    You could, for example, call the program with a G183 R? Z? Q? C? F?
    Where R is your Drilling start position, Z is your final Drill position, Q is your peck, C is your Clearance Retract Position and F is your Feed. To use particular letters for each variable you need to ensure the #numbers in the cycle correspond to those letters (it's not a perfectly alphabetical sequence) - in this example your separate cycle would therefore look like this: -

    %
    O9??? (Deep Drill Cycle)

    WHILE[#18GT#26]DO1 (Pecking Loop Start)
    #7=#18-#17 (Current Peck Depth)
    IF[#7LT#26]THEN #7=#26 (Sets Peck Depth to Final Depth if necessary)
    G0 Z#18+1.
    G1 Z#7 F#9
    G0 Z#3
    #18=#18-#17 (Resets Hole Depth for next pass)
    END1 (Pecking Loop End)

    M99 (Return to main program)
    %

    The next step would be to put in some safety logic to flag any crazy/backwards instructions and prevent them being carried out.

    DP

  10. #10
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    Quote Originally Posted by christinandavid View Post
    Sinha, I believe the need is to retract beyond the R-point in this case, ie back to the I-point as such.
    From a book:

    Final retraction after hole machining
    There is some difference in the way these cycles are commanded/behave in different G-code systems. The description here refers to system A. System-B and system-C cycles are similar to canned cycles on milling machines, with provision for selection between R-point retraction and initial-level retraction with G99 and G98, respectively. In system A, the final retraction is up to the initial level, if parameter 5161#1 is set to 0 (its default value). When this parameter is set to 1, the final retraction is up to the R-point.

  11. #11
    Registered
    Join Date
    Aug 2009
    Posts
    677
    I think he needs to retract fully beyond the point at which he wants to start drilling at each peck.

    I think your article is referring to retract behaviour after completion of canned cycle (ie between hole positions).

    Of course I can only vouch for the behaviour of the machining centre I currently operate...I dont know lathes...thankfully.

    DP

  12. #12
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    Quote Originally Posted by christinandavid View Post
    I think he needs to retract fully beyond the point at which he wants to start drilling at each peck.
    This can be done by calling the drilling cycle repeatedly without a Q-word for each cutting depth till the bottom is reached.

    Quote Originally Posted by christinandavid View Post
    I think your article is referring to retract behaviour after completion of canned cycle (ie between hole positions).
    DP
    Yes.

    We are discussing for somebody who does not appear to be much interested!

  13. #13
    Registered
    Join Date
    Aug 2009
    Posts
    677
    We'll just have to lie in wait for the next unwary victim to stumble into our world....

    DP

  14. #14
    Registered
    Join Date
    Mar 2011
    Posts
    0
    I am very interested.

    sinha,
    I call up a drill cycle now for each pass. I am looking for a better way to program this.

    christinandavid, you state:

    In your main program: -

    G0 G90 X0 (Or whatever command puts your drill in position)
    #1=? (Input your Retract Z)
    #2=? (Input your Start Drilling Z)
    #3=? (Input your Final Z Depth)
    #4=? (Input your Peck)
    #5=? (Input your Feed)

    WHILE[#2GT#3]DO1 (Pecking Loop Start)
    #6=#2-#4 (Current Peck Depth)
    IF[#6LT#3]THEN #6=#3 (Sets Peck Depth to Final Depth if it overshoots)
    G0 Z#2+1. (stands off a mil)
    G1 Z#6 F#5
    G0 Z#1
    #2=#2-#4 (Resets Hole Depth for next pass)
    END1 (Pecking Loop End)

    Pgm continues once depth is reached.....

    What value do I enter for #6?
    What does the DO1 represent? Is it the name of this routine? Should it go on the next line then? Or does this need to go in a subprogram?

    Thanks,
    John

  15. #15
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    You do not enter anything in #6, it is a calculation and the value of #6 will change as it runs thru the cycle.

    The way the WHILE statements work is like this.


    WHILE[#2GT#3]DO1---this is the start of the cycle and is saying until the value in #2 is greater then the value in #3 DO1. So it runs the code in between the WHILE line and the END1 line over and over until #2 is greater then #3 and it will exit the cycle to the next line after END1

    Stevo

  16. #16
    Registered
    Join Date
    Mar 2011
    Posts
    0
    Giving it a shot in the control today, I'll give you feedback later...

  17. #17
    Registered
    Join Date
    Mar 2011
    Posts
    0
    OK, I am getting the error message:

    "004 address not found"

    here is what I have in the program:

    "N801(#7 JOBBER DRILL)
    G97S3500T808M3
    G0X0Z.05M8
    #1=.1(RAPID)
    #2=-.5(START&DRILL)
    #3=-2.1(FINISH)
    #4=.125(PECK)
    WHILE[#2GT#3]DO1
    #5=#2-#4
    IF[#5LT#3]THEN#5=#3
    G0Z#2+.01
    G1Z#5F.004
    G0Z#1
    #2=#2-#4
    END1
    G30U0W0
    M1 "

    Why am I getting this error? can I not start a line with the # sign? Do these variables need to go in the parameters? if so where?

  18. #18
    Registered
    Join Date
    Aug 2009
    Posts
    677
    We are, of course, assuming that your control has the option for macro b activated. Can you view the current values of the local and common custom macro variables? I do this on my control via the OFS/SET hard key and page across until I get a 'Macro' soft key option.

    What I would do is put a few more brackets in there just incase it is trying to find #2.01. I remember a case where I had put #7/2 and it was trying to look for #3.5 instead of just getting the value of #7 and dividing it by 2....

    "N801(#7 JOBBER DRILL)
    G97S3500T808M3
    G0X0Z.05M8
    #1=.1(RAPID)
    #2=-.5(START&DRILL)
    #3=-2.1(FINISH)
    #4=.125(PECK)
    WHILE[#2GT#3]DO1
    #5=[#2]-[#4]
    IF[#5LT#3]THEN#5=#3
    G0Z[[#2]+[.01]]
    G1Z#5F.004
    G0Z#1
    #2=[#2]-[#4]
    END1
    G30U0W0
    M1 "

  19. #19
    Registered
    Join Date
    Mar 2011
    Posts
    0
    SUCCESS!

    The extra brackets did the trick!

    Thank you very much christinandavid. My old '83 Okuma LB-15 could do this with a G74 can cycle and I was just amazed that my new '10 lathe with a 21iT fanuc control could not. I have used the variable method before on other machines with great success.

    Thanks for you patience with me.

Similar Threads

  1. How to ream hole with no drill baby, drill
    By tome9999 in forum BobCad-Cam
    Replies: 2
    Last Post: 03-05-2011, 05:09 AM
  2. G83 won't rapid to the bottom of hole?
    By FASTSemi in forum Haas Mills
    Replies: 7
    Last Post: 06-05-2009, 06:28 PM
  3. Replies: 9
    Last Post: 02-11-2008, 05:54 PM
  4. Spade Drill Does Work in Aluminum; Big Hole Boring on Drill Press.
    By Geof in forum General MetalWork Discussion
    Replies: 47
    Last Post: 02-01-2008, 08:32 PM
  5. How would you drill this hole.
    By Loading in forum General MetalWork Discussion
    Replies: 11
    Last Post: 10-05-2006, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •