0% found this document useful (0 votes)
40 views15 pages

Advanced Ev3 Programming Lesson: Line Followers: Basic To Proportional

Distintas formas de programar un siguelineas con lego ev3

Uploaded by

XDrones UAV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views15 pages

Advanced Ev3 Programming Lesson: Line Followers: Basic To Proportional

Distintas formas de programar un siguelineas con lego ev3

Uploaded by

XDrones UAV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

ADVANCED

EV3
PROGRAMMING LESSON

Line Followers: Basic to Proportional


By Sanjay and Arvind Seshan
Lesson Objectives

ì Evaluate and compare different line followers

ì Learn to use the concept of “proportional” to create a


proportional line follower

ì Prerequisites: Basic Line Follower, Color Line Follower, Color


Sensor Calibration, Proportional Control, Math Blocks, Data
Wires

© 2015 EV3Lessons.com, Last edit 4/5/2015 2


Which Program Works Best for Which
Situation?

Simple Line Follower Smooth Line Follower


• Most basic line follower • Almost the same as simple
• Wiggles a lot due to sharp turns • Turns are less sharp
• Good for rookie teams à need to • Has trouble on sharp curves
know loops and switches • Good for rookie teams à need to know
loops and switches

3-Stage Follower Proportional Follower


• Best for straight lines • Uses the “P” in PID
• Droids do not recommend this. • Makes proportional turns
Just learn the proportional line • Works well on both straight and curved
follower. lines
• Need to know nested switches • Good for intermediate to advanced
teams à need to know math blocks and
data wires
Watch the videos on the next 2 slides to see all four.
© 2015 EV3Lessons.com, Last edit 4/5/2015 3
Curved Line: Watch Videos

Simple Line Follower Smooth Line Follower

3-Stage Follower Proportional Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 4


Straight Line: Watch Videos

Simple Line Follower Smooth Line Follower

3-Stage Follower Proportional Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 5


3 Line Follower Challenges

ì Challenge 1: Can you write a simple line follower? Hint: Review


Beginner: Basic Line Follower lesson

ì Challenge 2: Can you write a smoother line follower? Hint:


Change how sharp the turns are in a simple line follower.

ì Challenge 3: Can you write a three-stage line follower where


the robot moves different 3 different ways (left, right or
straight) based on the reading from the color sensor?

© 2015 EV3Lessons.com, Last edit 4/5/2015 6


A Note About Our Solutions

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

ì WHICH SIDE OF THE LINE:


ì Please take note of which side of the line the code is written for

© 2015 EV3Lessons.com, Last edit 4/5/2015 7


Solution 1: Simple Line Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 8


Solution 2: Smooth Line Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 9


Solution 3: Three-Stage Line Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 10


Challenge 4: Proportional Line Follower

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.

© 2015 EV3Lessons.com, Last edit 4/5/2015 11


Solution: Proportional Line Follower

© 2015 EV3Lessons.com, Last edit 4/5/2015 12


Tips

ì You will get better results

ì ….if your color sensors are closer to the ground

ì ….remember to calibrate

© 2015 EV3Lessons.com, Last edit 4/5/2015 13


Discussion Guide

Simple Line Follower Smooth Line Follower


+ +
+ +
- -
- -

Three-Stage Line Follower Proportional Follower


+ +
+ +
- -
- -

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.

© 2015 EV3Lessons.com, Last edit 4/5/2015 14


Credits

ì This tutorial was created by Sanjay Seshan and Arvind Seshan

ì More lessons at www.ev3lessons.com

This work is licensed under a Creative Commons Attribution-


NonCommercial-ShareAlike 4.0 International License.
© 2015 EV3Lessons.com, Last edit 4/5/2015 15

You might also like