Design of Control Strategy System Dynamics Environmental Disturbances Control Strategy GoalOutput Feedback Sensors.

Slides:



Advertisements
Similar presentations
Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
Advertisements

Nested If Statements While Loops
Synchronous Sequential Logic
Selection Control Structures Chapter 5: Selection Asserting Java © Rick Mercer.
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
Karel The Robot Nested If Statements While Loops Copyright © 2008 by Helene G. Kershner.
Design of Control Strategy System Dynamics Environmental Disturbances Control Strategy GoalOutput Feedback Sensors.
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Logical Operators Java provides two binary logical operators (&& and ||) that are used to combine boolean expressions. Java also provides one unary (!)
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
Tutorial 4 Decision Making with Control Structures and Statements Section A - Decision Making JavaScript Tutorial 4 -Decision Making with Control.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Using the Light Sensor A LEGO light sensor utilizes a LED and a phototransistor to read the reflection of light off a surface. Light sensors are useful.
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
COMPUTER PROGRAMMING. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may repeat code.
JavaScript Part 8 George Mason University June 21, 2010.
CONTROL STRUCTURE The if, elseif, and else & switch Statements 1.
CPS120 Introduction to Computer Programming The Programming Process.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Introduction to Real-Time Systems.
Decision making statements. Decision making statements are used to skip or to execute a group of statements based on the result of some condition. The.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Review, Pseudocode, Flow Charting, and Storyboarding.
Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.
CSCE 121: Introduction to Program Design and Concepts Dr. J. Michael Moore Spring 2015 Set 4: Computation 1 Based on slides created by Bjarne Stroustrup.
ENGR 101: Robotics Lecture 4 – Making Decisions Outline  The Stall Sensor  Making Decisions  Random Number Generation References 
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
© M. Gross, ETH Zürich, 2014 Informatik I für D-MAVT (FS 2014) Exercise 4 – Logical Operators & Branching.
Copyright Curt Hill The C/C++ switch Statement A multi-path decision statement.
1 CS161 Introduction to Computer Science Topic #8.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
Selection Executing Statements Selectively. Review We’ve seen that the C++ if statement permits a Statement to be executed selectively: if (Expression)
Program Structures Chapter 5. 5 Branching Allows different code to execute based on a conditional test. if, if-else, and switch statements.
Mindstorm NXT-G Introduction Towson University Robotics.
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
Dr. Sajib Datta Jan 23,  A precedence for each operator ◦ Multiplication and division have a higher precedence than addition and subtraction.
Learning Javascript From Mr Saem
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
Dr. Sajib Datta Sep 3,  A new operator used in C is modulus operator: %  % only used for integers, not floating-point  Gives the integer.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
Chapter 3 Selection Statements
Formatting Output.
Selection (also known as Branching) Jumail Bin Taliba by
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
Understanding Communication with a Robot? Activity (60 minutes)
Compound Condition Break , Continue Switch Statements in Java
Lecture 3- Decision Structures
Think What will be the output?
Introduction To Robot Sensors
TESTBED ACADEMY Final Exam.
Introduction to MATLAB
Problem Solving and Programming CS140: Introduction to Computing 1 8/21/13.
More Selections BIS1523 – Lecture 9.
CPS120: Introduction to Computer Science
Systems Design Nursebot
The switch statement: an alternative to writing a lot of conditionals
Design of the Control Strategy
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Using the sensor Lesson 5.
Input-Output-Process Demo
Control Structures Part 3
Input-Output-Process Demo
Conditionals.
Program Flow.
There many situations comes in real life when we need to make some decisions and based on these decisions, we decide what should we do next. Similar situations.
Presentation transcript:

Design of Control Strategy System Dynamics Environmental Disturbances Control Strategy GoalOutput Feedback Sensors

Linebot Control Strategy System Dynamics Environmental Disturbances motion_control GoalOutput Feedback decision Task decision() monitors the sensors and issues a control signal dir to task motion_control(). The signal dir is a code -1,0,1,2 to represent turn left, go straight, turn right, or stop. Task motion_control() issues the steering commands to the bot.

Design of Control Strategy System Dynamics Environmental Disturbances Goal2 Output feedback navigate line_follow Goal1 Goal 1: Follow the line Goal 2: Navigate to desired position

Task Structure line_follow() This is the old motion_control used in linebot to control the lateral line-following motion. navigate() a new task that takes over at an intersection. It decides which way to turn and executes the motion control to effect turning. feedback() is the old decision() task. It measures the sensors and changes the dir variable.

Task Structure Continued The tasks navigate and feedback cannot function at the same time. If task feedback signals that the bot has reached an intersection, line_follow must be stopped and navigate must be started.

Variables What variables do we need? We already have one which we called dir-- it is issued by feedback() which assigns values to indicate: turn right, turn left, go straight, and at an intersection. The master control is issuing a command to go to some final destination. This must be kept as a variable. What intersection are we at? Our decision to turn right or left at an intersection depends upon: Where we are and Where we want to go.

Navigation Strategy Suppose we can count the intersections. Depending upon the intersection number, certain destinations will only be achieved if we turn right, others if we turn left. We could use a bunch of if statements to branch to the decision rules for each intersection, or we could use a switch control structure.

The switch control structure switch(x) { case 1: // do something when x is 1 break; case 2: // do something when x is 2 break; case 3: // dosomething else when x is 3 break; default: // do this when x is not 1,2,or 3 break ; }

This is equivalent to the following if statements //put default statement if x is not 1,2, or 3 if(x==1) //add statement executed when x is 1 if(x==2) //add statement executed when x is 2 if(x==3) //add statement executed when x is 3