Maximizing Toolpath Quality with madCAM

I’ve been using madCAM to generate all my toolpaths for a few years now, and I have to say I really love it.  Since the machine I use is 3-axis, I’ve been using the entry level version, which sells for $750, which puts it squarely in the “budget” range of CAM software.  That being said, I have yet to find myself wanting, and would not hesitate to recommend madCAM to anyone looking for a CAM plugin for Rhino.

A big part of what I like about madCAM is the fact that it exists as a plugin for Rhino3D.  There are a few advantages to this, given that I use Rhino3D to do all my surface modeling.  First, it keeps me from having to learn another interface.  Second, since I don’t have to export the model, I know that there is no generation loss.  If I had to export my model, say as a .stl file, that would be a conversion of the geometry, with possible generation loss.  Third, since madCAM generates its toolpath based on the Rhino mesh settings, the quality of the toolpath can be easily manipulated by changing the Rhino mesh settings.

It’s this last point that I think represents truly the most important feature of madCAM as it relates to my work.  For people doing “mechanical” type of work, this is not as important.  However, if like me, you are trying to machine plugs and molds of “organic” shapes, the ability to really refine the level of detail in your toolpaths is crucial.  For those who have never generated g-code, the important thing to know is that there are only two types of lines in the g-code universe – straight lines, and arcs.  That’s it.  All your fancy/swoopy/orgainc/NURBS stuff is eventually going to get broken down into either straight line segments, or arcs.  HOW it gets broken down is one of the largest factors determining the quality of your machined parts.  What I’m going to show with this post is how to set your madCAM and Rhino settings to maximize the quality of your toolpaths, so that your machined molds and plugs require an absolute minimum of hand finishing.

The first thing to do is to set the Rhino mesh settings per the madCAM manual, or even better.  Here is how I set my Rhino mesh settings:

The really important one for the machining that I do is the maximum angle setting.  Notice that I have it set to 0.5 degrees, which is very fine.  Also, I have Maximum Distance, edge to surface set to 0.0001.  In the madCAM Settings tab, I also set the System Tolerance to 0.0001:

There is one more setting to dial in, and that’s the tolerance on the individual tools.  For my tools, I set the tolerance to 0.00015:

Now, if you try to look at your model in Rhino in either the “Shaded” or “Rendered” mode, it will go VERY slowly, simply because the mesh is so incredibly dense.  So, I suggest putting all your viewports into “Wireframe” mode.  If you’ve dialed in your Rhino mesh settings like I’ve shown, and put all your viewports into Wireframe mode, now would be a wonderful time to save your “empty” file out as a Template file.  This way, you only have to open up a new file when you want to make g-code, and use your template file to set all your settings:

Typically, I save a copy of part I want to machine with _Tooling appended to the end of the name, start a new file, use my madCAM template, import my _Tooling file and then save it over the original _Tooling file.  This is the easiest and fastest way to reset your mesh and viewport settings for toolpath generation.

Here’s something I’m working on right now, it’s a simple part, but it’s a good demonstration of how manipulating the Rhino mesh settings affect the toolpath quality:

I’ve created a toolpath to machine the top of this piece, which you can see below.  The cyan curve was used as a boundary curve, and I used the Curve Milling ->From Boundary Curves to make the toolpath, with the tool zig-zagging in y:

Now let’s look at the individual line segments that make up the toolpath.  Like I said – even though this is a smooth shape that is based on NURBS cuves, the toolpath can only be lines or arcs.  In the case of madCAM, it generates lines.  So, to evaluate the density of the linework, we just have to turn the points on in Rhino.  Here’s what that looks like:

What I’m looking for is enough point density so that the surfaces don’t look faceted when they are machined.  This looks nice to me – you can see that there are some lines along which the points align, but from experience I know that this type of density will look very nice when machined.  Here’s another thing to look out for – look at the areas where the toolpath makes hard turns, and make sure that it looks nice and orderly:

This “crease” in the linework looks well defined and clean, which is what we want.  Here’s another section of the part –  you can see that the toolpath is quite dense:

The non intuitive part of this is that the hardest parts to get really nice and smooth are the parts where very little is going on.  If you have a surface with just a tiny bit of curvature to it, that can often be harder to get right than something with lots of curvature.  I figured it might help to show what it looks like when things are not setup correctly.  With all the mesh and tolerance settings increased, here’s what that hard edge now looks:

Notice how along the “crease” some of the toolpaths are “jumping across” the crease.  This will result in a much less well defined edge on the part.  Now look at the general point density:

You’re going to get a much more faceted look with linework like this – the points are much more spread out, the line segments are longer, and you can see in many place the points align with each other in a way that will create flat spots in your part.

So, why not just turn the settings up even further that I have?  Well there’s two reasons.  First, as you increase the density of your mesh, it will take longer to generate the g-code.  Second, at a certain point, the density of your linework may overwhelm the ability of your mill to process the data.  When I have gone too dense in the past, the end result has often been something that looks worse than the same part cut with slightly less dense linework.  So, the mesh settings and tolerance settings may work for you, but they may not.  I’m using a machine controller made by AjaxCNC running Mach3.  This particular hardware communicates via the ethernet port instead of the parallel port, as many controllers do.  It’s possible that the linework generated with these settings will overload a machine running on the the parallel port, but really I can’t say that for sure.  The lesson here is that each setup is unique, and figuring out what works on your machine is a constant work in progress.  So approach each machine with patience, and lots of cheap stock that you can cut tests with.

4 Responses to “Maximizing Toolpath Quality with madCAM”
  1. Bill Dodson says:

    Just a post to share what I’ve used in past lives.

    I spec’d and purchased a “foam mill”/cnc router for my last job, from They publish their price lists on line, which to me says tons. We ended up with a custom 20’x11’x4′ mill
    with an extra router axis pivoting about the 20′ direction (in hindsight I would have left this out for the extra stiffness so I could cut faster and keep accuracy, or had some way to lock it out, as 99% of our work was 3 axis, and the servo just sits there straining to hold the head straight) and controls and wiring for a table rotary axis. The mill envelope was limited only by the maximum cable length allowable between the controller and servos. I believe the mill cost us less than we could have built our own for, and was clearly a fraction of the price of anything else on the market with the same capacity (I’d say one third) and they were great to deal with. They make very clever use of technology to retain accuracy while keeping price down, and it works. We could not have built it ourselves in the time we got it, nor had it work the first time. It cut aluminum at a conservative rate, and could cut dense foam, ply, mdf and acrylic all day long. The maker claims .003″ accuracy across the full envelope.

    We used VisualMill initially, which turned out to be a good value for the price. They now sell it as RhinoCAM running directly inside Rhino. I was very happy with its features. We upgraded to the high end version eventually at $5K for the extra axis. It is fairly intuitive; I was able to teach a number of other folks to use the software pretty quickly. I think they have a free version of their older basic package on line that might be worth checking out.

    My foray into CNC mill design and NC programming came from the desire to learn to cut accurate tooling within tolerances required to make sailplane wing molds. After15 years of fiddling, I know a lot about what does not work and what barely works adequately. The software input asks for a max deviation from the surface, and approximates it by a series of tiny straight line segments within the tolerance. These do not line up from pass to pass, even with all passes started from the same direction on the final cut. I am thinking perhaps of generating my own nc code in excel line by line from smoothed airfoil coordinates, and scaling them along the cut so each xyz station along the cut lines up from root to tip so the cut facets line up. Next I would probably try to generate chordwise circular interpolation (center, radius, start angle, stop angle) cut calls rather than xyz go-to’s to do the same thing to see if that could be done with greater smoothness.

    We also purchased a CNC hot wire cutter intended for architectural shapes that could support up to 16′ or so cutting wire with a rotary table accessory. Built a frame to allow us to vary the width of the setup and maintain alignment. Figured out how to set up foam blocks on the rotary table and cut complex fuselage shapes in bead foam guided by RhinoCam. While only good to about .030″, this is often more than adequate for customers needs (particularly fuselages). We could cut, glass, fill and smooth a male plug for less than the 18 lb foam alone would have cost on the mill, and do so faster. A two place side by side cockpit was about the limit of its capacity.

    So you can see why I am excited to see what you are doing.


    Wingsmith (Bill Dodson)

    • Bill –

      You said a lot! I think you absolutely nailed it when you said “After15 years of fiddling, I know a lot about what does not work and what barely works adequately.” A lot of what we do with this technology seems to rest on a razor’s edge – it’s often a real wake up call for people when they realize that the CAM software or mill they just bought will take them years to master. But when you do find that sweet spot, on a professional level that’s what I live for.

      There is a way with madCAM to set the maximum deviation between the toolpath and the model. Since madCAM generates the toolpath off the Rhino mesh, the “Maximum distance, edge to surface” setting effectively does the same thing.

      With regards to exporting circular interpolations, I should go back and finish off and update my posts on KevCAM. You can generate toolpaths like you want very easily. Once you have them, in Rhino you can use Curve->Convert->Curve to arcs. You can fiddle with the tolerance settings to get an arc polyline that fits your NURBS curves well below your tolerance. The only trick after that is exporting it as arcs, which is something I’m hoping to be able to do. I think for the types of things we do (wing molds) this should yield some fairly spectacular results both in terms of smoothness and feedrate. I know that these machines far prefer to process arcs instead of tiny line segments, and of course this gets rid of all the “faceting” issues you and I have.


  2. Do you mind if I quote a few of your articles as long as I provide credit and sources back to your website?
    My blog is in the very same area of interest
    as yours and my users would definitely benefit from a lot of the information you present here.
    Please let me know if this okay with you. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: