Following Lines

From PrattWiki
Jump to navigation Jump to search

Introduction

One of the critical tasks for the Integrated Design Challenge every semester is for each 'bot to follow a dark line and identify locations on the line marked with a perpendicular hash. The hash marks will be perpendicular to the track and will be significantly wider than the line.

The most common way to approach line following is to use a set of three, four, or five QTI (Q=charge, T=transfer, I=infrared) sensors to measure infrared reflectivity. For a given material, the darker the object is, the lower the reflectivity and thus the lower the QTI reading.

Three Sensors

If there are three sensors, typically there is one mounted in the middle to keep track of the line and two relatively close on either side to keep track of when the 'bot goes off course or encounters a hash. If we assume that each QTI will be categorized as being over something dark or something light, there are eight theoretically possible "states" for the system to be in:

  • DDD
  • DDL
  • DLD
  • DLL
  • LDD
  • LDL
  • LLD
  • LLL

In order to write a program that decides how to move the 'bot, you should first decide which of these states are physically possible and then describe those states and what the 'bot should do. For example, LDL means the center QTI is on the line, the outside QTIs are not measuring a hash, and so the 'bot should continue moving forward. DDD means all three are measuring dark - while it is possible that means the robot has made a 90-degree angle with the track and is now hopelessly confused, this more likely means the 'bot has found a hash.

In doing this exercise, you will likely discover that there are some reasonable states that do not provide sufficient information on what to do next. For that reason, it is more common to use four QTIs when line following.

Four Sensors

If there are four sensors, typically there are two next to each other in the middle and then two on the outside next to those (that is, there are four QTIs in a row, centered on the front of the 'bot). If we assume that each QTI will be categorized as being over something dark or something light, there are sixteen theoretically possible "states" for the system to be in:

  • DDDD
  • DDDL
  • DDLD
  • DDLL
  • DLDD
  • DLDL
  • DLLD
  • DLLL
  • LDDD
  • LDDL
  • LDLD
  • LDLL
  • LLDD
  • LLDL
  • LLLD
  • LLLL

Once again, you should decide which of these states are physically possible and then describe those states and what the 'bot should do. Note that some of these fall into the "highly unlikely" category - DLLD, for instance, would only be possible if one of the outer QTIs is on the line and the other is on the outside of a hash - not really a state you will need to worry about.

Five Sensors

The CX-Bot has connections for up to five QTIs. If five are used for line following, typically there are three near the middle to keep track of the line and two on the outside to keep track of hashes. If we assume that each QTI will be categorized as being over something dark or something light, there are thirty-two theoretically possible "states" for the system to be in:

  • DDDDD
  • DDDDL
  • DDDLD
  • DDDLL
  • DDLDD
  • DDLDL
  • DDLLD
  • DDLLL
  • DLDDD
  • DLDDL
  • DLDLD
  • DLDLL
  • DLLDD
  • DLLDL
  • DLLLD
  • DLLLL
  • LDDDD
  • LDDDL
  • LDDLD
  • LDDLL
  • LDLDD
  • LDLDL
  • LDLLD
  • LDLLL
  • LLDDD
  • LLDDL
  • LLDLD
  • LLDLL
  • LLLDD
  • LLLDL
  • LLLLD
  • LLLLL

Once again, you should decide which of these states are physically possible and then describe those states and what the 'bot should do. Note that many of these fall into the "highly unlikely" category - LLDLL, for instance, would be very hard to "achieve" given how close the center QTIs are to each other.