Presentation is loading. Please wait.

Presentation is loading. Please wait.

LEGO Mindstorms Robotic Invention System Barb Ericson Georgia Institute of Technology.

Similar presentations


Presentation on theme: "LEGO Mindstorms Robotic Invention System Barb Ericson Georgia Institute of Technology."— Presentation transcript:

1 LEGO Mindstorms Robotic Invention System Barb Ericson ericson@cc.gatech.edu Georgia Institute of Technology

2 What is it? A kit for creating and programming robots built with LEGOs

3 What is in it? 717 LEGO elements –One RCX programmable brick –2 motors –2 push sensors –1 light sensor –Infrared transmitter for transferring the programs A Constructopedia book with plans for 3 robots and many variations on them CD with video on getting started and visual programming environment (RCX code) –9 robots total

4 What else do you need? 6 AA batteries Computer –Windows 98/Me/XP –Pentium II 233MHz –32 MB RAM –115 MB Disk Space –USB Port (for the infrared transmitter)

5 What else might you want? Plastic storage containers –For storing built robots –And for sorting parts better Ultimate Accessory Kit - $50 –45 LEGO pieces including 1 remote control 1 touch sensor 1 rotation sensor 1 lamp 1 Constructopedia

6 More Sensors http://www.legoeducationstore.com/catalo g.cfm?dest=itempg&itemid=920&secid=9& linkon=subsection&linkid=45 Angle (Rotation) Light Touch Temp

7 DCP Sensors http://www.legoeducationstore.com/catalo g.cfm?dest=itempg&itemid=922&secid=9& linkon=subsection&linkid=45

8 What else might you want? Vision Command - $100 –A video camera 30 frames per second 352 by 288 color 145 LEGO elements USB connection Built-in microphone Vision recognition software Or get just the camera and USB cable for $39.00 at LEGO Education Store

9 What does it cost? About $200 Buy at –Toys R Us –Shop.lego.com –Amazon.com –Wallmart.com –http://legomindstorms2.0.hobbytron.net/robotl egosub.html?source=1359http://legomindstorms2.0.hobbytron.net/robotl egosub.html?source=1359 –Ebay.com

10 What can you do with it? Use it with RCX code or Robolab (visual programming) –To teach about commands, programs, iteration, conditionals, and variables –Without worrying about syntax Use it with leJOS (Java) –To teach about commands, programs, iteration, conditionals, and variables –Arrays, strings, recursion, listeners, static –Using Java syntax

11 Programming your Robot Click the Program button in the main menu

12 Pick the Robot Pick the robot to program. If you are using your own design pick “Freestyle”.

13 Create a Program using RCX code Big Blocks are shown for a particular robot Click and drag them to make a program –They will snap into place You can save the program using the File menu –This will name your program

14 Download your Program Turn on the RCX (OnOff button) Plug the IR Tower into your computer Put the RCX near the IR Tower Click the “Download” button –The default is to download to slot 5 –You can change this by clicking on “Settings” When the download is finished the RCX will play a short tune –It displays dots during the download

15 Running the Program Two ways to run –Click the Run button on the RCX –Or click the Run button on the screen Stopping the program –Click the Run button again on the RCX –Or click the Stop button on the screen

16 Modify a Block Click on the edit tab at the right edge of the block You can change the duration of commands –Use the arrow key to use preset values –Or type a value in the textbox

17 Robot Challenge Make your robot go forward for 2 seconds Make your robot turn right for 1.5 seconds Make your robot go backwards for 3 seconds Make your robot spin left for 1.5 seconds Save your program using the File menu

18 Getting More Information Click on Help Click on What’s this? The cursor will show What’s this? with an arrow Click on something you want more information about –Like a block –Or a menu item

19 Robot Challenge Use the help to find out the difference between turn left and spin left Use the help to figure out what a Dance block will do Use the edit tab to try out the Dance block –Make sure your robot is on and near the IR tower

20 Using the Sensors Click a Touch Sensor on the left and position it on the right –Pick the input port attached to your sensor –Click next Pick when to respond –On press, release, or click (press and release) –Click next Click “Try It” to try it or “Done”

21 Handling a Sensor Event Add command blocks after the if sensor event block –These actions will happen when that sensor event happens –Like when the touch sensor is pressed –Or when the light sensor’s value is > or < some amount

22 Robot Challenge Make your robot go forward for 10 seconds If your robot’s touch sensor is pressed backup for 1 second and spin right Set up items to block your robot and try it

23 Adding Iteration Use Repeat Blocks to add iteration (looping) You can change the number of iterations You can repeat a group of commands

24 Conditionals Add a test –Do one thing if the test is true Like turn left –Do something else if the test is false Like turn right

25 Variables You can create new variables –freq And use them in other blocks –Add to them –Subtract from them –Multiply them –Divide them

26 Create New Blocks You can create new blocks using My Blocks –Name the block –Add other blocks to it –You can collapse the interior commands Click on upper left square

27 Small Blocks Finer control of robot Big Blocks are made up of small block commands Click on the top left box to open a big block –And see the internal small blocks

28 Where to get help? http://mindstorms.lego.com\http://mindstorms.lego.com –Main web site Books – at LEGO Education Store –Building Robots with LEGO Mindstorms –Creative Projects with LEGO Mindstorms –LEGO Mindstorms: RIS 2 Projects

29 Project Ideas Anders Project ideas (scanner, fan) –http://www.norgesgade14.dk/legoSider/mindstorm_en.htmlhttp://www.norgesgade14.dk/legoSider/mindstorm_en.html Andy’s Page (chess playing robot) –http://www.artilect.co.uk/lego/default.asp?page=Chesshttp://www.artilect.co.uk/lego/default.asp?page=Chess Buick Music Study (Play MIDI or WAV files) –http://www.aga.it/%7Eguy/lego/bms.htmlhttp://www.aga.it/%7Eguy/lego/bms.html Joe’s Nagata’s Mindstorms Gallery (vehicles) –http://homepage3.nifty.com/mindstorms/http://homepage3.nifty.com/mindstorms/ –http://members.at.infoseek.co.jp/Milano/studio1.html (movies)http://members.at.infoseek.co.jp/Milano/studio1.html Mario Ferrari’s Web Pages (piano player, skier, etc) –http://www.marioferrari.org/lego_mindstorm.htmlhttp://www.marioferrari.org/lego_mindstorm.html

30 Using Java with LEGO Robots Install leJOS (the Java Operating System) –Download from http://lejos.sourceforge.net/faq.html http://lejos.sourceforge.net/faq.html Set the system variables Plug in the IR Tower to the top USB port Download the firmware using a command prompt –lejosfirmdl

31 Setting System Variables Create new System Variables –LEJOS_HOME variable to the directory where leJOS is installed –RCXTTY=USB Add to the PATH variable –The Java SDK bin directory –;%LEJOS_HOME%\bin Add to the CLASSPATH variable –;%LEJOS_HOME%/lib/classes.jar;%LEJOS_HOME% /lib/pcrcxcomm.jar

32 Using leJOS Import the classes in leJOS –import josx.platform.rcx.*; Compile for Java 1.1 using –lejosjc.bat Class.java Link together an executable –lejoslink.bat -o Class.bin Class Download the executable to the RCX –lejosdl.bat Class.bin

33 LCD Control

34 Motor Class –3 objects are available as public static (class) variables Motor.A, Motor.B, and Motor.C –You make the motor go forward, backward, stop (brake), and float to a stop –When you start a motor forward it will keep going until you tell it to stop or float to a stop. –Use Thread.sleep(numMilliseconds) to control how long the motor is moving –Control how fast the motor moves with setPower(num) with num from 0 to 7 (fastest)

35 Motor Test Make both A and C motors go forward at power 7 for 1 second Stop for 1 second Have both motors go forward at power 2 for 3 seconds Float to a stop

36 leJOS Resources Download from –http://lejos.sourceforge.net/http://lejos.sourceforge.net/ Tutorial at –http://lejos.sourceforge.net/tutorial/http://lejos.sourceforge.net/tutorial/ Discussion at –http://sourceforge.net/mailarchive/forum.php?f orum_id=552http://sourceforge.net/mailarchive/forum.php?f orum_id=552 Books –http://lejos.sourceforge.net/books.htmlhttp://lejos.sourceforge.net/books.html

37 FIRST LEGO League Robotics competition for a team of kids (ages 9-14) –Up to 10 kids on a team Register by Sept 30th –Work for 8 weeks on a challenge New one each year –Compete at tournaments Nov – Dec Georgia Tech hosted one Jan 15, 2005 –Cost (about $600 per team)


Download ppt "LEGO Mindstorms Robotic Invention System Barb Ericson Georgia Institute of Technology."

Similar presentations


Ads by Google