584,812 active members*
5,395 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > CNC Swiss Screw Machines > Question Help me improve this custom macro, also freebie chip breaker macro for lathe
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    261

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

    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
    Feb 2012
    Posts
    0
    You don't need to use #10; you can simply use #503 and enter the amount of taper compensation you would like to see. The #10 will work however, though you will still need to use #503 to enter the amount of taper adjustment. Please note that if you have "#503=(any value here)" in your program, it will reset to this value any time you run through your program even if you attempt to make an adjustment to #503 on the variable page.

  3. #3
    Join Date
    Jun 2012
    Posts
    7

    macro help???

    Hi everyone,

    I know that my question maybe will be to simple for someone, but I need help anyway.

    I want to create a macro that check the axis position during the g-code execution and if it is in exact position turn the output ON and in another position turn the output OFF.

    Any help will very appreciated.

    thanks

    darli

Similar Threads

  1. Question about Custom Macro AGAIN!!!!!
    By ixoxi999 in forum Fanuc
    Replies: 4
    Last Post: 04-25-2012, 09:19 AM
  2. Replies: 3
    Last Post: 02-13-2012, 07:20 PM
  3. Help writing chip breaker custom macro
    By MCImes in forum Fanuc
    Replies: 10
    Last Post: 10-31-2011, 05:34 PM
  4. custom macro question
    By sinha_nsit in forum G-Code Programing
    Replies: 28
    Last Post: 04-18-2009, 12:44 PM

Posting Permissions

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