line followers: basic to proportional -...
TRANSCRIPT
ì Evaluateandcomparedifferentlinefollowers
ì Learntousetheconceptof“proportional”tocreateaproportionallinefollower
ì Prerequisites:BasicLineFollower,ColorLineFollower,ColorSensorCalibration,ProportionalControl,MathBlocks,DataWires
©2015EV3Lessons.com,Lastedit4/5/2015 2
LessonObjectives
©2015EV3Lessons.com,Lastedit4/5/2015 3
WhichProgramWorksBestforWhichSituation?
SmoothLineFollower• Almostthesameassimple• Turnsarelesssharp• Hastroubleonsharpcurves• Good forrookieteamsà needtoknow
loopsandswitches
SimpleLineFollower• Mostbasiclinefollower• Wigglesalotduetosharpturns• Good forrookieteamsà needto
knowloopsandswitches
ProportionalFollower• Usesthe“P”inPID• Makesproportional turns• Workswellonbothstraightandcurved
lines• Good forintermediatetoadvanced
teamsà needtoknowmathblocksanddatawires
3-StageFollower• Bestforstraightlines• Droidsdonot recommendthis.
Justlearntheproportional linefollower.
• Needtoknownestedswitches
Watchthevideosonthenext2slidestoseeallfour.
©2015EV3Lessons.com,Lastedit4/5/2015 4
CurvedLine:WatchVideos
SmoothLineFollowerSimpleLineFollower
Proportional Follower3-StageFollower
StraightLine:WatchVideos
©2015EV3Lessons.com,Lastedit4/5/2015 5
SmoothLineFollowerSimpleLineFollower
Proportional Follower3-StageFollower
ì Challenge1:Canyouwriteasimplelinefollower?Hint:ReviewBeginner:BasicLineFollowerlesson
ì Challenge2:Canyouwriteasmootherlinefollower?Hint:Changehowsharptheturnsareinasimplelinefollower.
ì Challenge3:Canyouwriteathree-stagelinefollowerwheretherobotmovesdifferent3differentways(left,rightorstraight)basedonthereadingfromthecolorsensor?
©2015EV3Lessons.com,Lastedit4/5/2015 6
3LineFollowerChallenges
ì CALIBRATE:ì TheprogramsusetheEV3ColorSensorinLightSensormodeì Youwillhavetocalibrateyoursensors.ì PleaserefertoIntermediate:ColorSensorCalibrationLesson
ì PORTS:ì TheColorSensorisconnectedtoPort3.ì Pleasechangethisforyourrobot.
ì WHICHSIDEOFTHELINE:ì Pleasetakenoteofwhichsideofthelinethecodeiswrittenfor
©2015EV3Lessons.com,Lastedit4/5/2015 7
ANoteAboutOurSolutions
Challenge4:Canyouwriteaproportionallinefollowerthatchangestheangleoftheturndependingonhowfarawayfromthelinetherobotis?
Pseudocode:
1. ResettheRotationsensor(Onlyrequiredforlinefollowingforatotaldistance)
2. Computetheerror=Distancefromline=(Lightsensorreading– TargetReading)
3. Scaletheerrortodetermineacorrectionamount.Adjustyourscalingfactortomakeyourobotfollowthelinemoresmoothly.
4. UsetheCorrectionvalue(computerinStep3)toadjusttherobot’sturntowardstheline.
©2015EV3Lessons.com,Lastedit4/5/2015 11
Challenge4:ProportionalLineFollower
ì Youwillgetbetterresults
ì ….ifyourcolorsensorsareclosertotheground
ì ….remembertocalibrate
©2015EV3Lessons.com,Lastedit4/5/2015 13
Tips
©2015EV3Lessons.com,Lastedit4/5/2015 14
DiscussionGuide
SmoothLineFollower++--
SimpleLineFollower++--
ProportionalFollower++--
Three-StageLineFollower++--
Fillintheabovewithpositivesandnegativesofeachtechnique.Consider ifthelinefollowerisbestforcurvedorstraightlines.Consider iftherobotwillwigglealot.