Questions about QTI line following hardware.
MovieMaker
Posts: 502
I never got the IR system working.· I figured I would try the Line Following Kit. I was told I could detect the edge of the table. I just want to have it were the robot stops before going over the deep end. This could be carpet on the stairs or wood on the table, or concrete on the steps.· The techincal staff said that I could use this hardware for· that kind of stuff. I do not quite understand how it works.· I mean, it changes the voltage or resistance, but it looks like it take ground, positive, and two signal lines. ?? If someone could explain how I can use this in BoeBot Basic to detect the edge of the table.· I tried on the IR system and since I already am using the PING , I don't need IR just yet.· The answer could be right in front of my eyes, but I need a little focusing, please kind gentlemen.· And were am I going to find the code for the propeller. Is it built into boebot basic?
I have already printed up many pages. My printer is out of ink.
Thanks,
·
I have already printed up many pages. My printer is out of ink.
Thanks,
·
Comments
The statement / function is IRZONE. It's based on the IR-based distance detection
used with the Stamp BoeBot and described in detail in the "Robotics with the BoeBot"
tutorial, chapters 7 and 8.
Thanks.
could you give me an example and explain it?
I read irdetectLEFT,· irdetright, Pulsein, pulseout.·· Are these commands in boebot basic? or does IRZONE replace them?
How do I wire up the LINEFOLLOWING kit?· It looks like I put the input to two pins and the ground and positive to the other pins.· It is all fuzzy to me. Please help me understand.
I hate to be so dense. But, I really do not understand.·
sorry.
BoeBotBasic is set up for one I/O pin to drive one or two IR emitters and one I/O pin for an IR detector. You need a 100 Ohm resistor in series with each IR emitter. The cathode of the IR emitter gets connected to ground. The anode gets connected to the resistor. The other end of the resistor(s) gets connected to the I/O pin. The IR detector output pin is connected to a 1K resistor and the other end of the resistor gets connected to the I/O pin. The detector also needs a ground connection and a connection to +5V. See the IR detector documentation for which pin is which. Documentation for a part can be found on the Parallax webstore page for the product.
The IRZONE function has the form: IRZONE [noparse][[/noparse] <frequency> , <# zones> , <step size> ]
The <frequency> is the "center" frequency of the IR pulses. In the BOEBOT.BAS example, it's 38kHz (38000). As described in "Robotics for the BoeBot", the distance in front of the IR detector is divided into zones. <# zones> is this value. You can specify any number of zones. In the BOEBOT.BAS example, it's 10. IRZONE will return the number of the closest zone where there's a response detected. <step size> is the frequency change from zone to zone (in Hz). In the BOEBOT.BAS example, it's 500Hz.
IRZONE starts at the highest frequency: (<frequency> + (<#zones> - 1) * <step size>
If there's no response from the detector, it decreases the frequency by <step size>, then tries again.
If there's no response at any frequency, it returns -1, otherwise it returns the zone # where a response was detected.
As described in "Robotics for the BoeBot", the IR detector is most sensitive to the "center" frequency and less sensitive
the further the frequency is from the "center" frequency. Essentially, the higher the zone #, the closer the object is to
the BoeBot.
I can't help you with the line following circuit. As I've said before, get one thing working before you start on the next.
Your explaination has made it much clearer to me.
Thanks!
100 print irzone [noparse][[/noparse] 38000, 10, 500 ]
Every time you run this you should get a number from -1 to 9. If you have the IR emitter and IR
detector aimed in the same general direction and use a book or piece of wood or something as a test
surface, you should be able to get different zone values with different distances from the emitter / detector.
If you get -1 all the time, then either the IR emitter isn't working or the IR detector is always giving
a high (+5V) value. If you get 9 all the time, then the IR detector is always giving a low (0V) value.
Check your wiring. The IR detector should have a supply of +5V, ground, and the output lead should
be connected to the proper Propeller I/O pin through a 1K resistor.
Not good, once you let the magic smoke out, those parts are finished. Too bad they don't make magic smoke refill kits, like the inkjet cartridges my printer takes.
If any one has some comments, feel free. I am about the end of my proverbial rope.
Thanks