Shop OBEX P1 Docs P2 Docs Learn Events
Line Following — Parallax Forums

Line Following

HimszyHimszy Posts: 28
edited 2005-03-10 01:39 in Robotics
Hi,

I was wondering how robots follow lines. Has anyone got a schematic that i could have a look at?

Thanks Michael

Comments

  • RickBRickB Posts: 395
    edited 2005-03-05 19:03
    Type the words, line following robot stamp into Google. (would you believe 252,000 results?) Google can provide answers to many of the questions asked here, only much faster. Think of Google as an answer machine instead of a search engine.

    Rick
  • HimszyHimszy Posts: 28
    edited 2005-03-05 19:26
    I've had a look already. Counldn't find one about how they work though
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-06 02:45
    The typical line-following situation is this:

    You have a white surface, with black electrical tape put on it to make a 'path'.

    The robot has a light or reflectance sensor close to the ground. When the sensor is over 'white', it returns one value to the robot. When over 'black' or the tape, it returns a different value.

    Now you write some code to steer the robot so when the sensor is over 'black', you go forward. When it's over 'white', you turn the robot to 're-find' the tape.

    That's how line-followers work. Now there are a couple of algorithms to try to help the robot spend less time 'seeking' and more time moving forward, but that's the basics.
  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-03-06 03:21
    Solarbotics has a schematic for "herbie" a very basic line follower that also can act as a "photovore". Do a seach for Herbie on that site, it will be the last result. Also check out this sensor. It has 3 line detectors, so you know if your robot is to the left, to the right, or directly over the line.

    Post Edited (Robert Schwartz) : 3/6/2005 9:19:21 PM GMT
  • edited 2005-03-06 03:32
    I like this one because it's easy to use and adjustable:

    QTI Line Follower AppKit for the Boe-Bot
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-03-10 01:39
    Line following can be done with some very simple hardware and a few lines of code. But this task causes no end of consternation for many of my students....It is a matter of understanding series voltage dividers and what the Stamp needs in order to function, and a willingness to experiment. Here we go...

    Take a photoresistor ( www.radioshack.com/product.asp?catalog%5Fname=CTLG&product%5Fid=276-1657 ) and an ohmmeter and measure the resistance of the photoresistor while you hold it in a position similar to when it is pointing down at the white surface it will be aiming at when it's on the robot. Say it is about 5 kohms (I don't know what it'll be so I'm making this up). Then measure the photoresistor's resistance in the same position but over a piece of the black tape on the white surface, that will be the line you want your robot to follow. Say that resistance is 20 kohms. So now you know that your resistance will swing from about 5 kohms to about 20 kohms from light to dark.

    Suppose you hooked up a series circuit with 5 volts (Vdd) on one end of the photoresistor and a 4.7 k ohm resistor connected to the other end of the photoresistor. Then you connect the free end of the 4.7kohm resistor to ground (Vss). If the photoresistor was pointing at the white surface and had the measured resistance of about 5kohms, the voltage at the junction between the photoresistor and the resistor would be about half of the supply voltage, or about 2.5 volts (Voltage divider formula: V out = R 1 / Rt * Vin).

    Now suppose you pointed the photocell down at the black tape. The photocell resistance goes to 20kohms, while the 4.7kohm resistor stays the same. Now the voltage at the junction between the two components will drop to about 1 volt because 4/5 of the voltage is dropped across the photocell and only 1/5 of the voltage will remain across the 4.7kohm resistor.

    You may know this, but the 0 to 1 transition voltage on a Stamp input pin is about 1.4 volts. So this simple circuit will allow you to swing from a 1 to a 0 on an input simply by moving from above a white surface to black tape, if the input pin is connected to the junction between the photoresistor and the resistor. This means that you can write a program that looks at two inputs (each being connected to the point between a photocell and a suitable resistor). Assuming your two photocells are straddling the black line, in normal operation the inputs will both be high. If one input goes low, you know that that photocell is seeing black. You can adjust your motors to change direction accordingly.

    That's all there is to line following. Just be willing to experiment and adjust resistance values as appropriate. Oh, and you might need to supply some light near the photoresistors such as a LED in order to overcome the inevitable shadows that cross the phororesistors as the robot moves. Be sure you take your initial photoresistor measurements with the LEDs in place so you can trust your readings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Name: Bruce Clemens

    Work:· Clemensb@otc.edu
    Good Stuff on my Blog: http://theDeadBug.journalspace.com
Sign In or Register to comment.