Intro to NXT Programming

Slides:



Advertisements
Similar presentations
Robofest 2007 NXT Programming Workshop Jan
Advertisements

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.
Cairo Modern School Computer for Grade
Module 1: BLOCK 1 / MAIN MENU
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.
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Extended Learning Module D (Office 2007 Version) Decision Analysis.
BASIC SKILLS AND TOOLS USING ACCESS
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
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.
Manuscript Central Training Author Center Module 2.
Slide 1 FastFacts Feature Presentation August 28, 2008 We are using audio during this session, so please dial in to our conference line… Phone number:
Microsoft Access 2007 Advanced Level. © Cheltenham Courseware Pty. Ltd. Slide No 2 Forms Customisation.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
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 Wants.
Rhesy S.ppt proRheo GmbH
Mike Scott University of Texas at Austin
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Microsoft®.
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.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
ETS4 - What's new? - How to start? - Any questions?
PP Test Review Sections 6-1 to 6-6
User Friendly Price Book Maintenance A Family of Enhancements For iSeries 400 DMAS from Copyright I/O International, 2006, 2007, 2008, 2010 Skip Intro.
Vanderbilt Business Objects Users Group 1 Reporting Techniques & Formatting Beginning & Advanced.
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Reporting Throughout this slide show there will be hyperlinks (highlighted in blue). Follow the hyperlinks to navigate to the specified Topic or Figure.
LFCDS SkyMail & SkyDrive Full Student Orientation
Lesson 2 Navigating LabVIEW
Exercise 1: Install PC Software & NXT Firmware
INTRODUCTION Lesson 1 – Microsoft Word Word Basics
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
1 Displaying Open Purchase Orders (F/Y 11). 2  At the end of this course, you should be able to: –Run a Location specific report of all Open Purchase.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Page 1 of 43 To the ETS – Bidding Query by Map Online Training Course Welcome This training module provides the procedures for using Query by Map for a.
1 How Do I Order From.decimal? Rev 05/04/09 This instructional training document may be updated at anytime. Please visit and check the.
GEtServices Services Training For Suppliers Requests/Proposals.
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.
Analyzing Genes and Genomes
One-Degree Imager (ODI), WIYN Observatory What’s REALLY New in SolidWorks 2010 Richard Doyle, User Community Manager inspiration.
Essential Cell Biology
PSSA Preparation.
Essential Cell Biology
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
1.step PMIT start + initial project data input Concept Concept.
EV3 Workshop Curriculum Developed by Joe DeRose, Ph.D.
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
EducateNXT NXT... an introduction The Kit and the Software.
Introduction to NXT Software and Functionality Bot’oberfest October 15, 2007.
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.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
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.
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
Lego MINDSTORMS EV3.
Presentation transcript:

Intro to NXT Programming October 16, 2010 Joe Long jlong@ltu.edu (Special RoboParade edition) <NEXT: Agenda> Brought to you by a generous grant from Tardec

Agenda Basic Movements Loop, Sensors, Wait, Switches, and line following Program Beams Determining speed Extra Tips <NEXT: Before we begin…>

Creating a Program Start the NXT-G program Use meaningful names!!! Upon clicking [Go >>] a programming palette will appear. <NEXT: With that done, let’s see how to work the programming palette>

Exercise 0: Go Forward For Two Seconds Click on the Move button Drag it to the canvas <NEXT: Since our goal is to make the robot move forward for two seconds, how do we modify this block to do that?>

Exercise 0: Go Forward For Two Seconds Change settings (parameters) for the block: Port Direction Power Duration Steering Next Action <NEXT: Let’s test it!>

Let’s test it!!! Connect the NXT to the laptop (if this is the first time, then a “Found New Hardware” message will appear) Click on the ‘Download’ button It’s recommended to always unplug the cable from the bot before running the program Navigate through the NXT’s menu: Turn On > My Files > Software Files Then select your program and run it!

Sensors Touch Light Ultrasonic (distance measurement) Sound (microphone: decibel level) Rotation (Embedded in motor) Timer (Internal Sensor) Received Bluetooth Messages NXT Buttons (two grays and the orange)

Getting Sensor Values NXT-G offers a Live Update feature that lets you see what your robot is seeing, through the computer. When you click on a block that uses the light sensor (and the NXT is plugged into the computer and turned on), you can view the light sensor value.

Light Sensor Percent Mode: Reflected Light Mode: shines a red light 5% = lowest dark 100% = very brigh Reflected Light Mode: shines a red light The light can be turned off – detecting ambient light (surrounding light)

Light Sensor Navigate the NXT’s menu: View > Reflected Light On White Area: 55% - 65% On black area: 43% - 48% If the Live Update value is VERY different from the view value, then odds are a calibration was set up and it is skewing the results. Calibrations can be created / edited / deleted in the Tools Menu of the computer program.

Light Sensor Readings 50% 45% 40% 35% 30% 30% 35% 40% 45% 50% Based off of sources from: HighTechKids.org

Attaching a Light Sensor Facing Down Gap: around 0.5 to 1 inch off the ground The default port is port 3, so we’ll use that!

Exercise 1: Stop at the Edge of the Table Program:

Commenting Your Code Use the comment tool ( ) to note the following information: Author, date of creation How to use the program Descriptions Expected sensor values Known bugs Functions to improve upon etc, etc, etc…

Light Sensor Values on the RoboParade Course Be able to detect white area and the black line If necessary, detect the edge of the field so as not to fall off

What could go wrong? Some robot in front of you might have lights Unintentionally reflected light could blind the light sensor One end of the track might have more light than the other

Exercise 2: Infinite Line Following (touch) The NXT default for the touch sensor is port 1, so we’ll go with that. Possible outputs: PRESSED or NOT PRESSED!

Exercise 2: Infinite Line Following (Intro) Loops and Switches (beep on press):

Exercise 2: Infinite Line Following The Zig-Zag Method

Exercise 3: Follow the line until touched For the RoboParade field, the power should be less than 40. Switch

How to improve in line following Use a three way branch Use two light sensors Use a dynamic threshold (the program gets the light value before moving, then bases all of it’s decisions off of that value)

Dual Light Sensors Bounce along the line!

Dual Light Sensors

Ultrasonic Sensor Uses the same scientific principle as bats. The NXT can measure in centimeters or in inches 0 – 255 cm (0 – 100.4 inches) Precision: +/- 3cm (1.2 inches) View the sensor information: View > Ultrasonic cm > select port number Battery Glitch! Don’t go under ½ power!

Ultrasonic Sensor Large objects with hard surfaces return the best readings. Objects made of fabrics or something curved (like a foil wrapped tennis ball) are difficult to detect Two or more ultrasonic sensors in the same room interfere with eachother’s readings!

Exercise 4: Ultrasonic Distance

Exercise 5: Move until ultrasonic detection

My Blocks Wrap a complex procedure into a single block. Save what little memory the NXT has and avoid redundancy. Hide complex details.

Creating My Blocks Start with working code Highlight blocks to include Click the “Create MyBlock” button Name the MyBlock Build the icon(s) MyBlock replaces the selected code It is also now available in the ‘custom’ menu

Program Beams Multi-tasking, NXT style!

Creating Variables In the computer program, go to the Edit menu and select “Define Variables” Enter the variable name and type. Text = “hello world!” Number = 1337 Logic = true / false Also called boolean

Editing Variables Open the ‘Complete’ menu Next to the plus sign, select the suitcase block 2 modes: Read write

Variables and Dynamic Threshold Part 1 Get the light value of the white space Subtract 7 Save it to a variable called “Light Threshold”

Variables and Dynamic Threshold Part 2 Read the current light sensor value and see if it is greater or less than the threshold, act accordingly.

Editing the Memory A utility called the NXT Window will be your best friend for this! When the window pops up, click on the ‘Memory’ tab, select a file type from the chart on the left. This window can also upload and download files to / from the NXT. NOTE: No system files are shown! This means that you can delete at random and the NXT will still work without a hitch.

Tips: “Out of Memory” problem: Do not use sound files, or delete the currently existing files Do not display graphics Minimize the number of programs on the NXT Delete Unnecessary programs

Tips: Debugging: Game Details: Code gradually, not all at once. Beeps help, make the robot beep whenever it thinks that it sees a line and your coding gets a LOT easier. Displaying values helps too! Game Details: Ultrasonic sensor on #3 ball Light sensor on #4 ball

Something Cool: Getting rid of the startup sound If you open the ‘Memory’ window (shown three slides ago) and navigate to the Sound files, you can delete the startup sound. Now the NXT will turn on WITHOUT THE MUSIC!!! If you want to reload it, it’s one of the sound effects available to the sound block. Just make a program that uses that sound and it will be saved again, even if you delete the program.

Use RCX sensors and motors with the NXT NXT conversion cable 3 cables for $10 Available through Robofest office, M219.

Acquiring More Parts You can purchase spare parts (and a couple recently developed sensors, including a color sensor) at mindstorms.lego.com Interested in buying pieces? Bricklink allows people to sell and buy lego bricks, many a rare part can be found there, and the prices are EXCELLENT! www.bricklink.com Lots of 3rd party companies sell sensors and other parts that are available nowhere else!

That’s it! Questions? Comments? Concerns? Restraining orders? (…hope not…) Feel free to drop me an email for any of the above (although any notices for restraining orders can be forwarded to my evil twin). Email: jl0109@gmail.com