584,849 active members*
4,486 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > Help me improve this custom macro, also freebie chip breaker macro for lathes
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2011
    Posts
    261

    Question Help me improve this custom macro, also freebie chip breaker macro for lathes

    Hello,
    This custom macro was set up by the factory on a couple of our swiss machines to help control chips. It works awesome so feel free to use it if you have some unruly chips.

    As the program exists you can only turn in Z. This works fine most of the time but I would like to be able to program in some taper in X. Could you guys tell me if this would be possible?

    All it does is turn/dwell/turn/dwell ect.

    Z=end
    Q=turn distance before dwell
    D=Dwell in seconds
    F=Feed

    Here is the existing program:

    O0061(G1 MACRO: SET PARAMETER 6050 TO 61)
    (CHANGE TO O9010 WHEN INSTALLED)
    IF[#7LE0]GOTO5
    IF[#9LE0]GOTO6
    IF[#17LE0]GOTO7
    IF[#26LE0]GOTO8
    #501=#5042
    IF[#501GT#26]GOTO10

    WHILE[#501LT#26]DO1
    N1G01Z#501F#9
    G04X#7
    #501=#501+#17
    END1
    G01Z#26F#9
    M99

    (CUTTING Z+ TO Z-)
    N10
    #501=#5042
    WHILE[#501GT#26]DO1
    N1G01Z#501F#9
    M99

    N5#3000=1(D MISSING)
    N6#3000=2(F MISSING)
    N7#3000=3(Q MISSING)
    N8#3000=4(Z MISSING)

    __________________________________________________ _____________

    So, here's my (uneducated) thinking on how to improve this

    #501=#5042---------------------- (#501=current Z position)
    #502=[[#26-#5042]/#17] ---- [turn length/peck distance] (formula to get # of "pecks")
    #10=#503------------------------- (didnt look up what # U actually is so its 10 for this example)
    #503=[#503/#502 ] -------------(per peck U move)

    WHILE[#501LT#26]DO1
    N1
    G1 Z#501 U#503 F#9
    G4 X#7
    #501=#501+#17
    END1
    G1 Z#26 U#503 F#9
    M99

    Could this work? thoughts? thanks!
    __________________
    CNC Product Manager / Training Consultant

  2. #2
    Join Date
    Sep 2010
    Posts
    1230
    #501=#5042---------------------- (#501=current Z position)
    #502=[[#26-#5042]/#17] ---- [turn length/peck distance] (formula to get # of "pecks")
    #10=#503------------------------- (didnt look up what # U actually is so its 10 for this example)
    If you're passing U as an argument its #21. Also your assignment should be the inverse of the above, #503=#21 (#10 in your example). Or you could change #503 in your program to #21. Also, you would have to calculate what the total Incremental move in X is if you're not pre-calculating and passing it as the U argument.

    #503=[#503/#502 ] -------------(per peck U move)
    The above block would become
    #21=[#21/#502]

    and
    U#503 would become U#21

    WHILE[#501LT#26]DO1 This will only work if feeding in a Z- to Z+ direction
    N1
    G1 Z#501 U#503 F#9 In the 1st execution of this WHILE Loop, only an X move will result. The tool is already at Z#501. You need to execute #501=#501+#17 prior to starting the WHILE Loop
    G4 X#7
    #501=#501+#17 If #17 is a + value, this will also facilitate a movement in a Z- to Z+ direction.
    END1
    G1 Z#26 U#503 F#9
    M99

    Regards,

    Bill

  3. #3
    Join Date
    Aug 2011
    Posts
    2517
    a previous post of yours provided a solution to this same problem. A least the pecking in Z part. Your re-worked program is completely different and not based on something that was proven.
    http://www.cnczone.com/forums/fanuc/...er_custom.html

  4. #4
    Join Date
    Sep 2011
    Posts
    261
    Ill give that a try angel. Thats a good point about the first time through it will just move up. Ill add what you suggested and see if it works. Thanks!

    ford -The program at the top of my post is a working macro. the one you linked was me trying to remember the one I posted before I was able to get it back. Im using the posted macro on a job as i type this. It was made by a factory installer, so its plenty proven and works great. so the old one is irrelevant...
    CNC Product Manager / Training Consultant

Similar Threads

  1. Help writing chip breaker custom macro
    By MCImes in forum Fanuc
    Replies: 10
    Last Post: 10-31-2011, 05:34 PM
  2. Custom Macro Containing G65
    By LostInMacro in forum Fanuc
    Replies: 20
    Last Post: 09-15-2010, 09:21 PM
  3. Custom Macro?
    By cncwhiz in forum Fanuc
    Replies: 9
    Last Post: 06-24-2010, 04:11 AM
  4. "difference between Custom Macro A and Custom Macro B"
    By arulthambi in forum Parametric Programing
    Replies: 4
    Last Post: 10-05-2009, 09:34 PM
  5. Custom macro!!!!
    By chrisryn in forum G-Code Programing
    Replies: 4
    Last Post: 05-28-2008, 04:13 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
  •