Introduction: XY-Plotter

The Project:

Perhaps you have never been gifted at drawing, or you don’t have the time to do it yourself, so why not let a simple x-y plotter draw for you. This simple two axis device can accurately moves a pen to draw out anything.

The Device:

The x-y plotter has a two axis control and a special mechanism to raise and lower the pen. The plotter has a hole in its base where the pen goes through. It was designed to print on both paper or any surface such as a wall; simply place the plotter against the surface and the pen will draw away through the hole. Each axis is powered using a single stepper motor and belt. Pen control is achieved using a servo. All electronics are controlled by an Arduino and powered by a 12 volt wall adaptor.

A Demo Video
This video shows a demo of one axis (y-axis) of the plotter moving back and forth. The x-axis was moved by hand to generate curves.


The Team:

This project was completed by Tommaso Buvoli, Kristina Callaghan, Bruce Deakyne, and Phillip Dunlap for CU Boulder Things that Think Spring 2011.

Step 1: Materials

Tools:
- A Laser Cutter capable of cutting pieces up to 18” long.
- Band Saw
- Drill Press
- Screwdriver

Raw Materials:
- Several sheets of 1/4 inch thick acrylic (One side must be at least 18”).
- A small sheet of 1/8 basswood
- Several 1/4 inch dowels (metal or wood - at least 18”)
- 14 small long bolts and nuts
- 28 washers

Electronics
- 2 Gear & Belt combo sets: http://www.goldmine-elec-products.com/prodinfo.asp?number=G15973
- 2 high torque stepper motors: http://www.goldmine-elec-products.com/prodinfo.asp?number=G18202
- 2 stepper motor drivers (ULN2003A)
- 1 breadboard
- 1 2.5v, high current supply
- 1 5v supply (for arduino, USB cable acceptable)
- 1 EasyDriver Stepper Motor Driver (http://www.sparkfun.com/products/10267)

Step 2: Printing & Assembling the Base

Before beginning ensure you have collected a piece of 1/4” acrylic that is at least 18” x 7” (to accommodate the length of the base). Download the attached file base.svg which contains the four pieces that build the base and their corresponding struts. The base is held together at each corner by two screws and fastened with nuts. Depending on the size of the bolts you are using you may need to change the dimensions of the holes in the beams and the width of gap in the strut as shown below. Once you have adjusted the hole sizes cut the base pieces on the laser cutter.

When assembled, the base look like a square with the center cut out. Attach the four sides using the 4 screw holes on each piece. Bolts should slide easily though the base pieces and tension is achieved by tightening bolts on the nuts which should be loosely wedged into each strut as shown in following the picture.

Two wooden dowels can be inserted through the struts on each side of the base.

Step 3: Printing & Assembling the X-axis

The base should now be assembled. Now that the base is complete, the housing that moves along x-axis should be constructed. Download the attached file x-housing.svg. It contains a large base, and 6 sides. Again you will need to alter the size of the holes relative to the screws you are using. The x-axis housing is built by attaching 3 sides to each end of the base as shown in the first picture. Again the bolts should slide through the base and tension is achieved tightening bolts on the nuts.

Once the base is constructed two dowels can be inserted through the holes in the two light grey sides, as shown in the second diagram.

Step 4: Building the Y-axis Housing

The y-axis housing is final moving piece that needs to be built. It is the smallest and carries a servo to lift and lower the pen. It will be placed on the two dowels that were inserted into the light grey sides in step 3. When built the assembly looks as seen in the pictures and is mounted in relation to the two dowels that were put through the grey slots in step 3. The servo sits on the top of the y-axis housing and is locked in place with the small hole in the top of the y-axis housing.

Step 5: Building the Marker Holder

Now it’s time to build a simple attachment that holds the marker to the servo so that it can be lifted and lowered. Download the file pen-holder.svg and print out two parts. You may need to adjust the size of the square if you are using a pen that is larger a Sharpie. The two-piece assembly is relatively simple to put together and the final product looks as shown in the picture. The bolts are tightened evenly around the pen so that it does not slip.

Step 6: Belts and Gearing

It is recommended that you hand-drill the holes for the belt gear-shafts. Our spacing worked out to be 11.75in, but yours may vary based on your belt. It is important that the belt be tight enough to reduce slack but not so tight such that there is too much friction.

To mount the x-axis motor, it is best to move the strut closest to the gear back. After affixing the small gear to the motor shaft with gorilla glue or epoxy, align the motor gear with the belt gear. The stepper should be upside down as in the picture below. Adjust the height so that the two gears are flush. Mark this on the strut. Use epoxy or gorilla glue to fix one side of the strut to the motor - preferably the side that allows the wires to face in the y-axis direction (as seen in the photo below).

Once the motor is attached, position the strut such that the two gears are aligned. Hold the strut in place, move the belt; if your gear is off center, you may need to adjust the motor position. Once you're found the "sweet spot" so the gears mesh evenly, mark where the two new screw holes for the strut will do. Drill and mount the strut. We also found that adding two small acrylic "guides" to the bottom of the y-axis allowed the belts to move the y-axis better.

The exact process can be replicated for the y-axis. Note you may need to counter-balance the y-axis motor with a weight on the other side.

Step 7: Electronics

The electronics are fairly straightforward. 

Place the two ULN2003A motor drivers in a breadboard. 
The digital output can come from any of the PWM pins on the Arduino. These can be specified in the software on the next step.

Each motor will require 4 pins on the arduino (call them pins A-D, depending on which PWM pins you chose), one for each stepper motor coil/phase.
Attach Pins A-D from the arduino to pins 1-4 on the ULN2003.
Ground the driver's pin 8 and attach the 2.5V (high current supply) to pin 9. 
Attach the colored stepper wires to the driver chip in the following order:
Pin 16: Orange
Pin 15: Black
Pin 14: Red
Pin 13: Yellow
Pin 9: White

The Stepper Motor datasheet and ULN2003 pinout are attached.

To generate the video, motors were attached to Arduino using the Easy Driver Stepper Motor Driver. The code used for moving the write head back and forth is provided below:

int stepPin = 2;
int dirPin = 3;
int LEDpin = 13;
int ii = 0;

void setup(){

pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(13,OUTPUT);

digitalWrite(stepPin, HIGH);
digitalWrite(dirPin, HIGH);
}

void loop() {

digitalWrite(dirPin, HIGH);
for(ii = 0; ii<2000; ii++){
delay(5);
digitalWrite(LEDpin, LOW);
digitalWrite(stepPin, LOW);
delay(5);
digitalWrite(LEDpin, HIGH);
digitalWrite(stepPin, HIGH);
}

digitalWrite(dirPin, LOW);
for(ii = 0; ii<2000; ii++){
delay(5);
digitalWrite(LEDpin, LOW);
digitalWrite(stepPin, LOW);
delay(5);
digitalWrite(LEDpin, HIGH);
digitalWrite(stepPin, HIGH);
}


}

Step 8: Prospective Software

Our plan was to utilize the RepRap firmware to drive the motors. RepRap is an open source project with a portable three axis G-code interpreter originally intended for use with 3D printers. It is portable enough to interpret G-code for use in an x-y plotter, though requiring device-specific code to be modified. We were going to use the ReplicatorG (also open source, also intended for 3D printers) as our G-code generator. It reads a standard svg file and enables printing to a connected device, which hypothetically would have been our x-y plotter.

These can be found at reprap.org and replicat.org

Step 9: Future Work

This project provides the ground work for designing and building an xy-plotter. Several improvements, however, could be made:
  • Try to cut back substantially on platform, belt, motor, write head, etc. size to make a sleeker project.
  • Invest in higher torque motors.
  • Write a program to print an svg file in tiles.
As it stands, however, this project shows that it is possible to create a functioning xy-plotter that could potentially draw any shape with relatively easy to find materials.