Showing posts with label block diagram. Show all posts
Showing posts with label block diagram. Show all posts

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

Tuesday, April 15, 2014

Motor Encoder Based Speed Control PCB

Hey team,

In the course of one of my classes, Electronics Design Lab, my partner, Alex Mault and I saw the chance to improve upon the design of our robot, affectionately named Geoff. Our goal was to take a messy breadboard and make an easy to use PCB from it. The result of our efforts worked remarkably well (meaning it worked exactly the same as before) and reduced the area of the circuit by two-thirds.

Figure 1: Our original, messy breadboard.
Figure 2: The beautiful, simple PCB copy.
The circuit we planned to replicate was a motor encoder feedback system, which uses the optical encoder output of a 10 V DC motor to maintain a constant angular wheel speed. Below is the block diagram  of this system for the right and left wheels of our robot, which are independently regulated by a microcontroller (Arduino).


While Geoff (our robot) is in motion, it's motor encoders output a 50% duty cycle square wave with a frequency proportional to the speed of rotation. For more information on Optical Encoders and how to build one, check out my previous post here. This square wave is sent to a 555 chip, set up as a one-shot circuit. A one-shot circuit outputs a pulse of fixed width on every rising edge of the input. Since the input of the one-shot 555 varies, but the pulse width (T_on) is fixed, we can achieve a variable duty cycle output. This output is fed into a voltage amplifier which regulates the ~3V input into a 5V output.

The speed control block is where all the magic happens. First, the output of the voltage amplifier is put through a basic RC circuit. What this does is create a primarily DC voltage with amplitude proportional to the duty cycle of the input signal. This DC voltage can be described as the "current" state of the motor.

For a moment, consider the robot ascending a slope. Given a constant voltage and current input, the robot would tend to slow down. By slowing down, the duty cycle output of the one-shot 555 decreases, and the DC "current" state of the motor decreases. If we use a voltage follower, where the reference voltage is given by a microcontroller to be either high or low, we can pull the dropping "current" DC voltage higher, which maintains the speed of the wheel equal to the reference voltage.

The packages we used were TL272 (Op-Amp) and LM555(One-shot 555). These are shown in the block diagram above.

To create the PCB that replicated this system, we first constructed a fully functional breadboard circuit. Taking these values, Alex created an EAGLE schematic and board layout. I then proceeded to hand make a two-layer board, which turned out to be a very tedious, but ultimately rewarding process, as the board worked just as planned.

The EAGLE project files.

- John "I really should be writing this lab report right now" Dunn


Figure 4: Left wheel 555 one-shot. 
Figure 5: Right wheel 555 one-shot 
Figure 6: Headers.
Figure 7: Voltage followers for right and left.
Figure 8: Right speed control.
Figure 9: Left Speed Control
Figure 10: PCB layout.