Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design of the Control Strategy

Similar presentations


Presentation on theme: "Design of the Control Strategy"— Presentation transcript:

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

2 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.

3 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

4 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.

5 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.

6 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.

7 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.

8 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 ; }

9 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


Download ppt "Design of the Control Strategy"

Similar presentations


Ads by Google