Building Mindstorms NXT Robots

32
Building Mindstorms Building Mindstorms NXT Robots NXT Robots Dr. David Johnson Dr. David Johnson School of Computing School of Computing [email protected] [email protected]

description

Building Mindstorms NXT Robots. Dr. David Johnson School of Computing [email protected]. What Is a Robot?. What Is a Robot?. Sense Update information about the world Plan Modify original plan in response to this sensed information Act Move in the world or make a change in the world. - PowerPoint PPT Presentation

Transcript of Building Mindstorms NXT Robots

Page 1: Building Mindstorms NXT Robots

Building Mindstorms NXT Building Mindstorms NXT RobotsRobots

Dr. David JohnsonDr. David Johnson

School of ComputingSchool of Computing

[email protected]@cs.utah.edu

Page 2: Building Mindstorms NXT Robots

What Is a Robot?What Is a Robot?

Page 3: Building Mindstorms NXT Robots

What Is a Robot?What Is a Robot?

• Sense– Update information about the world

• Plan– Modify original plan in response to this

sensed information

• Act– Move in the world or make a change in the

world

Page 4: Building Mindstorms NXT Robots

Some Example RobotsSome Example Robots

• Big Dog– http://www.youtube.com/watch?v=b2bExqhhWRI

• Planetary Exploration– http://www.youtube.com/watch?v=nb2GsD7TAjU&feature=related

• Home assistance– http://www.youtube.com/watch?v=GTxW3GWZ5hI

• Hobby– http://www.youtube.com/watch?v=zX09WnGU6ZY

Page 5: Building Mindstorms NXT Robots

Resources for Learning About RobotsResources for Learning About Robots• Web

– Wikipedia• http://en.wikipedia.org/wiki/Robot

– New Scientist• http://www.newscientist.com/article/dn9973-instant-expert-

robots.html

– Youtube– MAKE magazine– Boy Scout badge guide is quite nice and cheap

• Consider exercising your team’s FLL research skills by having them look at some of these resources

Page 6: Building Mindstorms NXT Robots

Mindstorms NXTMindstorms NXT

• Is it a robot? Can it– Sense?– Plan?– Act?

Page 7: Building Mindstorms NXT Robots

Mindstorms NXTMindstorms NXT

• It can– Sense

• Light intensity and/or color• Sound intensity• Button presses• Distance to nearby objects• Wheel revolutions

– Plan– Act

Page 8: Building Mindstorms NXT Robots

Mindstorms NXTMindstorms NXT

• It can– Sense– Plan

• Small computer brain– “the brick”

• Graphical programming language

– Act

Page 9: Building Mindstorms NXT Robots

Mindstorms NXTMindstorms NXT

• It can– Sense– Plan– Act

• Three motors that turn• Make sounds• Put words and pictures on its display

Page 10: Building Mindstorms NXT Robots

Robot Design JudgingRobot Design Judging

• Teams demonstrate their robot on a field• Discuss challenges and solutions• Judges have a base rubric plus comments

– How are sensors used?– Is the robot solidly built?– Modular design– Programming innovation

• Does something stand out?– Reuse an attachment for different purposes– Go over obstacles instead of around– Programs that adapt to different risk levels

Page 11: Building Mindstorms NXT Robots

Goals For TodayGoals For Today

• Raise your comfort level with Mindstorms– Building– Programming– There is no substitute for doing it

• Try some common tasks– Wheeled robot– Respond to sensors

• Maybe a taste of competition…

Page 12: Building Mindstorms NXT Robots

Testing EquipmentTesting Equipment

• Plug in motors, sensors

• A critical thing to know is the view program– Let you read values from

sensors without writing a custom program

Page 13: Building Mindstorms NXT Robots

BuildingBuilding

• Not “normal” LEGO pieces– Based on the Lego Technic build system– Pegs and holes

• Need to plan to make a solid robot– Stable

• One peg makes a rotary joint• Multiple pegs lock two pieces in place

– Strong• Keep in close to the main body• The wheel axles must not be wobbly and flex!

Page 14: Building Mindstorms NXT Robots

Building ResourcesBuilding Resources

• There are lots of instructions for building things online– http://www.nxtprograms.com/

– Have the team try some out• Learn things that work• Then modify

– 5 minute bot• A quick base• Probably not good to adapt

for competition

Page 15: Building Mindstorms NXT Robots

ProgrammingProgramming

• Programming teaches– Breaking complex problems into solvable parts– Precise thinking and specification– Creative experimentation to discover and isolate

problems

• Programs are designed on a base computer– Downloaded by USB cable to the brick

Page 16: Building Mindstorms NXT Robots

Programming the BrickProgramming the Brick

• LEGO Mindstorms NXT-G– Default language for programming Mindstorms

• Designed to be friendly– Nice tutorials

• Try them with your team

– Not based on traditional programming languages– Easy to do very basic things

• More difficult to advance• It does have some subtle actions that can cause confusion

Page 17: Building Mindstorms NXT Robots
Page 18: Building Mindstorms NXT Robots
Page 19: Building Mindstorms NXT Robots
Page 20: Building Mindstorms NXT Robots
Page 21: Building Mindstorms NXT Robots
Page 22: Building Mindstorms NXT Robots

Learning to Use the TutorialLearning to Use the Tutorial

• Each tutorial is structured as– Challenge– Build– Program

• The mobile base from the tutorials is not my favorite– Takes too long to build– Difficult to modify

Page 23: Building Mindstorms NXT Robots

A Quick Programming Tour A Quick Programming Tour

• Control goes along the path

• Each block performs some action– Most blocks are very flexible– Learn the options at the bottom panel– Many actions continue until

• A sensor is triggered• Time has passed• A commanded result is finished

Page 24: Building Mindstorms NXT Robots
Page 25: Building Mindstorms NXT Robots

A Quick TestA Quick Test

• Attach a motor to the brick (ports A)• Attach a touch sensor to the brick (port1)• Write a program

– Move block• Set duration to unlimited

– Wait until touch– Move block

• Set “Direction” to stop

• Download to brick• Run it• Let’s do this together

Page 26: Building Mindstorms NXT Robots

Additional ResourcesAdditional Resources

• There is a lot to learn, but you can get started pretty quickly

• I recommend– Winning Design! LEGO Mindstorms NXT: Design

Patterns for Fun and Competition• Most FLL-centric of the books• Beginning to medium skill level

– If you don’t have prior experience, I think you would be foolish not to look at this book.

Page 27: Building Mindstorms NXT Robots

Some Quick HintsSome Quick Hints

• Light sensors can be tricky

• Light changes– Time of day– Clouds– Flash photography

• Isolate the sensor from the world

Page 28: Building Mindstorms NXT Robots

Using the Touch SensorUsing the Touch Sensor

• Add a bumper

Page 29: Building Mindstorms NXT Robots

Making TurnsMaking Turns

• What would this do?

• Some help– http://jamesreubenknowles.com/turn-robot-627

Page 30: Building Mindstorms NXT Robots

Driving StraightDriving Straight

• Some teams never get a robot to drive straight– Makes testing a

nightmare– Use the field to square-

off– Return to base so error

doesn’t accumulate– See

http://www.youtube.com/watch?v=OlAO9Ho-N58

• Things to try– Check balance of

robot• Are the wheels equally

spaced?• Axles straight?• Weight balanced?

– Check motors• Match up best two• Move block tries to

compensate

– Check tires

Page 31: Building Mindstorms NXT Robots

Let’s have a competition!Let’s have a competition!

1. Hit paper target2. Go through maze

– Stop before unknown finish “wall”

• Development cycle– Build, test, adjust, repeat– Most kids do not understand how to test and

modify something until it works• Quit or start new each time

– Really work with them on iterative improvement

Page 32: Building Mindstorms NXT Robots

Teams!Teams!

• 2 or 3 per kit• Start with the bot

– 5 minute bot

• Start building and testing the program• Compete! Or, cooperete?

• Also, check out the School of Computing technology camps– www.cs.utah.edu/~dejohnso/GREAT