1 North Alabama Robotics Team Monkey Madness FLL Intro Programming Workshop 2012 Kim Daugherty

Slides:



Advertisements
Similar presentations
Intermediate Robotics Getting to the Next Level Guiding Question: How might I move the robot consistently, accurately, and predictably? –Review basics.
Advertisements

Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Chung for Robofest 05 1 Introduction to RoboLab CJ Chung Lawrence Technological University.
Each team has their own: a.Laptop computer b.LEGO NXT robot c.USB cable d.Light paper on the table to test the robot Sit Down in Teams of 2.
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Dublin Robotics Boosters NXT-Step Programming Workshop.
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.
EV3 Workshop Curriculum Developed by Joe DeRose, Ph.D.
Add and Use a Sensor & Autonomous For FIRST Robotics
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.
Graphical RobotC NXT (EV3) Robot Workshop 2015 Instructor: Dr. Fred Brauchler Assistant: Chris Parker 2/7/2015Lawrence Technological University1.
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.
NXTG Workshop for Bottle RoboSumo Lawrence Technological University.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
LEGO MINDSTORMS PROGRAMMING CAMP
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Robotics Day4.
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.
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.
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.
Introduction to the Basic Parts of LEGO’s NXT Robotics
ORTOP WORKSHOP 3 ROBOT NAVIGATION & MISSIONS ORTOP WORKSHOP 3 ROBOT NAVIGATION & MISSIONS.
Coding for the FIRST Tech Challenge: RobotC
EN Engenharia Unificada I PROGRAMANDO O LEGO MINDSTORMS Centro de Engenharia, Modelagem e Ciências Sociais Aplicadas.
1 ORTOP Workshop 3 - robot Design Robot Design, Navigation & Missions.
Using Waits, Loops and Switches WAIT please!. Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can.
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.
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Negative Power or Negative Rotation makes robot go backwards. But if both are negative, the robot will go forward! Move Steering Block.
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.
Find the Mindstorms Icon on the computer.. To start a new program click go.
LEGO® MINDSTORMS® NXT Move Block.
How to Use EV3 Lessons. OVERALL STRUCTURE Beginner Lessons: These lessons will teach you to move and turn the robot, use the sensors, and use loops and.
EV3 Software EV3 Robot Workshop
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
ROBOTC Software EV3 Robot Workshop
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
1 Introductory Workshop for Horizon FLL Program Instructors: Cyrus Johannes With assistance from Coach Erik 2011 Some Slides and Materials courtesy Oregon.
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.
Introduction to Robotics using Lego Mindstorms EV3 Shreya Reddy & Kiran Raja RoboAvatars Robotics.
How Do You Make a Program Wait?
Robotics Abstractions: Levels of language, world view
LEGO Robotics Workshop
LEGO MINDSTORMS PROGRAMMING
BEGINNER PROGRAMMING LESSON
Understanding Communication with a Robot? Activity (60 minutes)
By Sanjay and Arvind Seshan
Robotics Abstractions: Levels of language, world view
Beginner programming Lesson
Loops and Switches Pre-Quiz
Automation and Robotics
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Exploring Computer Science Lesson 6-5
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING LESSON
EV3 Programming guide to “Following”
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Getting started with LEGO EV3 Mindstorms software
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

1 North Alabama Robotics Team Monkey Madness FLL Intro Programming Workshop 2012 Kim Daugherty

2 Goals Present NXT-G programming concepts that you can teach your FLL team Conduct a hands-on NXT workshop to facilitate learning Provide tips and strategies that have been learned through trial and error over five years

3 Agenda Introductions Our motivation NXT introduction Basic movement Sensors Control flow (loops and switches) Debugging

4 Our Motivation To help Alabama FLL teams be competitive at the national (US Open) and international level (World Festival) Robot design is typically not an obstacle for teams – programming is… Teams can design robust software if they are given a few tips… To help teams have a great FLL experience so they consider continuing into FTC/FRC

5 NXT Introduction Programming window Version checking NXT brick basics

6 Start a New Program 1. Enter “MoveTest” TIP: Use descriptive program names written in mixed case 2. Click on Go to open program

7 Programming Window 1 of 2 Common palette Move Record/play Sound Display Wait Loop Switch TIP: The common palette is usually sufficient for basic navigation

8 Programming Window 2 of 2 Complete palette Common Action Sensor Flow Data Advanced TIP: The complete palette contains advanced commands Move Record/play Sound Display Wait Loop Switch

9 Comment and Pan Tools Comment tool allows you to add documentation TIP: Document your program so you can remember what it does Pan tool allows you move the screen around Pointer tool allows you to select and insert blocks

10 NXT Version Number New Program V2.1.f3 Patch f3 located at /11plus-lego-mindstorms-education/downloads/ Help->About TIP: Patch f3 reportedly fixes the Error 1003 Broken Wire problem in NXT 2.x

11 Firmware Version Number Tools>Update NXT Firmware… Version 1.31 is the latest TIP: Check the NXT firmware on the brick by going to Settings->NXT Version

12 Before We Start The NXT Outputs for Motors/Lights (A,B,C) Inputs for Sensors (1,2,3,4) Buttons (Enter, Back, Left, Right) USB port Motors Middle (A), Left (B), Right (C) Sensors Light sensor (1), touch sensor (3), color sensor, ultrasonic sensor, rotation sensor BC A 1 – Light 3 – Touch

Practice Robot 13 Robot instructions obtained from Oregon Robotics Tournament and Outreach Program (ORTOP) Horizontal mount points High torque for lifting (small gear connected to large gear) Two light sensors Caster wheel Good balance and weight distribution over drive wheels Low center of gravity for stability

14 Name Your Robot This button brings up the NXT window This is where you name the brick This tab allows you to delete files from the brick TIP: You can delete sound files and demo programs to free up space on the NXT Connect robot to laptop using USB cable

15 Basic Movement The easiest way to get around is the Move block This is the block you will use the most

16 Most Basic Command 1. Click here and drag a Move block to the Start area Speed control Degrees OR rotations should be used; rarely use seconds It is usually better to brake than coast Steering control TIP: Get familiar with all aspects of the Move command Motor selection 2. Click here to download the program to the brick Direction control BC A 1 – Light 3 – Touch

17 Run the Program First menu is “My Files” Select with orange button Second menu is “Software Files” Select with orange button Use arrow keys to find “MoveTest” Select with orange button Press orange button to Run BC A 1 – Light 3 – Touch

Two Ways to Turn Use slider bar on steering control Middle position means robot will go straight The further the slider is from the middle (but not all the way to one side), the sharper the curve will be (swing turn) If the slider is all the way to one side, the robot will turn in place by turning one wheel forward and the other backward Make sure motors on steering control set to B and C Move one wheel only Click on either port B or C, but not both Only one wheel will turn; this is a pivot turn 18 TIP: Pivot turns are the most precise, but swing turns are faster BC A 1 – Light 3 – Touch

19 Experiment with Move Write a program to: Move forward 100% speed for 2 rotations Make a right pivot turn at 75% speed (hint 390 deg) Move backward 50% speed for 360 degrees Make a left swing turn at 75% speed for 1 second Turn in place clockwise all the way around at 25% speed (hint 800 deg) Move forward 100% speed for 1 rotation Observations? What could improve repeatability and accuracy? BC A 1 – Light 3 – Touch

20 Wait Block TIP: Waiting a short time after each move improves repeatability and accuracy BC A 1 – Light 3 – Touch 1. Click here, select 1 st block (time), and drag after Move block 2. Enter 0.25 seconds 3. Repeat until 5 Wait blocks have been added

21 Help Screen Move cursor over block to get short description in this window TIP: Access help for selected block by clicking on “More help” on NXT right bottom Click here to get detailed help screen

For Improved Navigation Use Wait blocks after Move blocks to allow robot motion to completely stop Start in the same position in base each time; it is common to have the robot bumper pressed again the wall 1 Use pivot turns instead of swing turns Don’t exceed 50% power when turning 22 1 In previous years, FLL mat is centered East West and flush with South wall; distance between East or West wall and mat can vary on different tables

Sensors Allows the robot to feel (touch), see (light), hear (sound), and measure distance (ultrasonic) Are often used to determine when to stop moving 23 TIP: Light and touch sensors are more useful in FLL than ultrasonic and sound BC A 1 – Light 3 – Touch

24 Developing an algorithm An algorithm is a step-by-step logical sequence Example: Move forward until robot runs into wall Step 1: Turn on motors 100% speed Step 2: Wait until touch sensor is pressed Step 3: Turn off motors TIP: It is a good idea to write an algorithm before you start writing the program BC A 1 – Light 3 – Touch

Touch Sensor 25 BC A 1 – Light 3 – Touch 2. Click here and drag a Move block to the Start area 1. Click here to start a new program 3. Select Unlimited for Duration of Move 4. Click here, select 2 nd block (touch), and drag next to Move block 5. Change port to 3 8. Save program and name it TouchTest 9. Click here to download the program to the brick 6. Click here and drag a Move block next to Wait block 7. Select Stop for direction TIP: Be sure to stop the motors after a Wait block

26 Experiment with Touch Write a program to: Move forward 100% speed until robot touches wall Move backwards 50% speed for 2 rotations Make a right turn at 50% speed (Hint 390 deg) Move forward 100% speed until robot touches wall Move backwards 50% speed for 2 rotations Make a right turn at 50% speed (Hint 390 deg) Move forward 100% speed until robot touches wall Move backwards 50% speed for 2 rotations Make a right turn at 50% speed (Hint 390 deg) Observations? BC A 1 – Light 3 – Touch

Questions? Did you use copy and paste? Did you remember to add waits after each move command? 27

One Way to Do It 28 Repeat these blocks 3 times BC A 1 – Light 3 – Touch TIP: Copy and paste can save you a lot of time Move forward 100% speed unlimited Move backwards 50% speed for 2 rotations Right pivot turn 50% speed for 390 degrees

The Loop Block (1 of 2) 29 BC A 1 – Light 3 – Touch 1. Click here and drag a Move block next to Wait block 2. Set Control to Count and set Count to 3 TIP: The Loop block allows you to repeat commands 3. Make sure Counter is not checked

The Loop Block (2 of 2) 30 BC A 1 – Light 3 – Touch 1. Click and drag these blocks inside the Loop block 2. Delete the remaining 12 blocks TIP: Wait for the Loop block to expand before you let go of the blocks 3. Save, download, and run TouchTest

Reusing Blocks You may have a specific block or a sequence of blocks that you want to repeat many times in the program Wait time block a) Move unlimited block followed by b) Wait sensor block followed by c) Move stop block followed by d) Wait time block One or more blocks can be captured in a MyBlock which can be reused 31

Create MyBlock (1 of 4) 32 BC A 1 – Light 3 – Touch TIP: Use mixed case and name MyBlock something descriptive 1. Select Wait block and then click on Create My Block 2. Name block WaitTimeBlock and click Finish

Create MyBlock (2 of 4) 33 BC A 1 – Light 3 – Touch TIP: When you edit a MyBlock, save it and download the main program 1. Select Custom palette 3. Select WaitTimeBlock and drag to previous locations of Wait blocks 2. Delete these Wait blocks 4. You can edit the MyBlock by double clicking on it

Why is this Better? Change the wait from.25 seconds to 1.0 seconds; you only need to change it in the MyBlock instead of changing every Wait block Don’t download the MyBlock; download the program that uses the MyBlock 34

Create MyBlock (3 of 4) 35 BC A 1 – Light 3 – Touch TIP: When selecting blocks in a Loop, click outside the loop then drag 1. Select first four blocks and then click on Create My Block 2. Name block MoveTouchBlock and click Finish

Create MyBlock (4 of 4) 36 BC A 1 – Light 3 – Touch TIP: There is no way to remove the space without redoing the Loop block

You Now Have Two MyBlocks WaitTimeBlock Wait a specified time MoveTouchBlock a) Move unlimited block b) Wait for touch sensor block c) Move stop block d) WaitTimeBlock 37 TIP: MyBlocks are useful for reusing specific blocks or sequences of blocks

Light Sensors 38 Optimum height above mat is between ¼ and 1 inch; too low saturates sensor and too high gets poor reading of reflected light Left light sensor connected to port 1 TIP: Light sensors should be calibrated and shielded from ambient light Turn on robot Use arrow keys to move to “View” Select with orange button User arrow keys to find “Reflected Light” Select with orange button Use arrow keys to find “Port 1” Select with orange button Read different areas of the mat – values will be 0 to 100

Light Sensor Readings Percent Mode: 5% = lowest dark, 100% = very bright Reflected Light Mode: shines a red light The light can be turned off – detecting ambient light (surrounding light) 39 TIP: The light sensor reads reflected light over an area determined by its height

Simple Line Following Does not actually follow the line… Then what does it follow? HINT: Line following would NOT work well on a very thin line 40

41 Another Algorithm Follows Left Edge of Line Two states: Left of desired position, Right of desired position Determine state to control robot movement If Sensor1 > Boundary (Left) Set Motor B to 60 Stop Motor C If Sensor1 < Boundary (Right) Set Motor C to 60 Stop Motor B BC 1 – Light 3 – Touch TIP: It is a good idea to write an algorithm before you start writing the program

Line Following 42 TIP: Make sure to set motor ports correctly when line following 2. Click and drag Loop block 3. Click Switch block and put into Loop 4. Select Control to be Sensor and Sensor to be Light Sensor 5. Make sure Port is 1 5. Add Move blocks 1. Start new program and name it LineFollow

Experiment with Line Following Write a program to: Test line following at 60 percent speed Test line following at 40 percent speed Test line following at 100 percent speed Observations? 43

Line Following Observations Faster line following makes large swerves back and forth and can lose the line Slower line following is smoother It is good to have a strategy to end line following 44

End Line Following 45 TIP: Use the rotation sensor to stop line following after a specified distance 1. Click on Loop block 2. Select Control to be Sensor and Sensor to be Rotation Sensor 3. Make sure Port is B 4. Set Until to be > 500 degrees

Put it All Together Use Line Following, WaitTimeBlock, and MoveTouchBlock to navigate robot from start of line to target area 46

A Possible Solution (1 of 2) Line follow for 1150 degrees at 60% speed WaitTimeBlock Right pivot turn at 50% speed for 390 degrees WaitTimeBlock MoveTouchBlock Move backward 50% speed for 1 rotation WaitTimeBlock Left pivot turn at 50% speed for 390 degrees WaitTimeBlock MoveTouchBlock 47

A Possible Solution (2 of 2) 48

Resources usfirst.org/roboticsprograms/fll – Official FLL site – Official Alabama FLL site – NXT designs (not all robots) and sample programs – Coaching tips and challenge worksheets – Get help from the FLL community; must register to post – Our team site – Coaches workshop materials – Online NXT tutorial – Carnegie Mellon Robotics Academy – Coaches materials storms%20Education – NXT Education Base set and Resource set storms%20Education 49 TIP: Be positive and always set a good example for your team