Saturday, January 10, 2015

Pinewood Derby

My 10 year old wanted the CNC router to produce carve his pine wood derby car, so I obliged.
I decided to use Sketchup to create the car's geometry, because Sketchup is easy to use.  The downside is that it has a polygon soup model of the world, but this wasn't a problem for us in practice.

The first thing we did was to cut a number of blanks out from a spare 2 by 4, because, as I told Peter, "Nothing has come out of the router right the first time."  This was a wise move, because we learned a lot from this project.

I decided to use SketchUCam v1.2 to generate the G-Code from Sketchup.  It generates G-Code, but in my experience getting it to generate the right G-Code can require some creativity.  It had problems when the car was aligned with the axis, which I was able to solve by offsetting the car by about 2 millimeters along the X and Y axes.  It doesn't seem to take the bit size into account, but I was able to compensate for that by making some of the features on the car extra large.

But the biggest problem was that the G-code would repeatedly go over the same space over and over again.  Fortunately SketchUCam generates very nicely structured G-Code, and it was easy to write an optimizer for it, which I've put on github here. It looks for repeated traverses, and replaces them with traverses to the next non-repeated section.  It tries to just be a peephole-optimizer; I figured that if I started tracking the space the that G-code had carved I might was well convert from Sketchup to G-Code myself.

The milling parameter that took the longest to get right was 1mm per pass; it was hard to get right because I tried being overly aggressive to save time.  It didn't save tine.  Even at 1.5mm per pass my machine would occasionally stutter.  Another thing that we got were wrong was choosing a bit without a square end; that version of the car had some cool V-stripes up and down the car's length.

The final run skipped a few steps at the end and I had to stop it after it ran through the cockpit dome, bit that was easily fixed with a bit of wood putty. I was able to restart the job without homing switches, probably because of the amount of practice with the blanks. 




No comments:

Post a Comment