Paintball Gun IR Sensing and Tracking
Download
Report
Transcript Paintball Gun IR Sensing and Tracking
Team Doki Doki:
Paintball Gun
IR Sensing and Tracking
Team Members:
Matt Freeman
James Kirby
Juan Rivera
Capstone CDR Fall 2005
Presentation Outline
• Project Overview
• System Diagram
– Input subsystem
– Processing subsystem
– Output subsystem
•
•
•
•
Schedule
Milestones
Division of Labor
Budget/Parts List
Capstone CDR Fall 2005
Project Overview
• Design a paintball gun auto-detection
and tracking system
• Implement both manual control and
automatic control based on IR sensing
• Stepper motors control gun movement
• Linear actuator pulls trigger
• Spartan-3 provides system control
Capstone CDR Fall 2005
System Diagram
IR Sensors
Data
ADC Data
Spartan-3
/MUX
Stepper
Motors
Actuator
User Interface
Control
IR
Transmitter
Capstone CDR Fall 2005
LCD
Gun
System Input
IR Sensors
Data
ADC Data
Spartan-3
/MUX
Stepper
Motors
Actuator
User Interface
Control
IR
Transmitter
Capstone CDR Fall 2005
LCD
Gun
IR Sensing
• IR λ emitted by humans is ~10μm
– Requires exotic and expensive detectors
• Use matched IR detector/emitter pairs
– Readily available, inexpensive
Capstone CDR Fall 2005
HgCdTe
IR Transmitters
• Transportable independent target
• House in self-contained multiple LED flasher
– Has different modes of operation
• Two IR LEDs for transmission and one visible
LED for alignment and power confirmation
Capstone CDR Fall 2005
IR Sensors
•
•
•
•
Mount in an array on gun barrel
Both fine-tuning and coarse adjustment
Shield from light for best results
More precise final design
Capstone CDR Fall 2005
MUX
• One ADC, 8
analog inputs
• MC74HC4051:
8 to 1 analog
switch
• Will require 8
cycles to
refresh all IR
readings
Capstone CDR Fall 2005
ADC
• IR sensors are analog,
board input is digital
• AD7821: 8 bit parallel
analog to digital
converter
• VREF+/- allows for finetuning of voltage of
one LSB
Capstone CDR Fall 2005
IR/MUX/ADC Schematic
+5 V
+3 .3.V
GP IO
1
74 HCT 4 051
A D782 1
74 LV C42 45/S O
2
11
10
9
6
16
7
A
B
C
EN
V DD
VEE
X
X0
X1
X2
X3
X4
X5
X6
X7
3
1
13
14
15
12
1
5
2
4
12
11
7
8
13
20
19
V IN
+V RE F
-VRE F
MODE
RD
CS
V DD
VSS
DB 0
DB 1
DB 2
DB 3
DB 4
DB 5
DB 6
DB 7
INT
OFL
WR/RDY
IR
D1
IR
D2
2
3
4
5
14
15
16
17
3
4
5
6
7
8
9
10
9
18
2
22
6
23
24
A1
A2
A3
A4
A5
A6
A7
A8
B1
B2
B3
B4
B5
B6
B7
B8
21
20
19
18
17
16
15
14
3
4
5
6
7
DIR
8
...
OE
V CCB
V CCB
74 LV C42 45/S O
IR
D3
IR
D4
IR
D5
IR
D6
3
4
5
6
7
8
9
10
2
22
IR
D7
23
24
IR
D8
Capstone CDR Fall 2005
A1
A2
A3
A4
A5
A6
A7
A8
DIR
OE
V CCB
V CCB
B1
B2
B3
B4
B5
B6
B7
B8
21
20
19
18
17
16
15
14
IR L SB
...
... MUX LS B
...
MUX
... MUX MS B
...
...
IR MS B
...
9
10
11
Manual Control Interface
• Modified 8-bit NES controller
• Controls switching between operation modes
• Controls manual and calibration functioning
Capstone CDR Fall 2005
Manual Control Interface
E1
+5 V
1
J3
2
4
J4
1
1
J1
J2
1
1
A1
1
3
U2
B 2S
B 2S
2
BT N
BT N
15
3
4
5
6
7
8
9
10
14
2
B 5S
U1
1
2
3
4
5
6
7
8
P8
Q6
Q8
P4
P3
V CC
P7
P6
P5
Q7
P2
DS
P1
C
VSS
P /S
16
13
+3 V
12
22
23
24
11
10
A1
A2
A3
A4
A5
A6
A7
A8
B1
B2
B3
B4
B5
B6
B7
B8
DIR
OE
V CCB
V CCB
21
20
19
18
17
16
15
14
3
4
5
6
7
8
...
B
A
Up
Down
Le ft
Rig ht
S el
S ta rt
...
GP IO
74 LV C42 45/S O
9
• Parallel control hard-wired
to MC14021B controller chip
14 02 1
• Input into board via 40-pin
GPIO expansion port
Capstone CDR Fall 2005
System Processing
IR Sensors
Data
ADC Data
Spartan-3
/MUX
Stepper
Motors
Actuator
User Interface
Control
IR
Transmitter
Capstone CDR Fall 2005
LCD
Gun
Spartan-3 Breakdown
SPARTAN-3
FPGA
IR Data
NES Control
State Machine 40-pin
GPIO
MUX/ADC
MicroBlaze
Serial LCD RS-232
Motor Drivers
Capstone CDR Fall 2005
State Machine
Reset=1
Calibration
NESRight=1
NESUp=1
MoveUp
NESSel=1
NESLeft=1
Transfer out of all move
states and fire state controlled
via variable PrevState
Automatic mode ignores all
inputs except Reset and
NESSel
NESUp=1
NESRight=1
MoveLeft
NESLeft=1
NESSel=1
Manual
MoveRight
NESB=1
NESDown=1
MoveDown
Automatic
NESDown=1
Capstone CDR Fall 2005
Fire
State Machine Implementation
• Big switch statement
– Registers keep track
of both next state
and previous state
• Digital lock prevents
unwanted toggling
• Separate modules
for clock division
and display
Capstone CDR Fall 2005
Initial Software Testing
• First used Spartan-3 on-board I/O, then GPIO
• Successful behavior of state machine observed
– Simulated and actual NES inputs all had correct effects
– L/R and U/D position each visible on two 7-segment displays
– Manual control working in software, yet to send pulses to motors
Capstone CDR Fall 2005
MicroBlaze
• MicroBlaze is a soft processor core from
Xilinx for use in FPGAs
• Create an RS-232 interface for serial
character LCD output
• Encapsulate Verilog state machine
– Cannot directly interface with GPIO ports
Capstone CDR Fall 2005
System Output
IR Sensors
Data
ADC Data
Spartan-3
/MUX
Stepper
Motors
Actuator
User Interface
Control
IR
Transmitter
Capstone CDR Fall 2005
LCD
Gun
Stepper Motors
• Provide gun left/right and up/down movement
• Chosen stepper motors have lots of torque
• Allow the system to know the position of
sensor
Capstone CDR Fall 2005
Motor Driver Circuit
• Bipolar Stepper
Motor Driver
• “H-bridge” design
• Interface between
Spartan-3 and motors
Capstone CDR Fall 2005
Motor Driver Schematic
Capstone CDR Fall 2005
Actuator
• Linear actuator physically pulls trigger
• Chosen over servo motor for faster reaction
– Can fire multiple times per second
• Mount directly on gun behind trigger
– Spring-loaded trigger pulls actuator back out
automatically after firing
Capstone CDR Fall 2005
LCD
• Character LCD chosen for ease of use
• Serial RS-232 LCD to interface with MicroBlaze
• Could display lots of different information
–
–
–
–
Initially: Debugging info
Gun position
Shots remaining
IR signal strength
• Not system-crucial
Capstone CDR Fall 2005
Paintball Gun
• Mounted on a Lazy Susan for left/right
rotation
• Will fire “safe” ammunition for indoor
testing
Capstone CDR Fall 2005
Updated Project Schedule
Capstone CDR Fall 2005
Milestone 1
• Date: October 27th
• Goal: Manual operation fully functional
– NES Controller properly interfaced
– Proper state machine operation
– Working motor driver circuits (wire wrap)
– Motors control gun movement
Capstone CDR Fall 2005
Milestone 2
• Date: November 17th
• Goal: Automatic operation functional
– IR detector array finalized
– Control logic (MUX, ADC) configured
– Automatic state on FPGA taking data from
IR sensors and sending out appropriate
signals to motor drivers
Capstone CDR Fall 2005
Add-Ons for Expo
• Get serial character LCD configured via
RS-232 using MicroBlaze
• Complete acrylic housing
– Ability to see all “guts” of system
• Mount CMOS video camera on gun barrel
Capstone CDR Fall 2005
Division of Labor
• Matt – Circuit Design and System
Integration
• James – Data Processing and Software
Design
• Juan – Structure and Circuit Design and
Implementation
Capstone CDR Fall 2005
Project Budget/Parts List
Item
Stepper Motors (2)
Linear Actuator
IR Sensors & Mounts
Color CMOS Camera
Mounting Hardware
Fiberglass Casing
FPGA/Embedded Controller
PCB
Serial LCD
Digikey Purchases
E-Store Purchases
Aprilog Adapters
Printing/Binding Costs
Miscellaneous Electronics
Description
Vexta 2-Phase 1.1A motors
Ledex heavy-duty tubular solenoid
RadioShack matched IR emitter detectors
CM-2 from ElectronicKits.com
For gun, motors, actuator
Stationary housing
Xilinx Spartan-3
2-layer, allows for at least one revision
ILM-216 from seetron.com
PFETS: IRFZ44 and MTP2955 (20 each)
BJTS: BC547B (20)
MUX: 74HC4051N
ADC: AD7821
Level shifters: LVC4245A (3)
Perfboard, caps, etc.
24SOD3SMTS (3, SOIC to DIP)
User and technical manual
Unforeseen parts and repairs
TOTAL:
Capstone CDR Fall 2005
Estimated Price
$25
$15
$40
$86
$100
$50
$125
$150
$60
$80
$40
$40
$150
$150
$1,111
Questions?
Capstone CDR Fall 2005