How to CNC machine a part from start to finish

Several readers have asked me for a post explaining the entire part creation process starting with a part concept, going through fabrication and ending with the part in use. I use a ZAY7045 (RF45 clone) Milling machine that I converted to CNC to make parts for my projects. In this post I will be sharing the details on the CAD design of parts, CNC coding, and fabrication process. I will be using a two different pieces ( a headlight mounting bracket and a speedometer mounting bracket) I made recently for my Honda CX500 Cafe Racer build to illustrate and outline the basic process of CNC fabrication of custom components. I will keep the details simple such that everyone can understand how the CNC fabrication process works.

All parts start with a need, in the photo above, I need a bracket to locate and mount a single gauge to the upper triple clamp on my Cafe Racer Motorcycle Project. I start by holding the speedometer gauge in place and taking some measurements. It’s critical to carefully measure details like mounting bolt hole spacing. As a rule of thumb I measure the smaller and larger dimension and take the midpoint between those numbers. Here’s a Zac Shop Tip: if you measure and calculate 138.43 mm, it is very likely the actual value is the next nearest whole or half number, ie. 138.5mm. After writing down the measured values on a small notepad, I next go to the computer to draw up the part.

After careful measurement, it is time to draw up your part in a CAD software package. I’m quite fond of Dassault Systems, Draftsight software for generating simple DXF and DWG drawing files. I am familiar and proficient with Solidworks, a 3d design software package which makes using the free Draftsight .dwg/.dxf CAD software an easy experience. The above screen shot shows my version 2.0 headlight mounting bracket as drawn in draftsight. You can see the part layer in white, the cutting layer in magenta, and the milling layer in green. I manually set cutter offset in my drawings (a topic for another more technical post). Each layer will have a different code generation step in the next part of the process. Separating them out here makes life easier later on when generating the G-code for the CNC Milling Machine.

The CNC code generation software I use is not great, but I can not afford very expensive enterprise level software for this stage and thus I make do with what I have available. I use this software to put the basic building blocks of the code in place. I then rearrange, and edit the Gcode (CNC Machining programming language) into a form that is more usable and efficient. The above photo shows a screen shot of the step in the process where I can set individual layer settings for the cutter. You may recall I explained the need to generate separate layers earlier in the post and this is the purpose. If you do not separate operations into layers you end up having to do a lot of tedious manual editing of your CNC Gcode program.

After chaining the layers together, so that the machine can generate code that does an entire loop in one go vs each individual drawing item one at a time, the software generates a basic G-code program. I then carefully reorganize, and edit the code to make the program safe, do what I want, and in most cases more efficient. The software tends to break things down such that the machine spends a lot of time traveling between points of entry into the material. I reorganize the code snippets to minimize this which in turns shortens the machining time considerably.

The above photo, is the Gcode generation for the v1.0 headlight mounting bracket. I made this first part as a fast test of the mounting location and strength of the 1/4″ thick 6061 aluminum plate I would be making this part from. I will use this part in the next couple pictures vs the V2.0 headlight mounting bracket we’ve seen in the post so far. I did not plan to put this post together ahead of time and missed some pics in the process with the v2.0 mount. Rather then wait till I build the next part, I wanted to get this up to help my readers understand the process as soon as possible.

Above you see a screen shot of the CNC machine control software running the machining process. After lots of careful checking and setting a zero point on a larger piece of metal “stock” clamped into the machine I start the program and the machine does the rest. This is really fantastic when you are making 4 of one part as after the first time the code has run through and is validated I will start the program and leave to do other tasks in the shop. My CNC machine is not 100% self sufficient yet, so I periodically monitor it when it runs. The number one problem with my current set up is coolant spraying everywhere making a real mess. I plan to place the machine in a full enclosure at some future time.

The above photo shows the cafe racer headlight mount version 1.0 in place on the bike. While this was a functional part, I learned I needed three changes for version 2.0. The first change is that version 2.0 needed to be less ugly. Aesthetics are important on some projects, and my Cafe Racer is to be a thing of beauty. Secondly I learned that I wanted to raise the headlight another inch or so in version 2.0. Third I needed a slot to keep the headlamp from rotating, especially important to prevent it rotating with riding vibrations over time.

Above you can see the version 1.0 and version 2.0 parts together. Clearly version 2.0 is superior in every way.

Above is the finished and painted bracket with the headlight mounted on the bike. I am quite happy with the way it came out in the end.

Similar to the headlight mounting bracket, I generated the code for the gauge mounting bracket for the speedometer. This program required considerably more reorganization of the code to make run efficiently. I use a simulation to determine the program run time. The “as generated” Gcode had a run time of almost 45 minutes. I managed to get that down to 28 minutes by manually editing and reorganizing the G-code in the program.

Now for a bit on post CNC machine processing of parts. I start by deburring all of the edges with either a deburring tool, a fine file, or sandpaper. The machining process often leaves razor sharp burrs on the edges where it cuts the metal. The parts used as examples in this post were primarily deburred with sandpaper. I then wash them with warm soapy water to remove any cutting oils and coolant left on the part. A quick trip to the sandblasting cabinet and they are left with a fine surface finish ready for paint. Another trip to the shop sink to wash off any residue sand from the blast cabinet and they are ready for painting.

I often paint small parts like these brackets hanging from bits of bent copper wire through a bolt hole. Several light coats of a quality paint results in a hard durable finish. A hairdrier (buy one especially for this purpose, do not “borrow” your significant others for painting car parts) can be used to help flash dry the paint between coats, or in the winter time cure the paint quickly in colder temperatures.

Here’s the finished CNC machined bracket on the bike.

I am very happy with the way these parts came out and the overall look on the bike as this project progresses. If you want more information on these parts (drawings, etc) or would like me to make one of these parts for your CX500 motorcycle project, leave a comment on this post or email me at zac at projectsbyzac.com. I hope this helps my readers understand the process of how to make parts with a CNC machine. When I finish my 3d printer project I will do a similar post on 3d printing parts from start to finish.

I’ve gotten a number of requests for the drawings I used to make these parts. Here are the DXF files I used to mill each of these brackets, this was before I had real cam software so they are ofset by 0.125 for G-Code generation via very primitive software. I had to convert the DXF to PDFs to share them with you in wordpress. It claims DXF is a security risk. You can convert back or open them in your cad software and everything should still be ok. CX500 front light mount & cx500 guage mount

I now use HSMexpress. It’s free and integrates with solidworks nicely and generates very easy to use programs. In the past I used DXF to gcode programs. I tried several of them, all worked ok but required tedious manual post editing to make usable.