Step A Sketch

An Etch A Sketch is probably the easiest hardware device that can be hacked to be controlled with stepper motors. We had recently gotten a Rapsberry Pi, along with some stepper motors and drivers, and so thought this would be a good project to tryout the GPIO capabilities on the Raspberry Pi.

Version 1:

<< This was put together quickly as a proof of concept. We wanted to make sure the voltage and power to the steppers was adequate (we used a 12V 2.5A switching power supply from some computer equipment), and that we could generate enough torque to move the dials on the Etch A Sketch, using a direct drive.

Andy put together some drawing routines in python, and ran that on the Raspberry Pi to generate the test patterns. The repeatability seems quite good, but we're going to try to see if we can get finer resolutions. We also need to investigate and compensate for some unexpected behaviour we noticed in the motion, which we suspect might be backlash issues.

Those little green boards on the breadboard in this picture are A4988 stepper drivers on a breakout board. Those are very capable drivers and a breeze to connect and use, but they are probably overkill for this projects needs.

>> Here's a close up of the drive. The stepper (SM-E040, a takeout from an Epson printer, leaving the center tapped windings unconnected, and running in full-step mode), is mounted using a bracket cut from sheet aluminium (from a discarded gutter). We had some scrap plastic tubes shrunk over the shaft until it was thick enough to slide on as a friction fit the vinyl tubing shown in the picture. The tubing provided a little bit of flexibility in the transmission, so that allowed us to get away with some misalignment in the shafts.

We found a few issues with this prototype. To erase, the Etch A Sketch needs to be held face down and given a vigorous shaking. The way we had the hardware attached in the version made it very difficult to do that. We're planning on coming up with a configuration that allows easy detaching and re-attaching of the Etch a Sketch from the rest of the hardware, so that we can safely do shake-to-erase routine.
It would also be nice to have a manual "jog" function, buttons to manually move the cursor. We'ed need this to have the stylus go to a "home" position, so we can synchronize that position with the software.

It looks like the steppers might be designed for a 5V/0.5A supply?, and they get quite hot running at 12v. We'll have to look into correcting the voltage, or do some current limiting.

Version 2:

<< Some of the problems we saw in version 1 were addressed here. The main thing was being able to clear out the drawing easily. The Etch A Sketch is now driven by gears and is held in place by a guide and saddle, so the unit can be slid up, shaken, and dropped back in. The steppers were replaced with these 24v units. These are running nice and cool, and are able to easily drive the Etch A Sketch. Also, the driver board is now made with discrete components and an onboard microcontroller. There are now manual "jog" buttons added.

We are seeing a usable resolution of 840x560 steps on this version, with the gearing and full stepping mode we are using.

>> The knobs have been replaced with gears (from an old printer), and they rest on matching pinions pressed on to the stepper shafts (with vinyl airline tubing). This allowed a way to easily engage and disengage the drive. An added benefit was the increased torque being transmitted to the knobs (the drive mechanism in the Etch A Sketch is quite sticky in places, and torque required varies significantly over its travel range, so the steppers sometimes struggled and skipped steps direct when we tried directly driving the Etch A Sketch shafts). This setup seems to work quite well, and we can't discern any significant backlash between the pinion and gear.

<< Here's a close up of the saddle design, made with scrap pieces of aluminium. The bottom of the Etch A Sketch rests on the saddle, and the saddle itself can be moved up and down a bit to adjust the gear meshing clearances. Also, note how the horizontal plastic ridge on the Etch A Sketch has been cut away to accommodate the vertical flange on the saddle. This was done to keep the Etch A Sketch from moving from side to side.

Circuit Design:

>> We came up with a TIP-120 (NPN Darlington medium power switching transitor, about $0.65 a piece) based stepper driver and also incorporated a microcontroller. This is the schematic showing the layout on the board.

<< A closeup of the completed board of the schematic above. You can see the 4 tactile switches that can be used for manually jogging the steppers. The 2 sets of headers at the top are where the stepper motors connect to, and the 5-pin header at the bottom is exposed for another microcontroller (or our Raspberry Pi) to connect to, if we wanted to directly control the stepper.

Microcontroller code listing:

Here's a simple Arduino program to drive the steppers. We're using an Ardweeny (which is an inexpensive Arduino clone) for the "brains". It can also be communicated with over a serial port and supports a simple protocol for handling drawing commands.

We also created a simple web page (listing) that allows controlling the StepASketch. This page has some controls that send commands to the microcontroller, through an AJAX post to python which in turns sends it over the serial port. There is also a crude G-Code interpreter on this page that can render a simulation of the steppers executing the G-Code, onto a canvas element on the page. And the same G-Code can also be translated and sent over serial to the microcontroller.

And this is a small python program that acts as a web server to serve up the web page, and also is the bridge to the serial port that the Step A Sketch is connected to.