Fun With CNC #2: CAD to CNC Machine Workflow

72
3

This is part 2 in a 2 part series: Fun With CNC

EDIT: I change the name to reflect the actual purpose of the post

Let's Make Some Boxes
So we all make boxes, right.  There are all kinds.  Fancy ones for gifts, ones slapped together from scraps for whatever reason or maybe utilitarian ones where we need a specific size,  shape or purpose.  This is for the later.  It is probably more accurate to call it a housing than a box but that is just a another way to say box.  It will have 6 sides, with various cutouts and I did most the cutting and machining with my CNC.  I made two of them that are slightly different from each other.   Nothing fancy and this not a craftsman exercise.  I just need a box and could not find a metal or other one cheap enough to fit my purpose or and cost goal.  I can make it.  In this example, you may see how anal and just how lazy I can be at the same time. 

My goal with this post is not to talk about making boxes on the CNC but to show a little about the current state of my design to machine workflow.    I really enjoy this process and it continues to evolve.  I call myself a hybrid wooodworker because I may use my CNC and hand planes on the same piece of wood and I did on this one as well.   This is a very simple project (its a box) so hopefully I won't wander too far off into the weeds or annoy you too much with with my musings that are probably only funny to me. 

The Purpose of the Box and Requirements:
As part of my #jumptheshark upgrade path to get off my CNC off of Next Wave's proprietary hardware, I chose to buy a 2.2kw/3HP 240v water cooled spindle off of Amazon because it is cheap, pretty standardized and plenty of online information about configuring it.   My CNC is not really near the wall were most of the power receptacles are in the shop so I usually use extension cords for it.   I want a beefy enough power supply nearby and my strategy is to run a couple of new  20 amp circuits (a 120 and a 240v) to the ceiling nearby and drop some heavy extensions cords from locking receptacles connected to receptacle boxes that I can basically put anywhere I need them.  You can find small boxes at Home Depot to to this but I wanted to add a power switch to shut off the power, GFCI for the 120v (at least) and have a locking connection for the drop down to connect the receptacle box.  I toyed with several off the shelf solutions but finally decide to just make my own.  The 120v box will have 4 GFCI protected outlets and a switch and the 240v box will have 1 outlet and a switch.   Both have locking recessed plugs to connect them to power.   I may decided to add an inline 240V GFCI on the drop cord for added safety but my concern there is that I have read that VFDs by their nature  (1 phase to 3) can create imbalances that trip GFCIs. 

Just make the boxes for crying out loud
Hold on.  Unless I actually spend a minute finding the components, measuring them, accounting for interior space requirements, etc. before creating a plan, I will build at least one box that ends up in the trash.  My usual workflow is to use some sort of CAD to draw up and check the design against components that go into it and use that to build a workable plan.  I often do this for just everyday woodworking designs  too but especially when I plan to use my CNC to machine it.   My current software stack is to use Onshape for design and Vcarve for the CAM (translation from design to CNC toolpaths).  Vcarve has some sort of the basic CAD toolkit and  that usually gets used during the translation.   It is 6 sides with holes in the appropriate places and I used rabbets for the joinery. 

A 3-gang box for 240v with a place to connect the power cord on the end.   


The great thing about parametric CAD is that I made a copy, increased the box length dimension to accommodate a 4-bang box and had the second one ready in seconds and I now have dimensions for both, including holes and rabbet locations.   Onshape will actually create 3D objects that I could export and machine using a 3D strategy in Vcarve or even 3D Print, but this is basically just a 2D machining exercise.   The goal here was dimensions and layout assumptions as well as a validation of my joinery strategy. 

Draw it up.  
To show sort of how I worked through this in a parametric framework, here is the a screenshot from Onshape that includes all of the pieces.  Onshape basically documents each operation that you took to create the design and you can go back and modify any step along the way or even change the order that they are done in and cascade the changes into the final result -- literally seconds after the changes are saved.   



The three planes shown are the line drawings/sketches that define the shape and layout of the the sides, top and bottom, including rabbets and cutout locations.  I drew them on different planes just to keep them straight but you do not have to (probably a best practice).
On this one I chose to use variables, (the {X} tagged lines) to adjust the dimensions.  I do not always do this but on this one, it made it easy to tweak the dimensions without modifying dimensions directly in a sketch/drawing.  It also allowed me to change the material thickness quickly so that if I switch from the 1/2" (12mm) BB plywood to a MDF with a different thickness, I can change it with one edit.  And to turn it from a 3-gang to a 4-gang version, I simply increased the #internal-lth variable by the width required for one more receptacle and all of the drawings and subsequent parts adjusted accordingly.  In this case the constraining dimensions are the interior height length and width and the outside dimensions will adjust based upon the material thickness or if I change the interior dimensions.  The goal is to make sure that the stuff I I bought to put into the box will fit. 

Sketching itself is very intuitive.  You basically draw whatever shapes you want in 2D using various drawing tools.  The real power comes into play when you place constraints on the entities.   Some of the constraints are automatic such as when you use the draw rectangle tool, the corners are automatically square and the side parallel (among other things).  You can very quickly do a rough layout without worrying about dimensions and constraints but you can also add them as you go.  You can then assign dimensions that define the size but also define the relative location of other entities that in this case also define the placement and width of the rabbets.  In this case I defined the top and bottom using the same sketch because they are basically the same size but the top has a cutout where the faceplate will be  along with the rabbet but the bottom just has the rabbet so I can use the geometry in different ways when I create the separate top and bottom 3D shapes later. 



The rest of the lines on the first screenshot are about creating the 3D objects for visualization and I will not go into that here.  That step is not always  necessary from a modeling POV but sort of a sanity check to verify my design actually results in a box shape when I assemble all of the parts -- which is what the first screen shot of the 3 Gang box basically is.   

Translate the design and Prep for the CNC
Vcarve Desktop is the tool I use to create toolpaths (gcode) that the CNC's computer uses to move the router around.  There are other ways to generate that code but this is how I started and it basically works.  Using Vcarve along side Onshape this way is redundant from a design perspective and I do not always do the initial modelling in Onshape.  I only do that when I feel like I may need to make adjustments along the way as I make design decisions through the design phase.   Vcarve is not really marketed as a CAD package.  It has basic CAD capabilities that allow you to draw and manipulate shapes onto a 2D canvas but their bread and butter is more artistic designs -- the sort of things that most hobbyists envision when they start thinking about getting a CNC machine. 

There are a few ways to proceed from the Onshape modelling step.  The simplest is to simply capture the dimensions from the model and manually redraw the objects one at a time.  This is basically what you do when  just use Vcarve's native tools to do all of the design.  It it is not that different than how I drew the sketches in Onshape, it just isn't as flexible especially as I change the design.  In this example, because everything is sort of centered and symmetrical around a center point so it would pretty straight forward to do the entire design in Vcarve, albeit without the 3D visual feedback that a full blown CAD model provides. 

The second way is to export the sketches from Onshape and import them directly into the Vcarve.  I do this when things are not as nicely symmetrical or centered so that I do not have to create the relative arrangement again.   Vcarve does not provide the best tools for that.  You sort have to know where you want things placed.  This is because with Vcarve's artistic slant, most who use it, place design elements based upon how they look, not necessarily because they are engineering something useful or that functions a certain way.   Often my approach is a sort of a hybrid of both approaches in that I will import what I can to avoid redrawing things from scratch and preserve spacing and other relative relationships between drawn objects  I developed the Onshape design and then manually make adjustments to make the machining process easier to execute.  For example, the rabbets for the box joinery is very precise in the Onshape design but when it is time to machine them, cutting square pockets with a round bit requires over cutting to get a full rabbet in the right place.  This is usually where I screw things up because without the constraints of the parametric design, you are left to use the artistic tools and experience (past mistakes) to lay it out properly. The biggest risk at this point is the need to make changes in the design.  If I change the material thickness for example, I may have to make adjustments to the width of the rabbets and the outside dimensions for example without adjusting the net interior dimension I was shooting for.  Not that critical in this case but easy to screw up if you do not inspect and adjust each affected object correctly.  In the parametric approach the change cascades through the design but in Vcarve, without that linkage between objects, it is easy to miss dependencies and you have to deal with each change one at a time.  Even small changes can be pretty tedious to make.  When I machined this one, hand plane came in handy to adjust one of the rabbets I didn't get quite right when I laid it out in Vcarve. 

Here are the Onshape sketches after I imported them into Vcarve, moved and copied them around to define separate parts and cutouts and converted the rabbet entities into oversized pockets.   The  white canvas here represents the piece of flat plywood that the parts will be cut from.



Creating the Toolpaths
Once I have a layout, I use these drawings as paths for the CNC to follow.  For this type of project, you basically use pockets and profiles.   A pocket basically clears material from an area down to a specific depth and is what I used to make the rabbets.  A profile cuts out a shape.  The profiles usually go to full material depth but they do not have too. Profiles can be interior or exterior.

Here is the same drawings above with the toolpaths overlaid on them. 





I simply selected them all but I could view them one at a time.  Vcarve then allows you to simulate the toolpaths in a 3D view.  You can rotate the virtual results and look at it from various angles if needed.  Note that when you create each tool path you can tell Vcarve where you want tabs so that as you cut through the material, the piece stays attached and doesn't get destroyed by the moving router.  That requires clean up but not that much work. 


The rest is just taking the generated gcode files to the machine and watching it do its thing.  

Voilà -- Boxes

Not pretty but functional.  


Note that I 3D printed the face plates.  I found an OpenScad  design that allows you create custom switch plate layouts.  It did not include the 6-20R configuration I need for the 240v box so I had to modify it to do that.  OpenScad is more like a programming language than a CAD tool.  Think parametric design without actually drawing.  I only use OpenScad when someone else has done all the hard work and I can just tweak it to do what I want.   Definitely not going wander off into those weeds here.  Too nerdy for even me to enjoy using.  



--Nathan, TX. Hire the lazy man. He may not do as much work but that's because he will find a better way.

Nice work Nathan👍

There is a lot of computer time spent getting the design machine ready, but once that is settled, you can make one or one hundred.
Best thing is assembly, everything fits perfectly!

Also nice is you can do the computer work anywhere, no need to go out to the shop at 0-dark thirty if you get inspired.
Yep.  The real power of this approach is the repeatability.  I frankly do not use machine to make multiple copies that often but it is nice to have a ready to run set of toolpaths that I can whip out as needed to make another.  Of course, I have to make sure that I create enough documentation along with it so that I remember how to execute it again.  Vcarve has something called job sheets for this purpose, but IMO, it does not really have enough user input to help you self document.  It really just outlines the job as you currently have it setup in Vcarve itself -- well, based upon the few minutes I spent looking at it anyway.   I suppose I should look a little closer to see if I missed something  

--Nathan, TX. Hire the lazy man. He may not do as much work but that's because he will find a better way.

That is my problem as well for laser work. The software has the ability to create "project libraries" where notes and other details can be saved. My problem is I'm always in a rush to get to the end results and I never spend the extra minutes to detail the little things like setups, etc. that make the parts come out better.
Usually I'll open up a year old file and think "what the heck was this for?" 

At least it keeps things interesting!