pong - massachusetts institute of technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... ·...

13
Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien

Upload: others

Post on 10-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Pong.iRL

Play pong in the real worldAlex Huang, Kathy Camenzind, Xavier Zapien

Page 2: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Project Overview

● A human vs robot physical air hockey system with the use of machine vision

● Wanted to expand our favorite lab of the semester onto a new dimension

Page 3: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Hardware● 2D movement, actuated by steppers

○ Stepper drivers● 2 PC fans under table generating air stream

○ Reduced friction puck● Camera

Page 4: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Subsystems

➔ Machine Vision subsystemAlex Huang

➔ Robot Logic subsystemKathy Camenzind

➔ Motion Control subsystemXavier Zapien

Page 5: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Sensing for Pong.iRL

● Analog camera 640 x 480● Chroma keying

Page 6: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Machine Vision Subsystem

● Needs to determine where the puck and paddle are

Page 7: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Challenges

● Image noise

● Vibration

● Distortion

● Provide light source

● Use temporal filtering

● Construct camera frame to be

rigid

● Filter out by using fixed

reference

● Construct a lookup table

mapping camera location ->

real table location

Page 8: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Robot Logic Subsystem

● Trajectory predictor: outputs the y coordinate and time

that the puck will score. Continuously self-corrects

based on newest input values.○ Velocity calculator: Calculates speed and direction of puck

based on two previous timesteps. Significant change in direction = bounced off wall.

○ Deflection calculator: Calculates the y deflection when the

predicted trajectory bounces off of walls○ Outputs an array of the next n positions

● AI Strategy: Implemented as an FSM○ Basic strategy is only y paddle movement (defensive)○ Stretch goal is more advanced AI: offensive strategy,

hitting puck forwards, choosing move based on heuristics

Page 9: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Robot AI FSM

Challenges:

● Not over correcting for noise

● Developing a good heuristic for where and how to hit the puck to score

● Not getting in the way of the puck

Page 10: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Mechanics of Pong

Page 11: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Motion Control Subsystem

● Given the desired paddle x and y values, we will be shifting the paddle to the desired position as fast as possible

● Need to consider acceleration and stalling

Page 12: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Challenges

Motor Stall

● Testing methods

Moving and Timing

● Need to be able to react fast enough to not lose to

human

Reach Goal

● Allow the paddle to move in the X axis

● Add the attack mode

Page 13: Pong - Massachusetts Institute of Technologyweb.mit.edu/6.111/volume2/www/f2018/projects/... · Pong.iRL Play pong in the real world Alex Huang, Kathy Camenzind, Xavier Zapien. Project

Tim

elin

eModule 11/5 11/12 11/19 11/26 12/3 12/10

Machine Vision

Camera communicating with FPGA

Research chroma-keying image processing

Test and fine tune algorithm on monitor

Assist stall detection

Testing

Final project checkoff

Output to computer screen

Implement machine vision algorithm

Integrate subsystems

Robot AIDevelop detailed plan for AI strategy

Implement trajectory predictor submodules

Implement AI submodules with varying levels of aggression

Motion Control

FPGA communicating with motors

Implement smooth ramp up speed Stall detectionTest motor speeds

Hardware Mount camera3D print pucks and paddles

Fine tune for durability and minimizing vibrations Maintenance