Robofest 2007 NXT Programming Workshop Jan

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Variations of the Turing Machine
AP STUDY SESSION 2.
1 WORKING WITH 2007 WORD Part 1 Developed October 2007 with lots of help from.
1
1chung Robofest 2007 Introduction to RoboLab Workshop Feb. 3, 2007 Maurice Tedder
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Intro to NXT Programming
1chung Robofest 2005 RCX code Workshop Jan 29, 2005 CJ Chung.
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Chung for Robofest 05 1 Introduction to RoboLab CJ Chung Lawrence Technological University.
Introduction to LEGO NXT robotics and Robot Sumo for
David Burdett May 11, 2004 Package Binding for WS CDL.
Microsoft Access 2007 Advanced Level. © Cheltenham Courseware Pty. Ltd. Slide No 2 Forms Customisation.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
CALENDAR.
Mike Scott University of Texas at Austin
1 Advanced Tools for Account Searches and Portfolios Dawn Gamache Cindy Bylander.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
The 5S numbers game..
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Windows XP Project An Introduction to Microsoft Windows XP and Office 2003.
Photo Slideshow Instructions (delete before presenting or this page will show when slideshow loops) 1.Set PowerPoint to work in Outline. View/Normal click.
Break Time Remaining 10:00.
The basics for simulations
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Exercise 1: Install PC Software & NXT Firmware
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
1 Titre de la diapositive SDMO Industries – Training Département MICS KERYS 09- MICS KERYS – WEBSITE.
Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
Physics for Scientists & Engineers, 3rd Edition
Select a time to count down from the clock above
Copyright Tim Morris/St Stephen's School
1.step PMIT start + initial project data input Concept Concept.
EV3 Workshop Curriculum Developed by Joe DeRose, Ph.D.
Graphical RobotC NXT (EV3) Robot Workshop 2015 Instructor: Dr. Fred Brauchler Assistant: Chris Parker 2/7/2015Lawrence Technological University1.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
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.
Introduction to the Basic Parts of LEGO’s NXT Robotics
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
EV3 Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
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.
NXT Mindstorms Kit Programming
Presentation transcript:

Robofest 2007 NXT Programming Workshop Jan Robofest 2007 NXT Programming Workshop Jan. 27, 2007 CJ Chung Associate Professor of Computer Science Lawrence Tech University CHUNG@LTU.edu www.Robofest.net chung

Assistant Joe Long chung

Agenda Intro to NXT Construction of NXT basic model: TriBot Intro to NXT programming Language: Move, Loop, Sensors, Wait, Display, Switches, and My Blocks 9 Class Missions (somewhat related to the Robofest Game 2007, Miner Rescue) Programming Tips chung

chung

Robots to be used: TriBot Robo Center, Quick Start Vehicle or small booklet in the retail version box Left motor: A Right motor: C chung

Alternative guide to build the TriBot (Retail Version) Launch the software, Mindstorms NXT Robo Center -> Vehicles Quick Start -> TriBot Go -> Driving Base chung

Software Installation Usually be positive! Yes, Yes, Yes,… After the installation you will see the following icon on your desktop chung

Exercise 0 (First NXT program): Go forward for 2 sec. and stop (1/3) Let’s name the program first Click on Go >> button You’ll see a programming palette chung

First NXT program: Go forward for 2 sec. and stop (2/3) Click on Move button Drag and drop the move block to the canvas A C chung

First NXT program: Go forward for 2 sec. and stop (3/3) Change parameters for the Move Port Direction Steering Power Duration Next Action Block Configuration Panel chung

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

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) chung

How to rerun the program Check the program name on the LCD Press the orange button just once again chung

Just watch: Go forward for 2 rotations and come back by reversing motors chung

Ex 1: Go forward 720 degrees and come back by reversing motors chung

NXT motors chung

Embedded Rotation Sensor Each motor has an embedded rotation sensor 360 counts per rotation The counter can be incremented or decremented Distance traveled for a rotation of a wheel can be calculated: Circumference = 2 x radius x π Or diameter x phi chung

Find out the distance a rotation of the wheels will travel (metric) Method 1: Write a program to go for a rotation then measure the distance: almost 17cm Method 2 Measure the diameter of the wheels: 5.5 cm Calculate Circumference: diameter x π 5.5cm x π = 17.27cm chung

Making Turns Turn left: Spin left: (point turn) Face left: Left wheel Right wheel stop Turn left: Spin left: (point turn) Face left: chung

Spin Right 90 degrees chung

Ex 2: Go forward 1.5 rotations and come back by spinning left Spinning 180 degrees? chung

Sensors Light Touch Ultrasonic (Distance measurement) Sound (microphone) Rotation – embedded in the motors Timer – Internal sensor Received Bluetooth messages NXT buttons chung

Light Sensor Percent mode Reflected light mode: shines a red light 5% - lowest dark 100% - very bright Reflected light mode: shines a red light The light can be turned off – detecting ambient (surrounding light) Live updates: See lower left corner, if your robot is connected to the computer via either USB or Bluetooth chung

Light Sensor II Press View | Select “Reflected Light” | Select input port number On white area: 55%-65% On black area: 43%-48% If Live Update value is quite different from the View value, light sensor calibration was done (using menu Tools). Either use default or update firmware, to reset. Light value is affected by the gap between the sensor and the floor chung

Light Sensor Readings Source: HighTechKids.org chung

Attach a Light Sensor Facing down Gap: around 0.5 cm -1 cm (What will be the problem if too close to the floor to solve the Miner Rescue problem?) Port No. 1 chung

Ex 3. Stop at Edge of the table chung

Comments Use balloon text tool Add the following information Author, when Who made changes, when How to use Functions Block descriptions Assumptions: 1 - light Expected results Known bugs Rooms to improve Etc. chung

Measure Light Sensor Values on the Miner Rescue field White: Black: Foil: Outside Edge: Crack (gap) between home base and ramp: Approaching down ramp Approaching up ramp stopAtBlackLine.rbt chung

The gap between the Light sensor and the floor!!! Both Reflected and Ambient light values are affected by the distance between the sensor and the floor! The light sensor value is in inverse proportion to the gap Light sensor Light sensor chung

Stop when it sees the black line on the Miner Rescue field chung

Ex 4. Stop when it sees the 2nd black line on the Miner Rescue field Need to skip the black line 0.1 rotation is OK What is wrong? chung

How about stopping at the 4th line? Loop (Repeat) Block Count = 4 chung

Touch Sensor Press View | Select Touch | Select input port number If released (not pressed): 0 If pressed: 1 Is it sensitive? – it seems not NXT-G can handle “Bumped” - (pressed and released) or (released and pressed) chung

Attach a Touch Sensor Port No. 2 chung

Ex. 5 Loop until a touch sensor is pressed File name: DisplaySec No event; Same as do while Display seconds until touch sensor is pressed. chung

Line following - Zigzag methods chung

Ex 6. Follow the black line until a touch sensor is pressed For Robofest field, the power should be less than 40 Switch chung

Ex 7. Follow the line until it detects the foil Need more power to climb Use rotation sensor to locate the robot chung

Ex 8. Follow the line until it climbs back to the home base chung

How to improve line following? Three way branch … Use two light sensors http://home.earthlink.net/~xaos69/NXT/Line_Follower/Line_Follower.html http://www.teamhassenplug.org/NXT/ - Steve H’s line following block chung

Ex 9. Follow the line until it climbs back to the home base – Use My Blocks chung

My Blocks Wrap a procedure into a package To do the same thing from different places; to reuse code; to make code non-redundant To divide a large task into smaller meaningful modules (provide structure) To hide complex details chung

How to create MyBlocks Start with working code Highlight blocks to include Click the “Create My Block” button Name the MyBlock Describe the MyBlock Build icon(s) MyBlock replaces the selected Blocks chung

How to reuse the MyBlock Select it from the Custom Tab chung

Ultrasonic Sensor Uses the same scientific principle as bats: it measures distance by caluclating the time it takes for a sound to hit an object and return – just like measuring an echo. Measures in centimeters and in inches 0 to 255 cm (or 0 to 100.4 inches, 8.4ft) Precision of +/- 3cm (1.2 inches) Press View | Select Ultrasonic cm | Select input port number chung

Ultrasonic Sensor II Large-sized objects with hard surfaces return the best readings Objects made of soft fabric or that are curved (like a ball) or are very thin can be difficult for the sensor to detect Note that two or more Ultrasonic sensors operating in the same room may interfere with each other’s reading Connect an ultrasonic sensor to port no. 4 chung

Can you guess what the following program is behaving? utraTst2.rbt Data driven chung

The same program – event driven chung

Not covered advanced topics Variables Multiple tasks & Synchronization of multiple tasks … chung

NXT Programming Tips “Out of Memory” problem Debugging Do not use sound file Do not display graphics Minimize number of programs on NXT Delete unnecessary programs Debugging Gradually, not all at once Display Tone chung

Tips for Robofest 2007 Game Line following is required? Ultrasonic sensor – No. 3 ball May be light sensor for No. 4 ball in the tunnel NXT conversion cable: you can use your existing RCX sensors and motors with the NXT brick! (3 cables for $10) chung

Please go through Getting Started and Software Overview after this workshop chung

Where to get additional Lego blocks? http://www.bricklink.com/ eBay for Legos chung