Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
EEL 4924 Electrical Engineering Design
(Senior Design)
Final Report
April 23, 2013
Project Name: SpyBot
Team Members:
Name: Josh Kurland Name: Parker Karaus
Email: [email protected] Email: [email protected]
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
2
TABLE OF CONTENTS
Project Abstract...................................................................................3
Introduction.........................................................................................4
Technical Objectives............................................................................5
Cost Objectives...................................................................................10
Parts List............................................................................................11
Division of Labor.................................................................................13
TABLE OF FIGURES
Block Diagram……………………………………………………………….……9
Gantt Chart…………………………………………………………………….…14
Schematics…………………………………………………………………….…15
PCB Layouts………………………………………………………………….…17
Software Flowcharts……………………………………………………………19
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
3
Abstract
Our project consists of a remote controlled vehicle equipped with a servo turret and
mounted wireless camera. The vehicle is controlled remotely by a portable device using Xbee
Wireless transceivers. Utilizing two joysticks the user can control the movement of the vehicle
as well the camera direction. A large push button operates a laser that can be used to mark
specific targets. The remote control also houses a Beagleboard-XM computer with an ARM8
processor. The Beagleboard takes the live video feed from the camera and implements a color
tracking algorithm, which is then sent to a monitor through HDMI.
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
4
Introduction
The SpyBot is used as a search and destroy device capable of tracking a subject
(colored ball) from a distance.
The purpose of this project was to build a remote controlled vehicle with a camera
attached to a pan/tilt servo turret. The device will provide the user with a video feed in order to
drive the vehicle and move the camera. The vehicle can be driven in close range within
eyesight or over longer range through use of the video feed. The video displayed to the user
has the option to track a colored target. The rover vehicle and camera can be driven or turned
independently of one another.
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
5
Technical Objectives
This project consisted of two distinct spheres of focus: Driving the vehicle and following an
object.
The vehicle uses DC motors driven by a microprocessor with H bridges in between. The H
bridge takes the PWM pulse from the microprocessor and uses it as a signal to open and close
the transistor gates and allow the voltage to flow to the motor. The wider the PWM pulse (the
more area under the curve) the longer the gates will be opened, and the faster the motor will
run. This also allows the motors to be controlled both forward and reverse. By using four
control signals we can precisely control left and right steering.
Sending a pulse to A and C will move the motors forward. A pulse on B and D will put the
motors in reverse. Turning is achieved by sending signals to opposite directions. For example,
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
6
to turn left at an angle, C can be set to full speed while B will drive back at a fraction of its
maximum, thus turning at precise angle.
The vehicle and the remote control are both powered by 9.6V NiMH rechargeable batteries.
To recharge the cells, we built a recharging circuit that provides a current source (from a 12V
500mA power pack) of about 200 mA. This slowly charges the battery packs until they reach
their peak charge. Upon reaching their peak, the voltage curve will start to dip. To sense this
voltage drop, a TL081 op amp was used as a comparator, with one input being the battery
voltage by itself (in the negative input of the op amp), the other being the battery voltage along
with a charging capacitor (in the positive input of the op amp). The capacitor will discharge
slowly and still be greater than the pure battery voltage after the drop. This will result in a large
increase in voltage from the output pin (from about 1-2 V to above 9 V). The op amp output is
applied to the gate pin of a power PMOS transistor. When it receives a high voltage, there is not
enough of a differential between source and gate to close the transistor, as the source end is
receiving the voltage from the regulator. When the output is low (meaning the two compared
voltages are near equal), the gate will have little voltage applied, meaning the source is being
biased enough to create a large gate source differential, closing the transistor and allowing the
batteries to charge. As the circuit must be closed to begin charging initially and obtain the
voltage comparison, a switch is used to bridge the PMOS temporarily, after which it can be open
to allow the PMOS and op amp to start or stop charging on their own. A large capacitor was
used to ensure that the difference in peak voltage and dropped voltage would not be missed.
Target color identification is achieved by using a thresholding algorithm. First the image is
converted from RGB into an HSV color scale. Then the specific color’s minimum and maximum
HSV range values are set. This converts the video into a binary image, where all the pixels that
fall outside of the threshold range are removed, leaving just the pixels of interest. The threshold
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
7
values can be set using a calibration algorithm that takes the average and standard deviation of
all of the H, S, and V values. The maximum will be the average plus one standard deviation up
to account for slightly brighter or duller values. The minimum will be the average minus the
standard deviation. This will work as long as the entire frame is filled by the object. Any
background color will affect the calibration.
Target tracking is done by finding the spatial moment of the already thresholded binary
image. The spatial moment of the image is the weighted average of the centroid over the area.
∑ ∑ ( ) ( ) ( )
(
)
This algorithm returns the first order moment of the colored object as it changes position in
pixel space. This method is limited to tracking just one object at a time. If multiple objects of
the same color are in the frame, the algorithm will attempt to detect the change in both objects.
This will result in the moment being in the middle of both objects, instead identifying the correct
position.
Lastly, the processed video needed to be displayed to a screen. In the original proposal, we
had not yet settled on what type of device we were going to use to process the video, so the
specifics of the display output were not given. The Beagleboard was chosen due to its
supported DVI-D output as well as special LCD expansion headers. It wasn’t until later that it
was discovered that the operating system chosen for its OpenCV support did not also include
support to those expansion headers. The next option was to acquire an analog composite
screen and use a digital to analog converter to output the video. After spending far longer than
necessary modifying the kernel to support different screen resolutions, we learned that the
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
8
signal converter was in fact not compatible with the DVI-D video output used by the
Beagleboard, so that the board would never get the digital handshake that it was expecting.
Therefore the third choice was taken to use a standard computer monitor to view the camera
video feed. While this method is not very portable, it is able to support far higher resolutions
than the previous LCD designs could, resulting in a much better overall image.
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
9
Block Diagram
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
10
Cost Objectives
Our initial goal was to spend less than $300 on this project, not including the cost of the
computer and xbees. We ended up using the BeagleBoard as the computer for the image
processing software, which cost a significant amount. The project still cost less than $500
overall, which was our absolute limit in purchasing, so our estimate was not too far off.
According to the parts list below, which also includes spare parts and some unused parts, we
spend a total of $410.78 on all parts of the project. This includes the remote, rover, motor
drivers, and PCBs (all of our PCBs were milled for free by UF or Advanced Circuits).
Our project is similar to a handful of RC cars on the market with live video feeds. For
example, the “Spy Gear Spy Video Car VX-6” (http://www.amazon.com/Spy-Gear-Video-Car-
VX-6/dp/B004QM91JE/ref=sr_1_3?ie=UTF8&qid=1366679496&sr=8-
3&keywords=rc+car+with+camera) is a remote controller car with LCD mounted in the
controller. It costs far less than our project, mostly due to the lack of image processing of any
sort, which we performed with the BeagleBoard. Our Spybot project is also able to turn the
camera without turning the rover, since it is mounted on the pan/tilt servos rather than directly
on the car.
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
11
Parts List
SPYBOT
Item Quantity Cost Shipping Total
Remote
Joystick 2 $3.95 $2.00 $7.90
Xbee 1 - -
NiMH Battery Pack 1 $16.00 $10.00 $26.00
Switch 3 $0.00 $0.00 $0.00
9V to 5V Regulator 1 $0.00 $0.00 $0.00
5V to 3.3V Regulator 1 $0.00 $0.00 $0.00
Large Push Button 1 $0.00 $0.00 $0.00
Enclosure 1 $8.00 $0.00 $8.00
MicroController 1 $0.00 $0.00 $0.00
Computer
BeagleBoard 1 $160.00 $0.00 $160.00
HDMI - DVI Connector 1 $2.00 $0.00 $2.00
Computer Monitor 1 - -
Rover
Rover-5 Platform 1 $27.00 $25.13 $52.13
IP Camera 1 $49.99 $0.00 $49.99
Xbee 1 - -
NiMH Battery Pack 1 $16.00 $10.00 $26.00
Processor 1 $0.00 $0.00 $0.00
Pan/Tilt Bracket 1 $5.95 $0.00 $5.95
Pan/Tilt Servo 2 $8.95 $0.00 $17.90
Low Power Laser 1 $7.95 $0.00 $7.95
Proximity Sensor 1 $13.95 $4.43 $18.38
Voltage Regulator 3 $0.00 $0.00 $0.00
Barrel Jack 1 $3.88 $0.00 $3.88
Recharge Circuit
Op Amp 1 $0.00 $0.00 $0.00
Resistor 1 $0.00 $0.00 $0.00
Capacitor 3 $0.00 $0.00 $0.00
Switch 1 $0.00 $0.00 $0.00
Potentiometer 1 $0.00 $0.00 $0.00
Transistor 1 $0.20 $0.00 $0.20
Voltage Regulator 1 $0.00 $0.00 $0.00
Diode 3 $0.00 $0.00 $0.00
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
12
H Bridges
NPN MOSFET 20 $0.77 $0.00 $15.40 *includes spares/extras
PNP MOSFET 10 $0.91 $0.00 $9.10 *includes spares/extras
Resistor 12 $0.00 $0.00 $0.00
Opto-Isolator 8 $0.00 $0.00 $0.00
TOTAL
$410.78
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
13
Division of Labor
Parker Karaus was responsible for
H Bridge design and construction
Battery Recharging circuit design and construction
Xbee transceiver communication
Josh Kurland was responsible for
Beagleboard kernel, Operating System and OpenCV installation
Image processing and tracking
Camera setup and interface
Shared tasks consist of
PCB design
Motor/servo drive code
Parts selection
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
14
Gantt Chart
Project Selection P+J
Joystick Testing
Xbee Communication P+J
MicroProcessor PWM J
DC Motor Interfacing P
IP Camera Interacing P+J
LCD Driver J
Testing P+J
Time
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
15
Schematics
Rover:
Recharge/Regulator:
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
16
H-Bridge:
Remote:
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
17
PCB Layouts
Rover:
Recharge/Regulator:
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
18
H-Bridge:
Remote:
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
19
Software Flowcharts
Rover:
University of Florida EEL 4924 – Spring 2013 4/23/13 Electrical and Computer Engineering
Final Report: SpyBot
20
Remote: