EN1002 - Engenharia Unificada I PROGRAMANDO O LEGO MINDSTORMS Centro de Engenharia, Modelagem e Ciências Sociais Aplicadas.

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

A Crash Course in LEGO NXT Robotics - Getting Started
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
How Do You Make a Program Wait?. 1. What is an algorithm? 2. Can you think of a reason why it might be inconvenient to program your robot to always go.
LabView Basics.
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
Using the NXT Light Sensor. 2 Connect One Light Sensor – 1 From My Files use Left / Right NXT buttons and get to View menu and push Orange button. From.
LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
Google SketchUp Castle
EducateNXT NXT... an introduction The Kit and the Software.
Introduction to NXT Software and Functionality Bot’oberfest October 15, 2007.
 LEGO MINDSTORMS is a programmable robotics construction set that gives you the power to create and command your own LEGO robots. The new LEGO MINDSTORMS.
Conversational Computers
Digital Camera Picture Transfer One Example of Moving Files from a Camera to the Computer’s Hard Drive By Bob Fiske.
A Crash Course in LEGO Robotics - Getting Started Meri V. Cummings, Ph.D. NASA-sponsored Classroom of the Future Center for Educational Technologies Wheeling.
The NXT is the brain of a MINDSTORMS® robot. It’s an intelligent, computer-controlled LEGO® brick that lets a MINDSTORMS robot come alive and perform.
Reviewing Common Blocks for St. Agnes Elementary School Teachers by Jenny Chang Feb. 26th, 2007 USC & University Neighborhood Outreach Robotics STEM program.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
What Is a Program?. What Is a Program? Pre-Quiz 1. What is a program? 2. What is an algorithm? Give an example. 2.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
Adapted for STLP Camp ‘09 Mobile Robots Why do robots need to move?
Introduction to the Basic Parts of LEGO’s NXT Robotics
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
MICROSOFT WORD GETTING STARTED WITH WORD. CONTENTS 1.STARTING THE PROGRAMSTARTING THE PROGRAM 2.BASIC TEXT EDITINGBASIC TEXT EDITING 3.SAVING A DOCUMENTSAVING.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
PowerPoint Basics Tutorial 3: Graphics In this tutorial we’ll be looking at graphics, and the various types of illustrations that can be included in a.
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Sentry System Multiple Sensors
As you look at an iMac you will notice that there are no buttons on the front of the machine as shown in figure 1.
PowerPoint Basics Tutorial 3: Graphics In this tutorial we’ll be looking at graphics, and the various types of illustrations that can be included in a.
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
CS320n –Visual Programming More LabVIEW Foundations.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Minds and Computers 2.1 The RCX l Hitachi H8/3297 series processor l 3 inputs/sensors (1, 2, 3) l 3 outputs/motors (A, B, C) l 32k RAM/ 16k ROM ä 12 kB.
Vex Robotics Program four: reversing and turning.
The desktop (overview) Working with desktop icons The desktop is the main screen area that you see after you turn on your computer and log on to Windows.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
1 Introductory Workshop for Horizon FLL Program Instructors: Cyrus Johannes With assistance from Coach Erik 2011 Some Slides and Materials courtesy Oregon.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
Vex Robotics program three: using motors and sensors together.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Lego Mindstorm Robots 9797 kit.  Students will learn how to identify how to detect a change in a condition.  Students will learn where and how to identify.
Digital Literacy Introduction to Computers Unit 1, Lesson 1.
How Do You Make a Program Wait?
Introduction to LEGO Mindstorms EV3 What is in the box?
NXT Mindstorms Kit Programming
LEGO MINDSTORMS PROGRAMMING
Using the Lego Mindstorms Edu NXT Software
Deriving Consistency from LEGOs
Understanding Communication with a Robot? Activity (60 minutes)
Touch Sensor.
Learning to program with Logo
Loops and Switches Pre-Quiz
Exploring Computer Science Lesson 6-5
A Crash Course in LEGO NXT Robotics - Getting Started
Go to =>
Directions are in slide notes. You can view them in two ways
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Creating a Simple Game in Scratch
Getting started with LEGO EV3 Mindstorms software
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

EN Engenharia Unificada I PROGRAMANDO O LEGO MINDSTORMS Centro de Engenharia, Modelagem e Ciências Sociais Aplicadas

Outline NXT capabilities Software development options Introductory programming projects Advanced programming projects

The LEGO Mindstorms® is a robotic building system consisting of: The NXT Intelligent Brick: the brain of the system Sensors and servo motors LEGO TECHNIC Elements Programming software Lego Mindstorms NXT

Project Implementation The system: PC with USB Bluetooth adapter, running control LabVIEW software and an NXT sensor- equipped robotic vehicle

NXT Brick Features 64K RAM, 256K Flash 32-bit ARM7 microcontroller 100 x 64 pixel LCD graphical display Sound channel with 8-bit resolution Bluetooth radio Stores multiple programs Programs selectable using buttons

Sensors and Motors Four sensor ports Sonar Sound Light Touch Three motor ports Each motor includes rotation counter

Touch Sensors Education kit includes two sensors Much more robust than old RCX touch sensors

Light Sensor Reports light intensity as percentage Two modes Active Passive Practical uses Identify intensity on paper Identify lit objects in dark room Detect shadows

Sound Sensor Analogous to light sensor Reports intensity Reputed to identify tones I haven’t experimented with this Practical uses “Clap” to signal robot

Ultrasonic (Sonar) Sensor Reports distances Range: about 5 cm to 250 cm In practice: Longer distances result in more missed “pings” Mostly reliable Occasionally gets “stuck” Moving to a new location helps in receiving a sonar “ping”

Motors Configured in terms of percentage of available power Built-in rotation sensors 360 counts/rotation

Getting Started with NXT LEGO and the LEGO Mindstorms Software

Putting Commands in a Program The commands get executed in a row by how far away they are from the beginning of the beam. So, command 1 in this picture happens first, and command 3 happens last. This is the program beam. This is where you put commands for the robot.

Using Commands You can pull commands down from the “palette” on the left side of the screen to the program beam. We’ll start with the MOVE command.

Move Settings When you put a new command in the program, settings pop up at the bottom that you can change. These are the settings for the MOVE command.

Direction 1.Up means forward, down means backward. 2.The “Do Not Enter” sign means “stop.” If you use this setting, nothing will happen to the robot’s movement unless it is already moving when this command is given.

Steering 1.The STEERING setting can be used to tell the robot to turn to the left or to the right. 2.The arrow in the middle will change to give you an idea of how the robot will move. 3.If the slider is moved all the way to the left or right, the robot will spin in place. 4.However, if the slider is moved to just before the extreme left or right, the left or right wheel (respectively), will not rotate during movement. (In other words, the robot will pivot.

Power 1.The POWER setting tells the robot how fast to move. 2.Think of it as a percentage, with 0 being no power and 100 being full power. 3.Also keep in mind that this is not necessarily a measure of speed. A heavy robot moving at 100 power can still go slower than a very light robot moving at 50 power.

Duration 1.With the DURATION setting, you can tell the robot how long or how far to move. 2.There are four options for the duration: Unlimited: The robot will continue to move with these settings until it is given a new movement command. Rotations: For each rotation, the wheels turn through 360 degrees. So, going forward 2.5 rotations would make the wheels rotate 2.5 x 360 = 900 degrees. Degrees: Same as rotations, but specified in degrees of rotation. Seconds: Amount of time for wheels to rotate at the given speed.

Putting the Settings Together The actual movement of the robot is a combination of all of the settings. Some examples: You tell the robot to turn to the left using STEERING and set the DURATION to three rotations. Both wheels can’t do three rotations, because if they did, the robot would move straight. So, the robot’s computer figures out how far to turn each wheel to make the robot drive to the left on a path that is equivalent to three rotations of the wheels. If you set the POWER to 75, then setting different DURATIONS in seconds will make the robot move different distances. When making the robot turn, it usually makes the most sense to pull the STEERING slider all the way to the left or right. When you do this, each wheel will rotate the same amount (which can be set with DURATION in rotations mode), but in opposite directions.

Issues for First-Timers There are a lot of small issues that can put off new users to the NXT robots and software. Hopefully these pointers can help you get started! When the NXT software is first loaded on the computer, in order to create a program, you need to give it a name and hit GO as shown in this picture.

Issues for First-Timers As shown in the picture on the right, there are tabs at the bottom that bring you to different palettes of programming tools. The “Common Palette” (shown as the green circle) has most of the tools a beginning student should need. Also, If you have a lot of commands on the screen at once, you might want to move around the programming area so that you can have more room or see commands that are off the screen. You can move around the programming area with the arrow keys on the keyboard.

Issues for First-Timers “Where did my settings go?” If you hear this, this usually means that the student has clicked away from the command for which they want to change the settings. If you put the mouse cursor over the command you want to change, it will have a blue highlight and the settings will reappear below the programming window. Click

Issues for First-Timers When you have finished building the program for the robot, it’s time to download it to the robot’s NXT brain. First, make sure that the USB cable that came with the NXT kit is plugged into the back of the computer and into the top of the NXT robot. Then, turn on the robot with the orange button on the NXT brain. (It doesn’t really matter whether you plug the robot in or turn it on first.)

Issues for First-Timers When you plug in the robot for the first time, the computer has to figure out how to talk to the robot before you can put the program on it. (For the computer savvy, the operation system installs the NXT drivers.) You don’t have to do anything for this, but it’s a good idea to wait about one minute after you have turned the robot on and plugged it into the computer. If you don’t, you might get an error message. Once the robot is on and plugged in, you can hit the “download” button (pointed out in the picture below). You should get a “Complete!” message on the computer screen if it downloaded correctly.

Issues for First-Timers Once the program is downloaded on the NXT brain, you use the buttons on the front of the brain to run the program. You use the orange button to select items on the screen, and the dark gray button to back up in the menus. (They’re a little like the green and red buttons on a cell phone.) The arrow buttons move left and right in the menus. To run the program you downloaded, you first need to find it. From the main menu, programs you download are located in My Files->Software Files. The program you downloaded should be called by the same title you gave it at the beginning. If you press the orange button when you find your program, you will be given the option to Run or Delete the program. Choose Run to see if the program did what you wanted!

Issues for First-Timers If you are finished with the robot, you can turn it off by hitting the dark gray button from the main menu on the NXT brain. You will be asked if you want to turn the robot off. Select the checkmark to say OK. The NXT brain only has a limited amount of space to store programs. It’s not a bad idea to go into the My Files->Software Files folder and delete old programs from time to time so that you won’t run out of space. If you are running the Mindstorms software at a school, you probably have a tech specialist that installs software for you. You will probably need to ask the tech specialist to install the software for the first time. Make sure he or she knows that the students in your class are going to need to be able to run the program. Also for the tech specialist: The LEGO Mindstorms software is not compatible with display resolutions below 1024 by 768 pixels. Make sure before you need to use the software in your class that all of the computers you will use are set to this resolution or higher.

The Problem-solving Process What is the robot’s task? What behaviors are needed to accomplish it? Create the program – debug then download. Run the program. Is the NXT behaving badly (doesn’t do task)? Check the robot first. If there’s a problem, can you fix it? Next, check the program. Problem? Can you fix it? Last, go back to the beginning and reread the task. Does your program really tell the robot what it’s supposed to do?

Challenge 1: Line Program Create and test a program to make the robot go forward in a straight line for exactly 1 second Save your program as your first name and Line (e.g., File  Save as Maria Line  Enter)

Challenge 2: Square Program Create and test a program to make the robot go in a square Save your program as your first name and Square

Challenge 3: Light Dark Program Create and test a program to make the robot: Go forward until it finds a dark line Stop for 1 second Go forward until it finds light Stop for 1 second Reverse for 4 seconds Save your program as your first name and Light Dark

Challenge 4: Tracker Program Create a program to make the robot: Go forward until it finds a dark line Move forward along the edge of the line Save your program as your first name and Tracker Hints: You need a loop, and it’s easier if the robot starts at less than a 90  angle

Challenge 5 – Bump Program Create a program to make the robot: Go forward until it finds a wall Turn moving backward for 2 seconds Repeat these behaviors for 5 “wall bumps” Save your program as your first name and Bump Hint: You’ll need to use wait until Touch in for the first step.

Bonus Beep Challenge Create a program to make the robot: Go forward until it finds a line Stop for 1 second and beep Repeat for 5 lines For fun, end with a different sound Save your program as your first name and Beep

Sample ROBOLAB Programs

Sample NXT Programs Challenge 2 – Square with a sound Challenge 1 – Forward for 1 second Challenge 3 – Detecting Light/Dark

NXT Programming Details Select a motor icon (you’ll see a blue border around it) to open its control panel - displayed at the bottom of the screen Additional control panels for sensors and wait for icons have similar displays

Due to the limited amount of memory available for the NXT, all currently installed sound files should be deleted Sound files take up a lot of space and should be used selectively Use the same sound file repeatedly in stored programs to cut down on memory usage NXT Programming Details (cont’d)

ROBOLAB Basics Go to RCX settings in Administrator to unlock programs 1 and 2. Single-click the silver Programmer button Double-click the Inventor 4 button. Maximize the lower Block Diagram window. Drag the Function bar to move the Functions palette to the lower right of the window. If the Block Diagram window is accidentally closed, open it by hitting Window -> Show Block Diagram. Hit Tab key to switch from hand to cursor tool.

ROBOLAB Basics (cont’d) Hit spacebar to toggle between cursor and wiring tool. Hit Esc to escape sticky wires. Click on a wire or icon and hit Del to remove it. Drag an icon within a cm of another, then with the mouse still down, tap the spacebar to shoot a wire between the icons. Ctrl + B removes broken or partially deleted wires. Right-click an icon to replace it with another using a new popup Functions Palette.

ROBOLAB Basics (cont’d) Always break a wire instead of placing a new icon on top of the wire; otherwise, the icon looks wired when it isn’t. Click on Help-Show context help, then on the icon itself in the block diagram to learn more about a ROBOLAB icon, including seeing what modifiers each icon requires and where to attach them and to see the icon in a sample program. If the white download arrow under Edit is broken, click on the broken arrow for information about where the program is miswired.