Design of the Control Strategy

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

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.
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.
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.
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.
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.
Copyright Curt Hill The C/C++ switch Statement A multi-path decision statement.
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.
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.
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?
Lecture 2 Introduction to Programming
Introduction To Robot Sensors
TESTBED ACADEMY Final Exam.
Algorithms Today we will look at: what the word algorithm means
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
More Selections BIS1523 – Lecture 9.
CPS120: Introduction to Computer Science
Systems Design Nursebot
Introduction to Programming
Recursion Data Structures.
The switch statement: an alternative to writing a lot of conditionals
While Loops and If-Else Structures
Using the sensor Lesson 5.
Traffic Safety.
While Loops and If-Else Structures
While Loops and If-Else Structures
While Loops and If-Else Structures
Input-Output-Process Demo
Control Structures Part 3
Input-Output-Process Demo
Conditionals.
CISC101 Reminders All assignments are now posted.
Program Flow.
While Loops and If-Else Structures
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.
Using the sensor Lesson 5.
While Loops and If-Else Structures
CIS 136 Building Mobile Apps
While Loops And If-Else Structures
Presentation transcript:

Design of the Control Strategy Environmental Disturbances Control Strategy System Dynamics Goal Output Sensors Feedback

Nursebot Control Strategy Environmental Disturbances System Dynamics Goal motion_control Output decision Feedback 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 the Control Strategy Goal2 Environmental Disturbances navigate line_follow System Dynamics Output Goal1 feedback 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 line_follow 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 case 3: // do something else when x is 3 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