[ Raspberry Pi/Piface ] Draw Bot Failure #1

Raspberry Pi Stepper Motor

This post is something a bit different to my previous posts, but hey.
I’ve been playing with a raspberry pi, piface and a whole slew of various things the past while.

My creation pictured above is a V-plotter prototype.
It works – to a degree, and has taught me tons about working with stepper motors.

The issue I have had is successfully keeping the pen or pencil in firm enough contact with the paper to draw a really visible line. I tried adding a magnet at the top of the pen-holder. This obviously acted as a pivot. Additionally it wasn’t possible to use a magnet large enough, as then the holder would remain in place, and not be pulled back down by gravity.

So I conceded, its not a failure. It requires re-engineering.


Anyway, so for those who don’t know, the Piface pictured above is an expansion board for the Raspberry Pi, that slots right on top of it neatly, consuming the GPIO pins. The Piface is essentially just a nicely packaged ULN2803A Darlington array, two relays, and a couple of push-button switches. However the Darlington array is perfect for driving a stepper motor.
I have included the datasheet for the ULN2803A below, if you’re interested.

The device was mostly constructed out of 60 year old Meccano. Forget Lego. The motor and gear mounts were made out of alclad.

raspberry pi piface
raspberry pi piface

The stepping is preformed using the Full-step sequence. I have also included a table picturing Half-stepping. This provides more steps, but less torque.

The wiring diagram for the stepper motor, 42SPM-24DJA is shown below. They were two cheap 24V stepper motors I picked up at Communica.

42SPM-24DJA Wiring diagram

The application is shown functioning below, stepping through the various steps. Stepping on both motors is shown in this screenshot (F and B control rotor 1 whilst N and G control the other):

Below is a brief youtube clip showing the stepper motors ticking away upon instruction. The lines being drawn are unfortunately too light to be picked up clearly by the camera.

[ C Code ] Pitool.c
[ Binary ] Pitool (Raspian)
[ .PDF ] ULN2803A Datasheet

You can build the code with:
sudo gcc -L/usr/local/lib/ -lpiface-1.0 -o pitool pitool.c

Note: Jumpers 4, 5, 6 have been removed to disconnect the diodes and the relays.

I reworked the idea on an arduino platform in a working printer-project.
I have posted a psuedo-build log on my blog available here:

[ Blog Post ] Arduino V-Control Printer


~ by Rhys Mossom on August 3, 2013.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: