![]() | |
| 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
| |||
| |||
Hey all still new to cnc here my ? is what g code can be used to increase z depth in a program for say a simple square without writing the 4 lines to outline the square an additional line for z(increase depth) and on and on I am still writing programs the long way(theres gotta b a easier way.lol) Thanks |
|
#2
| |||
| |||
| Put the code that outlines the square in a subroutine and then have the Z depth set before calling the subroutine. Exactly how you do this may depend on your machine; I use Haas and this is how it would be done: Say it is a 4" x 4" square, I would put the work zero at the center of the so the four corners are at; X-2. Y-2.; X-2. Y2.; X2. Y2.; x2. Y-2. To go around this square five times taking a cut 0.1 deep the code would be something like this: etc G00 X-2. Y-2. Z0. G91 G01 Z-0.1 M97 P1000 L5 G00 Z1. etc M30 N1000 G90 X2. Y-2. X2. Y2. X-2. Y2. X-2. Y-2. M99 This positions the tool at the corner of the square, increments down 0.1 and goes around the coordinates in the subroutine, returns back from the subroutine and increments down another 0.1 and back to the subroutine until it has taken five cuts. Notice each cut stops at the place it started. Of course this simple code needs other stuff, you would need a pilot hole or have a ramping move and you need extra moves to clear out the center of the square but this is the basic idea. Problem is some machines will not let you do an L count on a sub routined call.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#3
| |||
| |||
| In addition to using a sub there is the macro approach if your control handles it. Probably best to learn subs first. This site has some basic info http://www.cncci.com/resources/tips/...om%20macro.htm
__________________ Anyone who says "It only goes together one way" has no imagination. |
|
#4
| |||
| |||
| Thanks for the replies Guys! I have been tryin to learn mastercam and also have a conversational (simplecnc) program. Built a bench top mill with x18" y8" z7" in travel and runs on pc using kcam. I understand what u mean cyclestart and will keep practicing but a shortcut once in a while would b nice.lol Thanks for the example Geoff i'll give it a try |
![]() |
| 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 |
| Please Help!! Simple 3-D part not so simple for me | eaglegage | Mastercam | 16 | 05-15-2008 10:00 AM |
| Very Simple Part - Difficulties | John3 | General Metalwork Discussion | 6 | 08-20-2007 12:48 PM |
| Simple Aluminum Part | vadimvc | Employment Opportunity | 3 | 04-30-2007 03:51 PM |
| RFQ on simple part... | nate | Employment Opportunity | 14 | 04-28-2006 01:25 AM |
| Simple G-Code program? | N4NV | G-Code Programing | 10 | 03-24-2006 06:35 PM |