Beruflich Dokumente
Kultur Dokumente
Week 14
If you wish to meet with your academic advisor you may schedule an appointment through the GE Advising Scholar Sign-Up Tool.
Please note that it is typical for students to course request courses and not
receive a seat in that respective course. You will use Drop/Add on Hokie Spa
under the registration and schedule menu to add any courses you did not
receive and finalize your class schedule.
Tuesday, Dec 15
Begins at 1:05 pm
Test will be one hour long
Location: to be announced
Multiple Choice (~25-30 questions)
Bring Hokie passport, pencil, eraser, calculator
Do NOT bring computer
Open MATLAB
Review pretest procedures
Review test procedures
Practice submission
Read Sensors
Determine
desired
response
Send instructions
to motors
Path
Before you can write the program that will cause your
robot to follow a line you should test your logic.
Center
Sensor
648
Right
Sensor
98
720
61
44
54
72
810
44
52
38
50
505
717
57
730
546
620
550
50
OUTPUT
left motor off ,
right motor off
INPUT
Sensor Readings
STOP
Increment loop
control variable
OUTPUT
Instructions to
motor
For each set of sensor values display the desired motor actions i.e.,
disp(leftmotor on) or disp(leftmotor off)
What is the desired/expected output?
Left
Sensor
51
Center
Sensor
648
Right
Sensor
98
720
61
44
54
72
810
44
52
38
50
505
717
57
730
546
620
550
50
Threshold = 500,
NumReadings = 1000, LC = 1,
AllWhite = 0,
OUTPUT
left motor off ,
right motor off
While
LC<NumReadings
INPUT
Left, Center, Right
If
LC = LC + 1
OUTPUT
leftmotor ___,
rightmotor ___
if
OUTPUT
leftmotor ___,
rightmotor ___
if
OUTPUT
leftmotor ___,
rightmotor ___
Compare a
single sensor to
the threshold
value in each
decision.
Threshold = 500,
NumReadings = 1000, LC = 1,
AllWhite = 0,
OUTPUT
left motor off ,
right motor off
While
AllWhite == 0
INPUT
Left, Center, Right
If
? >Threshold
LC = LC + 1
Left motor ?
Right motor ?
if
? >Threshold
Left motor ?
Right motor ?
if
? >Threshold
Left motor ?
Right motor ?
How can we add logic to correct for the robot going off
course? How many all white readings means the robot
is off course?
while AllWhite == 0
OUTPUT
left motor off ,
right motor off
While
AllWhite = 0
end
INPUT
Left, Center, Right
If
?>Threshold
LC = LC + 1
Left motor ?
Right motor ?
if
? >Threshold
Left motor ?
Right motor ?
if
? >Threshold
F
AllWhite = AllWhite+1
Left motor ?
Right motor ?
Maybe
while AllWhite <= 15
would be better?
Require N2 consecutive
white readings to
indicate no line sensed.
OUTPUT
left motor off ,
right motor off
While
AllWhite < N2
INPUT
Left, Center, Right
If
Center>Threshold
LC = LC + 1
Left motor on
Right motor on
if
Left>Threshold
if
Right>Threshold
Left motor on
Right motor off
AllWhite = AllWhite+1
AllWhite = 0
Infra-Red Sensors
Tadpole Robot
Path