Shop OBEX P1 Docs P2 Docs Learn Events
Questions about QTI line following hardware. — Parallax Forums

Questions about QTI line following hardware.

MovieMakerMovieMaker Posts: 502
edited 2008-09-03 03:11 in Propeller 1
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,

smile.gif·

Comments

  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 13:53
    I could still use an answer if anyone has the time. Happy Labor Day!!
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-01 14:37
    READ THE DOCUMENTATION for BoeBotBasic that comes with it when you download.
    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.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 15:46
    I read the documentation. But, I am still not clear how to hook it up. Do I treat the Unit as two completely different IRemit,IrDET??· I have to have two pins with the signals?· I am sorry, it just isn't clear to me. Could you explain it as if you were talking to a ten year old?

    Thanks.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 16:05
    I read IRZONE <expression> <expression> <expression>



    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.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 16:08
    I forgot to mention. I have two line following circuits hooked to front left and front right. It is not just the IRemitter and IRdetector separate. It is the Line following chip if this helps you understand.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-01 16:39
    Look at BOEBOT.BAS lines 160 to 220 and lines 1000 to 1210 for examples of IRZONE.

    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.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 16:41
    Thank you, Mike for your answer. it is a lot more detailed and I am going to read it and re-read it until I understand it.



    tongue.gif
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-01 16:47
    Is it possible to hook up the line following circuit just the same way that the IRdect,emit is hooked up since there are both of them in the same circuit? I have alread taken off the emit and det circuitry. I had a hard time figuring out how to mount it. The line following chips are so much easier to mount. I would like to use them INSTEAD of the IR separate items.

    Your explaination has made it much clearer to me.

    Thanks!
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-01 17:04
    The line following device is COMPLETELY different from the IR emitter / detector combination. There is no built-in support in BoeBotBasic for the line following device although you could probably use the same techniques shown for the Stamp, just programming in BoeBoeBasic. You'd use OUTA[noparse][[/noparse] ] to turn on the IR LED, INA[noparse][[/noparse] ] to sense the state of the line following device's capacitor. Without changing BoeBotBasic, you'd have no way to do "greyscale" sensing, only black and white. Be careful. The IR LED in the line following device probably should be powered from +5V and you probably should have a 1K resistor in series with the output from the line following device in addition to the 220 Ohm resistor already part of it.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-02 03:17
    OK, so I rewired everything to match what I figured would be right. I read all of the documentation. I took off the line following hardware and put the IRdect, IRemitt back in place. I am going for edge detection. But, no matter what I do, I get v,w,x,y,z with each a value of 9. I do not exactly know what this means, but I do have them pointed diagonally to the floor. I need to know if this is the value that I am supposed to have and if they are in fact working.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-02 03:37
    How about using just a single IRZONE statement and see what you get? Like:

    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.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-02 23:52
    Mike, just a little update from you. I re-read, re-wired and tried different things. I always got a 9 from my IRdetectors. On my last try things started to smoke and started burning up. I think I will have to completely rebuild that circuit. Wish me luck. You have been very clear, it is just my stupid understanding got hung up on the IR part of things. Before that, things were going fine. So, I have to regroup and start over. Thanks for your help. I don't need any advice at this point, just prayers. Hope to give you a good update soon.'

    smile.gif
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-02 23:54
    Sorry, I meant to say FOR you.
  • parts-man73parts-man73 Posts: 830
    edited 2008-09-03 02:23
    MovieMaker said...
    On my last try things started to smoke and started burning up. I think I will have to completely rebuild that circuit.


    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. wink.gif
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-03 03:11
    It all started when the solid little green light started pulsing until it almost went out. Next, the IRdetector got really really hot. I don't know exactly what was smoking, my eyes are not that good. And , I have lost my sense of smell, so It really had to do some stuff for me to notice. I took everything apart and check my circuitry. Next I rebuilt in another place all of the same stuff wired to meet the specs, I think. After I hooked it all up, the green light stayed solid. (good sign). I changed the ports completely just in case I have blown the ports. Next I did the test in boebot basic and I got 9 9 9 9 9. I disconnected all of the stuff and re-did the test, and I got 9 9 9 9 9. So, I measured the resistance accross the DETectors and they were different. I measured accross the Emitters and they were about the same. SO, I figure one of the Detectors fried. But, None of them pulled a lot of current. But, when I went back to test everything in Boebot Basic, I changed the port numbers and tried to compile, but the only boebot basic I could load up and run was the BoebotBasic PP.BIN. I was trying to change the ports in Boebotbasic.spin and then complie it.But for some strange reason, it did not let me.

    If any one has some comments, feel free. I am about the end of my proverbial rope.

    Thanks
Sign In or Register to comment.