grid tutorials
DESCRIPTION
how to solve grid using line follower robotTRANSCRIPT
-
3/29/2015 Tutorials
http://www.robotix.in/tutorials/category/auto/grid 1/4
IntroductionGridsolvingrobotsareveryusefulinvariousroboticscompetitions.Inthistutorialwewouldbedealingwithhowthegridfollowerrobotworksalongwithitsalgorithm.Agridfollowerisbasicallyalinefollowerwithamodifiedcodewhichhelpsitintraversingagrid.Justasasimplelinefollower,agridfollowertakesinputsfromvarioussensorstodetectitspositiononthegrid.
RobotTherobotwillconsistingoftwoparts
SensorPartDrivingPart
SensorPart:
Thesensorwillbebasicallyalightdetectingsensor.Wehereareusingthepropertyofabsorption.Weallknowthatblacksurfacetendstoabsorballthelightthatfallsonit.So,weplaceaLED(LightEmittingDiode)alongwithaLDR(LightDependantResistor)asoursensor.Supposethatoursensorishoveringuponwhitesurface.Whitesurfacereflectsmorethanblack.Therefore,morelightwouldbereflectedonLDRandthus,itsresistancewouldchangeandwecanpredictaccordinglythatthesensorwillbeuponwhitesurface.Whenitwillbehoveringuponblacksurface,lessamountoflightwillbereflectedandsowecanpredictthatitisovertheblacksurface.
WecanuseIRsensortooinsteadofLEDLDRsensor.
-
3/29/2015 Tutorials
http://www.robotix.in/tutorials/category/auto/grid 2/4
Arrangement:
TheRobotwillbeasimplelinefollowerwithadditionalsensorsforfindingnodesinthegrid(Nodeisbasicallyanintersectionbetweentwolines).Sotherewillbesomesensorsforlinefollowingandsomesensorsfornodedetection.00000
||
||
||
0[M][M]0
||
Theabovefigureshowstherobotalongwithsensorplacement.Thesensorsareshownby0andthemotorsintherobotareshownby[M].BasicallytheGridfollowerrobotwillhavelinefollowerpart(whichincludesthefrontsensors)andnodedetector(whichincludesthesensorsparallelwithmotorshaft).TheGridfollowerhastobasicallyfollowlinewhenitisnotonanodeandwhenanodearrivesithastodecidewhethertotakealeftorrightdependinguponthefinalpositionithastoreach.
DrivingPart:
ThispartisverysimpleitincludetwomotoralongwithamotordriverIC.Motordriverwillnotbeexplainedinthistutorial.Itisexplainedindetailinthis(http://www.robotix.in/tutorials/category/auto/motor_driver)tutorial.
LineFollowingAlgorithmThelinefollowerisexplainedinanothertutorial(http://www.robotix.in/tutorials/category/avr/linefollower).Basicallyitdecidingwhichmotortorundependinguponthelocationsofsensors.Inourcodeonefunctionismadewhichusesthelinefolloweralgorithm.
GridFollowingAlgorithmTheProblemstatementhereisthatgiventwocoordinatesongridtherobothastomovefromonepointtoanother.Forconvenienceweareconsideringthattherobotwillcoverthexcoordinatesfirstandthewillcovertheycoordinates.Forthisconfigurationweneedtoperformthefollowingsteps:AligninproperXdirection.Moveonsomenodessothatthecurrentxcoordinate=thefinalxcoordinate.AligninproperYdirection.Moveonsomenodessothatthecurrentycoordinate=thefinalycoordinate.Withthesefourstepsyourrobotwillreachthefinalcoordinate.Example:Yourrobotisat(0,0)anditneedtoreach(2,2).Theleftlowercorneris(0,0)andtherightuppercornerin(2,2).[w]meansforwarddirection.[s]meansbackwarddirection.[a]meansleftdirection.[d]meansrightdirection.[0]measnode.|||
[0][0][0]
|||
[0][0][0]
|||
[a][0][0]|||
Socurrentlyyourrobotisat(0,0)andpointinginleftdirection.Ithastoreach(2,2)firstcoveringxcoordinatesandthenycoordinates.1]Aligninproperdirection.
HOME(http://www.robotix.in/) (http://www.robotix.in/)
ARCHIVE
EVENTS(http://www.robotix.in/events)
(http://www.robotix.in/events)
TUTORIALS(http://www.robotix.in/tutorials)
(http://www.robotix.in/tutorials)
WORKSHOPS(http://www.robotix.in/page/open/workshop11)
KRAIG INITIATIVES(http://www.robotix.in/page/open/dream_a_bot)
BLOG(http://blog.robotix.in/)
ANDROID APPLICATION(http://www.robotix.in/app/)
http://blog.robotix.in/http://www.robotix.in/app/http://www.robotix.in/page/open/dream_a_bothttp://www.robotix.in/eventshttp://www.robotix.in/eventshttp://www.robotix.in/http://www.robotix.in/page/open/workshop11http://www.robotix.in/tutorials/category/auto/motor_driverhttp://www.robotix.in/http://www.robotix.in/tutorialshttp://www.robotix.in/tutorials/category/avr/linefollowerhttp://www.robotix.in/tutorials
-
3/29/2015 Tutorials
http://www.robotix.in/tutorials/category/auto/grid 3/4
Inthiscasetherobotmustpointtowardsright.Thereforeafterthisstepyourgridalongwithrobotwilllooklike.|||
[0][0][0]
|||
[0][0][0]
|||
[w][0][0]|||
|||
[0][0][0]
|||
[0][0][0]
|||
[d][0][0]|||
2]Moveonsomenodessothatcurrentxcoordinateisequaltofinalxcoordinate.Inthiscaseithastomovefrom(0,0)to(1,0)to(2,0)|||
[0][0][0]
|||
[0][0][0]
|||
[d][0][0]|||
|||
[0][0][0]
|||
[0][0][0]
|||
[0][d][0]|||
|||
[0][0][0]
|||
[0][0][0]
|||
[0][0][d]|||
3]Aligninproperdirection.Inthiscasetherobotmustpointtowardstop.Thereforeafterthisstepyourgridalongwithrobotwilllooklike.|||
[0][0][0]
|||
[0][0][0]
|||
[0][0][w]|||
4]Moveonsomenodessothatcurrentycoordinateisequaltofinalycoordinate.Inthiscaseithastomovefrom(2,0)to(2,1)to(2,2)|||
[0][0][0]
|||
[0][0][0]
|||
[0][0][w]|||
|||
[0][0][0]
|||
[0][0][w]
-
3/29/2015 Tutorials
http://www.robotix.in/tutorials/category/auto/grid 4/4
|||
[0][0][0]
|||
|||
[0][0][w]|||
[0][0][0]
|||
[0][0][0]
|||
So,wehavetestedthatouralgorithmworks!!
TheHardwarePartoftheRobotInthissectiontheconnectionsofsensorsmotordriverandmicrocontrollerwillbeexplained.BeforereadingthissectionmakesurethatyoucompletelyunderstandthefunctioningofmotordriverIC(L293d),LEDLDRsensorandpinoutsofATmega16.IwillbeusingATmega16forthisgridfollowerasmymicrocontroller.
Aswehavealreadydiscussedwheretoplacethesensorsonthebot,nowwewilltalkaboutitsconnectionswiththemicrocontroller.Thesensorwillgiveoutputintheformofanalogvoltage.Thisvoltagehastobecomparedwithsomethresholdvoltagetodecidewhethertheconcernedsensorieeitheronwhiteorblack.Forthistherearetwomethods:
1. ADCAnalogtoDigitalConverter:Hereweassignadigitalvaluetocertainanalogvoltageandthenusingsoftwarecompareitwiththethresholdvalue.InthiscasetheoutputfromthesensorcanbedirectlyconnectedtotheADCpinofthemicrocontroller.
2. Comparator:Heretheanalogvoltageiscomparedusinganotherknowvoltage(Vth)whichcanbesetupusingapotentiometer.Dependingupontheconnectionstheoutputwillbeeitherhighorlow.InthiscasetheoutputfromthecomparatorcanbedirectlygivenasinputtoanyI/Opin(Input/Output)ofthemicrocontroller.
ThemotorsconnectionwillbedonewiththemotordriverICandthecontrollinesofthemotordriverICareconnectedtothemicrocontroller(Formorespecificdetailsrefertomotordrivertutorial(http://www.robotix.in/tutorials/category/auto/motor_driver))
FindusonFacebook
TechnologyRobotixSocietyYoulikethis.
Youand16,766otherslikeTechnologyRobotixSociety.
Facebooksocialplugin
Like Subscribetoouremailnewslettertoreceive
updates.
EmailID
Subscribe
ProfilePicture
YouTubelogo
RobotixIITKharagpur71videos
Subscribed 1K
http://www.robotix.in/tutorials/category/auto/motor_driver