RoboLab Exercises (1)

Similar documents
Lego Robot Tutorials Touch Sensors

How To Program An Nxt Mindstorms On A Computer Or Tablet Computer

Quick Start Guide to computer control and robotics using LEGO MINDSTORMS for Schools

Building Instructions: Maze Robot

Your EdVenture into Robotics You re a Controller

2/26/2008. Sensors For Robotics. What is sensing? Why do robots need sensors? What is the angle of my arm? internal information

understanding sensors

Tutorial for Programming the LEGO MINDSTORMS NXT

Programming LEGO NXT Robots using NXC

The Basics of Robot Mazes Teacher Notes

CONTENTS. What is ROBOTC? Section I: The Basics

How To Turn On A Robot On A Computer On A Black Box On A Pc Or Macbook

Line Tracking Basic Lesson

BASIC RULES OF CHESS

How to Create a Resume Using Microsoft Word

Additional Guides. TETRIX Getting Started Guide NXT Brick Guide

ROBOTICS AND AUTONOMOUS SYSTEMS

North Texas FLL Coaches' Clinics. Beginning Programming October Patrick R. Michaud republicofpi.org

Classroom Activities for the Busy Teacher: EV3

The Sensor Readings Gadget for Window 7. Version

Your EdVenture into Robotics You re a Programmer

TEACHER S GUIDE TO RUSH HOUR

Advanced Programming with LEGO NXT MindStorms

Analysis of Micromouse Maze Solving Algorithms

ScanPro 3000 High Definition Microfilm Scanner. Help Guide

SE05: Getting Started with Cognex DataMan Bar Code Readers - Hands On Lab Werner Solution Expo April 8 & 9

Programming the VEX Robot

DVR GUIDE. Using your DVR/Multi-Room DVR WAVE-123 wavebroadband.com

About your ereader... 4

Dr Robot C# Advance Sputnik Demo Program

LESSON 7: IMPORTING AND VECTORIZING A BITMAP IMAGE

Building a Better Robot

Your EdVenture into Robotics You re a Programmer

SolidWorks Tutorial 3 MAGNETIC BLOCK

EV3 Programming. Overview for FLL Coaches. A very big high five to Tony Ayad

TETRIX Add-On Extensions. Encoder Programming Guide (ROBOTC )

Workshop NXT Programming For Beginners

Experiment 3: Magnetic Fields of a Bar Magnet and Helmholtz Coil

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

Quick Guide. Passports in Microsoft PowerPoint. Getting Started with PowerPoint. Locating the PowerPoint Folder (PC) Locating PowerPoint (Mac)

Experiment 3: Magnetic Fields of a Bar Magnet and Helmholtz Coil

Lab 3 Microcontroller programming Interfacing to Sensors and Actuators with irobot

Using Microsoft Access

ADDING and/or DELETING PIN NUMBERS (Plus other simple programming commands) in My DK-16 or DK-26 DIGITAL KEYPAD

How to Build a Simple Pac-Man Game

Alarm Security Kit - NVR

Intermediate STEMSEL Project 6 Light Sensor Alarm

Mimio Interactive. Pad and Bar. Technology Integration Department. Last update: 2/15/2013

Getting to know your computer

Microsoft PowerPoint Exercises 4

CREATE A 3D MOVIE IN DIRECTOR

TUTORIAL 4 Building a Navigation Bar with Fireworks

Tutorial 1. Introduction to robot

The Richard Pate School. Draft Year 4 Scheme of Work for Scratch

Laser Cutter User Manual

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

paragraph(s). The bottom mark is for all following lines in that paragraph. The rectangle below the marks moves both marks at the same time.

THE WINNING ROULETTE SYSTEM.

Integrated Accounting System for Mac OS X

Action settings and interactivity

Kodu Curriculum: Single Session Intro

Linux provides two basic types of interface for you to use when working with your

MASKS & CHANNELS WORKING WITH MASKS AND CHANNELS

Start Here. BrightLink Interaction. 1 Connect your computer and turn on the projector

Lenovo Miix 2 8. User Guide. Read the safety notices and important tips in the included manuals before using your computer.

Updox, LLC

4 Wire / 5 Wire Resistive Touchscreen

Introduction to programming moway

How to Use the Drawing Toolbar in Microsoft Word

Building A Computer: A Beginners Guide

PRINTER DRIVER GUIDE (KODAK 305 Photo Printer)

RS232/DB9 An RS232 to TTL Level Converter

The Rush 24/7 Podcast for itunes 9

Electric Landing Gear controllers and sequencer LGC12 / LGC 13C

WakeMyPC technical user guide

Using VLOOKUP to Combine Data in Microsoft Excel

Excel 2003 A Beginners Guide

Hands-on Practice. Hands-on Practice. Learning Topics

ios 9 Accessibility Switch Control - The Missing User Guide Updated 09/15/15

ShoutCast v2 - Broadcasting with Winamp & ShoutCast DSP Plugin

Mirror Mount Video Monitor/Recorder with Front and Rear View Night Cameras PLCMDVR5

SMART Notebook: Basics and Application

Snagit 10. Getting Started Guide. March TechSmith Corporation. All rights reserved.

Getting Started in Tinkercad

Mathematical goals. Starting points. Materials required. Time needed

edgebooks Quick Start Guide 4

Acrobat PDF Forms - Part 2

Using the HOCK flash cards in Anki on Windows, Mac, mobile and web

Basic instructions. Move. Move n steps forward. adelante(n) Move n steps backward. atras(n) Turn left over 90 degrees. izquierda()

Analog control unit for mobile robots

Windows XP Pro: Basics 1

Aeries Student Information System Attendance Notes October 3, 2008

Left Hand Limit Switch. Housing. Left Hand. Connections. Motor Connector BROWN PURPLE GRAY BLACK DARK BLUE BLACK BROWN BROWN LIGHT BLUE.

Presents. AccuDraw. Instructor Pam Roberts

Tutorials Drawing a 555 timer circuit

From the list of Cooperative Extension applications, choose Contacts Extension Contact Management System.

Building Robots with NXT and LEJOS. Introduc<on. What is the NXT Robot Michael Wooldridge liv.ac.uk)

63720A IN I S N T S R T U R C U T C I T O I N B O O N B O O K O L K E L T E

Excel 2007 A Beginners Guide

INSTALLATION MANUAL VEHICLE SECURITY SYSTEM CE-SS200

Transcription:

RoboLab Exercises (1) Below are some simple exercises to get used to working with RoboLab and the LEGO robot. It should not take you long to complete these; answer the questions as you go. 1. The picture below shows a RoboLab program for the caterpillar robot: Program this in, then use the download program button to download it to your robot. Make sure that the robot is turned on and is facing the IR tower! The wait for 2 seconds gadget can be found in the wait-for toolbox. If you get stuck at any point, ask one of the available helpers for assistance. (a) When run, what does the robot do? (b) At which point in the above program is the robot when it is moving? 2. Remove the stop all motors gadget from the program, and download the new program to the robot: What now happens? 3. Modify your program so that the robot returns to its original starting position. You will need to add new gadgets to the above program to make it do this. Hint: try reversing the the direction of the motors (two of the gadgets above are motor A forward and motor B forward). Remember to make the robot stop once it has finished! 4. Program in the following: The power-level modifiers, can be found in the modifiers toolbox. These should be wired to the bottom-right corner of the motor gadgets. (a) What does the robot do now?

RoboLab Exercises (2) Here are some more advanced exercises, that make use of the touch sensor and looping structures. 1. Place a touch sensor on the front of your robot and connect it to the sensor port marked 1 (this is one of the gray terminals on the RCX brick). 2. Program the following: The wait for push gadget The input 1 modifier can be found in the wait-for toolbox. can be found in the modifiers toolbox. 3. Check that the program works as you expect: the robot should move forwards in a straight line until it bumps into something (the touch-sensor is pressed), and then stop. You may want to add some sort of bumper mechanism to your robot that pushes the touch sensor when the robot bumps into something parts are available from the front of the room. 4. Modify the program so that after bumping into something, the robot turns itself around (and stops). Hint: you can make the robot turn on the spot by moving one motor forwards and the other backwards. As a further exercise, make the robot back away (for 1 second) from the obstacle it bumped into before turning around and stopping. The program above does just one thing and then stops. In practice, it is often useful to have a program do the same thing over and over (looping). RoboLab provides these in the form of jumps, that can be found in the control structures toolbox. 5. Add a red jump and red land to your program, so that after it has bumped into something and turned around, the program jumps back to the beginning to do the same thing over and over again. The resulting behaviour should be bump and wander the robot moves forward until it hits something, turns away, and then moves forward again, repeating this cycle of actions indefinitely (or until the batteries run out!). 6. Save your program for later. You should save this on the Desktop, with a suitable name, or alternatively keep the window open in RoboLab. As an example of how to use these jumps, the following program makes the robot go forward for 2 seconds, stop for 1 second, then loop (moving forward for another 2 seconds): program jumps back to the beginning go forwards for 2 seconds stop for 1 second

RoboLab Exercises (3) Here are some more advanced exercises, that make use of the light sensor. 1. Attach a light sensor to the front of your robot using an l-bracket (so that the sensor is pointing at the ground, between 2-5 millimetres) and connect it to the sensor port marked 3 (this is one of the gray terminals on the RCX brick). The light sensor works by measuring the amount of light entering the sensor, giving a value between 0 (dark) and 100 (light). The sensor also emits light, with the intention being that it measures the amount of reflected light. 2. Collect one of the rectangle sheets from the front of the room. 3. Program in the following: The wait for dark gadget causes the program to wait until it becomes dark. More specifically, to wait until the value given by the light sensor goes below a certain threshold. The input 3 modifier can be found in the modifiers toolbox. Make sure that you have actually connected the light sensor to the right port on the robot (number 3)! The numeric constant modifier is used to specify the light sensor threshold value. Once you have placed the modifier on the canvas (it will show as white-on-black text), type in the value on the keyboard (50) and press return. 4. Place the robot within the rectangle and run the program. The intention is that the robot should drive forwards until its light-sensor reaches the edge of the rectangle (dark), at which point it should stop. If the robot doesn t do this (e.g. it stops immediately or doesn t stop at all), the threshold value will need adjusting. After your program has been run at least once, the RCX will know that a light-sensor is connected to input 3. To see the values being generated by the sensor, press the view button on the RCX brick until the indicator mark (on the LCD) is in-line with input 3. The centre of the LCD should then show the light-sensor value (updated continuously). Place the robot on the paper so that its light-sensor is over a white bit (the middle), and make a note of the value. Then move the robot so the light sensor is over a black bit (the border), and make a note of the value. A suitable value for the threshold is half-way between the two values you measured. view 5. Starting with the bump-and-wander program you created in exercise 2 (and hopefully saved!), modify the program so that it works with the light-sensor instead of the touch-sensor. Your robot should only bump-and-wander within the rectangle!

RoboLab Exercises (4) Here are some more advanced exercises that make use of the touch sensor, program control structures and additional LEGO components. 1. Improving on the bump-and-wander robot (exercise 2), modify the robot so that it has two bumpers and two touch-sensors, connected to inputs 1 and 2. You might need to get fairly creative with the LEGO in order to build the bumpers! 2. Write a new program that is able to respond to both touch sensors (bumpers) in the following ways: To start with, and by default, the robot should just move forwards. This can be done using the motor A forward and motor C forward gadgets. If the left bumper is triggered (button pressed), the robot should stop moving forwards and reverse to the left for 1 second. It should then resume its default behaviour of moving forwards. If the right bumper is triggered (button pressed), the robot should stop moving forwards and reverse to the right for 1 second. It should then resume its default behaviour of moving forwards. Unlike the previous exercises, you have to write a program that can respond to more than one event. The various wait-for gadgets (e.g. wait for push ) only wait for single events.. Although it is not particularly elegant, one solution is to have the program repeatedly check a particular sensor (or sensors). As an example, the following program runs motor A forwards until a touch sensor connected to input 1 is pressed, then the motor stops: The following program does exactly the same thing, but in a different way: The program above loops between the red jump and red land gadgets as long as the touch sensor is not pressed, determined using the touch sensor fork gadget. Extending this to deal with two touch sensors is not too difficult: This version loops between the red jump and red land as long as neither touch sensor is pressed. As soon as one of the touch sensors is pressed, the program will take the other path, and not jump back to the beginning.

RoboLab Exercises (5) Here are some more advanced exercises, that make use of the light sensor and program control structures. 1. Attach a light sensor to the front of your robot using an l-bracket (so that the sensor is pointing at the ground, between 2-5 millimetres) and connect it to the sensor port marked 3 (this is one of the gray terminals on the RCX brick). 2. Program the following: The light sensor fork and fork join gadgets can be found in the control structures toolbox. Use the numeric constant from the modifiers toolbox to specify the value for the light sensor the mid-point black/white value you determined in exercise 3. 3. Place the robot on one of the A3 checkerboard sheets (available from the front of the room) and run the program. (a) What does the robot do? (whilst it is on the checkerboard sheet!) 4. The program above, as it is, is not particularly good the robot will run off the checkerboard sheet before long. Modify the program so that the robot moves around just one square at a time. Hint: remove the wait for 2 seconds delay that is used to drive forwards (the first one), and add new gadgets after the light sensor fork that cause the robot to either wait for dark or wait for light, depending on which path it took.

RoboLab Exercises (6) Here are some more advanced exercises, that make use of the light sensor and program control structures. 1. In industrial applications, robots often follow marked paths on the ground. Attach a light sensor to the front of your robot using an l-bracket (so that the sensor is pointing at the ground, between 2-5 millimetres) and connect it to the sensor port marked 3 (this is one of the gray terminals on the RCX brick). 2. Determine a suitable threshold value for the light sensor explained in exercise (3). If your sensor is mounted in the same way as before, the value determined previously should work. 3. Write a program that makes the robot follow a line on a sheet of paper (available from the front). The simplest way to do this is by having the robot follow the edge of the line. Essentially: Go forwards, but bearing to the left, until the line is seen (dark). You can make the robot steer whilst going forwards by setting the power levels for the motors differently (e.g. 1 and 5). Continue going forwards, but bearing to the right, until the line is lost (light). Repeat from the start. You re on your own with this one, good luck! 4. Does the program you wrote do the job well? Are there any problems with it? 5. Using a second light sensor, construct a better line-following robot and program.