Shop OBEX P1 Docs P2 Docs Learn Events
Gap in QTI sensor. — Parallax Forums

Gap in QTI sensor.

Carol HazlettCarol Hazlett Posts: 312
edited 2012-07-31 14:32 in General Discussion
Our club uses a 1/4 inch line for the line maze course and when I test my QTI sensors there is a gap between them where the line does not registor. I have the sensors butted up tight against each other and I also tried using the Infrared Sensor Array and found it had an even larger gap between the sensors. This creates the problem of having all 0's when the line is under the gap between sensors. How do I overcome this? I thought of using a different kind of sensor but 1/4 inch line is common and lot's of people use Parallax QTI's so I must not be the only person to run into this. Any suggestions for me? Thanks Ahead.

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-07-31 10:21
    This is a common problem with any line sensor made of large elements as there will always be gaps between the elements. You can solve this in software by retaining state between readings, and heuristics (a $10 word for a guess). Assume a three element array (1, 2, 3).

    * If you've never seen a line the robot should rotate in place until one of the sensors picks up a line.

    * If the line was under 2 and is still under 2, then go straight.

    * If the line is under 1, then turn left.

    * If the line is under 3, then turn right.

    * If the line was under 1 and you are turning left, then keep turning until it is under 2.

    * If the line was under 3 and you are turning right, then keep turning until it is under 2.

    See how these rules use a previous state coupled with the current state to infer where the line might be? There's a more advanced algorithm called PID which uses the concept of current state, prior state, and rate of change to follow lines more effectively than the above.
  • Carol HazlettCarol Hazlett Posts: 312
    edited 2012-07-31 10:43
    Thank you, that heads me in the direction I need to go.
  • Carol HazlettCarol Hazlett Posts: 312
    edited 2012-07-31 14:32
    It looks like the Stamps in Class lessons on PIDs has everything I need. I understand all the logic on how the robot looks for and acquires and holds a line. I needed to find a way for it to not stop immediatley when the thin black line goes into a gap between sensors and reads all zeroes. I think it needs a small delay before it responds to that state and keeps looking for the line. Then when the all zero state is more persistant is when it goes into the dead end routine. It looks like this can be achieved with the PID.
Sign In or Register to comment.