|
Overview
The words elegant, beautiful, and high precision have never been used to describe our final design. Nevertheless,
we prefer to use (the superior) words functional, and implementable to describe our plotter.
The plotter consists of three main controllable devices. An x-axis stepper motor, a y-axis stepper motor, and a
continuous pull solenoid for raising/lowering a pen. These devices are all connected to two things, an Atmel
8515 microcontroller (with some extra transistors for drive) and a Rube-Goldberg like mechanical assembly
(pictured below). The microcontroller supplies the required signals to drive the stepper motors and solenoid based
on commands recieved from a PC.
The Mechanical Apparatus
The tracks for the plotter are simply 4 aluminum guide rods, on which the axis arms rest. The motion of the axes are
coupled by way of hollow pieces of a larger diameter aluminum rod, placed at right angles and bonded together. The
pen holding mechanism resides on this coupler, assuring that it is free from any individual axis and moves in a
relatively smooth and frictionless manner.
Constructing a drive mechanism for our axes was far and away the most difficult part of the project. At first, we tried
a continuous timing belt approach (similar to mechanisms found on inkjet printers), but found that belts suitable for
our purposes were either non-existant, or needed to be purchased in lots of tens of thousands.
After trying several other designs, we finally came up with a suitable drive scheme. It consists of one motor pulling
both ends of each axis rod with equal strength. This is accomplished by use of a pulley and thread, which translates the
rotational motion of the motor, to linear motion along the desired axis. In this configuration, the motors can only be
used to pull the axes in one direction, so rubber bands were cobbled together to provide a restoring force to pull the axes back.
The pen raising/lowering apparatus consisted of a solenoid epoxied to our axes motion coupler. unfortunately, as we ran
out of both time and materials, the pen itself was supported only with a cleverly bent wire. The wire performed
adequately during our initial testing, but ended up failing quickly as it wore down. We plan on replacing this piece with
a small aluminum plate that can be attached to the solenoid and will provide a uniform structure for the
pen to rest on.
The Electronic Apparatus
Strangely enough, the electronics components were the easiest to design and cheapest to acquire. A total of nine
devices were required to be driven. 4 poles on each stepper motor, and the pen raising solenoid. Since the Atmel port
pins can only supply approximately 20mA, we needed to use darlingtons to supply enough current to the devices. We
used 2 standard 35 cent ULN2003 devices for this task. (Schematics are under the hardware section)
The motors we used we Unipolar 12VDC stepper motors from NMB Technologies. Full specifications of the motors can
be found at this address. This particular motor
required 48 steps to complete one rotation. This coupled with the shaft diameter of 32mm, gave us 1cm linear motion
per revolution of the motor. However, since our software allowed us to make steps as small as 1 step, we had a
minimum resolution of 2 mm.
Software and Interface
Our software is fairly simplistic as there are only a few devices to control (2 stepper motors, and 1 solenoid). An
added complexity is the need for input (communicating with a computer), which is handled by the UART peripheral.
Our software uses only one interrupt, the UART character received interrupt which receives commands and data
from the computer. Once a command is fully entered, it is sent to be decoded. Typical instructions are to change
user modes (line drawing, character drawing, calibration) and to give motor and pen control signals. The program
organization was fairly simple, as we simply wrote several functions, one for line drawing, several for character
drawing, and 6 functions for motor control.
Motor control is fairly simple, as we used a simple Unipolar stepper motor driving algorithm. We modified it a little
bit to take advantage of tourque doubling, which aided in overcoming the large spring constants of our rubber bands.
The hardware section includes a graphical illustration of our driving sequence (as recommended by the manufacturer).
Drawing lines, though a seemingly simple task, is a far from trivial task. There are many different approaches to
approaching this problem. As our plotter behaves as a discretely addressable raster display, we will use the line
drawing algorithm developed by Jack Bresenham. The will allow us to easily draw lines between specified (x,y)
coordinates without having to divide or multiply, which is useful as we would like to save cpu cycles wherever possible.
The interface was fairly simplistic. There were a handful of commands and command formats:
- "! recalibrate" -> takes us to the calibration mode, which allows the user to manually set the zero coordinate.
- "XXXX,YYYY" -> In calibration mode, this string specifies the x_offset and y_offset to move the
origin.
- "! pointmode" -> takes us to the line drawing user mode, which draws lines between specified coordinates.
- "XXXX,YYYY,WWWW,ZZZZ" -> In pointmode, this string is the string of coords. only positive
integers between 0 and 3000 are allowed.
- "! charmode" -> takes us to the character drawing user mode, which writes strings to the plotter.
- ">string" --> prints out the specified string with the plotter.
- "font N" --> sets the font size, where N is an integer between 1 and 10. The size is on an
exponential scale, where the size is 2^N units (1 unit ~ 2 mm).
|