Shop Tour

Other Interests

 Hand Engraving Simulation CNC

Tool Path GCode


Arrow Pro



Example programming using Tool Path Gcode
by Steve Lindsay

For this example I will be generating the gcode for the above part.  This piece measures approx. 1/2"x3/8" and 3/32" thick.

In the 2d drawing below the part is drawn in red and the toolpaths are in yellow. Three end mills will be used to mill this part (1/8", 1/16" and 1/32"). Drills used are a #0 centerdrill and a #55 drill

The part outlines were drawn with plines and arcs. I then used pedit to join the entire outline into one polyline. The tool paths were then made by offsetting off of the part. As you can see the outermost toolpath will "rough" the profile out full depth of .092". It is set out from the part to leave an extra .004" stock. The 1/8" endmill will also go through the middle of the part cutting the slot through the middle. The depth of this cut will be half the thickness of the part (.046"). We then want to do a tool change and use a 1/16" endmill. This path goes around the part twice taking .002" each time. The next tool change is now done and the 1/32" cutter is used. The endmill is used to cut the ridges in. These are to have the same radius as the 1/32 cutter (1/64"). So what I have done is drawn the tool path so the cutter moves to each position and comes in the correct amount and then back. So each little line you see that goes to the center of the radius actually is two lines. One going into the part/radius and one returning and then continuing on to the next position. Pedit was use on this path too joining all into one path (polyline). The final tool change is for the holes that are drilled first with a center drill and then a drill.

Above is a close-up of the start and end of the 1/16 tool path. I used offset twice.....one at .0176" and the final cut at .0156". I then trimmed the ends back just a little and drew a line between them connecting them and then using pedit turning them into one polyline with pedit's "join" command.

Now it is time to start putting the gcode file together.
I will be using the "polygcode" option in AutoGCode but first it is helpful to know which direction the toolpath lines (polylines) have been drawn and are stored in autocad's database. To discover this use the "Edit" option in the autocad command pedit. At the autocad command type: "pedit". You will be prompted to select a polyline. Select a tool path and then type: "e" for edit, and begin hitting enter a few times. You will see a highlighted x moving from vertex to vertex on the polyline you selected. Notice which direction it is moving and decide if you would like your endmill to move this way or the opposite direction. Cancel out of pedit once you discovered the direction it is stored in autocad. Also before use "ToolPath GCode" be sure you have autocad's UCS origin (0,0) where you want it. I set it to the center of the hole to the left in the drawing. When you setup your part in the mill you will use this for reference to know where to set the X0 Y0 axis over the part/stock you will be milling.

To load ToolPath GCode in Autocad click on "Tools" "Load Application" and find and select the GCode.lsp file and click "load". At the autocad
command prompt type "gcode" to start the program.

From the ToolPath screen click "Run" to the Poly GCode function. You are now prompted to select a polyline. Click on the 1/8" toolpath. The next prompt asks if you want to create a new gcode file or append an existing one. We will be starting a new file so choose new. A file dialog box will appear for moving through the directory structure allowing you to select a existing file to replace or to type in a new one. The next prompt asks "Do you want the cnc jog direction to be reversed from what the polyline was created? ('Y' 'N')". This is the question you were determining above when using pedit to discover the direction the vertexes are stored in autocad. The function will now write the toolpath polyline gcode information to the file and close.   Find the file on your harddisk and open it with notepad.  Edit the code as desired and save the file.