Sie sind auf Seite 1von 1

Starting Point: Line Edge Following

When you follow a line, you follow the edge of the line.
Why use line edge following?
How it works?
Consistency
Consistency decreases as the robot
travels further from base. Line edge
following navigation makes for more
consistent robot runs.
Teaching Skills
Line edge following teaches logic and
math skills that will pay dividends in the
future. Line following navigation can be
applied to several missions.
Shared Reset Navigation Point
Reset points are points on the game feld where you
can start multiple missions. If a robot can use line
edge following and line detection (2nd Sensor) to get
to a specifc spot consistently, multiple programs can
use the code by creating a My Block, code segments
that can be used across multiple programs/missions.
This saves time and improves consistency.
Human Eye
Light Sensor
Your eyes sees
black and white
when looking at
the line edge.
The light sensors sees a
gradient scale, which can
be used to determine
where the robot is on the
edge of the line.
0
100
50
Program Logic
Following the left edge of a line.
Navigation
Using line edge following allows the robot to know
where it is on the game board. It allows the robot to
navigate the board and align for specifc missions.
Using the light reading, determine which direction
to turn. For smoother line following, use the
reading to determine the degree of turn.
A loop is used so the robot moves
forward reading the line edge
until an exit condition is true.
0
100
50
Exit Condition
Rotations = 3
Time = 10 Seconds
Color Sensor = Green
Logic Block = True
Loop
- If greater than 50, turn right
- If 50, go straight
- If less than 50, turn left
Calibration Sensor Placement
Types of Line Edge Following?
Dual State
Complex State
Proportional Algorithm (PID, Proportional Integral and Derivative)
Simple, on/of logic for zigzag line following.
Moderately Simple conditional logic for smooth line following. Great for straight lines.
Complex, math calculations for smooth line following. Great for curved lines.
Motor B
Motor C
F
r
o
n
t
P2
Light Sensors
Line - Following Left Edge
P1
Switch Block Loop Block
Exit loop after
Motor B rotates
3 times.
Power: 50 Power: 75
Power: 50 Power: 75
White - Turn Right
Black - Turn Left Read
Light
Value
The examples below are using a diferential steering robot, illustratrated
on the left. They are following the left line edge with light sensor 2. To
turn right, Motor B must be faster than Motor C.
Use when you want to break down the light sensor intensity values by more than 5 conditions for smoother line following. It uses math to
calculate the amount of correction that is needed. For more information on PID, Google NXT PID, there are several great examples. PID is
a hard concept to teach to FLL Division I teams but is worth noting for older and experienced teams.
Dual State sees black or white and turns accordingly. It is simple but
can be very jerky. It utilize a two state switch that determine the
turn direction.
Complex State is great for straight lines and is easy for FLL teams to understand. It divides the light
reading (0 - Black to 100 - White) by 20, resulting in a number between 0 and 4. A switch block is
used with 5 conditions to determine the direction and size (degree) of the turn.
If mainly following straight lines, place the light sensor close
to the pivot point.
If mainly following curved lines, place out front of the pivot
point.
Loop Block
Read
Light
Value
Connectors: Passes values between blocks
Exit loop after
Color Sensor 1
Sees Green
Out In
20
Reading (A) / 20 (B)
Math Block: Sensor Block
(0 to 100) Motor Block Motor Block
0 1 2 3 4
Out
In
Power: 50 Power: 35
Big Right Turn
Switch Block
2
1
Power: 50 Power: 35
Big Right Turn
2
3
4
0
Power: 50 Power: 40
Small Right Turn
Power: 40 Power: 50
Small Left Turn
Power: 35 Power: 50
Big Left Turn
Power: 50 Power: 50
Straight
Websites:
http://www.nxtprograms.com/line_follower/steps.html
http://www.theroboticist.org/learning-resources/nxt-examples/line-follower/
Books:
Winning Design!: LEGO MINDSTORMS NXT Design Patterns for Fun and Competi-
tion
By James Jefrey Trobaugh
Resources
Sample from http://www.nxtprograms.com/line_follower/steps.html
The distance from the sensor to the
mat should be the height of a penny.
Consistent
Not Consistent
Light varies from place to place, so you need to calibrate the light sensor
to set the minimum (0% - black line) and maximum (100% - white mat).
In the NXT Tools menu, use the calibration block. Once you start the
program, follow the instructions on the display. More information can
found under in the LEGO NXT MINDSTORMS help content.
No fash photography when the robot is running.
The fash may interfere with the light sensor.
Poster created by Scott Rakestraw (scott@rakestraw.com)

Das könnte Ihnen auch gefallen