Real Pen Etch-A-Sketch with Stepper Motors

21 October, 2009

Ever since I was a kid, I've gone through intermittent periods of being obsessed with Etch-A-Sketches. The last such period was in 2005. There was an Etch-A-Sketch resident in the French pastry shop where I worked at the time and so I'd doodle with it at slow moments, eventually buying one for home use and making a whole series of drawings.

Etch-a-Sketch: Dying Leaves

Etch-a-Sketch: Tea Bag and Tissue Paper

There's something about the continuous trace and physical scratching of the Etch-A-Sketch point that satisfies both the primitive and sophisticated sides of the drawing urge: like using high tech remote manipulator arms to scratch pictures in the dirt.

Hence, when a recent Drawing Machines assignment directed us to build a "simple" physical drawing machine, my mind immediately returned to the Etch-A-Sketch and the elemental control it gives you over the minute up-down/left-right movement of the drawing point. I decided to try to see if I could transfer the Etch-A-Sketch's combination of primitive and sophisticated effects to a drawing machine that operated more at the human drawing scale of a real pen and paper.

The result was a two-axis drawing machine built with stepper motors scavenged from CD-ROM drives.

Motors with pen mounted on base

I started by pulling two CD-ROM drives off the ITP junk shelf. Last week, I had help from Todd Holoubeck and Tom Igoe understanding how to control stepper motors, so I figured out pretty quickly that these motors were bipolar steppers (they each had four contacts).

two stepper motors from two CD-ROM drives

Once I knew that, I tested the resistance between the contacts on each stepper to identify the pairs of leads that were actually connected. I attached each of these pairs to half of an h-bridge and programmed the Arduino to step them as slowly as possible (using the Arduino Stepper library). Switching the polarity of each lead-pair around until the motor moved in a straight line showed me exactly how the motor needed to be plugged in for full control from the Arduino. Here are short videos of each of the motors moving under control of the Arduino:

Once I'd gotten control of the motors, I set about designing a mechanism for translating the movement of the two motors into x/y control of a pen.

Two Axis Stepper Design doodles 1

The trick was to get both the motors mounted at the same height around the middle of the pen's length and to attach extensions to them that could hold the pen tightly while not limiting its movement along the other axis. After some early experiments, I settled on cutting rectangles out of flat pieces of masonite, which would allow the pens to slide in one axis while constraining them in the other:

pen holding hardware test

After cutting out these masonite pen holsters, I hot-glued them to the motors, which I'd mounted on pieces of two-by-four in order to get them to a good height around the middle of the pen. Once I had the whole arrangement in place, I hot glued it to a wooden base piece to keep it all in delicate alignment. Here you can see it all setup and doing a test pattern of movement:

Then, finally, I attached two pots to my Arduino and programmed it to detect the change in direction of each pot and reverse direction along the relevant axis (see the complete code in the embedded gist at the bottom of this post). I ran into a bit of trouble when the steppers would get all the way to one side of their range. They each have built-in mechanisms to prevent jamming and motor burn out at that point so they can soak up attempts to move too far in any one direction, the result being that the range of motor motion covered by the knobs' rotation would get shifted off to the side whenever the motor went all the way to one side of its range. So, I added an extra bit of logic to the sketch that had the motor continue to move in a given direction if the knob seemed like it was turned all the way (i.e. its reading was near 0 or 1024). This let you escape the kind of stuck situation that would otherwise arise from the steppers' anti-jam hardware.

Two Axis Machine Drawing 2

The final device ended up embodying the aesthetic properties of the Etch-A-Sketch I described above in a surprisingly effective way. Sometimes, when the pressure between the pen and the paper was perfect, the motion control would be smooth and precise, enabling me to make much straighter lines and cleaner right angles than I ever could by hand — just the kind of sensation of precise control provided by the Etch-A-Sketch.

Two Axis Machine Drawing 1

At other times, when the pen would get torqued into a odd angle, one of the motors would vibrate at the edge of its range, or the pressure between the pen and the paper would get too high or low, the device would do all kinds of surprising things causing the pen to skate all over the paper or bleed into a single spot, or make little intricate wiggles in what was intended to be a straight line.

Moments of control and of chaos happened in the process of making each drawing, resulting in an interesting aesthetic contrast between gird-like ordered lines and messily sketchy ones.

two axis stepper red/blue

This short video combined from moments taken while making a series of different drawings demonstrates this combination of precision and erratic physicality:

In nearly all of these drawings, I'm attempting to depict the actual machine itself — it being the only thing I can see while also looking at the in-progress drawing. The tiny scale (1.5" by 1.5") accentuates the effect of the moments of machine-based surprise, often rendering the drawings illegible.

Two axis stepper blue/green