Thursday, January 3, 2013

New Project - CNC/3D printing

While physical computing has captured my fancy the past few years, one thing that seems to have frustrated me is the physical construction for my projects. I have a degree in Mechanical Engineering, though I went into Software Engineering professionally, so that struck me as odd. I think I've grown accustomed, spoiled even, on the fantastic availability of free and low cost tools available in the software world. I'm used to having as powerful tools to develop software as a hobby as the professionals use. Not so with hardware. Things are getting better though.

I've decided to take it to the next level, and I'm investing in a small CNC that will also be capable of 3D printing. I'll document my progress on ByteCruft. (My robot project is not stalled, but I'm putting the CNC project first, since there's a long lead time with getting up to speed.) I currently know very little about milling beyond what I remember from school almost 20 years ago. I expect my progress to go faster than my typical  'epic' level project, since I'm focusing less on trying to do lot of design myself. I'm mostly cherry picking various kits and packages and making them work together.



CNC's and 3D printers have a lot in common in the mechanics and software. Both move something that does the work in X-Y-Z space. Both tend to use the control language "G-code" to get that done. The workflow for both can be boiled down to:


  1. Design a part in 3D software
  2. Convert part to a series of instructions (the G-code) that is meaningful to a specific type of machine. This is usually called "CAM" when used for CNC, or a "Slicer" when used for 3D printing, but the output is similar.
  3. Feed the instructions to a controller, which actuates whatever motors or end-effectors do the work.

CNC's are a little simpler than 3D printers, at least at the semi-pro/hobbyist level, 3 axis CNC mills. Therefore many of the controller hardware devices originally intended for printers are usable for CNC, since only a subset of the g-code needed for 3D printing is used for milling. There are exceptions, some CNC's also allow for spindle control, and the 3D printer boards don't typically handle that. 

I've decided to use a "Sanguinololu" controller board:

My Sanguinololu board, with Pololu 2.0 amp stepper drivers, and a throw-away
stepper for testing, while I await for my real hardware. I'll probably add heat-sinks
eventually to the stepper drivers.
Many of the 3D printer hobby boards are descendants of the Arduino platform. Mine uses an ATMega 1284p with an Arduino bootloader. I decided on using the "Marlin" firmware, since it had a nice set of extra features, like SD card and LCD/encoder-wheel support. (As long as you use a Atmel 1284, not the kid cousin 644). I ordered an LCD/encoder/sd card reader combo kit. LCD's eat a lot of microcontroller pins, so I got myself an LCD Backpack from Adafruit, to free up a few pins. 


The LCD kit has a link to a thingverse part where you can print your own case, but since I added the backpack, and want to breakout the free lines from the ribbon cable, the thingverse case won't work for me. I think my first CNC project will be to cut a custom wooden case for my control panel. In the short term, I mounted all the parts on a piece of plywood:

Something tells me this style is more Wozniak than Jobs.
The LCD backpack is underneath the LCD.
Notice than my "heatbed" temperature is -34C!
(The thermistor is not connected)

Since, software is my forte, the first thing I did was to "de-arduinoize" the firmware, and created a AVR Studio project, copied the firmware and various Arduino headers in. I love the Arduino as a concept for the doors it opens for people, but I find the IDE lacking. I didn't have to make very many edits to the Marlin source to use in AVR Studio, which is nice, because I can continue to pull code updates easily. I added to the firmware the ability to turn off the backlight to the LCD after a period of inactivity, I hoping to back-port that back into the Arduino version of Marlin so I could make a patch available. It wasn't too hard.

So my "rough cut" on the electronics side is just about done, with some of the free expansion pins, I re-enabled "kill switch", PWM fan control, and master PSU disable, which aren't normally enabled on Sanguinololu's with Marlin. I have one free pin left, I haven't figured out what I'm going to do with it yet.

Next, I will start on the construction of the Mill itself, I got a Zen Toolworks CNC kit, with a bunch of extras and 3D printing add-ons. I'm also playing around a lot with some of the open source manufacturing and design related software packages. I haven't ruled out buying commercial software, I just want to see how far I can get in the open source world.

--P

No comments:

Post a Comment

I welcome you're thoughts. Keep it classy, think of the children.