Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview of Project 3 Slides are available at : Updated 1/28 Due Date for project has been extended to next Friday 2/6.

Similar presentations


Presentation on theme: "Overview of Project 3 Slides are available at : Updated 1/28 Due Date for project has been extended to next Friday 2/6."— Presentation transcript:

1 Overview of Project 3 Slides are available at : http://www.pages.drexel.edu/~mjm46 Updated 1/28 Due Date for project has been extended to next Friday 2/6 http://www.pages.drexel.edu/~mjm46 Matthew Murach

2 Project 3: The Wall For this project, you are hard coding a set path to avoid an oncoming wall. For this project, you are hard coding a set path to avoid an oncoming wall. The timing methods used from the last project will be used again in this project for distance estimation The timing methods used from the last project will be used again in this project for distance estimation If the code works the robot should detect the oncoming wall and pass-through the finish line If the code works the robot should detect the oncoming wall and pass-through the finish line

3 Project 3: The Wall For this project your code should be organized roughly as follows: For this project your code should be organized roughly as follows: void right(){} /* do right turn */ void left(){} /* do left turn */ void forward(){} /* go forward 1 unit */ void backward(){} /* go backward 1 unit */ void main(){} /* Call series of directions */ For this project the distance to the wall is unknown. A persistent global variable should be declared to calculate the time needed by the robot to travel from start to finish. For this project the distance to the wall is unknown. A persistent global variable should be declared to calculate the time needed by the robot to travel from start to finish.

4 Distance Algorithm The distance from start to finish is roughly 3 cells. So dividing the calibration time by 3.0 should yield the time to travel forward one cell. The distance from start to finish is roughly 3 cells. So dividing the calibration time by 3.0 should yield the time to travel forward one cell. Turn times should be hard coded Turn times should be hard coded ****In addition to the original requirements the robot should be able to circumnavigate the wall with left or right openings. ****In addition to the original requirements the robot should be able to circumnavigate the wall with left or right openings.

5 Wall Navigation When the robot hits the wall it should now implement the following pseudo-code. When the robot hits the wall it should now implement the following pseudo-code. If(hit){/* test right for opening first default to right state*/ backup();right(); forward 1 U; left(); While (time < 1U){ forward(); if (hit) { r_flag = 1 /* indicates no opening at right use left state */ backup();left(); forward 2 U; right();forward();}}

6 Project 3: The Wall Basic robot parameters Basic robot parameters The robot contains two motors and two sensors The robot contains two motors and two sensors To go forward both motors should be turned on i.e. fd(0) and fd(1) To go forward both motors should be turned on i.e. fd(0) and fd(1) To go right, the left motor should go forward and the right motor should go backward. To go right, the left motor should go forward and the right motor should go backward. fd(0); /* left motor forward */ bk(1); /* right motor backward */

7 Project 3: The Wall There are times when a variable power level for the motor is desired. Using the motor() sub- function allows this. There are times when a variable power level for the motor is desired. Using the motor() sub- function allows this. motor(0,50); /* 50% of power for motor 0 in forward */ motor(0,-33); /* 33% power for motor 0 in reverse */ The usage of sensors is simple just place your sensors connections in a digital port. Operation is the same as before. The usage of sensors is simple just place your sensors connections in a digital port. Operation is the same as before. The motor should be connected as follows on the next slide The motor should be connected as follows on the next slide

8 Motor Connection 2 1 3 Pins 1 and 3 should be connected to the motor. The bank of pins corresponding to each motor.

9 Project 3: The Wall Additional notes Additional notes Your machine should ONLY require one calibration period to run the course. Hard coding of distances is NOT permitted. Your machine should ONLY require one calibration period to run the course. Hard coding of distances is NOT permitted. The robot should travel the length of the course and store this time as a global variable i.e. The robot should travel the length of the course and store this time as a global variable i.e. persistent int a; The robot after determining this value should run the course flawlessly…well maybe… The robot after determining this value should run the course flawlessly…well maybe…

10 Project 3: The Wall This project will require the following. This project will require the following. Each design team consisting of 1-2 students should submit a brief 2-3 page report detailing the design and implementation that was chosen. Each design team consisting of 1-2 students should submit a brief 2-3 page report detailing the design and implementation that was chosen. In addition, all C files needed for this project should be well commented and readable. In addition, all C files needed for this project should be well commented and readable. Also each team will be required to show that the design works 3 out of 4 times (this maybe increased) on the course. Also each team will be required to show that the design works 3 out of 4 times (this maybe increased) on the course.


Download ppt "Overview of Project 3 Slides are available at : Updated 1/28 Due Date for project has been extended to next Friday 2/6."

Similar presentations


Ads by Google