Advanced Ev3 Programming Lesson: Line Followers: Basic To Proportional
Advanced Ev3 Programming Lesson: Line Followers: Basic To Proportional
EV3
PROGRAMMING LESSON
ì CALIBRATE:
ì The programs use the EV3 Color Sensor in Light Sensor mode
ì You will have to calibrate your sensors.
ì Please refer to Intermediate: Color Sensor Calibration Lesson
ì PORTS:
ì The Color Sensor is connected to Port 3.
ì Please change this for your robot.
Challenge 4: Can you write a proportional line follower that changes the angle of
the turn depending on how far away from the line the robot is?
Pseudocode:
1. Reset the Rotation sensor (Only required for line following for a total
distance)
2. Compute the error = Distance from line = (Light sensor reading – Target
Reading)
3. Scale the error to determine a correction amount. Adjust your scaling factor
to make you robot follow the line more smoothly.
4. Use the Correction value (computer in Step 3) to adjust the robot’s turn
towards the line.
ì ….remember to calibrate
Fill in the above with positives and negatives of each technique. Consider if the line
follower is best for curved or straight lines. Consider if the robot will wiggle a lot.