![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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
| |||
| |||
| 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
| |||
| |||
| 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 |
![]() |
| Tags |
| fanuc, macro, pocket |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help in hexagon pocket milling | brianklein | G-Code Programing | 27 | 05-13-2009 11:56 AM |
| Pocket milling | orionstarman | Mazak, Mitsubishi, Mazatrol | 1 | 04-07-2008 06:26 PM |
| pocket milling | CNC stud | General Metalwork Discussion | 1 | 03-26-2008 03:33 PM |
| Problem with pocket milling... | Driftwood | GibbsCAM | 1 | 09-03-2006 10:25 PM |
| rectangular pocket macro | mistux | G-Code Programing | 0 | 11-01-2005 11:54 AM |