View
5
Download
0
Category
Preview:
Citation preview
DuckhunterFinal Project Presentation
Taylor Barton and Andrew Lisy
tbarton@mit.edu, alisy@mit.edu
6.111 - Digital Electronics Laboratory
Massachusetts Insitute of Technology
Duckhunter – p.
Outline of Talk
Objectives and System Overview
Block Diagram
Input System
Output Servomechanizm
Calibration
What’s Next?
Conclusions
Taylor Barton
Andrew Lisy
Duckhunter – p.
Objectives and System Overview
Objective: build a servomechanism that plays Nintendo’sDuck Hunt in skeet mode
Nintendo
switchbox
TV light gun
servos
optical sensorcalibrate
Duckhunter
Duckhunter – p.
Block Diagram
calibration video
timing module
light calibratorwhite v_sync
h_sync
xvga
hcount
vcount
65 MHzclock
c_videoto TV
comparator hit
thresh
light gunphototransistor
c_ready
x_hit
y_hit
FSM
c_enc_x_coords
c_y_coords
conversion
x_coord
y_coord
x_offset
y_offset
8
(LED[0])
debounce
7
theta_coord
phi_coord8
8
drivermotor
distance to TV(switch[6:0])
to motors
debouncecalibrate(switch[7])
black
Each block also gets clock and reset inputs
calibrated
calibrator
FSMstate: oneof fivecoord pairs
8 8
<δ?
<δ?
counts v and hsyncs betweenwhite and hit
coordinate
use trig toconvert totheta and phi based onTV distance
tv_dist
8
8
8
8
8
A/D controller
AD7125
on high c_en andc_ready, blanksscreen and pulses black, then colors screen white andpulses white
two registers:
black and whitescreen.
sensor vals for
light_val
x1_coord_pred
y1_coord_pred
x2_coord_pred
y2_coord_pred
8
8
8
8
ADC0820
shoot to triggerof light gun
8
Andrew Lisy
Taylor Barton
timer
start_counttime
disk spacing delayinput vectorsystem time
physics1
disk spacing delayinput vectorsystem time
physics2
wait FSM
start_d1
start_d2
enable
enable
0
video
19
vsync
<x,y>
phy1_en
phy2_en
10
t2timersave
time offset 8
8
8
Duckhunter – p.
Input System
Function: Translate the video output of the Nintendo totime-adjusted coordinates for the gun.
Duckhunter – p.
Input System
Function: Translate the video output of the Nintendo totime-adjusted coordinates for the gun.
Subcomponents:
Duckhunter – p.
Input System
Function: Translate the video output of the Nintendo totime-adjusted coordinates for the gun.
Subcomponents:
Vector Analyzer - from frame sequence, detect discs anddetermine initial velocity vector < −→x1,
−→y1 > for each disc.
Duckhunter – p.
Input System
Function: Translate the video output of the Nintendo totime-adjusted coordinates for the gun.
Subcomponents:
Vector Analyzer - from frame sequence, detect discs anddetermine initial velocity vector < −→x1,
−→y1 > for each disc.
Physics Engine - Using vectors, apply formulas:
xt = −→x0t, yt = −→y0t + 1
2gnest
2
where gnes = experimentally determined gravity force ofNES (in pixels/frame2).
Duckhunter – p.
Input System
Function: Translate the video output of the Nintendo totime-adjusted coordinates for the gun.
Subcomponents:
Vector Analyzer - from frame sequence, detect discs anddetermine initial velocity vector < −→x1,
−→y1 > for each disc.
Physics Engine - Using vectors, apply formulas:
xt = −→x0t, yt = −→y0t + 1
2gnest
2
where gnes = experimentally determined gravity force ofNES (in pixels/frame2).
Timer - keeps track of delays in 1/10 seconds.Duckhunter – p.
Input System: Vector Analyzer
1. Wait for white ’blip’ to appear just above scoring panel.
Duckhunter – p.
Input System: Vector Analyzer
1. Wait for white ’blip’ to appear just above scoring panel.
2. When blip is found, record coordinates in register bankA1. Wait a frame, record new coordinates to to A2 andassert start_d1.
Duckhunter – p.
Input System: Vector Analyzer
1. Wait for white ’blip’ to appear just above scoring panel.
2. When blip is found, record coordinates in register bankA1. Wait a frame, record new coordinates to to A2 andassert start_d1.
3. Set ’disc_present’ register to high to indicate we havecoordinates for one disc.
Duckhunter – p.
Input System: Vector Analyzer
1. Wait for white ’blip’ to appear just above scoring panel.
2. When blip is found, record coordinates in register bankA1. Wait a frame, record new coordinates to to A2 andassert start_d1.
3. Set ’disc_present’ register to high to indicate we havecoordinates for one disc.
4. Output < xA2 − xA1, yA2 − yA1 > to vector output
Duckhunter – p.
Input System: Vector Analyzer
1. Wait for white ’blip’ to appear just above scoring panel.
2. When blip is found, record coordinates in register bankA1. Wait a frame, record new coordinates to to A2 andassert start_d1.
3. Set ’disc_present’ register to high to indicate we havecoordinates for one disc.
4. Output < xA2 − xA1, yA2 − yA1 > to vector output
5. Repeat process for next disk (using register bank B1,B2). When blip for next disk is found, assert start_d2.
Duckhunter – p.
Input System: Physics Engine
Inputs: Vector from Vector Analyzer, system time t, gunaiming latency taim, shot spacing offset tsp
Duckhunter – p.
Input System: Physics Engine
Inputs: Vector from Vector Analyzer, system time t, gunaiming latency taim, shot spacing offset tsp
Output: Coordinates of the two discs, compensating foraiming latency and spacing offset, as a function of t, taim, tsp
Duckhunter – p.
Input System: Physics Engine
Inputs: Vector from Vector Analyzer, system time t, gunaiming latency taim, shot spacing offset tsp
Output: Coordinates of the two discs, compensating foraiming latency and spacing offset, as a function of t, taim, tsp
Implementation: The first physics engine receives input t
from timer, taim from experimental values, and tsp wired toground (since it handles the first disc, there is no spacingdelay). The second module receives t and taim from thetimer and experimental values, as well as tsp from the t2module.
Duckhunter – p.
Servomechanism
The output system takes the (x, y) coordinate from the physics
engine and translates it into angles for the servomechanism.
distance
height
(0,0)
inputs: (x, y) coordinates, (x, y) offsets, distance from TV, height
(constant)
outputs: motor control signal
Servo resolution ≈ 1 degree.
Duckhunter – p.
Servomechanism: Calibration
hcount
vcou
nt
(0,0)
Calibrator outputsvideo to TV: first black,then white screen.
Timing module countsthe hsync and vsyncsignals between thestart of the whitescreen and the gunsensing a hit to deter-mine position.
System is calibrated by comparing intended and actualcoordinates.
Duckhunter – p.
What’s next?
1. Real-time Feedback: If we are able to find a version ofthe NES Duck Hunt game that uses a specific mode ofhit detection (blanking then whiteing the entire screen),we can implement real-time calibration to our system,thus increasing the accuracy.
Duckhunter – p. 10
What’s next?
1. Real-time Feedback: If we are able to find a version ofthe NES Duck Hunt game that uses a specific mode ofhit detection (blanking then whiteing the entire screen),we can implement real-time calibration to our system,thus increasing the accuracy.
2. Miss Correction: If possible, we will implement a hitdetection mechanism which sends a signal into the FSMafter the gun is fired. If the signal is low, re-aim and fire.If high, move to the next state.
Duckhunter – p. 10
What’s next?
1. Real-time Feedback: If we are able to find a version ofthe NES Duck Hunt game that uses a specific mode ofhit detection (blanking then whiteing the entire screen),we can implement real-time calibration to our system,thus increasing the accuracy.
2. Miss Correction: If possible, we will implement a hitdetection mechanism which sends a signal into the FSMafter the gun is fired. If the signal is low, re-aim and fire.If high, move to the next state.
3. Duck Hunt Mode: Depending on the mechanicallimitations of our tracking and firing mechanism,Duckhunter could be implemented to play the DuckMode of Duck Hunt
Duckhunter – p. 10
Conclusion
Mechanical considerations limit how fast and accuratethe digital system can be.
Duckhunter – p. 11
Conclusion
Mechanical considerations limit how fast and accuratethe digital system can be.
The calibration routine, while seemingly mundane, is avery critical part of the system, since the gun will bemoved from station to station. Manual calibration wouldbe tedious and unreliable.
Duckhunter – p. 11
Conclusion
Mechanical considerations limit how fast and accuratethe digital system can be.
The calibration routine, while seemingly mundane, is avery critical part of the system, since the gun will bemoved from station to station. Manual calibration wouldbe tedious and unreliable.
Determining the coefficients for the physics engine mayrequire a separate system to track and analyze datafrom previous runs.
Duckhunter – p. 11
Conclusion
Mechanical considerations limit how fast and accuratethe digital system can be.
The calibration routine, while seemingly mundane, is avery critical part of the system, since the gun will bemoved from station to station. Manual calibration wouldbe tedious and unreliable.
Determining the coefficients for the physics engine mayrequire a separate system to track and analyze datafrom previous runs.
If we are successful, this system may succeed where wehave failed: reaching the final level of Duck Hunt
Duckhunter – p. 11
Recommended