Back in November, I posted a short example of getting one of these into CNC, but I didn't use the method outlined there of using a CAM program to automagically create my G-Code files. I coded these by hand back in January. It's pretty straightforward (although tedious) to do. Basically, I got the motor mount drawings into my 3D design program (Rhino3D), the DVD I bought includes them in a standard format that Rhino can read, then got the dimensions for all the features. This was basically the centers of all the holes to drill.
The first step was to create a G-Code file to drill the holes with a center drill to mark their locations. G-Code files are plain ASCII, and the syntax is dirt simple. Here's a sample piece of code. It goes to two different holes and lowers the center drill, in a drill chuck, down low enough to mark the hole clearly:
G01 X 0.323 Y 0.323 Z 0.0250 F10This is far more than really needed to be written, but it's a text export from a spreadsheet (I use Apache Open Office because it's free and it does everything I've ever asked of Excel). G01 X xxxx Yxxxx Zxxxx Fxxx means Go to coordinates X Y and Z of the work at a feed rate of F (in inches per minute). The first line will drive the cutter to the point (0.323, 0.323, 0.025) at 10 IPM. All of these assume that the cutter was starting from a safe place, and it's my responsibility to make sure my machine won't cut itself or anything undesired. Once the cutter is at that point, I lower it to 0.125 below the surface at 1 IPM, then I retract it at 10 IPM and go to the next point. There's another GoTo command in G-code: G00. G00 is a rapid GoTo, set as fast as the machine can move. I could have easily made that third line read
G01 X 0.323 Y 0.323 Z -0.1250 F1
G01 X 0.323 Y 0.323 Z 0.0250 F10
G01 X 2.177 Y 0.323
G01 X 2.177 Y 0.323 Z -0.1250 F10
G01 X 2.177 Y 0.323 Z 0.0250 F10
G0 Z0.025moved the F10 to the next line, and had the same effect while saving some space. On my machine there isn't much practical difference between "as fast as you can go" and 10 IPM.
Once these holes are marked, I could have used the file to drill the holes to full depth, with breaks to change drill bits, or any degree of fancy I want. I did those manually, in what's usually called immediate mode. The machine controller has a command line, where I can enter strings of commands and repeat them with using a loaded file. I wasn't sure how fast I could drill, so I experimented by hand and drilled the holes slowly, peck drilling "manually", then feeding faster, and finally in one continuous move with no pecking.
The next step was to create a tool path to cut out the square hole in the middle. The drawing called out a 1/8" radius, so if I moved a 1/4" cutter in a square with the end points 1/8" in from the edges of the square, it will cut it out with that radius with one tool. I wrote a program assuming a hole big enough in the center to lower the cutter, the move to the edge, cut the four sides, lower the mill, cut the four sides, and then repeat until the cutter is below the bottom of the piece, cutting a little chunk of aluminum off.
G01 X 1.250 Y 1.250In reality, you don't want to keep cutting until you make the last path around the square. That piece in the middle is going to be held on by a progressively smaller and smaller piece of metal. Generally speaking, it's going to get yanked out of place and jam up the machine rather than politely fall to the bottom, not affecting anything. It could do Bad Things. I stopped the cut on the last side and then took the piece out by hand. Once it was out of the way, I resumed the cut and cleaned out the last of the metal in the hole. Here's a look at the last cut. You can see where the bit cuts through the light web of aluminum and leaves air behind it. This video stops before I stopped the machine to pop out that little cube with the big hole in it.
G01 Z -0.0250 F1
G01 X 1.777 Y 1.250 F10
G01 X 1.777 Y 1.777
G01 X 0.717 Y 1.777
G01 X 0.717 Y 0.717
G01 X 1.777 Y 0.717
G01 X 1.777 Y 1.250
G01 X 1.777 Y 1.250 Z -0.0500 F1
G01 X 1.777 Y 1.777 F10
I should probably powder coat these. I'm not sure what color, but the only powders I have now are for fishing lures: white, chartreuse and an orange-red. None of those seem quite right.