Uses for a Tiny CNC Robot

Thinigiverse user Zamanlui's copy of a  Tiny CNC

Thinigiverse user Zamanlui’s copy of a Tiny CNC

Thinigiverse user Zamanlui printed a Tiny CNC with the idea to turn it into a platform for a phage/bacteria printer. While I realize that a two-axis CNC machine can be used for just about anything, I LOVE the idea that something this easy and cheap to build could be put to such noble uses.1 This makes me wonder…  what other potential uses would there be for a simple low cost CNC machine?  Here’s what I have so far:

  • Phage/bacteria printer
  • Drawing robot (one-off business cards, playing Tic-Tac-Toe, etc)
  • Drawing electronic circuits with a conductive ink pen2
  • Adding a third servo for a Z axis and a fourth servo for a gripper for a tiny sorting robot
  • I guess you could turn one into a useless machine that turns itself off?
  • Automatic pencil sharpener?

What other ideas can you think of?

  1. Especially when my most noble idea is to make the ‘bot cheat at Tic-Tac-Toe []
  2. How awesome would it be to use a Tiny CNC to draw an electronic circuit used to power a Tiny CNC?! []

Design considerations with the Tiny CNC

Tiny CNC - Exploded View

Tiny CNC – Exploded View

This weekend I’ve been slowly working to improve my Tiny CNC.  There are a number of potential mechanical changes that would very likely help with the accuracy, performance, and even reduce the cost of this little robot.  Here are some of the things I’m fiddling with so far:

  • Herringbone Rack and Pinion
    • The reason so many RepRaps use herringbone gears is that they help to reduce backlash, the play between the rack and pinion.  The downside to herringbone gears is that they’re difficult to produce – except by 3D printing.  Fortunately, since this entire design 3D printable, this is not a problem.  As a practical matter, it’s not really any more difficult or time consuming for a 3D printer to create a herringbone gear than it is to create a non-herringbone gear of the same size.
    • Since I couldn’t find an easily modifiable OpenSCAD script, I had to write a few modules to create herringbone racks and pinions.  My script for the rack is so unbelievably “hacky” that I am actually a little ashamed to admit how I cobbled it together.  I’ve also reduced the size of the teeth used to hopefully get finer control.  The flip side is that it might make it easier for the ‘bot to accidentally skip a step. We’ll see!
  • Drawing Area
    • I’ve arbitrarily chosen a 75mm x 75mm square1 as the necessary drawing area.  Why this size?  First, it would be difficult to print the parts much larger than this.  Secondly, this is just large enough to draw on three different kinds of common materials – traditional American business cards which measure 74mm x 52mm, and Post-It notes which measure 3″ x 3″ or 76mm x 76mm, and 3″ x 5″ rectangular2 index cards.  The versions published to Thingiverse are able to move in the X and Y axes by about 65mm or so – just shy of my desired goal.  Thus, I’m designing this newest version will be a very little bit larger.
  • Hollow Parts
    • One of my goals is to make the entire robot use even less plastic.  As it stands, it is already a very minimal design, so there’s not a lot of fat to trim.  I figure there are at several ways I can still reduce the plastic used.  First, I could make thinner parts.  Since most of the parts were already very thin, I’m not sure how much thinner these parts can get.  Secondly, I can cut holes into parts.  This probably makes a bit of sense with the gears3 and the X and Y stages.  Third, I can try to “hollow” out parts – such as the gears.  There’s one additional way I thought of, but it’s wacky enough that it deserves it’s own first order bullet point…
  • Half Pinions / Gears
    • This is the wacky idea.  The servos I’m using can only sweep across 180 degrees.  Thus, only one-half of the gears actually ever touch the racks.  Why not make these half-gears instead?  To be on the safe side, I try these with slightly more than half-gears.  My concern is that these half-gears will cause a lot of wobble when the ‘bot is operating at higher4 speed.  My other concern is that incorporating half a gear would make this robot harder to assemble.  As it is, I’m pretty sure a little kid could build this robot with very little direction.  However, if the design required half-gears it would become much more difficult to match the servo’s position with the orientation of the half-gear.  While it doesn’t matter if a full gear is rotated one tooth one way or the other, a single tooth offset on a half-gear would cause the ‘bot to stop prematurely or cause the gear to hit the ends of the rails.
    • I would genuinely enjoy creating a variation with half gears because it would look cool and use less plastic.  But, for now I think I’ll stick with full gears even if that means using more plastic because it means the final robot will be easier to assemble.
  • Ease of Assembly
    • As I’ve mentioned above, the published version of robot is really easy to assemble.  With six plastic parts that pretty much only fit together one way, two identical servo motors that only fit into the mounts one way, and a fairly self-explanatory rubberband-pencil holding system, I’m feeling confident that this robot could be assembled by a kid with Lego or Ikea style instructions.5 With the robot using just servos and running at a whopping 5V, instead of more powerful steppers or higher voltages, there’s not much of a chance of pinched or burned fingers with misuse.
  • Cost
    • It was not very long ago at all that my own “parts drawer” was pretty bare.  I didn’t have spare servos, steppers, and Arduinos.  So, when I used to see a tutorial online about building a robot investing in that robot would have meant $100 which seems like a lot of money to just try something out.  For someone who has zero parts, this would probably be a very cheap robot to build.  On a lark I checked out the cost of the parts if they were made through 3D printing services.  The prices from two such services seemed really high – in the range of $45-55.
    • While the pure materials cost for these parts is relatively low, about $2 for the pieces from version 0.18, this doesn’t take into account the cost of purchasing, maintaining, and operating a printer.  One interesting wrinkle is that if I’m able to design and print a better version of this robot using herringbone gears, there wouldn’t be an alternative to 3D printing for the manufacture of these parts.  ((The six parts will include two herringbone gears and two herringbone racks – none of which can be easily produced by any method other than 3D printing)) I would love to print these parts and offer them as kits, but it doesn’t exactly seem feasible to turn my home into a full fledged plastic parts manufacturing plant6 and it doesn’t seem cost effective to outsource the 3D printing.
    • Electronics. As for the electronics, I would like to keep the entry costs there down as much as possible.  Ideally, I’d be able to get everything to work with a tiny Adafruit Trinket.  Since the Adafruit Trinket cannot act as a serial port, due to the nature of it’s tiny hardware, I just found a tutorial on Adafruit that suggests there is a work around for the 5V version!  I’m really excited about this because a tiny little robot such as this one deserves an equally cute board.
    • Motors.  One interesting limitation turned benefit to a micro servo is that it can’t move past 180 degrees.  A traditional CNC using stepper motors will try to tear itself apart if you accidentally tell the motors to move too far in a given direction – that’s why most such machines use endstops to detect when the ‘bot has moved too far.  Since the servos won’t even try to turn past 180 degrees, there’s basically zero chance of them getting uppity and trying to destroy the robot.  Also, these little micro servos are really weak.  Unlike a stepper motor, they (probably) don’t have enough power to crush a finger.
  • Z-Axis or Pen Lift?
    • There’s really two different ways to go with this robot.  One is to make it a proper 3-axis CNC – with a rack and pinion system for raising and lowering the toolhead with some degree of precision.  The second way would be to use a simple “pen lift” system where the pen is either up or down.  For the purposes of a drawing robot, the pen lift system is entirely sufficient.  However, a legit 3-axis CNC is far more useful.  With a third servo for the Z-axis and a gripper powered by a fourth servo, you could have a fully functional 3-axis robot in no time.  I honestly quite torn between just making a drawing 2-axis CNC robot or a 3-axis ‘bot.
    • The best way forward might be to optimize this robot for use as a pen-lift 2-axis drawing robot and then later develop a different Y axis where a proper Z-axis could be mounted.
  1. 2.95″ by 2.95″ []
  2. 76mm x 127mm []
  3. Okay, okay, pinions []
  4. Read: more interesting/entertaining []
  5. I’m working on these too – check out the picture at the top! []
  6. Then again, perhaps I’m getting ahead of myself since I have no idea if people would buy even one set! []

One set of Tiny CNC plastic parts up for grabs for $0.05

Drawing robot drawings

Drawing robot drawings

Since I’m working on designing new parts for my little drawing robot, I’ve decided to list the existing parts for sale on eBay starting at a nickle.  I’m not going to print or sell any more copies of this version.  One way or another, these parts are gone in less than three days.  🙂

However, before you consider bidding…

  • This is a total work in progress and not a proper “robotics kit.”  There’s no software to run it, except the Arduino sketch to make it draw a grid.  You shouldn’t try to buy this if you aren’t willing to get your hands dirty.
  • I’m not including anything except the six 3D printable plastic parts.  I need the other bits so I can continue working to develop and improve this robot.  So, don’t try to buy this if you don’t have a bunch of your own electronics parts.
  • The parts are used since I’ve been using them the last few days.  I printed, cleaned, sanded, and assembled these parts into the robot I showed in videos on my blog, so they’re not “new.”
  • You could always just 3D print these parts for yourself – I’ve already published all the files on Thingiverse and all the instructions on my blog.

However, if you are interested in experimenting with these parts for yourself, you might be able to steal them for a measly $0.05.  🙂  Here’s the link to eBay listing for these plastic parts for a drawing robot.

Better video of Tiny CNC Drawing Robot actually drawing

I wanted to share a video of the ‘bot in action that was slightly less terrible.  In this one I’ve elevated the robot on two stacks of index cards, taped it down to keep it from wandering off, and given it a pen to draw with on another 3″x5″ index card.

I elevated the robot for two reasons.  First, it allowed the ‘bot to have a better “grip” on the pen (rather than just holding it near the tip) and resulted in a much better drawing.  Secondly, I’m using an old version of one of the gears which extends slightly below the larger rail due to the set screw.  By elevating the ‘bot, the screw doesn’t hit the surface and cause a wobbly walking motion.

The other day I discovered that I could use the Adafruit FTDI Friend to provide power to the Mintduino as well as reprogram it.  All I had to do was run a little red wire from the VCC pin to the positive rail and a black wire from the GND pin to the ground.  Easy!  Since then I’ve abandoned powering the Mintduino by 9V battery.  🙂  The next time I find an old USB mouse or keyboard, I’m going to definitely clip it’s leads so I can turn it into a USB source of 5V power for projects.  It’s convenient to use the FTDI friend to reprogram and power the board, but it’s a little awkward and not a great permanent solution.

How to Build a Tiny CNC Drawing Robot

Tiny CNC - all the parts needed

Tiny CNC – all the parts needed

UPDATE: Here’s everything you need to to build a Tiny 3-Axis CNC robot using just 8 plastic pieces.

The above are nearly all the tools and parts you’ll need to build your own itty bitty CNC drawing robot.1 If you have a 3D printer and a spare Arduino, the rest of the parts should cost you around $20.  Right now this robot only has two axes, but in the very near future I hope to add either a Z axis or a pen lift.  Without further ado the tools needed are:

Tools

  • One small precision screwdriver

Parts

You’ll also need an Arduino, some wire to connect your servos to the Arduino, and a USB cable to communicate with the Arduino.

Assembly

Step 1:  Print parts

All printed parts

All printed parts

There are only six printed parts necessary for this mini-CNC.  If you’re careful, you’ll be able to fit all six on your MakerBot Replicator into a single build plate.

Step 2:  Assemble the X axis stage

step04

Grab your Micro Servo, the little screw that came with it, the flat gear (really, pinion), and the X axis stage.  Just insert the Micro Servo into the X axis stage (it only fits one way), push the gear onto the Micro Servo’s motor shaft, and use the screw to secure the gear.  It should look like this when done:

Assembled X axis stage

Assembled X axis stage

Step 3:  Place the X axis stage on the large X axis rack

X axis stage and X axis rack

X axis stage and X axis rack

With the X axis stage gear-side down, rotate the gear clockwise until it stops.

X axis stage and X axis rack

X axis stage and X axis rack

Then place the gear into the X axis rack as show.

Step 4:  Place the Y axis rack

Y axis rack

Y axis rack

Locate the Y axis rack and place it over the X axis Servo Motor.

Y axis rack in place

Y axis rack in place

Like so.

Step 5:  Assemble the Y axis stage

Building the Y axis stage

Building the Y axis stage

Just as with the X axis, gather the parts and assemble.  This time, the servo motor goes into the stage (it only fits one way), the thick gear is then pushed onto the motor shaft with the gears toward the Y axis stage.

Assembled Y axis stage

Assembled Y axis stage

Like so.

Step 6:  Add the Y axis stage

With the Y axis stage gear-side down, rotate the gear clockwise until it stops.

Getting the Y axis stage ready

Getting the Y axis stage ready

Route the X axis servo motor wires through the rectangular hole in the Y axis stage.

Routing X axis servo motor wires through the Y axis stage

Routing X axis servo motor wires through the Y axis stage

Place the Y axis stage down, with the large rectangular hole around the X axis motor.

Almost done building a robot!

Almost done building a robot!

Almost done!

Step 7:  Ready the pen holder

Place the rubber band around the pen holder as shown.  You will probably have to wrap it around a few times.

Rubber band wrapped pen holder

Rubber band wrapped pen holder

Insert a pencil, pointy-bit down, into the pen holder.

Full assembled drawing robot

Full assembled drawing robot

Step 8:  Admire your work

A baby robot is born!

A baby robot is born!

Your robot is done!

Step 9:  Wire Robot to Arduino

To save you a little bit of trouble reading the Arduino sketch and figuring it out, here’s how you would connect your robot to the Arduino:

  • Use a piece of wire to connect the orange wire from the bottom X axis servo to pin 13 on the Arduino
  • Use a piece of wire to connect the orange wire from the top Y axis servo to pin 12 on the Arduino
  • Connect the brown wires from the servos to the ground pins on the Arduino
  • Connect the red wires from the servos to the 5v pin on the Arduino

Step 10:  Draw!

Download my Arduino sketch to operate this robot.  The movements of the robot are hardcoded at the moment, so please check back for updates.  Also, if you don’t tape or glue or somehow affix the little bot to a heavy surface, it will literally jerk itself all around the table.  (Although, in retrospect, I could have made it draw slower…)

It’s a little difficult to see the lines as the robot is drawing, but it really is drawing a grid in this short video:

Room for Improvement

I hacked this little project together just in time for the MAKE and GE Robot Hacks presentation on 11/20/2013, so I know there’s lots of room for improvement.  Here are some things I’m working on:

  • An entire Z axis or pen lift mechanism using a third servo
  • A better pen/pencil holder
  • Actual code to use XY coordinates instead of directly specifying the degrees for each servo
  • Actual motion control software from Processing or Python
  • A few adjustments to the Y axis stage for a better fit
  • Possibly thicker gears so that I can use set screws
  • A variation on the gears to use less plastic
  • Getting the robot to work with my Adafruit Trinket!

I hope you enjoyed this quick to print and easy to use desktop drawing CNC!

  1. You’ll also need an Arduino and some bits of wire []

Tiny CNC Drawing Robot – Cost Estimate

A really tiny CNC - a work in progress

A really tiny CNC – a work in progress

One of my goals in designing/building this little robot was to make it really cheap and easy to build.  I’d like to think I’m headed in the right direction.

I would estimate the cost of building (a completed version of) this little robot as follows:

  1. 3x Micro Servos at $6/each
  2. 1x Arduino Uno at $30
  3. 30.6g of ABS plastic for roughly $1.53

I’m going to exclude the bits of wire and pen, and estimate the materials cost of this robot at $49.53 which I’ll round up to about $50.00 since I have to design and print a few more plastics parts.  Basically, if you’ve already got a 3D printer, plenty of plastic, and an Arduino lying around, there’s no reason you couldn’t have a similar robot up and running in no time for about $20.

It’s my hope to use my newly won Adafruit Trinket 5v, courtesy of Hackaday and Adafruit1 , it might even be possible to power all three servos off of a single Trinket ($8) and bring the total cost of the project down to around $28 plus little bits of wire and a pen.

Although I give vague building instructions on the Thingiverse page for the parts of this robot, I hope to have an Ikea/Lego style set of instructions ready in the next day or so.  So far there are only 8 parts (including the two servo motors), so even a team of monkeys taking a break from writing Shakespeare could manage to assemble one of these in a few minutes.

  1. Thanks again!!! []

An Itty Bitty Drawing Robot

OpenSCAD Rendering of Mini CNC

OpenSCAD Rendering of Mini CNC

My daughter and I recently signed up to take part in Make’s Robot Hacks’ project.  Make was kind enough to send me a box of parts, including the Make Ultimate Microcontroller Pack and a bunch of servos.

The catch?  We had to actually create something and share my progress by November 20.  From the time my parts arrived, this was exactly 14 days.  🙂

I had a number of ideas about what I wanted to make – an automated Robo Hand, electronically released spring loaded wings, a little servo-powered walking robot, and a dozen of other smaller ideas.  My daughter’s ideas were significantly more ambitious – flying, wall crawling, dancing, hearing, seeing, talking, thinking robots.12 The idea that I kept coming back to was a tiny little CNC robot using servos powered by an Arduino – something I had first seen in February of 2012 with Piccolo – the tiny CNC-bot by the Diatom Studio team.

My adventures building robots aside, I still consider myself a “newb.”  However, I knew the basics of what I needed to accomplish:

  1. Drive three servos with a single Arduino
  2. Make each servo drive an axis of movement
  3. Figure out a way to translate 180 degrees into linear movement

So, for what it’s worth, here’s my process:

Driving Multiple Servos with a Single Arduino

Since I had never (!) driven a servo with an Arduino, I needed to figure out how to manipulate at three servos at the same time.  Fortunately, the Arduino “Sweep” example explicitly states that it’s capable of controlling eight servos.

Connecting them was significantly simpler than I was anticipating.  For the Batan B2122 servos I had, the brown wire was ground, orange wire was positive, and yellow wire was the “control” that would have to be connected to one of the Arduino’s digital out pins.3 The easiest way for me to wire up the three servos was through a small breadboard.

Once the servos were wired up, it was a matter of loading up the Sweep example and driving a single servo back and forth.  By adding a few lines, I was able to drive two servos, and then three.

Using a Micro Servo Motor to Drive an Axis of Movement

The Batan B2122 micro servos are not continuous rotation motors – they only have a 180 degree range of movement.  Most CNC machines use stepper motors which are strong, fast, precise, and can rotate continuously forwards or backwards.  Servo motors, by contrast, are smaller, cheaper, slower, and unless they are specifically designated as “continuous rotation” have a limited range of movement.

I considered two different ways, each with their own merits, of using a limited range of motion motor to drive an axis of movement.  The first way I considered was using a spool and twine to drive each axis – similar to the Printrbot Simple and WaterColorBot.  This is an excellent and cheap alternative to using expensive precision toothed belts to control movement.  The reason I didn’t use this method is that it would have required a spool for the twine, and some form of rails or metal rods, and of course twine.  My concern is that this would have been a bulky solution for such a small robot.

The second method, the one I decided upon, was to use a rack and pinion to turn the rotational motion of the servos into linear motion.  One benefit of using a rack and pinion is that the rack itself removes the need for rails or precision rods, spools, and twine – all while providing a sturdy framework for adding additional axes.

Translating 180 Degrees into Linear Movement

As I alluded to above, the micro servos only have 180 degrees of movement.  Thus, a gear (or pinion) attached to a servo would only be able to drive the rack by 1/2 of its circumference (or 180 degrees).  Keeping that in mind, I chose a gear size that would produce the desired freedom of movement.  I settled on a gear radius of about 20mm because it created about 2.5 inches or 62.8mm [ (2 * π * 20)/2 = 62.8 mm] of movement.

Moving a pen over a 2.5″ square would enable me to create nifty little robo-drawn post-its, bespoke business cards, or an auto-signature device.

Here’s what I have so far:

Next Steps…

Since the robot isn’t actually capable of doing a whole lot yet, I’ve got a bit to do still:

  1. I need software to interpret XY coordinates or GCode into rotational degrees
  2. Get write a Processing or Python script to send the XY coordinate or GCode to the Arduino
  3. Slightly redesign the two gears (well, pinions) so that it’s easier to attach them to the servos
  4. Create a new Y rack that can hold the third servo (for the Z axis) and a pen for drawing

Since I’m only intending to use this little CNC for small drawings, I don’t really need a huge Z axis lift – even a few millimeters should be sufficient.  I was considering cheating a little and just making the “Z axis servo” just lift the front of the robot off the surface.

Even though I’ve got a bit of work ahead of me, I’m pretty happy to have a working proof of concept of a robot of my very own design!

If you would like a little robot like this of your very own, you can find my 3D printable files on Thingiverse and the Arduino code is pretty much the stock “Sweep” example.  Stay tuned because I’m looking forward to turning this into a legit itty-bitty CNC drawing robot.

  1. Just put the words on a microchip and put the microchip in the robot’s head, Daddy []
  2. Thanks pumpkin! []
  3. If this seems like Greek to you, as it did to me just a few weeks ago, I’d recommend picking up a Mintduino kit and blinking a single LED.  You’ll be able to blink two LED’s in no time! []

Maker Artist Ytai Ben-Tsvi and his IOIO Board Plotter

Ytai showing off his plotter art at Codame 2013

Ytai showing off his plotter art at Codame 2013

Easily one of the most memorable aspects of exhibiting at this year’s Maker Faire Bay Area was getting to meet and interact with lots of other Makers.  Ytai Ben-Tsvi had built and brought a pen plotter of his own design – and it was amazing.

Ytai’s pen plotter used an Android tablet, his IOIO OTG board1 , two stepper motors, two comically large spools, and lots of custom code to turn pictures taken with the tablet into instant portraits on the fly.

His plotter was everything a Maker Faire exhibit should be – highlighting the intersection of art and technology while inviting the audience to be a part of the action.  Can you believe this guy was reluctant to call himself an artist?

After Ytai was invited to participate in the Codame 2013 art-tech festival2 he decided to create an entirely new drawing algorithm to turn images into a single line drawing which appears to be sharp scribbles up close and a detailed image from a few meters away.

Photo transformations with Ytai's ScribblerDemo

Photo transformations with Ytai’s ScribblerDemo

What I love about Ytai’s drawing process is that it produces a drawing with a sense of whimsy and movement without the hard number crunching necessitated by a Traveling Salesman Problem3 style drawing.4  By allowing the algorithm to have lines cross over one another, something the TSP method eschews with its own aesthetic, Ytai’s drawings essentially gets “for free” extra dark patches where lines closely intersect.5

Looking at this drawing, it seems to me that an SVG created from his algorithm conveys so much more meaning with far less points than a TSP file.  At least for my own PlotterBot, far fewer points would also mean a much faster, and more satisfying to watch, drawing.  I would estimate that in the time it took Ytai to cover a wall, I might have been able to create one, perhaps one and a half, drawings.  And, as any good Maker does, Ytai has shared the fruits of his hard work in the form of the source code on Github.

  1. Ytai’s succinct description of the IOIO board says it all, “The IOIO-OTG is a printed circuit board for electronics hobbyists and prototypers, which addresses a very common problem: how do I use my {computer, tablet, phone} to control my {robot, dish-washer, cat-feeder, etc.}.” []
  2. An art-tech festival?!  Why the hell aren’t there more of these things?! []
  3. Link to blog post showing a method []
  4. Doesn’t exactly hurt to have a cute kid as a subject either []
  5. Having played with TSP drawings a lot, I have discovered that finding the right balance between lightness versus darkness and simplicity versus complexity and quick versus glacial to be… maddening.  Like H.P. Lovecraft maddening []