nxtg workshop for bottle robosumo lawrence technological university

36
NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Upload: joy-matthews

Post on 17-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

NXTG Workshop for Bottle RoboSumo

Lawrence Technological University

Page 2: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Rules

1. Game Objective and Synopsis First robot to intentionally push the bottle

off the table OR Be the last robot remaining on the table6. Game Match Rules If the robot moves during the first 3

seconds, the robot automatically loses the game

Page 3: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Robot Configuration for this workshopLeft Motor B Left Light Sensor 2

NX

T B

rick

Right Light Sensor 3Right Motor C

Ultraso

nic S

enso

r 4

Page 4: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Left Motor connects to BRight Motor connects to C

Left Light sensor connects to port no. 2Right Light sensor connects to port no. 3Sonar sensor connects to port no. 4

Remember the connections!

4

Page 5: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Move “Forever”

Will the robot move forever?

Download and test this program

Page 6: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Downloading Programs

Make sure your robot is plugged in, and turned on, then click the down arrow.

Page 7: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Running a Program

Press the orange button to run your program and go down a menu level

Press the dark gray button to stop your program and go up a menu level

Use the arrows to view choices in this menu level

Page 8: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Move “Forever”

Did it go forever?Why not?

Page 9: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

This Does Work

Put the Move block in an infinite loop.

Page 10: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Moving Backwards

Page 11: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Spin

Page 12: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Light Sensors

Page 13: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Light Sensor Readings

Connect the robot with the USB cordPlace light sensor 3 over the edge of the tableA number between 0-100 is displayed hereNow place it over the tableEnter the average of those numbers here

Page 14: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding the Edge

Page 15: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding the Edge

Use your mouse to draw a green data wirePut a Move block outside the loop in the Stop directionTry out the program!

Page 16: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Problems

If your robot stops too soon or too late, try adjusting your light sensor value

We only are looking at one light sensor – what if the other one goes off the table first?

Page 17: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding with Both Sensors

Page 18: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding with Both Sensors

Page 19: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding with Both Sensors

Page 20: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Simple Sumo without detecting objects (sumo1.rbt)

Page 21: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Ultrasonic Sensor

Measures the distance to the closest objectUses sonar waves like a batCan be used to see if an object is within a

certain range of the robot

Page 22: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Finding the Bottle

Page 23: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Sumo2.rbt – Simple Sumo with object detection

Page 24: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Wait for a second

3 second wait is required when the game starts

Page 25: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Test sumo2

For the qualifying round, each robot will be placed on a table with two bottles. Practice!

Did your robot find both bottles? Did it spin around forever? We can avoid it spinning forever by using a Timer block

For the tournament, there will be two robots and one bottle on the table at a time. Practice!

Try improving your program so you can win sumo!

Page 26: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Timer

Whenever you use a timer, it’s always a good idea to reset it first

Page 27: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Wait to play a sound using the timer

Page 28: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Physics of sumo

• Your robot will be more effective at pushing other robots off the table if you use• Mass• Velocity• Force• Torque• Power

Page 29: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Mass

• m=mass, v=velocity, p=(linear) momentum• p=m*v

• F=force, a=acceleration• F=m*a

• If we increase the mass, we increase the momentum and force• Where to add mass? Consider the center of

gravity (should be low and inside wheel base)

Page 30: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Velocity

• m=mass, v=velocity, p=(linear) momentum• p=m*v

• If we increase the velocity, we increase the momentum• The larger the momentum, the more Force is

required to change the acceleration• How do we increase the velocity of the

robot? (With the motor)

Page 31: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Force

• T=torque, r=wheel radius• Torque=Force*radius• Force=Torque/radius• How do we increase the Force?

• Increase the torque• Decrease the radius (smaller wheels)

Page 32: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Torque and Power

• P=Power, T=Torque, w=angular velocity• P=T*w• T=P/w

• How do we increase the torque?• Increase the power (Motor power)• Decrease the angular velocity

• Make sure batteries are fully charged!• We can increase the torque by “gearing down”

Page 33: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Build a better robot (later)

• Sturdy construction• At least 2 attachment points for each part so

robot stays together• Compact design• Triple pegs on multiple beams

• Wheel base• Wide base for slow turns• Narrow base for fast turns• Which is best for stability of robot?

Page 34: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Robot design (2)

• Wheels• How many with tires? 2 or more?• Tires- rubber or plastic? (for traction?)• Size – large or small?• Placement of wheels – front or back?

Page 35: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Robot design (3)

• Sensors• Placement of light sensors (height above

table? How far in front or to side of wheels?)• Placement of sonar sensor (low or high?)• Use additional sensor(s)?

• Touch sensor(s) to detect if an opponent is pushing your robot?

• Touch sensor(s) to detect if you are pushing an opponent or the bottle?

Page 36: NXTG Workshop for Bottle RoboSumo Lawrence Technological University

Strategy

• Try to lift an opponent off the table?• Try to hide from an opponent (cloaking)?• Bounce off an opponent if attacked?• Add a motor to power a mechanical device to

attack your opponent (try to flip your opponent over)?

• The best strategy is to find the bottle first!