Wednesday, June 4, 2014

Robot Dot Printer

Hello all,

Well, the end of my sophomore year has finished, and with it, half of my college career...hopefully. At the tail end of every semester, design classes kick into high gear and students produce some extraordinary results. For the end of our electronics design lab, my partner and I decided to create a robot dot printer. For those who haven't seen our robot before, here he is, Geoff, with a face lift.

Figure 1: Geoff with his printer face.
Introduction
”Theoretically, this should work” was probably the most commonly used phrase in our final project days. The goal of our final project was to create a robot that is able to print discrete images using sharpies actuated by servo motors. To complete this goal, we had to construct a printer assembly that would be placed on the rear of our robot, and developed code for the Arduino to drive servos with pulse width modulation such that sharpies moved in a linear path.
Figure 2: Block diagram of our system.
We also had the idea to use a Sparkfun manufactured PWM shield (Fig. 3a)that had the ability to
drive the 8 servo motors. Unfortunately, luck was not on our side, because the board had a faulty powerpage3image1256
management system. To sidestep this issue, we settled for only using 6 servos, which was the maximum the arduino could provide. 

Design of Printer Assembly
Next, something that actually worked! Originally we had planned on using solenoids to actuate the Sharpies. After connection between the solenoids and markers became a dubious prospect at best, we opted for a more accurate, and more Arduino friendly method of actuation, the humble sub-micro servo. The servos allowed us to use PWM to accurately push and pull the Sharpies.
The first issue we ran across was constructing servo horns to connect servo and Sharpie. Using a laser cutter and some 1/8” acrylic, we were able to manufacture horns that fit our application wonderfully. A slot was cut along the length of the arm which allowed the Sharpie to side back and forth on its vertical path. This movement minimized the torque on the servo motors.
Figure 3: Printer Assembly. Due to the buggy nature of the PWM shield, we decided to remove the outside servo assemblies in favor of using the built-in PWM outputs of the Arduino. 

Figure 4: Connection between Sharpie and servo.
Figure 5: Printer assembly. By laser cutting the printer assembly, the servos were able to be press fit into the holes 
without any screws. This accuracy was accomplished through many iterations. 

PWM Servo Control
Servos are controlled by pulse width modulation. Different pulse widths are associated with different positions, shown in Fig. 6. In our robot, we use three positions: Storage (fully up), Set (down but not touching), and Print (down and touching). We ran across issues with power regulation when we tried to drive all 8 servos from PWM shield, so we defaulted to using the six PWM pins available on the Arduino. However, eight PWM outputs were required to control the six servos and two robot wheels. Two additional PWM outputs were made by manipulating Arduino digital output pins with strategic timer interrupts. This created a PWM signal suitable to be a voltage reference to the robot motor controller. 


Figure 6:
Explanation of pulse width modulation with servos. 

In order to print designs, servos would have to be in specific positions at specific times. The process of printing would be to 1) Push Sharpies down, 2) Move forward, 3) Change positions of Sharpies, 4) Repeat. Using a linked list method explained graphically in Fig. 7.
Figure 7: 
This diagram explains the basics of linked lists. A data structure was created print col that contained a list of values, 0 or 1, and a pointer, or link, to the next print col. At the start, the servos are given the list at the first print col. The dots indicate that the servos are in the up position. After all servos are positioned according to the current list, the robot moves forward an increment, then changes the position of Sharpies to the list in print col 2. This process is repeated until the print sequence is completed. 
Results
In order to have an operational robot dot printer, the Sharpies had to be properly calibrated. Calibration was as simple as manipulating the servo horns on the servo head such that the tip to be of the ground when the servo was in a high position, and on the ground in the low position. The results of a simple pattern print is shown in Fig. 8.
Figure 8: Results of  a simple pattern test.
-John "I've been in bed for a month because my face is broken" Dunn