Hey everyone,
I'm really pretty stupid when it comes to electronics, so forgive me if I embarrass myself here, but I really need help with this issue. Some friends and I are making a robot for a competition where part of the challenge is navigating through a mock house. A crucial function of the robot is being able to align itself so its sides are parrallel with the walls of the house...i.e. so it sets itself going straight down the hallway.
The way we're doing this is looking at the outputs of 2 analog rangefinding sensors on the same side of the robot (1 towards the front, one towards the back). When the outputs are roughly the same we know we're roughly parrallel with the wall.
Since our programmer is mad strapped for time and working in an unfamiliar language, I thought I'd try doing the comparison electrically instead of making him code it (that also means I don't have to wire up ADCs).
Right now I have the output of each rangefinder hooked up to an LM341 configured as a Schmitt Trigger with adjustable hysteresis. It works when I test it with a multimeter - I get a +3.3v output when both sensors read approximately the same distance (+/- accuracy depending on the pot setting).
The thing is, when we try to have the robot align itself it totally misses the signal...like it's never worked, not even once. Sometimes, when we actually pick the bot up instead of letting it drive itself the motors will stop, but only when the hysteresis is so high that it ends up being worse off than when it started.
I really don't why the hell this happens, although I wonder if it has anything to do with the fact that the output from the rangefinders isn't linear. Or the fact that I know nothing about electronics.
Any help would be much, much appreciated (like you wouldn't believe how insanely appreciated it would be)!
Thanks so much!, Sam