The George Washington University Department of ECE ECE 1010 - Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 5.

Slides:



Advertisements
Similar presentations
RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.
Advertisements

Sensors.
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Lab 1.
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.
 Project 1: To build and program a robot that will follow a solid black line, make a U-turn, and follow the line back to the start.  Project 2: To understand.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
©2006 CSUC Institute for Research in Intelligent Systems Introduction to Coding June 15, 2006.
IR SENSORS AND ENCODERS. LCDs Timothy Friez Class # 2.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
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.
Flowol subroutines Subroutines are used to:  Simplify your code to make it easier to read (or for someone.
Program ultrasonic range sensor in autonomous mode
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.
Members (from left to right): Rachel Bevill, Brae Bower, Samantha Cherbonneau, Professor Ahmadi, Anthony Contreras.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 3.
Reactive robots UPNA The Public University of Navarra Material for pupils & students.
The Batmobile and Centrifuge November 11, Members (from left to right): Rachel Bevill, Brae Bower, Samantha Cherbonneau, Professor Ahmadi, Anthony.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering –Intro to the Robotics –Introducing the IC –Discuss.
The George Washington University Department of ECE ECE 1010 Intro: Electrical & Computer Engineering –Introducing KIPR Link/Interface and Set-up –Continuation.
A note on oral presentations These are the progress report presentations. Please note that the individual presentations should be ~8 min long. Since the.
Wall Encounter By Made easy by Dwayne Abuel.
Xtreme Robot Olympiad Programming Basics Dr. Peter Laz Associate Professor Department of Engineering University of Denver.
Sentry System Multiple Sensors
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
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.
Erin Halseth, Will Gottschalk, Briana Warschun, and Michaella Gaines
Title Slide Progress Report Name. Goal Goal Statement – ex. design/create/fabricate … - should be clear and short Needs/Problems – clear and short Space.
Find the Mindstorms Icon on the computer.. To start a new program click go.
By Eric Greene RMS / I. S. 192 Q. Smart Start Question How would you get the robot to flirt with disaster by touching the edge of the “table” as many.
ECE Project 1 Overview. Project Description The aim of this project is to design a robot that moves along a given path, from the Start point, towards.
Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what does this one do? Inserted code.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
ECE 002 Robots and Sensors Group 14. Objectives Research sensors and their usefulness to analyze data Research sensors and their usefulness to analyze.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
The George Washington University Electrical & Computer Engineering Department Dr. S. Ahmadi Class 3.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
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.
1 The George Washington University Electrical & Computer Engineering Department ECE 1010 Intro To Electrical and Computer Engineering Dr. S. Ahmadi Class.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
Forward Until Near Stop when near a wall.
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
Sensor Information: while loops and Boolean Logic.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Intro to the Robotics Introducing the IC Discuss.
By Sanjay and Arvind Seshan
Introducing KIPR Link/Interface and Set-up
Introductory Presentation
Learning Outcomes Understand While Loop
Automation and Robotics
Module F: Presentation Understanding Robot Fundamentals
Forward Until Touch Robot goes forward until it hits a wall.
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Line Following Behavior
Switch Blocks check a value and choose a path based on that value
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
if-else Structures Principles of Engineering
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
Lego MINDSTORMS EV3.
Oregon Robotics Tournament and Outreach Program
Getting started with LEGO EV3 Mindstorms software
Presentation transcript:

The George Washington University Department of ECE ECE 1010 - Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 5

Class Outline Programming Left/Right Turn Capabilities for the Robot Light Sensor Applications

(Before going on, let’s make robot go forward and backwards first!) Turning (Before going on, let’s make robot go forward and backwards first!) 20 - Minutes

Implementing Turning Number of different ways to turn: 1. Turn only one motor on, and leave it running for ‘X’ amount of milliseconds. X is determined by experimenting with your particular robot. motor(1, 80); // Turning motor 1 forward @ 80%. msleep(X);

Turning continued… 2. One motor forward, opposite motor backwards, and then leave for X milliseconds. motor(1, 80); // Motor 1 goes forward @ 80%. motor(3, -80); // Motor 3 goes backward @ 80%. msleep(X); // X determined experimentally by // programmers/designers. Although not as efficient, you can also turn by having both motors going in the same direction, but at different speeds.

Calculating the time, X Write a short program to make a robot turn, using one of the mentioned techniques. Put X = 2.0, and run the program. See how much the robot turns. Change the value of X accordingly. If turn is much greater then 90 degrees, lessen the time, X. If it is smaller, put a larger time. Keep repeating until your robot executes a near perfect 90 degree turn.

Loops

2 Different Types of Loops To repeat a group of commands until a condition is no longer true, we use a WHILE loop To repeat a group of commands a predefined # of times, we use a FOR loop Examples: while (a_button()==0) { beep(); } for (int count=0; count<=4; count++) { beep() ; } WHILE LOOP FOR LOOP

Block Diagram For a Right Turn Go Forward Turn Right? No Yes Turn Right

Flow Chart to Code for Turning Right while (1) { // go forward motor ( 1, 100 ) ; motor ( 3, 100 ) ; // should we turn right? if ( analog10(4) > 200 ) // turn RT, until off black tape ao() ; while (analog10(4) > 200) motor (3, 100) ; } Go Forward Turn Right? No Yes Turn Right Flow Chart C Code Implementation of Flow Chart

Block Diagram For a Right Turn or Left Turn Go Forward Right turn? Left turn? No No Yes Yes Turn Right Turn Left

Block Diagram for a Complete System Go Forward Right turn? Left turn? No No Yes Yes No Turn Left Turn Right Left turn? Yes STOP

Sample Program int main() { int sensor1, sensor3, Flag=1; printf("Press A button to begin:"); while(a_button()==0); // Waits for start button to be pressed. while(Flag==1) sensor1=analog10(4); // Reads the signal coming from analog port 4. sensor3=analog10(6); // Reads the signal coming from analog port 6. motor(1, 10); // GO FORWARD. motor(3, 10);

if(sensor1>200) // RIGHT TURN?? { // If Yes then…. if(sensor3>200) // …LEFT TURN?? { // ao(); // Flag=0; // If YES then STOP!!! } else // Right turn = yes BUT Left turn = no, then... { ao(); msleep(2000); while(analog10(4)>200) // Turn RIGHT!! motor(3,100);

motor(1,100); else if(sensor3>200) // LEFT TURN???? { ao(); msleep(2000); while(analog10(6)>200) // TURN LEFT motor(1,100); }

U-Turn Making the robot U-turn, and go back along the path to the starting point. This can be carried out in the following way: After sensing a black surface on BOTH light sensors, the robot stops, and then starts to rotate in either direction. The robot rotates until the first sensor senses the black line, it CONTINUES rotating, but stops once the second sensor detects the black line. Once the rotation has been completed, the robot moves along the line in the same way as in the main part of the project until it reaches the start line.