Society of Robots - Robot Forum
Software => Software => Topic started by: prolog on December 15, 2007, 11:06:13 AM
-
I'm developing a line following robot with 8 LEDs and 8 LDRs as sensors
like this
(http://ikalogic.com/tutorials/line_sens_algo/pic.jpg)
I'm using PID algorithm..
I detect line by comparing the analog values of the LDRs with the threshold values..
Apparently, I always have to re-calibrate the threshold values for every new place.
Furthermore, the threshold values keep changing in accordance with the lighting pattern of the place..
Is there any smarter way to make the threshold values auto-adapt to any environment?
Thanks in advance...
-
You could build a hood over the sensor bar so outside light cant get to the LDRs
BTW, theres 9 LEDs and 8 LDRs :P
-
BTW, theres 9 LEDs and 8 LDRs
it not necessarry to pair them, the important thing is to have enough detectable light. I think the reason that there is 1 more LED is so that each LDR has a light source on either side. Think about it if say the left LDR didnt have an LED to its left. It would only get 50% of the light that the others are getting along with an inaccurate reading. :P
PS. 1)Turn the LED's off, 2)Take a reading,3)turn the LED's on, 4)Take a reading. 5)Subtract the 1st reading from the 2nd reading. (This takes a reading of just the background light, then a reading of the background light with the led lights. Then subtracts the background light reading leaving only the true value of the reflected LED light)
-
Hey Paul, check out this link: http://www.wrighthobbies.net/guides/linefollower.htm (http://www.wrighthobbies.net/guides/linefollower.htm)
About the LDRs, they are slow in response and the ADC conversion also takes time. Why not use IR LEDs and IR phototranzistors? They are digital and offer fast feedback so you can speed up your robot.
-
Is there any smarter way to make the threshold values auto-adapt to any environment?
yeap, I call it auto-config.
Have your sensors during startup take readings of the line (physical angle your robot by 90 degrees so that all sensors are on the line) and the ground, add those two reading values, and divide by two for the threshold. This will have to be done for each sensor.
You could build a hood over the sensor bar so outside light cant get to the LDRs
do this!
About the LDRs, they are slow in response and the ADC conversion also takes time.
about ~50ms, depending on the size of your photoresistor. but if you modulate like paulstreats mentioned, then you'd want IR . . . but you'd still need a threshold.
-
Why 8 sensors? Thats overkill !!! :D
I am doing line following with 5 and it detects turns of every angle , as well as knowing when there is a break in the line
-
also why would the modulation paulstreats mentioned have to be IR?
-
it can still be done with ldr's only its a very slow process.
I suppose that more sensors = more resolution. It can be done with just 3. or even 2 if you dont mind your robot veering left and right. There is a link ro-bot-x left above that shows a line follower with just 1 sensor (although with 1 sensor its entirely possible for the robot turn 180 degrees and go the wrong way)
-
with only 3 you cannot detect sharp turns AND detect breaks in the line
only with 5
-
BTW, theres 9 LEDs and 8 LDRs
it not necessarry to pair them, the important thing is to have enough detectable light. I think the reason that there is 1 more LED is so that each LDR has a light source on either side. Think about it if say the left LDR didnt have an LED to its left. It would only get 50% of the light that the others are getting along with an inaccurate reading. :P
yea but i was only saying because he said 8 LEDs and 8 LDRs but theres 9 LEDs :P
But yeah, there is a benefit to having an LED on both sides of the LDRs as mentioned above
-
BTW, theres 9 LEDs and 8 LDRs :P
Thanks guys!
That pic is not mine, btw..
My sensor board is very similar to that though
Anyway,
what are phototransistors and how do they offer digital feedback?
How do IR LEDs differ from normal LEDs?
Thanks!
-
the light they emit is invisible to the human eye, though cameras can pick up IR light
phototransistors work in basically the same way as the photoresistor, just for IR, think IR photoresisotr * which doesn't exist)
-
Check out this IR photoreflective sensor: http://www.wrighthobbies.net/catalog/product_info.php?cPath=34&products_id=105 (http://www.wrighthobbies.net/catalog/product_info.php?cPath=34&products_id=105)
The sensor has a IR LED that emits IR light that reflects of close distance (about 3/16 of an inch) objects back to the IR phototransistor. The phototransistor needs a pull up resistor of 10K and the IR LED a series resistor of about 330-470 ohm. The output will stay high until a reflection gets to the phototransistor and changes to low. This is very fast response and is digital, no need for ADC conversion.
-
Thanks :)
-
My first line following robot has this same problem, I'm currently experimenting having an extra LDR on the top of the robot, to find the light level and callibrate the others accordingly, but I'm using comparators so that might not work with PIC's.
Thanks,
Barnaby