Two Servo and Drawer Slide Pen Plotter

by JimRD in Circuits > Art

3521 Views, 11 Favorites, 0 Comments

Two Servo and Drawer Slide Pen Plotter

Two Servo and Drawer Slide Pen Plotter
Plotter2.JPG
IMG_3319.JPG

Built this primitive 2d pen plotter using two standard servos (plus one microservo for pen) and 3 drawer slides. Software is DrawingBotV3 to create gcode which is sent to Arduino Uno via Python script. Simple and draws crude prints but perfect for artwork. Uses polynomial functions for x and y to translate servo angles into linear positions.

Why build this plotter when you can buy a DIY plotter kit for $60 that prints very accurately? For two reasons: I want a printer that makes hand drawn looking prints though I am probably just rationalizing a bit. Two, it really teaches you the whole process from creation of jpeg, to Gcode, to serial communication, to Gcode interpretation, to line drawing algorithms, and a short intro to polynomials. What an education.

The still-life is a plot of a painting by Cathleen Rehfeld which I then painted with acrylics. Took just a few minutes to paint.

Supplies

(2) standard size servos, I used cheap analog servos at first but finally settled on TD8130MG digital servos (also cheap)

1 micro servo

(3) drawer slides - mine slide out about 10cm but wish I had gone with longer ones. Use longer than you want the drawing area so that servos have some slack area.

Arduino Uno

Sensor shield for easily plugging in servos

6 volt regulated power supply to easily run servos

various brackets and dodads for servo linkage

a bamboo cutting board to mount the slides on

Mount Slides on Board

Plotter10.JPG
Plotter18.JPG
Plotter17.JPG

I mounted two of the slides about 8cm apart on the edge of a cutting board,

Then I screwed one more slide onto a piece of 1x4 inch board about 24cm long

Then I screwed this board to the sliding rails.

Make Pen Holder

Plotter9.JPG

Cut a slot in 3mm plywood board and epoxied a fishing tube section to hold the pen.

Mounted the board onto a second 3mm plywood board with a small hinge.

Mounted the board to the sliding rail.

Mounted a servo to operate the pen lift mechansim.

Note, gravity is a great force to use to keep the pen in contact with the paper. A stiffer solution will just end up tearing the paper.

Mount Servos and Linkage

Plotter10.JPG

I used a servo mounting bracket to mount one servo to the cutting board. Then made a servo arm out of wood and a fishing tube. I used 3mm threaded bolt with horns and attached the servo arm to a bracket on one of the slides. The threaded arm is 16cm long, the servo arm is attached at 9.5 cm from the servo shaft.

I mounted the second servo on the 1x4 wood, made a servo arm, and connected the linkage in the same way with the same dimensions. Note: servos must be mounted in the same direction as the photo or the printer will not print in an X,Y horizontal/vertical orientation.

Counterweights: this is optional but recommended. I built a couple of pulleys so that I could hang some weights off the servo linkage to reduce the amount of servo gear lash. Watch the video for details.

Connect Electronics

Plotter12.JPG

I used a sensor shield for easily connecting the servos to the Arduino. Unfortunately I only had a 6 volt power supply which is too much for an external supply for the shield so I bent the sensor shielc 5 volt pin out of the way and connected the sensor shield to the Uno. This means the 6 volt external power supply will only feed the servos and not the Uno. The uno must have its own power supply.

Connect the horizontal servo(X axis) to pin 9 and the vertical (Yaxis) to on 10.

Connect the 6 volt power supply to the sensor shield.

Connect the micro servo to pin 5.

Software

Plotter14.JPG
Plotter15.JPG
Plotter16.JPG

I use DrawingBotV3 to convert a jpeg photo to Gcode.

Use Python IDLE Gui to run a script that reads the Gcode file and sends it via serial to an Arduino Uno.

Use Arduino sketch to read the Gcode from the Python script and execute a line drawing function.

Code below.

1. DrawingBotV3 download: https://github.com/SonarSonic/DrawingBotV3

2. Python download: https://www.python.org/downloads/

3. Python script to read Gcode file produced by DrawingBotV3:https://wordpress.com/post/demej00.wordpress.com/2525

ARDUINO CODE

4. VarSpeedServo library: https://github.com/netlabtoolkit/VarSpeedServo

5. Arduino Calibration routine for servos: https://wordpress.com/post/demej00.wordpress.com/2521

6. Arduino Gcode interpreter: https://wordpress.com/post/demej00.wordpress.com/2528

Calibrate Servos

The only time consuming job that must be done before the plotter is usable is to calibrate the servos.

Run the calibrate print program that will print a

Some Artwork

Plotter6.JPG
Plotter4.JPG
Plotter3.JPG
Plotter5.JPG
Plotter1.JPG
Plotter7.JPG
Plotter8.JPG
Einstein.JPG

I download interesting images from the internet into DrawingBotV3.

I like to plot a print and then use a brush and water to smear the ink around in a wash. Or I can add acrylics which has a nice effect on smooth printer paper.

The last plot is my favorite so far. If you squint your eyes you can probably tell who it is.