PDA

View Full Version : Line follower sensors



kartikmohta
11-23-2007, 02:57 PM
With IR LEDs and photodiodes using the specular reflection (the direct reflected beam), I get a good (almost digital) sensor for detecting whether the line is below the sensor or not, but the values will fall off rapidly as the sensors goes off the line. I want to get analog values to detect how far off the edge of the line I am (up to 1-1.5 cm on either side of the edge). What are the ways of doing this?

Assumptions:
1. There is no ambient light (it has been filtered out using some method like modulation)
2. There are 2 sensors, one over the left edge of the line, one over the right edge.
3. Max turn angle is 90 (at least for now)
4. The floor is flat (or very close to flat)

jaabis
11-24-2007, 01:37 AM
hey bro the usual way to tackle the problem is by using a sensor array but in ur case if two sensors are the limit what u can do is instead of using the led and sensor pair kept close together make a small array as shown


led sens led sens

such tht either sensor can be used to switch on the led and now by cyclic switching of the two leds u can tell where exactly is ur posn ie btw led sens pair 1 pair2 or pair 3!!!!

shreek1123581321
11-24-2007, 01:51 AM
i read quite many posts of yours kartik, and i think you are not on the rite track...

and i guess, you should first think on your own, then search web to get the answer, and then practically implement the thing....

now, how will you get analog value corresponding to the distance from the line?? again do you want to use diffused light?? do one thing na...try to make a real moving machine using reflected light and then using diffused light...i think then you will get how to think about robotics....

and about your question...have an array of sensors, and then use PD algo to follow line...PID even better! and you design array according to your need...single line, double line whatever! use your brain!!!

allbits
11-24-2007, 08:03 AM
:D

Framing a question with constraints so as to lead the thread to a conclusion required by you??

1)

I get a good (almost digital) sensor for detecting whether the line is below the sensor or not,

I strongly disagree. I repeat, I strongly disagree. you can get .5V, 1V,2V,3V and 4V with a simple LDR+light combination!!! you need the right calibration. I am saying you can, ot just by assumptions, It has been TESTED!!

So you don't need complex answers, all you need is simple calibration, and you can get output proportional to the light intensity entering the sensor.

Always, the sensor out will be always proportional to the light entering it. Its up to the algorithm to decide how far the line is. In fact, there are situations in a two sensor arrangement when the sensors will give the same output, which might lead us to think the line is exactly at the middle of the bot, while it aint!!

here are some of the situations:

http://i223.photobucket.com/albums/dd30/greatjobin/linefollower.jpg


while the first four will have same outputs from sensors, the last two will also have same output levels from the sensor. So its all in an algo!!

If you want to make a good lone follower, increase the sensors. I am not sure if the original post was to do that.



There is no ambient light (it has been filtered out using some method like modulation)

I dont want to argue about the assumption made, but but ambient light reduction with modulation IS very tricky, Its somewhat easy with IR, since hardly will your sensor get saturated. You will know what i mean, if you try a line follower with sensors uncovered, no reflected light from the line-sensor, in a room, with windows on one side!!

And the robot takes the fist turn.. guess you got what i mean.

I didnt mean a discussion on ambient light here, i guess i might be starting a discussion on a new thread.

docel
11-24-2007, 09:10 AM
Kartik!
( You need to spend a little time on this....)
Get a torch, a white paper, stick a 3cm black tape on it. Flash the Torch light beam ( a visible light LED is great for this) on the black tape and slowly move the beam towards the white. CAREFULLY OBSERVE the circle of light every 1mm and make a serial sketch of the shape.
Now , tell us:
a. Is it Digital :?:
b. or is it Analogue :?:
c. What is the relationship to the shape of the light beam and its intensity :?:
d. Calculate the angles for the best reading at an imaginary sensor.

You can repeat this experiment with a LDR connected to a Analog multimetermeter in the OHMs range ( so that you can see the results clearly)

Plot this and draw the curve.

By then, you'll realise WHAT we are all trying to tell you!

kartikmohta
11-25-2007, 03:57 PM
@docel: Currently I am a bit busy since my exams are going on, will try the experiment sometime later.

@allbits: Of the cases you mentioned, the second case cannot occur because the distance between the sensors is almost equal to the width of the line, so both cannot be outside the line when the bot is at some angle. Cases 3 and 4 are when the bot has already strayed away from the line and these are the cases which we have to prevent. For the last two, the robot has to turn to the turn, so there is no ambiguity.

shreek1123581321
11-25-2007, 06:33 PM
arey baap re!!! kartik, you want to keep the distance between the sensors almost equal to the width of the line???????? 8O


do one thing na, try this out practically na...

as for your information let me tell you, your bot will be a god slow bot, for it will always be in correction mode and never to its max velocity...


and now i strongly recommend you to try something practically before you post here,,,maybe after your exam.... :wink:

kartikmohta
11-25-2007, 07:48 PM
I had made a line follower with the distance between the sensors about the same as the line width. It ran at a decent speed. I accept it was always in correction mode, the corrections were done using a PD controller so for small errors there was not much reduction in the speed.
I don't get the problem with this approach?

shreek1123581321
11-25-2007, 07:51 PM
well how do you achieve PD control using just two sensors??? 8O

kartikmohta
11-26-2007, 01:09 PM
Whats the problem in that? You can get analog values from the sensors to detect how far from the center you are which acts as the error for the PD controller.

allbits
11-26-2007, 05:40 PM
For the last two, the robot has to turn to the turn, so there is no ambiguity.

turn how much?? You are using PD controller!! if you turn the same degree, why do u need a PD controller??

You DONT need a controller or a PD algorithm if you dont care about the ambiguities. You dont them either if you are using TWO sensors, that too to the edges. You can just use two transistors!!! and yes, you can use a couple of OP amps for a differentiator!!!

having said this, i would like to know , for the info, these:

1) the type of sensors used
2) the type of emitters used
3) the modulation technique used

shreek1123581321
11-27-2007, 12:27 AM
does it give good analog value?? like the area in which receiver is active is quite low, so to use that analog value as amount of error is doubtful...

as in at one point the error is 1% and within 3mm of a distance it is 100%!!

I think i should try this out but,,
give me some more detail about this linefollower please...

you know keeping a sensor array works very fine, and we know where exactly we are...but if we can apply this logic also in sensor array theory then it will be nice!

docel
11-27-2007, 01:15 AM
2 sensors....and you need an algorithm??
and PD???
Meaning , Microcontroller(s), maybe????
:lol: :lol: :lol:

Boy! I'd love to see the 'speed' of that thing....

Kartikmohta, I think you are just passing time. I do'nt think you have any genuine problem but just want to show off your theoretical knowledge, scourged from the net here and there. The more you say , the more ridiculous you seem.

You ask something and answer it yourself , with a twist of contradiction to your own ideas. Then you reply that you have already done it. Tomorrow, you'll probably say it won prizes already!
What are you up to?

Your problem of the thread is absolute nonsense!

I suggest that you take time out and concentrate on your studies. Get back here after exams, after you read your own posts in detail, with a free mind.

Now, I would like to see some 'meaningful' and relevant posts here. Some of the things you say make no sense, and its confusing to people who are just starting. i cannot allow that to continue. You're welcome to a healthy discussion, but enough is enough. Good luck!

ppppking04
11-27-2007, 08:59 AM
Perhaps this is what Kartik has been trying to suggest...

http://www.me.iitb.ac.in/~adeshmukh/linefollower.php <Check the video at the bottom>

Uses the same two sensors - analog value setup with P control as mentioned.

By "diffused" light, I SUPPOSE Kartik was trying to suggest that you DONT align the emitter and receiver to get maximum reflected voltage but deliberately keep them parallel so that the voltages received give a more linear (only relatively speaking) response, kind of like decreasing the sensitivity of the sensor setup so that direct reflection doesnt overwhelm the receiver. This COULD give analog values that MAYBE can be used for PD control.

Just my interpretation of whats been going on the forum last few days.

allbits
11-27-2007, 10:13 PM
yes, pppp, we got the idea alright!!

But the counter argument was that there are issues to this method!!

putting it in a simple way -

we humans have the most sophisticated control systems, i guess. Looking at both sides of the argument -


*> We see because light gets reflected from the thing we see.

*> Reflected light is like a torch light pointed out to the thing we want to see - minimum power, and we see only what we want to see. - the line

*> we feel comfortable with a tubelight illuminating a room, but we dont have to see the minor details - we are just looking for a line!! This situation is ideal when we use a camera for image processing . But a tube light requires much more power than a torch light!!

*> so we dont have to use a tube light when a torch would do the trick.

*> try illuminating the whole room with a torch light!! compare this with focusing our target with the torch light!!!

no more arguments from me on this thread!!!



:D :twisted:

shreek1123581321
11-28-2007, 09:56 PM
i really dont know, whether we will get good analog output or not, ... but i think i should try this out,

because the receiver works on an area (it has a lens) so if we get good analog value then that value will give us the 'amount of line' inside the circular area in which the receiver is active...

and of course, amol bhaiyya has tried it, then there has to be some point in it!

Man! lot many things to work on!!! :)

Cmux
12-18-2007, 12:16 PM
@allbits: I guess you got the analogy wrong. A better analogy would be a bright torch with a small beam angle (for the conventional reflective multi-sensor array) and a dim torch with a large beam angle (for the analog sensor design).

A bright torch with a small beam angle would illuminate the object of interest very nicely. But what will you see when you point the torch slightly away from the object? Nothing ... Darkness. Imagine navigating in a dark room and trying to maintain a predefined path (say by following a line). A slight misalignment of the torchlight leads to a complete loss of information about the direction of the line. Now imagine the same situation with a dim torch but with a larger beam angle. Slight misalignments still show you the line and allow time for correcting your path.

Now I hope its kind of trivial to judge whose 'speed' can be higher :P. As far as the use of microcontrollers is concerned, I don't think it is essential to use them as a PD algorithm can be easily implemented using opamps.

As for the range of analog values that one can obtain from it, take it from me that the values are high enough for detection. And yes from first-hand experience, the speed of a PD-controlled line-follower can be much higher than that shown in the video link posted by pppp

allbits
12-18-2007, 07:18 PM
@allbits: I guess you got the analogy wrong. A better analogy would be a bright torch with a small beam angle (for the conventional reflective multi-sensor array) and a dim torch with a large beam angle (for the analog sensor design).

better?? than what?
There was no argument on "analogy" in this thread!! and you are the first one to bring in the word "beam angle" (which, I guess, you are meaning something like the "radiation pattern" rather than the angle of beam to the object) - And i never said you were wrong, :D - since this is your first post!!



But what will you see when you point the torch slightly away from the object? Nothing

yes!! that is the point!! you should not see the object when you point it away!!! that is, you should not see the LINE when the light is NOT illuminating the line!!



A slight misalignment of the torchlight leads to a complete loss of
information about the direction of the line.

Yes, it will, but this is the trade off, and the cost you pay for better demarcation.

I Understand your point something similar to this - A torch in the dark room will let you see only the thing you point the torch at, and if you point the torch wrong, you may not see what you are looking for.

Where as, a bulb will illuminate the whole room, so that you can see the object even if you are not pointing at it.

But then, the sensors are not intelligent -

1) Comparing the methods, you can easily see that the bulb needs to be more powerful (in terms of total light radiated) than the torch, or the sensor needs to be more sensitive.

2) The confusion was all about "diffused light", and the OP failed to give an convincing explanation of the word "diffused" as he used it. Any waves reaching the sensor are reflected waves. Any waves reaching the sensor, not getting reflected from the line is useless to us.

3) The thread was NOT about illumination, it was about getting distance value using 2 sensors - whose solutions has illumination issues as part of it.

The motive of this thread was NOT to have a good discussion on light effects. The initial conditions were drafted in a way to direct the thread to a particular solution, but then, all men have egos (yes, including me twisted: ) which led this thread to this length.

we can go on for months arguing about this topic, but I guess we can conclude this thread in a healthy manner as well, by putting down the trade offs of each method. And I guess the moderator can do it best, after we have a reply from the OP.

:D

Cmux
12-19-2007, 11:23 AM
Where as, a bulb will illuminate the whole room, so that you can see the object even if you are not pointing at it.

But then, the sensors are not intelligent

Right ... the sensors are not intelligent. But you are. The sensor will give you different values when it sees different parts of the line. It does not know what it is looking at. You have to make sense out of the sensor values and judge what the sensor is looking at. If you start from a point close to the edge of the line (and on the line) and keep going outwards, you will see a steady (analog) drop in the sensor values.

About diffused light:
Pardon me for getting in to discussing the light effects again but I thought these deserved a clarification.
Diffused light is nothing but reflected light. Its the surface of reflection that matters. This 'diffused light' the thread has been talking about is the result of reflection from irregularities in the surface and hence is low in intensity. And as contrary to somebody's belief in the thread, no surface however smooth the maker claims it is can be smooth enough to not to cause these irregular reflections. You need angstrom-level accuracy to eliminate these irregularities.

We can't argue out a possible design when it has been experimentally verified.

It would be helpful if someone could post all possible designs discussed and then we can discuss the pros and cons of each. That would be a good way to end this thread.

allbits
12-19-2007, 03:47 PM
Right ... the sensors are not intelligent. But you are. The sensor will give you different values when it sees different parts of the line. It does not know what it is looking at. You have to make sense out of the sensor values and judge what the sensor is looking at. If you start from a point close to the edge of the line (and on the line) and keep going outwards, you will see a steady (analog) drop in the sensor values.

And for this, a directed light is far better, simple and more efficient!! And this was the point I always wanted to convey!!

Nobody said the other design WONT work. I am saying because I have done it, have made more line followers than all the other robots that i have made - with LDRs, with IR, with illumination, without illumination, and blah - blah.

The OP posted a question on a line follower with TWO sensors - ( and "filtering" the ambient light while using LDRs!!!! Now I want to know how people do it!) The problem statement was not genuine, the topic was not directed to a healthy discussion either. Line followers and the sensor placement possibilities can always be a good topic for discussion, but not when the constraints are kept like the one in this thread.