Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.

Slides:



Advertisements
Similar presentations
While Loops and If-Else Structures
Advertisements

Automation and Robotics
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
Photos and Sensor Instructions
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
Testbed: Exercises.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
Robotics NXT sensors Back to Light sensor: red vs blue ball.
ROBOTC for VEX On-Site Professional Development
LabVIEW Basics Review LabVIEW Robotics Fundamentals.
Today’s Agenda 1.Scribbler Program Assignment 1.Project idea due next class 2.Program demonstration due Wednesday, June 3 2.Attendance & lab pair groupings.
VEX Robotics Design System Sensors A Brief Overview
Wall Encounter By Made easy by Dwayne Abuel.
AUTOMATION WITH ROBOTC Starting to write and troubleshoot computer code.
Robotics NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room.
Photos and Sensor Instructions
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
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.
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
Vex Robotics program three: using motors and sensors together.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Project Overview  Introduction  Clawbot Build  Design Modification  Design Development  Programming  Sensors  Advanced Sensors  Open design challenges.
LESSON 04 Starter Key words: Programmable, environment, design, manufacturing and application Modelling VEX Tumbler solutions In this lesson you are.
Programming Design ROBOTC Software. Behavior-Based Programming A behavior is anything your robot does –Turning on a single motor or servo Three main types.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
LOGICFUSION’S HANDS-ON ROBOTICS EV3 LEVEL 2! Welcome to.
Programming Design ROBOTC Software Principles Of Engineering
Introduction to Programming in RobotC
VEX IQ Curriculum Smart Machines Lesson 09 Lesson Materials:
ROBOTC for VEX Online Professional Development
ROBOTC for VEX Online Professional Development
ROBOTC for VEX On-Site Professional Development
LESSON 04. LESSON 04 LESSON 04 STARTER Modelling VEX Tumbler solutions In this lesson you are going to adapt and improve your virtual CAD VEX Tumbler.
By Sanjay and Arvind Seshan
Programming – Using a Range Finder
ROBOTC for VEX Online Professional Development
Project Overview Introduction Clawbot Build Design Modification
Programming Part 2 Mod Kit
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
RobotC Sensors.
RobotC Sensors.
Programming – Using a Range Finder
Automation and Robotics
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
While Loops and If-Else Structures
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING LESSON
While Loops and If-Else Structures
An Introduction to VEX IQ Programming with Modkit
SENSORS.
Programming Design ROBOTC Software Principles Of Engineering
While Loops and If-Else Structures
While Loops and If-Else Structures
While Loops and If-Else Structures
RobotC While loop When and how to use the while loop
Photos and Sensor Instructions
Robotics Programming Using Shaft Encoders
While Loops and If-Else Structures
Robotics Programming Review and Quiz.
Compiled from various Internet sources Presented by Mr. Hatfield
While Loops and If-Else Structures
Lego MINDSTORMS EV3.
While Loops And If-Else Structures
Basic Robotic Programming
Presentation transcript:

Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance

Learning Objectives You will be able to understand at least one method of following a wall. Be able to write a program for a robot to follow a wall forever. Be able to add sensors and internal timers to stop the robot once it has tracked for a certain distance.

Review How does an ultrasonic range finder work? What is the range of distances it can read? What value does it give if it cannot see anything?

Basic Wall Following Pseudo Code Forever: - If the robot is too far from the wall Turn into the wall - else Turn away from the wall. How is this done in code?

Sensor Placement Considerations Clear Path to the wall Near the front to the robot Mounted far enough from the wall to get a reading. (3.0 cm to 3.0 m or 1.5 to 115 inches)

Sensor Setup Motors and Sensors Setup -> VEX Cortex Digital Sensors 1-12 Name the sensor (sonarSensor) Select the Sensor Type SONAR -> Units being measured I will use Digital Port 8 in my demonstration. You may assign a different Digital port.

Pseudo-code to Code: Wall on Left Pseudo Code Forever: - if the robot is too far Turn into the wall - Else Turn away from the wall. task main() { int distance = 100; //Used for following 100 cm from wall while (true) //Forever { if ((SensorValue(sonarSensor)>distance) || (SensorValue(sonarSensor) == -1))/ /Too far { motor[leftMotor] = 10; motor[rightMotor] = 100; } else //Too close { motor[leftMotor] = 100; motor[rightMotor] = 10; } } }

How can you modify the code to have the robot stop when it hits something?

Incorporate a Touch Sensor Place a ‘Bumper’ Switch in front of the Robot Bumper Switch is a touch Sensor – Gives a value of ‘0’ when not touched – Gives a value of ‘1’ when pressed.

Pseudo Code While the robot has not bumped into something If the robot is too far Turn into the wall Else Turn away from the wall. Stop the Robot

Sensor Setup: Bumper (Touch) Sensor Plug the Bumper Switch into Port 6 Digital (1 and 0) Sensor

Translating to code While the robot has not bumped into something If the robot is too far Turn into the wall Else if the robot is too close Turn away from the wall. Else Go straight Stop the Robot task main() { int distance = 100; //Used for following 100 cm from wall while (SensorValue(sensorTouch) == 0) { if ((SensorValue(sonarSensor)>distance) || (SensorValue(sonarSensor) == -1))/ /Too far { motor[leftMotor] = 10; motor[rightMotor] = 100; } else //Too close { motor[leftMotor] = 100; motor[rightMotor] = 10; } } motor[leftMotor] = 0; //Stop the robot motor[rightMotor] = 0; } Demonstrate your physical robot following a line until the touch sensor is pressed.

Line Tracking for an amount of time In this section you will modify the code for line tracking so it will go for a set amount of time.

Pseudo-Code Reset the timer While there is still time – If light sensor is on black Turn left – Else Turn right When the time is up, stop

Translating to Code Reset the timer While there is still time If light sensor is on black Turn left Else Turn right When the time is up, stop

Activities Complete the Ultrasonic Wall Follower challenges Each person will need to answer the first two questions. Add the sensor to your robot so it can follow a wall and modify code to work with your sensor. Demonstrate your performance to get it signed off.