![]() | |
| 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
| |||
| |||
Hi there, Does anyone know of a good G-Code editor that allows to copy paste an array of g-code "objects"? For example, I'd like to copy 6 times the g-code for a pc-board and have it offset by 4 inches verticaly and 6 inches horizontaly. Exactly like the reactangular array command in AutoCAD except with g-code instead... Any suggestion are welcome. Many thanks! -- Tobie |
|
#2
| |||
| |||
| Why? Surely you get the same result by assigning a different Work Zero to each of the 6 locations. Alternatively if your machine can understand G52 you have one main Work Zero and then use G52 to define local work zeroes at the 6 locations.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#3
| |||
| |||
| Suburban machinery has a really good editor. I use it a lot for jobs similar to what you describe. I really like the fact that I can have several files open on the screen at once and jump back and forth between them. I would highly recommend them. http://www.sub-soft.com/ Last edited by JWK42; 10-22-2008 at 10:25 AM. Reason: spelling |
|
#4
| |||
| |||
| Thanks Geof, I'll look up about G52 as you suggest. I'm not much of a G-code buff yet so please excuse my ignorance. My CNC doesn't have an automatic tool change feature so when I want to drill a circuit with several different hole diameters I must be present to swap drill bits when required. If I were to simply move the work zero I'd have to go through the bit swapping process 6 times. What I want to do is automate the process by giving a single file to my CNC and have it drill all the holes with a given diameter across the 6 iterations of the same board before it asks me for another bit. Hence my request for a tool to copy/paste or generate an array of 6 complete parts. If you think I can simply add a series a zero offsets in my existing g-code to achieve the same result I would be more than willing to try it! regards, -- Tobie |
|
#6
| |||
| |||
| There is a few ways you can do it. As JWK42 is hinting at is the ability of using loops and macros to run the process 6 times. There is also a thing called work coordinate rotation but it would be across the same diameter. Or a canned cycle then all you need is to program the X,Y to the different locations you want to drill. Contro?? Stevo |
|
#8
| |||
| |||
There are different ways to do it: If your machine can handle subroutines you make your pcb code into a subroutine and go to this subroutine for each work zero. The program structure is like this using words not G-code. Start Work Zero Selection Program Select G54 Go to Subroutine at line N1000 Select G55 Go to Subroutine at line N1000 etc for all the work zeros End program ====== N1000 This is the pcb machining code M99 This returns for the next work zero selection The other way is very similar but instead of having the pcb code at the bottom it is in a separate program and the program structure is: Start Work Zero Selection Program Select G54 Go to Subprogram O1234 Select G55 Go to Subprogram O1234 etc for all the work zeros End program O1234 This is the pcb machining code M30 End program and return for the next work zero selection You run through all the work zeroes for tool #1 then have a stop to change tools and then continue through them for tool #2, etc. You have a subroutine for each tool, N1000, N2000, etc.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#9
| |||
| |||
| I used Geof's idea of G52 zero shift to write this example for a Haas Mill. I have never used this method so this was a chance to learn how to do it. I assumed each board is 5" wide in X and 3" tall in Y. I layed then out 3 wide in X and 2 wide in Y. I made up a set of coordinates for 3 sets of drilled & tapped holes. I don't know if this will work on your Mach3 but I think the structure can be adapted to suit your needs. I have only tested this on our Haas simulator. You also could make line N240 G55 and line N260 G56 ect. to call the different work coordinate systems. That would depend on how many boards are in your pattern and how many systems you have available. Haas has G54-G59 and G110 - G129 I hope you find this example useful, I enjoyed writting it. % O5555 (TEST G52 ZERO SHIFT) N30 ( WRITTEN 10-22-2008 10:48:27 ) N40 (MODIFIED 10-22-2008 12:55:59) N50 #101= 1 ( NO. 7 DRILL ) N60 #102= 2 ( NO. 21 DRILL ) N70 #103= 3 ( NO. 29 DRILL ) N80 #104= 4 ( .25-20 TPI TAP ) N90 #105= 5 ( 10-24 TPI TAP ) N100 #106= 6 ( 8-32 TPI TAP ) N110 G17 G54 G90 N120 G40 G49 G80 N130 G53 G00 Z0. N140 G53 G00 X-20. Y0. N150 G52 X0. Y0. N160 ( TOOL #1 IS A NO. 7 DRILL ) N170 G53 G00 Z0. ( RESTART TOOL #1 HERE ) N180 G53 G00 X-20. Y0. N190 T#101 M06 N200 S1234 M03 N210 G54 G00 G90 X1. Y1. N220 G43 Z0.25 H#101 D#101 M08 N230 M98 P8001 N240 G52 X5. N250 M98 P8001 N260 G52 X10. N270 M98 P8001 N280 G52 Y3. N290 M98 P8001 N300 G52 X5. N310 M98 P8001 N320 G52 X0. N330 M98 P8001 N340 G52 X0. Y0. N350 G53 G00 Z0. M09 N360 G53 G00 X-20. Y0. N370 M01 ( OP STOP ) N380 ( TOOL #2 IS A NO. 21 DRILL ) N390 G53 G00 Z0. ( RESTART TOOL #2 HERE ) N400 G53 G00 X-20. Y0. N410 T#102 M06 N420 S1234 M03 N430 G54 G00 G90 X0.5 Y0.5 N440 G43 Z0.25 H#102 D#102 M08 N450 M98 P8002 N460 G52 X5. N470 M98 P8002 N480 G52 X10. N490 M98 P8002 N500 G52 Y3. N510 M98 P8002 N520 G52 X5. N530 M98 P8002 N540 G52 X0. N550 M98 P8002 N560 G52 X0. Y0. N570 G53 G00 Z0. M09 N580 G53 G00 X-20. Y0. N590 M01 ( OP STOP ) N600 ( TOOL #3 IS A NO. 29 DRILL ) N610 G53 G00 Z0. ( RESTART TOOL #3 HERE ) N620 G53 G00 X-20. Y0. N630 T#103 M06 N640 S1234 M03 N650 G54 G00 G90 X1.5 Y1.5 N660 G43 Z0.25 H#103 D#103 M08 N670 M98 P8003 N680 G52 X5. N690 M98 P8003 N700 G52 X10. N710 M98 P8003 N720 G52 Y3. N730 M98 P8003 N740 G52 X5. N750 M98 P8003 N760 G52 X0. N770 M98 P8003 N780 G52 X0. Y0. N790 G53 G00 Z0. M09 N800 G53 G00 X-20. Y0. N810 M01 ( OP STOP ) N820 ( TOOL #4 IS A .25-20 TAP ) N830 G53 G00 Z0. ( RESTART TOOL #4 HERE ) N840 G53 G00 X-20. Y0. N850 T#104 M06 N860 S1234 M03 N870 G54 G00 G90 X1. Y1. N880 G43 Z0.25 H#104 D#104 M08 N890 M98 P8004 N900 G52 X5. N910 M98 P8004 N920 G52 X10. N930 M98 P8004 N940 G52 Y3. N950 M98 P8004 N960 G52 X5. N970 M98 P8004 N980 G52 X0. N990 M98 P8004 N1000 G52 X0. Y0. N1010 G53 G00 Z0. M09 N1020 G53 G00 X-20. Y0. N1030 M01 ( OP STOP ) N1040 ( TOOL #5 IS A 10-24 TAP ) N1050 G53 G00 Z0. ( RESTART TOOL #5 HERE ) N1060 G53 G00 X-20. Y0. N1070 T#105 M06 N1080 S1234 M03 N1090 G54 G00 G90 X0.5 Y0.5 N1100 G43 Z0.25 H#105 D#105 M08 N1110 M98 P8005 N1120 G52 X5. N1130 M98 P8005 N1140 G52 X10. N1150 M98 P8005 N1160 G52 Y3. N1170 M98 P8005 N1180 G52 X5. N1190 M98 P8005 N1200 G52 X0 N1210 M98 P8005 N1220 G52 X0. Y0. N1230 G53 G00 Z0. M09 N1240 G53 G00 X-20. Y0. N1250 M01 ( OP STOP ) N1260 ( TOOL #6 IS A 8-32 TAP ) N1270 G53 G00 Z0. ( RESTART TOOL #6 HERE ) N1280 G53 G00 X-20. Y0. N1290 T#106 M06 N1300 S1234 M03 N1310 G54 G00 G90 X1.5 Y1.5 N1320 G43 Z0.25 H#106 D#106 M08 N1330 M98 P8006 N1340 G52 X5. N1350 M98 P8006 N1360 G52 X10. N1370 M98 P8006 N1380 G52 Y3. N1390 M98 P8006 N1400 G52 X5. N1410 M98 P8006 N1420 G52 X0. N1430 M98 P8006 N1440 G52 X0. Y0. N1450 G53 G00 Z0. M09 (UNLOAD HERE) N1470 G53 G00 X-20. Y0. N1480 M30 (END OF MAIN PROGRAM) O8001 (NO. 7 DRILL) N10 G81 G98 R0.1 Z-0.25 F6. L0 N20 X1. Y1. N30 X2. Y1. N40 X3. Y1. N50 X4. Y1. N60 X4. Y2. N70 X3. Y2. N80 X2. Y2. N90 X1. Y2. N100 G80 N110 M99 O8002 (NO. 21 DRILL) N10 G81 G98 R0.1 Z-0.25 F6. L0 N20 X0.5 Y0.5 N30 X1.5 Y0.5 N40 X2.5 Y0.5 N50 X3.5 Y0.5 N60 X3.5 Y1.5 N70 X2.5 Y1.5 N80 X1.5 Y1.5 N90 X0.5 Y1.5 N100 G80 N110 M99 O8003 (NO. 29 DRILL) N10 G81 G98 R0.1 Z-0.25 F6. L0 N20 X1.5 Y1.5 N30 X2.5 Y1.5 N40 X3.5 Y1.5 N50 X4.5 Y1.5 N60 X4.5 Y2.5 N70 X3.5 Y2.5 N80 X2.5 Y2.5 N90 X1.5 Y2.5 N100 G80 N110 M99 O8004 (.25-20 TAP) N10 G84 G98 R0.1 Z-0.25 F50. S1000 L0 N20 X1. Y1. N30 X2. Y1. N40 X3. Y1. N50 X4. Y1. N60 X4. Y2. N70 X3. Y2. N80 X2. Y2. N90 X1. Y2. N100 G80 N110 M99 O8005 (10-24 TAP) N10 G84 G98 R0.1 Z-0.25 F41.67 S1000 L0 N20 X0.5 Y0.5 N30 X1.5 Y0.5 N40 X2.5 Y0.5 N50 X3.5 Y0.5 N60 X3.5 Y1.5 N70 X2.5 Y1.5 N80 X1.5 Y1.5 N90 X0.5 Y1.5 N100 G80 N110 M99 O8006 (8-32 TAP) N10 G84 G98 R0.1 Z-0.25 F31.25 S1000 L0 N20 X1.5 Y1.5 N30 X2.5 Y1.5 N40 X3.5 Y1.5 N50 X4.5 Y1.5 N60 X4.5 Y2.5 N70 X3.5 Y2.5 N80 X2.5 Y2.5 N90 X1.5 Y2.5 N100 G80 N110 M99 % |
|
#10
| |||
| |||
| Thanks to you both JWK42 and Geof, I'll go through your code and post back with my results. At this point I've only used Mach3 as an intermediate step between my CAD software and the CNC and haven't really dived into all its' intricacies yet. Btw, I tried the software you mentionned earlier in the thread JWK42 and it does indeed allow for the offset and pattern features I was looking for. Although it won't automatically rearrange the code to optimise for tool changes I can still achieve what I want by manually copy/pasting the chunks of code regrouping them under the same tools. Its a start! I'm certain I could do this more elegantly through macros and loops as you suggest so again, I'll post back with my results... thanks and regards, -- Tobie |
| Sponsored Links |
|
#11
| |||
| |||
| Here is a variation of the program posted earlier. Note that I am calling the G81 drill or G84 tap cycle, then calling the sub with the hole positions, then using G52 to shift the program zero , call hole sub ect. then use G80 to exit the cycle. I didn't know that I could jump in and out of a sub while still in a canned cycle mode. I have ran this on our Haas simulator only. The L0 at the end of each cycle call inhibits drilling or tapping until the next X-Y position is read. I think this may be a Haas feature. I don't know about Fanuc or other controls. Haas also allows local subs. So by changing all M98 to M97 and the O1610, O1710 and O1810 to N1610, N1710 and N1810 the program will all be contained an 1 file instead of 4 separate files. Again, I don't know if Fanuc has this option. % O5555 (TEST G52 ZERO SHIFT) N30 (WRITTEN 10-22-2008 09:26:05) N40 (MODIFIED 10-23-2008 09:37:19) N50 #101= 1 ( NO. 7 DRILL ) N60 #102= 2 ( NO. 21 DRILL ) N70 #103= 3 ( NO. 29 DRILL ) N80 #104= 4 ( .25-20 TPI TAP ) N90 #105= 5 ( 10-24 TPI TAP ) N100 #106= 6 ( 8-32 TPI TAP ) N110 G17 G54 G90 N120 G40 G49 G80 N130 G53 G00 Z0. N140 G53 G00 X-20. Y0. N150 G52 X0. Y0. N160 ( TOOL #1 IS A NO. 7 DRILL ) N170 G53 G00 Z0. ( RESTART TOOL #1 HERE ) N180 G53 G00 X-20. Y0. N190 T#101 M06 N200 S1234 M03 N210 G54 G00 G90 X1. Y1. N220 G43 Z0.25 H#101 D#101 M08 N230 G81 G98 R0.1 Z-0.25 F6. L0 ( Call Drill Cycle) N240 M98 P1610 N250 G52 X5. N260 M98 P1610 N270 G52 X10. N280 M98 P1610 N290 G52 Y3. N300 M98 P1610 N310 G52 X5. N320 M98 P1610 N330 G52 X0. N340 M98 P1610 N350 G80 (Exit Drill Cycle) N360 G52 X0. Y0. N370 G53 G00 Z0. M09 N380 G53 G00 X-20. Y0. N390 M01 ( OP STOP ) N400 ( TOOL #2 IS A NO. 21 DRILL ) N410 G53 G00 Z0. ( RESTART TOOL #2 HERE ) N420 G53 G00 X-20. Y0. N430 T#102 M06 N440 S1234 M03 N450 G54 G00 G90 X0.5 Y0.5 N460 G43 Z0.25 H#102 D#102 M08 N470 G81 G98 R0.1 Z-0.25 F6. L0 ( Call Drill Cycle) N480 M98 P1710 N490 G52 X5. N500 M98 P1710 N510 G52 X10. N520 M98 P1710 N530 G52 Y3. N540 M98 P1710 N550 G52 X5. N560 M98 P1710 N570 G52 X0. N580 M98 P1710 N590 G80 (Exit Drill Cycle) N600 G52 X0. Y0. N610 G53 G00 Z0. M09 N620 G53 G00 X-20. Y0. N630 M01 ( OP STOP ) N640 ( TOOL #3 IS A NO. 29 DRILL ) N650 G53 G00 Z0. ( RESTART TOOL #3 HERE ) N660 G53 G00 X-20. Y0. N670 T#103 M06 N680 S1234 M03 N690 G54 G00 G90 X1.5 Y1.5 N700 G43 Z0.25 H#103 D#103 M08 N710 G81 G98 R0.1 Z-0.25 F6. L0 ( Call Drill Cycle) N720 M98 P1810 N730 G52 X5. N740 M98 P1810 N750 G52 X10. N760 M98 P1810 N770 G52 Y3. N780 M98 P1810 N790 G52 X5. N800 M98 P1810 N810 G52 X0. N820 M98 P1810 N830 G80 (Exit Drill Cycle) N840 G52 X0. Y0. N850 G53 G00 Z0. M09 N860 G53 G00 X-20. Y0. N870 M01 ( OP STOP ) N880 ( TOOL #4 IS A .25-20 TAP ) N890 G53 G00 Z0. ( RESTART TOOL #4 HERE ) N900 G53 G00 X-20. Y0. N910 T#104 M06 N920 S1234 M03 N930 G54 G00 G90 X1. Y1. N940 G43 Z0.25 H#104 D#104 M08 N950 G84 G98 R0.1 Z-0.25 F50. S1000 L0 ( Call Tap Cycle) N960 M98 P1610 N970 G52 X5. N980 M98 P1610 N990 G52 X10. N1000 M98 P1610 N1010 G52 Y3. N1020 M98 P1610 N1030 G52 X5. N1040 M98 P1610 N1050 G52 X0. N1060 M98 P1610 N1070 G80 (Exit Tap Cycle) N1080 G52 X0. Y0. N1090 G53 G00 Z0. M09 N1100 G53 G00 X-20. Y0. N1110 M01 ( OP STOP ) N1120 ( TOOL #5 IS A 10-24 TAP ) N1130 G53 G00 Z0. ( RESTART TOOL #5 HERE ) N1140 G53 G00 X-20. Y0. N1150 T#105 M06 N1160 S1234 M03 N1170 G54 G00 G90 X0.5 Y0.5 N1180 G43 Z0.25 H#105 D#105 M08 N1190 G84 G98 R0.1 Z-0.25 F50. S1000 L0 ( Call Tap Cycle) N1200 M98 P1710 N1210 G52 X5. N1220 M98 P1710 N1230 G52 X10. N1240 M98 P1710 N1250 G52 Y3. N1260 M98 P1710 N1270 G52 X5. N1280 M98 P1710 N1290 G52 X0. N1300 M98 P1710 N1310 G80 (Exit Tap Cycle) N1320 G52 X0. Y0. N1330 G53 G00 Z0. M09 N1340 G53 G00 X-20. Y0. N1350 M01 ( OP STOP ) N1360 ( TOOL #6 IS A 8-32 TAP ) N1370 G53 G00 Z0. ( RESTART TOOL #6 HERE ) N1380 G53 G00 X-20. Y0. N1390 T#106 M06 N1400 S1234 M03 N1410 G54 G00 G90 X1.5 Y1.5 N1420 G43 Z0.25 H#106 D#106 M08 N1430 G84 G98 R0.1 Z-0.25 F50. S1000 L0 ( Call Tap Cycle) N1440 M98 P1810 N1450 G52 X5. N1460 M98 P1810 N1470 G52 X10. N1480 M98 P1810 N1490 G52 Y3. N1500 M98 P1810 N1510 G52 X5. N1520 M98 P1810 N1530 G52 X0. N1540 M98 P1810 N1550 G80 (Exit Tap Cycle) N1560 G52 X0. Y0. N1570 G53 G00 Z0. M09 (UNLOAD HERE) N1590 G53 G00 X-20. Y0. N1600 M30 (END OF MAIN PROGRAM) O1610 (NO. 7 DRILL .25-20 TAP) N1620 X1. Y1. N1630 X2. Y1. N1640 X3. Y1. N1650 X4. Y1. N1660 X4. Y2. N1670 X3. Y2. N1680 X2. Y2. N1690 X1. Y2. N1700 M99 O1710 (NO. 21 DRILL 10-24 TAP) N1720 X0.5 Y0.5 N1730 X1.5 Y0.5 N1740 X2.5 Y0.5 N1750 X3.5 Y0.5 N1760 X3.5 Y1.5 N1770 X2.5 Y1.5 N1780 X1.5 Y1.5 N1790 X0.5 Y1.5 N1800 M99 O1810 (NO. 29 DRILL 8-32 TAP) N1820 X1.5 Y1.5 N1830 X2.5 Y1.5 N1840 X3.5 Y1.5 N1850 X4.5 Y1.5 N1860 X4.5 Y2.5 N1870 X3.5 Y2.5 N1880 X2.5 Y2.5 N1890 X1.5 Y2.5 N1900 M99 % Last edited by JWK42; 10-23-2008 at 10:45 AM. Reason: spelling |
![]() |
| 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 |
| G-code editor? | gearsoup | G-Code Programing | 17 | 11-28-2011 08:06 AM |
| Newbie- Using VB as a G-Code debugger / editor | BonusODJ | Visual Basic | 1 | 12-22-2008 01:49 AM |
| G Code Editor | nykie | Visual Basic | 3 | 06-17-2008 02:12 AM |
| New M&G code 3D Viewer, Editor, DNC Dripfeeder and optimizer software! | BinaryCam | Product Announcements & Manufacturer News | 4 | 05-05-2007 08:56 PM |
| Looking for g-code editor | avengine | CNCzone Club House | 8 | 04-28-2006 01:01 PM |