introduction to lego nxt robotics and robot sumo – sept 20, 2008

53
Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008 Douglas G. Czinder IEEE SEM R&A Chairperson [email protected] Professor Keith Bozin [email protected] CJ Chung, Ph.D. Associate Professor and Director of Robofest [email protected] Lawrence Technological University

Upload: yates

Post on 12-Jan-2016

51 views

Category:

Documents


0 download

DESCRIPTION

Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008. Lawrence Technological University. Douglas G. Czinder IEEE SEM R&A Chairperson [email protected] Professor Keith Bozin [email protected] CJ Chung, Ph.D. Associate Professor and Director of Robofest [email protected]. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Douglas G. CzinderIEEE SEM R&A [email protected]

Professor Keith [email protected]

CJ Chung, Ph.D.Associate Professor and Director of [email protected]

Lawrence Technological University

Page 2: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

This program is possible thanks to:

a grant from The Chrysler Foundation

the Southeastern Michigan Chapter of the IEEE Robotics & Automation Society

Page 3: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Workshop Schedule – Sept 20, 2008

9:30 – 10:00 Continental Breakfast (provided) 10:00 – 10:20 Intro to Lego NXT & Robofest 10:20 – 11:00 Basic NXTG programming 11:00 - 11:15 Break 11:15 - 12:30 Programming with Sensors

12:30 - 1:30 Lunch (provided)

1:30 - 2:15 Programming with Sensors (cont’d) 2:15 – 2:30 Break 2:30 – 3:00 Basic Sumo Program 3:00 – 3:30 Improved Sumo Program 3:30 – 4:00 Mini Competition

Page 4: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Introduction to Robotics

What is a true robot? autonomous robot with an on board computer Mechanical, electrical, and computational

components Six fundamental components of a robot

A brain or brains – computer Body: physical chasses that holds other pieces Actuators: motors, hydraulic pistons, pneumatics Sensors Power sources Communication mechanism

Page 5: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

What is Robofest?

100% Autonomous Affordable Challenging: Unknown problem No direct adult help allowed during the

competition Qualifiers and a World Championship Various categories including Robot Sumo Two divisions:

5th – 9th grade: Jr. Division 9th – 12th grade: Sr. Division

Page 6: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

RoboSumo

Push the other robot out of the Sumo ring

Page 7: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Specifications

  Junior Division Senior Division

Sumo ring diameter 77 cm (30 inches) 122 cm (48 in)

Maximum robot mass

1kg (2.2 lbs) 2 kg (4.4 lbs)

Maximum robot width and length

23 cm (9 inches)30 cm (11.75

inches)

Maximum robot height

no limit 30 cm (11.75

inches)

Robot type Any;Lego Mindstorms or NXT

recommended. any

Page 8: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Why Sumo?

The most popular robot competition in the world

Integrator in Science Education – Math, Logic, Computers, Mechanics, and Physics

Good for rookie teams Fun Motivator

Page 9: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Unknown Problem in Robofest Sumo

How to start is unknown Need sensor(s) Teams must bring a computer to program

the unknown parts

Page 10: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Introduction to Lego NXT

Brain – RCX micro computer Body: Lego Technic pieces Actuators: up to 3 motors Sensors: Light, Touch, Ultrasonic, Sound, etc. Power source: 9V (six AA batteries or

rechargeable battery pack) Communication mechanism: USB or Blue

Tooth

Page 11: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Introduction to “SB2 (Sumo Bot 2)”

Left motor: A Right motor: C Touch: 1 Light: 3 Ultra Sonic

(distance): 4

Page 12: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Introduction to NXTG Programming

Please go through Getting Started and Software Overview after this class

Page 13: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

First NXT program: Go forward for 2 sec. and stop

Let’s name the program first

Click on Go >> button You’ll see a

programming palette (canvas)

Page 14: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

First NXT program using SB1: Go forward for 2 sec. and stop (2/3)

Click on Move button Drag and drop the move block to

the canvas

Page 15: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

First NXT program using SB2: Go forward for 2 sec. and stop (3/3)

Change parameters for the Move Port Direction Steering Power Duration Next Action

Block

Configuration Panel

Page 16: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

How to run your first program (1/2)

Page 17: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

How to run your 1st program (2/2)

If “Found New Hardware” pops up, just follow the instruction

Click on “Download” button Recommended to un-plug the

cable from the Bot Press the orange button 4 times

(Turn on, My files, Software files, Run your program entitled go2stop)

Page 18: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

How to rerun the program

Check the program name on the LCD Press the orange button just once again

Page 19: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

How to stop the program

Gray button

Page 20: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

First NXT Program: Go forward for 2 sec. and stop (Review)

Page 21: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Do not forget:

Save your programs Meaningful file (program) names Use comments

Page 22: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

2nd Program: ForwardBack

1. Go Forward 2 rotations2. Wait 3 seconds, then 3. Backward 1 rotation

Page 23: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Go Forward 2 rotations, Wait 3 seconds then Backward 1 rotation – ForwardBack

Page 24: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Making Turns(Instructor Slide)

Turn left

Spin left

Face left

Left wheel Right wheel

Left wheel Right wheel

Left wheel Right wheel

stop

stop

Objective Challenge the students to think about how a turn is made Two ways to turn using one motor (demonstrate by turning with

your leg) Demonstrate advantage of turning by spinning

Page 25: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Making Turns

Turn left

Spin left

Face left

Left wheel Right wheel

Left wheel Right wheel

Left wheel Right wheel

stop

stop

Page 26: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Forward 2 rotations, Turn Left 90 Degrees, and Forward 2 rotations

Turn90Left – Using a Motor Block!

Page 27: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Forward 2 rotations, Turn Left 90 Degrees, and Forward 2 rotations – Turn90Left

Page 28: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

How do we make to turn 90 degrees?

Timer? Trial errors Let’s do the math!!!

Width of the robot: 14 cm Diameter of the wheel: 5.5 cm Perimeter of the wheel: 5.5 cm x pi = 17.27

Travel distance needed: (14 x 2 x pi) / 4 = 21.98 cm

Number of rotations needed?

21.98 / 17.27 = 1.272714 cm

Page 29: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Programming with Sensors

Programming with Touch Sensor Light Sensor Ultrasonic Sensor

Repeat Basic Sumo Program

Page 30: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Start-Touch

Wait until the touch sensor is pressed; Then start the robot to go forward Stop after a second

Page 31: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Start-Light

Locate the robot in the middle of the ring Wait until the light sensor detects very

bright (lantern) light Then start the robot to go forward Stop after a second

Page 32: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Start-Light

Page 33: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Stop-Touch

Go straight until the bumper is hit then stop

Page 34: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Stop-Edge

Go straight until the white edge of the ring

Then stop

Page 35: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Loop

To repeat a sequence of code Until

Elapsed time Number of repetitions Sensor condition is met Logic becomes true Forever

Page 36: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Say “Yes” – 10 times

Page 37: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Make the robot move around in the ring – Basic Sumo (Sumo0)

Repeat the following forever: Go forward until the edge Backward slightly Spin right

Page 38: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Sumo0

Page 39: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

First Sumo Competition

Some matches Ask students to list ideas to improve the

Sumo robot

Page 40: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Improved Sumo Program

Improved Sumo program Unknown Problem Mini Competition Tips and Ideas to improve your Robot!

Page 41: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Program for the Mini Competition

Press “Shift” to connect parallel sequence beams

Page 42: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Ideas to improve your SumoBot

Improve (debug) your program! Applying Theories learned in Physical

Science Mass, Newton’s laws Friction Gearing Wheel size Power level

Detecting the opponent (can be done later) Touch sensor US sensor(s)

Page 43: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Ideas to increase weight of your Robot

What is the max weight of each division? Add more Lego technic pieces, if you

have some at home Add Coins, Used Batteries, or others –

make a holder using cardboards

Put your team name on the robot. An idea: make a team flag

Page 44: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Ideas to increase friction of your Robot

Use rubber bands Add more wheels later for Worlds

Page 45: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Gearing Ideas

Use gear train to increase gear ratio Considering resources, this is not allowed

for the school qualifier The winner from the school qualifier may

consider this idea later

Page 46: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Changing Wheels?

Using bigger wheels Considering resources, this is not allowed

for the school qualifier The winner from the school qualifier may

consider this idea later

Page 47: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Make sure the Power!

Default power level is 75% Fully charge your battery!!! How to check the voltage level?

See the icon on the LCD

Page 48: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Changing the shape of the Robot

Make it sturdy Front part may need some changes (After

the school qualifier)

Page 49: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Height of the robot matters?

Consider the “center of gravity”

Page 50: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Ideas using 2 Touch Sensors

A touch sensor –front leftAnother touch sensor – front right

If left sensor is pressed – turn left and push hard

If right sensor is pressed – turn right and push hard

If both left and right sensors are pressed, push straight hard

Page 51: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

What is next? - Meet with your teacher at least twice before the school qualifier

Improve your programs Add stuff for the max possible weight for

your robot Review what you have learned for the

unknown problem. If you do not solve the unknown problem, you lose automatically

Signed Media Release form must be ready before the qualifying competition date at your school

Page 52: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

Online Resources

www.ortop.org/NXT_Tutorial: a great tutorial on how to program in NXTG

nxtasy.org: with more information than you could ever want about LEGO robots and programming; a great place to ask questions

Page 53: Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008

End of Today’s Workshop

Contact us with any questions:

Douglas G. Czinder IEEE SEM R&A Chairperson [email protected]

Professor Keith Bozin [email protected]

CJ Chung, Ph.D. Associate Professor and Director of Robofest [email protected]