Team Doki Doki: Paintball Gun IR Sensing and Tracking

33
Capstone CDR Fall 2005 Team Doki Doki: Paintball Gun IR Sensing and Tracking Team Members: Matt Freeman James Kirby Juan Rivera

description

Team Doki Doki: Paintball Gun IR Sensing and Tracking. Team Members: Matt Freeman James Kirby Juan Rivera. Presentation Outline. Project Overview System Diagram Input subsystem Processing subsystem Output subsystem Schedule Milestones Division of Labor Budget/Parts List. - PowerPoint PPT Presentation

Transcript of Team Doki Doki: Paintball Gun IR Sensing and Tracking

Page 1: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Team Doki Doki:Paintball Gun

IR Sensing and Tracking

Team Members:Matt Freeman

James Kirby

Juan Rivera

Page 2: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Presentation Outline• Project Overview• System Diagram

– Input subsystem– Processing subsystem– Output subsystem

• Schedule• Milestones• Division of Labor• Budget/Parts List

Page 3: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 4: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

System Diagram

IR Sensors

User Interface

DataADC

/MUX Spartan-3Data

Control

StepperMotors

Actuator

LCD

Gun

IRTransmitter

Page 5: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

System Input

IR Sensors

User Interface

DataADC

/MUX Spartan-3Data

Control

StepperMotors

Actuator

LCD

Gun

IRTransmitter

Page 6: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

IR Sensing

• IR λ emitted by humans is ~10μm– Requires exotic and expensive detectors

• Use matched IR detector/emitter pairs– Readily available, inexpensive

HgCdTe

Page 7: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

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

Page 8: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 9: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 10: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

ADC

• IR sensors are analog, board input is digital

• AD7821: 8 bit parallel analog to digital converter

• VREF+/- allows for fine-tuning of voltage of one LSB

Page 11: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

IR/MUX/ADC Schematic

EN6

A11

B10

C9

VDD16

VEE7

X3

X013

X114

X215

X312

X41

X55

X62

X74

74HCT4051

VIN1

WR/RDY6

MODE7

RD8

CS13

+VREF12

-VREF11

DB02

DB13

DB24

DB35

DB414

DB515

DB616

DB717

INT9

OFL18VDD

20

VSS19

AD7821

+3.3.V+5V

...7

...6

...5

...4

IR LSB1

......

...2

...3

IR MSB8

MUX LSB9

MUX10

MUX MSB11

GPIO

DIR2

OE22

VCCB23

VCCB24

A13

A24

A35

A46

A57

A68

A79

A810

B121

B220

B319

B418

B517

B616

B715

B814

74LVC4245/SO

DIR2

OE22

VCCB23

VCCB24

A13

A24

A35

A46

A57

A68

A79

A810

B121

B220

B319

B418

B517

B616

B715

B814

74LVC4245/SO

D1IR

D2IR

D3IR

D4IR

D5IR

D6IR

D7IR

D8IR

Page 12: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Manual Control Interface

• Modified 8-bit NES controller• Controls switching between operation modes• Controls manual and calibration functioning

Page 13: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Manual Control Interface

DS11

P17

P26

P35

P44

P513

P614

P715

P81

C10

P/S9

VCC16

Q62

Q712

Q83

VSS8

14021

U1

1

2

3

4

E1

B5S

1

J1

BTN

1

J2

BTN

1

J3

B2S

1

J4

B2S

Sel7

Right6

Left5

Down4

B1

......

A2

Up3

Start8

GPIO

A1+5V

DIR2

OE22

VCCB23

VCCB24

A13

A24

A35

A46

A57

A68

A79

A810

B121

B220

B319

B418

B517

B616

B715

B814

U2

74LVC4245/SO

+3V

• Parallel control hard-wired to MC14021B controller chip

• Input into board via 40-pin GPIO expansion port

Page 14: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

System Processing

IR Sensors

User Interface

DataADC

/MUX Spartan-3Data

Control

StepperMotors

Actuator

LCD

Gun

IRTransmitter

Page 15: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Spartan-3 Breakdown

SPARTAN-3

RS-232

FPGA40-pinGPIO

MicroBlaze

Serial LCD

NES Control

IR Data

MUX/ADC

Motor Drivers

State Machine

Page 16: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

State Machine

Calibration MoveUp

MoveRight

MoveDown

Manual

Automatic Fire

Reset=1

NESLeft=1NESSel=1

NESDown=1

NESUp=1

NESRight=1

NESB=1

NESRight=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

MoveLeft NESLeft=1

NESSel=1

NESDown=1

Page 17: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

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

Page 18: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 19: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 20: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

System Output

IR Sensors

User Interface

DataADC

/MUX Spartan-3Data

Control

StepperMotors

Actuator

LCD

Gun

IRTransmitter

Page 21: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

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

Page 22: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Motor Driver Circuit

• Bipolar Stepper

Motor Driver• “H-bridge” design• Interface between

Spartan-3 and motors

Page 23: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Motor Driver Schematic

Page 24: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 25: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 26: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Paintball Gun

• Mounted on a Lazy Susan for left/right rotation

• Will fire “safe” ammunition for indoor testing

Page 27: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Updated Project Schedule

Page 28: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 29: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 30: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 31: Team Doki Doki: Paintball Gun IR Sensing and Tracking

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

Page 32: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Project Budget/Parts ListItem Description Estimated PriceStepper Motors (2) Vexta 2-Phase 1.1A motors $25Linear Actuator Ledex heavy-duty tubular solenoid $15IR Sensors & Mounts RadioShack matched IR emitter detectors $40Color CMOS Camera CM-2 from ElectronicKits.com $86Mounting Hardware For gun, motors, actuator $100Fiberglass Casing Stationary housing $50FPGA/Embedded Controller Xilinx Spartan-3 $125PCB 2-layer, allows for at least one revision $150Serial LCD ILM-216 from seetron.com $60

Digikey Purchases

PFETS: IRFZ44 and MTP2955 (20 each)BJTS: BC547B (20)MUX: 74HC4051NADC: AD7821Level shifters: LVC4245A (3)

$80

E-Store Purchases Perfboard, caps, etc. $40Aprilog Adapters 24SOD3SMTS (3, SOIC to DIP) $40Printing/Binding Costs User and technical manual $150Miscellaneous Electronics Unforeseen parts and repairs $150

TOTAL: $1,111

Page 33: Team Doki Doki: Paintball Gun IR Sensing and Tracking

Capstone CDR Fall 2005

Questions?