Shop OBEX P1 Docs P2 Docs Learn Events
Qti line sensor question — Parallax Forums

Qti line sensor question

iDaveiDave Posts: 252
edited 2008-12-04 21:12 in Robotics
Reading the description for the QTI lIne sensor, it says other than line sensing it can serve other purposes. What are those? Could it be used as a drop off detector? So my beloved robot won't tumble down the stairs? Thanks in advance.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"THE ONLY TRUE WISDOM IS IN KNOWING YOU KNOW NOTHING." - SOCRATES

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-12-04 02:41
    It says other than sensing the outer ring in sumobot there are other uses. Like line following and rotation or movement sensor used with black and white tape, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • ZootZoot Posts: 2,227
    edited 2008-12-04 19:06
    The QTI sensor makes an *amazing* drop off detector. I have a small Boe-ish Bot that uses it's two front QTIs for following a black electrical tape line on a brown table, the line ends on white paper. When the bot detects the paper, it prints on it with an inkjet. If the table edge is sensed, it backs up and turns around.

    You need to use RCTIME with the QTIs -- you will find that the RCTIME reading for a "drop-off" goes through the roof, so it's a pretty easy threshold to detect, unlike say a brown tabletop and a black line, where the thresholds are much closer. Using the circuit straight from the QTI docs and read into a Word variable, I get values approximately like the following:

    - white paper -- ~163 and lower
    - light brown tabletop -- ~170-250
    - electrical tape -- ~500-1200
    - "drop off" -- anything greater than 1600 or so, with the table edge ususally being over 3000

    But don't use my numbers, that's just FYI -- debug your RCTIME values and see what you get. In my case I wrote a short bit of code that lets me just place the Boe-bot on the paper, on the tabletop, on the tape, and at the "drop-off" so that it self-calibrates.

    In any case, the key to drop off detection is positioning your sensors way out in front of the chassis -- you need to give the bot enough time to reliably read and parse a drop-off state and stop in time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • ZootZoot Posts: 2,227
    edited 2008-12-04 19:16
    Here's my code if you are interested. You can ignore all the parts relating to the basic state machine and the ink jet printer -- what you might find of interest is the QTI code, plus the reset code that performs the self calibration. In my case, I set up the code so that if the·user holds his/her hand in front of the IR sensors upon reset AND then takes the hand away after about 2 seconds, it goes into "calibration" mode, beeping and flashing lights on each calibration read. There are 4 calibrations, from lightest to darkest (white paper, tabletop, electrical tape, drop-off), and calibrations are taken and parsed separately for each sensor (in this case, just a left and right QTI).

    The final threshold values are calculated from the readings·and stored in EEPROM. This make it easy to recalibrate for any table top, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • ZootZoot Posts: 2,227
    edited 2008-12-04 19:44
    Here's some pix of my cheap setup -- I had to get the sensors pretty far out front. And yes, be prepared to catch your 'bot when you are testing! Once I had the calbrations and code dialed in, however, it proved to be totally reliable, except at the most oblique angles of approach (sensors hanging off the side would be good for this, but I'm out of pins on this particular project).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
    2048 x 1536 - 843K
    2048 x 1536 - 953K
  • iDaveiDave Posts: 252
    edited 2008-12-04 21:12
    Thanks Zoot! That's great info. And nice calibration technique though i won't go that direction as my bot will stay on my 2nd floor.


    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "THE ONLY TRUE WISDOM IS IN KNOWING YOU KNOW NOTHING." - SOCRATES
Sign In or Register to comment.