Now we need to generate the g-code which will control the CNC router. G-code is simply a series of commands. Basically it is just a bunch of:
go this fast
and so on.
Sometimes it is really nice to have a simple program which does the one thing you need it to do perfectly. Freemill
allows us to read in a .stl file and generate the gcode to cut out a surface. Perfect. Just follow the wizard.[Load Part]
Just import the .stl file you just created.[Set Cutting Direction]
You can cut from the top or the bottom. I wanted to make a mold for plaster so I am choosing to cut from the bottom.
(If your object is tilted oddly you'll have to alter that in the 3D modeling software. In Hexagon 2 you can just load the part and then alter the properties to align it with the axis)[Create Stock Model]
Add material to the side if you want, I'm not going to.[Set Parting Plane]
Just skip this step for now. We are going to come back to it.[Set Machine Zero]
I am picking the top. I want the top to be at zero so I can easy scale the g-code later on.Step Backwards to [Set Parting Plane]
Here I am going to pull a trick. I want to cut all the way down to the parting plane inside the mold, but not outside. We are going to do a little trick in notepad after this step, so for now, set the parting plane to something low and even. It will show Z Max = 0. We want it this way. Change the parting plane elevation to -2.0 (it doesn't like it if you type the - first. Type 2.0 and then add the - sign).[Create/Select Tool]
Input the dimensions of your cutting tool. Now be careful, I don't think this is checking for bit crashes. We will have to keep this in mind later when cutting. [Set Feeds & Speeds...]
Input your feed rates.[Create Machining Operation]
I prefer to cut along the Y-axis because my CNC works better that way. You can do that however you'd like to. Set the stepover distance. A smaller distance will give you better resolution, but it will take a long time. Of course that is the nice thing about CNC, you can let it take a long time and take a nap or eat a sandwich.
Also, right now this model isn't scaled properly. I want it to be the same size as my head. I am going to change the scale using a g-code command later, but it is important to note that the cutting spacing will be scaled too.[Post-Process Operations]
If there is a post-processor that is better suited for you, pick that. I just used Mach3-Inch. Click 'Post' to generate the g-code.G-Code tweaks
As I mentioned before, we are going to alter this g-code in notepad. First, I deleted out the extra stuff at the beginning. I don't have spindle control or anything like that. All I need are the goto and feed speed commands (G00, G01, F). There are also a few at the bottom, but those wont matter (delete them if you want to).
Now, being sneaky, I set the parting plane below the part at a nice even -2.0. If you open the gcode file in notepad you will see commands like 'Z-2.000'. We are going to change all those to Z0.000 so that it does not cut around the object. go to Edit -> Replace and switch Z-2.000 (or whatever depth you used) to Z0.000 (or whatever you want your top surface to be).
Bingo, we got rid of that extra cutting. There are two other lines that need to be fixed. At the beginning and end the code it is going to a low Z value. Change those to Z0.000 as well.
Now we have the g-code all ready to go. Lets crank up the CNC.