586,123 active members*
3,389 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    19

    Fanuc pocket milling macro

    Have been trying to make a rect. pocket milling macro, so far as below but only if X is greater than or equal to Y, but can be rotated.

    If anyone knows of a better way can they please post it.


    O9999(RECT POCKET MACRO)
    (X GE Y OR ROTATE AXIS)


    #1=200.(LENGTH)
    #2=100.(WIDTH)
    #3=6.5(DEPTH) (**)
    #4=20.(TOOL DIA.)
    #5=10.(STEP OVER)
    #6=2.(Z CUT) (**)
    #7=200(FEED)
    #8=1.5(Z START) (**)(MUST DIVIDE EQUALLY)
    #9=[#3+#8]/#6(NO OF Z CUTS)
    #24=#3+10.


    #10=#1-#4(INC. X)
    #11=#2-#4(INC. Y)
    #12=#10/2(S.P. X)
    #13=#11/2(S.P. Y)
    #14=#10-#11
    #15=#14/2
    #16=#15+#12
    #17=#14+#4
    #18=#5+#5
    #19=#12/2
    #23=FUP[#11/#4]

    #5=#11/[#23*2]


    G68X0Y0R0.(R= ANGLE ABOUT X AND Y)
    (CUTTER MUST START IN CENTRE OF POCKET)
    G0G91
    X-#12Y-#13
    G01Z#8F50(Z1.0)
    M98P9998L#9
    G0Z#24
    G69
    M30
    O9998
    G01X#16 Y#13 Z-#6 F#7
    X-#14
    #21=1
    WHILE[#21LE#23]DO2
    X-#5Y#5
    #22=#22+[#5*2]
    #14=#14+[#5*2]
    X#14
    Y-#22
    X-#14
    Y#22
    #21=#21+1
    END2
    Y-#22
    M99

  2. #2
    Join Date
    Oct 2006
    Posts
    6

    Cool Rectangle milling cycle

    Under normal circumstances I would just cad up the rectangle I required, if however, I needed to produce many different rectangles, then I suppose a cycle such as yours my be useful.

    Your going to have to think out of the box, the G68 rotation code is useful but limited.

    I suggest that you avoid using it and improve your calculations to include trigonomic equations. In this case you only need a start point (X0. Y0.) and an angle for the first line.

    Hope this helps

  3. #3
    Join Date
    Jun 2008
    Posts
    1511
    TTurnbull50,
    I sent you a reply to your PM to refer back to this post. This will mill your pocket with the things that you wanted. I changed a bit of it so we can go a few different ways depending on how you want your rotation set up. Now when you’re going to rotate is there a small amount of rotations? Are they going to be equally spaced rotations? These are need to know so we can set up the macro either modal or non modal. Macro modal is easier if you only have a few rotations and especially if they are not equally spaced. If you have equally spaced it is better off coding it into the actual macro. What model Fanuc are you on?

    I ran this through a test run on my 15M so it should work no problems. There will probably be a few adjustments that you might want to make as you go. Here are the definitions:

    #1=100(LENGTH)(A)
    #2=200(WIDTH)(B)
    #3=6.5(DEPTH)(C)
    #17=20.6(TOOL DIA.)(Q)
    #8=.7(TO CUT LESS THEN 1/2 CUTTER FOR OVERLAP)(E)
    #21=2(Z PICK)(U)
    #9=200(FEED)(F)
    #23=.5(FINISH STOCK ON WALLS)(W)
    #20=10(TOOL NUMBER)(T)

    I would set it up macro like this:

    O0001(MAIN PROGRAM)
    G65P9000A100B200C6.5Q20.6E.7U2F200W.5T10
    M30

    O9000(RECT. POCKET MACRO)
    M6T#20
    #10=[#17/2]-#8
    #1=#1/2
    #2=#2/2
    #17=#17/2
    #11=0(Y COUNTER)
    #12=#21(Z COUNTER)
    N100G0G90X0Y0Z1.
    Z.1
    G1Z-#12F#9
    N200
    WHILE[#11LT[#1-#17-#23]]DO1
    #11=#11+#10
    IF[#11GE[#1-#17/2-#23]]TH#11=[#1-#17-#23]
    X-[#2-#17-#23]
    Y-[#11-#23]
    X[#2-#17-#23]
    Y[#11-#23]
    X-[#2-#17-#23]
    Y0
    END1
    IF[#12EQ#3]GOTO300
    #12=#12+#21
    IF[#12GE#3]TH#12=#3
    #11=0
    GOTO100
    N300
    IF[#23EQ0]GOTO400
    #23=0
    GOTO200
    N400G0Z1.
    M99

    Let me know how you want to do the rotation. Macro modal would have a format like this.

    O0001(MAIN PROGRAM)
    G66P9000A100B200C6.5Q20.6E.7U2F200W.5T10
    #100=10
    #100=30
    #100=53
    #100=108
    #100=260
    G67
    M30
    The #100 would be each rotation you want to mill a pocket at. Then in the program we would stick a G68X0Y0R#100.

    Stevo

  4. #4
    Join Date
    Jun 2006
    Posts
    14
    i need to learn how to program a simple pocket with macros. can you help me please.

  5. #5
    Join Date
    Feb 2006
    Posts
    1792
    In the modal macro call, tool movement is necessary.

Similar Threads

  1. Need help in hexagon pocket milling
    By brianklein in forum G-Code Programing
    Replies: 27
    Last Post: 05-13-2009, 05:56 PM
  2. Pocket milling
    By orionstarman in forum Mazak, Mitsubishi, Mazatrol
    Replies: 1
    Last Post: 04-08-2008, 12:26 AM
  3. pocket milling
    By CNC stud in forum MetalWork Discussion
    Replies: 1
    Last Post: 03-26-2008, 09:33 PM
  4. Problem with pocket milling...
    By Driftwood in forum GibbsCAM
    Replies: 1
    Last Post: 09-04-2006, 04:25 AM
  5. rectangular pocket macro
    By mistux in forum G-Code Programing
    Replies: 0
    Last Post: 11-01-2005, 06:54 PM

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
  •