Newbie MACRO ?


Results 1 to 10 of 10

Thread: MACRO ?

  1. #1
    Registered Get lucky's Avatar
    Join Date
    Jul 2008
    Location
    us
    Posts
    116
    Downloads
    0
    Uploads
    0

    Default MACRO ?

    Not so sure that these statements are correct if somebody could look at them and let me know if they are correct and if it would work or if there is a better way to do this.

    PECK DRILLING CYLCLE

    N1000M01
    T1000M8
    G97S600M3
    X0Z.1T1010
    G65P9001R.1Z-.3Q.1F.005
    (R =RETURN POINT#18)
    (Z=DEPTH OF CUT#26)
    (Q= PECK#17)
    (F= FEED RATE#9)
    G60G28U0W0T1000


    %
    O9001
    #102=0
    N1
    G1Z-[#17+#102]F#9
    G0Z#18
    Z-[[#117+102]-.005]
    #102=#102+#18
    IF[#102GE[#26-#18]]GOTO10
    M99P1
    N10
    G0Z-[[#100+102]-.005]
    G1Z-#26
    G0Z#18
    M30
    %

    Similar Threads:


  2. #2
    Registered jamesweed's Avatar
    Join Date
    Jan 2007
    Location
    USA
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default

    %
    O9001
    #102=0
    N1
    G1Z-[#17+#102]F#9
    G0Z#18
    Z-[[#117+#102]-.005]
    #102=#102+#18
    IF[#102GE[#26-#18]]GOTO10
    M99P1
    N10
    G0Z-[[#100+#102]-.005]
    G1Z-#26F?
    G0Z#18
    M30
    %

    Maybe the changes that are in bold?



  3. #3
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1511
    Downloads
    0
    Uploads
    0

    Default

    I am not quite sure why you are doing so much code for just a peck drilling cycle. For starters in your sub after the N10 your using #100 I don't see that being set anywere. What is it? I also don't see your drill code G73,G83. I always use a variable to establish a clearance plane. Try this, using the same R,Z,Q,F as you were.

    N1000M01
    G97S600M3
    T1010
    #500=3.(clearance plane)
    G65P9001R.1Z-.3Q.1F.005
    G60G28U0W0T1000

    O9001
    G0G90X0Y0
    Z#500
    G73Z-#26R#18Q#17F#9M8
    M99
    %

    I typically have mine set up to use all variables. It makes it more universial. But I am typically doing mine with multiple holes on a bolt circle and the macro loops. I just modified this one here to do one hole. Thats what I figured you were doing.

    A=3.(CLEARANCE PLANE #1)
    K=73.(G-CODE FOR DRILL CYCLE)(#6)
    Q=.1(PICK SIZE FOR DRILL CYCLE)(#17)
    W=.1(R-PLANE)(#23)
    T=1515(TOOL NUMBER BEING USED)(#20)
    Z=1.0(FINAL DEPTH OF HOLE)(#26)
    X=2.5(X COORD. OF HOLE)(#24)
    Y=1.5(Y COORD. OF HOLE)(#25)
    F=5.0(FEED RATE)(#9)
    M=8(COOLANT TYPE 8=FLOOD 18=SPINDLE 9=OFF)(#13)
    S=500(SPINDLE SPEED)(#19)

    N1000M1
    G65P8000A3K73Q.1W.1T1515Z1.X2.5Y1.5F5.M8S500
    M30

    O8000(DRILL CYCLE)
    T#20
    G0G90X#24Y#25Z#1M3S#19
    G#6Z-#26R#23Q#17F#9M#13
    G60G28U0W0M9
    M99
    %

    Stevo



  4. #4
    Registered Get lucky's Avatar
    Join Date
    Jul 2008
    Location
    us
    Posts
    116
    Downloads
    0
    Uploads
    0

    Default

    Stevo,

    I was trying to make a drill cycle for a lath so it is only have one hole in the center of the part. The lath will not read the G81,G73 I tried it out this morning and that macro didn't work for crap. The other reason that I don't put all the information in this macro is the machinist that work for me really don't under stand how a letter transpose to a number with equation and I tried to explain it to them and they just don't under stand here is how I finaly got it to work.

    peck drilling cycle

    N1000M01
    T1000M8
    G97S600M3
    X0Z.1T1010
    G65P9001R.1Z-.3Q.1F.005
    (R =RETURN POINT#18)
    (Z=DEPTH OF CUT#26)
    (Q= PECK#17)
    (F= FEED RATE#9)
    G28G28U0W0T1000
    %
    O9001
    #102=0
    #103=#26+#17
    N122
    #102=#102-#17
    G1Z#102F#9
    G0Z#18
    Z[#102-.005]
    IF[#102LE#103]GOTO123
    GOTO122
    N123
    G0Z[#102-.005]
    G1Z#26F#9
    G0Z#18
    M99

    Kyle



  5. #5
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1511
    Downloads
    0
    Uploads
    0

    Default

    My apologize. I did not see anything in your first post that said you were running this on a lathe. I should have asked. If that works for you then great.

    If you want to help your operators understand the Alpha numeric word usage better I usually have lists made for each macro that I have. I have attached the spreadsheet that gives you the format that I use. You say they dont quite understand how it works, but with macros the operators don't have to understand how the letters transfer to variables and how the variables calculate in the macro. That is why most macros will be locked programs once proven out. If it is a proven program then there would be no reason to understand it and tweek it. The operators have a list that program 9001 is a peckdrilling cycle on the lathe and they have a list that says

    Z= DEPTH OF CUT
    Q= PECK/PICK SIZE
    R= R-PLANE
    F= FEED
    S= SPEED
    T= TOOL NUMBER USED
    ...
    ect.

    The list will never change and the macro will never change. As long as they understand how the line has to be set up G65P9001Z()Q()R()F()......ect. They should not be a problem.

    Stevo

    Attached Files Attached Files


  6. #6
    Registered
    Join Date
    Apr 2006
    Location
    usa
    Posts
    133
    Downloads
    0
    Uploads
    0

    Default Better peck cycle

    I found this on the web several years ago and it looks like something you could use on a lathe. It allows you to reduce the size of the peck with a limit of how small. You don't have to call it with a G65 block, just insert into your main program. I don't know the author so I can't give the proper credit





    <-- Quote-->

    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[ #536 LE #531 ] GOTO330 ( DONE )
    G1 Z#536 F.0016 ( DRILL-NEXT-DEPTH )
    G0 Z#535 (RETRACT)
    G0 Z[ #536 + .005 ] ( CLEAR )
    #537= [ #537 * #534] ( REDUCE-PECK )
    IF [#537 GE #533 ] GOTO325
    #537 = #533 ( NOT-TOO-SMALL )
    N325 GOTO320
    N330 G1 Z#531
    G0 Z#535
    M99

    Gives you a LOT of control, with no canned cycles, and very little extra code!

    <-- Quote end -->



  7. #7
    Member
    Join Date
    May 2007
    Location
    USA
    Posts
    1003
    Downloads
    0
    Uploads
    0

    Default

    JWK42, nice macro. Question tho. Shouldn't N310 be H310? Sorry for the dumb question, but I did stand next to a Swiss lathe one time.



  8. #8
    Registered
    Join Date
    Apr 2006
    Location
    usa
    Posts
    133
    Downloads
    0
    Uploads
    0

    Default

    I really don't know. I just cut and pasted exactly as I found it.
    I have modified it to work on a Haas control.
    Since Haas would use "M97 P310" to call this as a local sub program, I can imagine that Swiss would use an "H310" to do the same thing. Any Swiss users out there to help?

    Edit

    We use a right angle head to drill holes on our Haas EC 1600 and the drill cycles only work in "Z" axis so I agree, this is a very nice Macro.

    Last edited by JWK42; 08-28-2008 at 10:42 AM. Reason: Added a comment


  9. #9
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    304
    Downloads
    0
    Uploads
    0

    Default

    On a Citizen machine, with a Mitsubishi control, you would have "Sub programs" that are internal to the main program. The way you run the sub program is with the statement "M98H###"
    This means your example is correct. The M98H310 will hop to N310 and the
    M99 will send it back just like an external sub program would do it.(Which also works) This just allows you to keep all you needed sub programs and the main program as one neat package.
    On a Fanuc control and others you would use the "M99P310" to hop to N310 but to send it back you would have to use a "GOTO###" statement and have the "###" somewhere for it to find.



  10. #10
    Member
    Join Date
    May 2007
    Location
    USA
    Posts
    1003
    Downloads
    0
    Uploads
    0

    Default

    I've never used the M99P310 type call, but will keep an eye open for future possibilities. Thanks.



Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

MACRO ?

MACRO ?