grid tutorials

4
Introduction Grid solving robots are very useful in various robotics competitions. In this tutorial we would be dealing with how the grid follower robot works along with its algorithm. A grid follower is basically a line follower with a modified code which helps it in traversing a grid. Just as a simple line follower, a grid follower takes inputs from various sensors to detect its position on the grid. Robot The robot will consisting of two parts Sensor Part Driving Part Sensor Part: The sensor will be basically a light detecting sensor. We here are using the property of absorption. We all know that black surface tends to absorb all the light that falls on it. So, we place a LED(Light Emitting Diode) along with a LDR(Light Dependant Resistor) as our sensor. Suppose that our sensor is hovering upon white surface. White surface reflects more than black. Therefore, more light would be reflected on LDR and thus, its resistance would change and we can predict accordingly that the sensor will be upon white surface. When it will be hovering upon black surface, less amount of light will be reflected and so we can predict that it is over the black surface. We can use IR sensor too instead of LEDLDR sensor.

Upload: nitin-nilesh

Post on 16-Nov-2015

216 views

Category:

Documents


1 download

DESCRIPTION

how to solve grid using line follower robot

TRANSCRIPT

  • 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