Download Project Name: SpyBot - University of Florida

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Variable-frequency drive wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Alternating current wikipedia , lookup

Opto-isolator wikipedia , lookup

Buck converter wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Power MOSFET wikipedia , lookup

Metadyne wikipedia , lookup

Computer science wikipedia , lookup

Voltage optimisation wikipedia , lookup

Rectiverter wikipedia , lookup

Stray voltage wikipedia , lookup

Mains electricity wikipedia , lookup

Electrical engineering wikipedia , lookup

Electronic engineering wikipedia , lookup

Transcript
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
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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
2
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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.
3
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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.
4
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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,
5
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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
6
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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
7
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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.
8
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
Block Diagram
9
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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-CarVX-6/dp/B004QM91JE/ref=sr_1_3?ie=UTF8&qid=1366679496&sr=83&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.
10
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
Parts List
SPYBOT
Item
Quantity Cost
Shipping Total
Remote
Joystick
Xbee
NiMH Battery Pack
Switch
9V to 5V Regulator
5V to 3.3V
Regulator
Large Push Button
Enclosure
MicroController
2
$3.95
$2.00
1 1
$16.00
$10.00
3
$0.00
$0.00
1
$0.00
$0.00
$7.90
1
1
1
1
$0.00
$0.00
$8.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$8.00
$0.00
BeagleBoard
HDMI - DVI
Connector
Computer Monitor
1
$160.00
$0.00
$160.00
1
$2.00
$0.00
1 -
$2.00
1
$27.00
$25.13
1
$49.99
$0.00
1 1
$16.00
$10.00
1
$0.00
$0.00
1
$5.95
$0.00
2
$8.95
$0.00
1
$7.95
$0.00
1
$13.95
$4.43
3
$0.00
$0.00
1
$3.88
$0.00
$52.13
$49.99
$26.00
$0.00
$0.00
Computer
Rover
Rover-5 Platform
IP Camera
Xbee
NiMH Battery Pack
Processor
Pan/Tilt Bracket
Pan/Tilt Servo
Low Power Laser
Proximity Sensor
Voltage Regulator
Barrel Jack
Recharge Circuit
Op Amp
Resistor
Capacitor
Switch
Potentiometer
Transistor
Voltage Regulator
Diode
1
1
3
1
1
1
1
3
$0.00
$0.00
$0.00
$0.00
$0.00
$0.20
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$26.00
$0.00
$5.95
$17.90
$7.95
$18.38
$0.00
$3.88
$0.00
$0.00
$0.00
$0.00
$0.00
$0.20
$0.00
$0.00
11
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
H Bridges
NPN MOSFET
PNP MOSFET
Resistor
Opto-Isolator
TOTAL
20
10
12
8
$0.77
$0.91
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$15.40 *includes spares/extras
$9.10 *includes spares/extras
$0.00
$0.00
$410.78
12
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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
13
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
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
14
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
Schematics
Rover:
Recharge/Regulator:
15
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
H-Bridge:
Remote:
16
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
PCB Layouts
Rover:
Recharge/Regulator:
17
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
H-Bridge:
Remote:
18
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
Software Flowcharts
Rover:
19
University of Florida
Electrical and Computer Engineering
EEL 4924 – Spring 2013
4/23/13
Final Report: SpyBot
Remote:
20