[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sensors.txt



Re-updated the section on timing.  Should be clearer now.  I suppose
since you know what it's trying to say now, it will seem clearer, but
I'd like to think it actually is a little clearer now, too.

My apologies for not having done this earlier.

I've included a copy of the current version of the file here.  You are
not expected to read it.  You may be interested to read the section on
interrupt timing, which is the section I subjected to revision.

--
This document describes how the sensors on our robot will work and why.
The description places particular emphases on how the computer will
interact with the sensors.

This document is not considered the authoritative reference.  The completed
circuitry is considered to be the authoritative reference.


IR sensors

A simple 555 timer will be used on the beacon to broadcast IR at a known
frequency.  This will be picked-up by the sensors on the robot.  Each
sensor will be connected to an op-amp used as a voltage follower.  The
output from each of these opamps will be joined together and connected
to a single amp + filter circuit.  The computer will turn individual
sensors on/off by controlling the voltage supply, and, if necessary, the
current supply to the opamp +Vcc and -Vcc lines.  The voltage can be
controlled trivially from the computer through a buffer (and possibly an
inverting opamp if a negative voltage also needs to be controlled).  The
current can be easily controlled using a transistor as a switch.  The
output of the amp + filter circuit will be rectified and connected to
an AD converter.  The exact number of sensors will depend on time and
electrical constraints.  More sensors means higher resolution describing
the angle at which the enemy is detected.  We plan to use wide-angle IR
sensors if these can be obtained.  The use of wide-angle sensors will
eliminate blind spots.

An alternative scheme connects each sensor to the same opamp and turns
the sensors on and off through relay control.  One disadvantage of this
method of multiplexing is that a greater amount of time is required to
switch between sensors; the computer must be especially careful to avoid
bouncing.  This scheme is currently being compared to the above-described
scheme for cost, ease of implementation; the amount of switching time
required will be measured quantitatively before a decision is made.


i) rationale for filtering sensor output in circuitry:

We considered several different methods of filtering received IR from
the sensors.  One particularly interesting method performed much of the
filtering inside the computer.  The computer would sample the amplified
sensor output at a known frequency and then analyze these samples to
determine if a certain required frequency existed or did not exist.
The major advantage of this method is that a lot of the work is performed
by the computer, and the computer is easier to modify and to tweak than
is a circuit.  The major disadvantage is the amount of processing time
required to perform this sampling.  Another disadvantage is that modifying
the frequency of our emitted- and detected- IR requires more effort
(just changing caps is easy; retuning constants in the frequency-detection
algorithm requires more trial and error).

Using a straightforward algorithm, reading and storing the value from
a single given input line would require about 10 instructions (read,
mask, dereference to array, increment).  Assuming an average of 3us per
instruction, this gives 30us to sample one input line.  A constant
overhead of 20us per interrupt should also be assumed.  To handle the
varying analog signal strengths that can indicate distance, the computer
should sample around five digital input lines for a single analog line,
each digital line being read as logical true/false for a different
threshhold of the analog line.  To perform an accurate analysis of the
samplings, interrupts should occur at least 6 times per cycle of the
frequency being searched-for on the analog input.  If we use an 833Hz
modulation for the IR, then a single cycle is 1.2ms long.  This means
each interrupt must finish in less than 0.2 ms.  It would be possible
for the computer to perform frequency analysis of the sensor output.

However, the above analysis shows that a careful worst-case branch path
analysis would be necessary for the programmer to feel comfortable that
the timing demands have been met.  Several tricks are available to relax
the per-interrupt time constraints:

	o the computer does not need to monitor each of the five
	  digital input lines --- if a modulated signal exists and can
	  be sensed, it will always show-up on the line with the lowest
	  voltage threshhold.  The computer needs only monitor this
	  threshold.  When a signal is detected at this level, it can
	  switch up to the next highest threshold and check this one
	  for a signal.  The disadvantage of this scheme is that it
	  makes the analysis more susceptible to noise.  This disadvantage
	  can be largely overcome by sampling 2 of 5 or 3 of 5 lines.

	o to search for the desired frequency, each cycle of the desired
	  frequency is broken into six parts, and each part associated
	  with one entry in an array.  In the above calculations, interrupts
	  must occur at 1 * 200us = 200us.  However, the same algorithm will
	  work equally well if interrupts occur at [ 1 + (6 * n) ] * 200us =
	  200us + 1200us * n.  This scheme would decrease the responsiveness
	  of the algorithm, although as an unintended side-effect, it could
	  decrease the sensitivity of the algorithm to noise.  The
	  advantage is that the maximum time permissible per interrupt
	  will increase by nearly an order of magnitude for even n = 1.
	  
The merits of the above method were considered extensively on Jan 8 by
myself and Joyce.  The biggest advantage of the above method is that the
computer has more control.  In general, I seem to have more faith in
the tricks that could be used to minimize required processing time than
does Joyce, but this is balanced by a greater concern on my part that
we stay far away from the limit of our processing power.  Ultimately
the amplify & rectify scheme was chosen since if everyone else does it,
it must work just fine.

One of the major (perhaps even "the major") consideration on Jan 8 was
that a computer-based filtering method would require less work (= time)
to build more sensors.  This consideration is less significant now that
the scheme for connecting multiple sensors to a single amp + filter
circuit has been devised (see Tim's Jan 18 log entry).


ii) Rationale for the use of a single amp + filter circuit

It is not possible to connect 8 A/D chips to the computer --- there
simply are not enough pins.  Using a single amp + filter circuit solves
this problem.  Other solutions were possible, including multiplexers and
the use of pulse-width modulation input.

The original motivators for devising a method of connecting
multiple sensors to a single amp + filter circuit were cost and
simplicity.  Purchasing 8 A/D converters and 8 * 4 high-quality opamps
proved to be more expensive than originally anticipated.  The use of
a single amp + filter circuit makes it possible to expend more time
optimizing that specific circuit.  By turning on only one sensor at a
time, the electrical stability of the circuit as a whole may also be
improved (we have been warned that when using high amplification levels,
setting off one sensor tends to set off the others as well due to the
slight voltage supply variation).

The disadvantage to the single amp + filter scheme is that, to
the best of our knowledge, no other groups are using such a scheme.
There may be a reason (other than general stupidity) for this.  Or there
may not be a reason.


iii) Rationale for the use of wide-angle sensors

The use of wide-angle sensors eliminates blind spots.  In general, the
wide-angle sensors are also listed as being more sensitive.  There is
some concern that they will not work or will be hard-to-obtain, since
very few (if any) other groups seem to use them.  In fact, other groups
appear to go out of their way to limit the sensing angle of the sensors.
After much consideration of this, it was decided that a) we're not sure
why they do this, and b) we won't.  Due to the cost of photosensors, we
will need to test our sensor system before investing too heavily into
it.  The biggest mechanism of inertia preventing us from switching to
small-angle sensors if the wide- angle sensors do not work would be the
amount of time spent recalibrating the sensor circuits.


Mechanical Touch Sensors

These sensors go around the perimeter of the robot and detect when the
robot has struck an obstacle.  The computer could intuit when we have
struck an obstacle based on whether or not the wheels are turning
(assuming they don't slip --- no-slip wheels are also important if we
try our push-obstacles-around tactic).  Using the mechanical touch
sensors, however, a) provides redundency, b) provides an excuse to use
more input pins, c) saves the motors and interface circuitry from the
damage caused by a stall, and d) allows the computer to determine the
angle at which we struck an obstacle, provided there are a sufficient
number of these sensors around the robot.  For the purposes of d), it
was decided that 10 or so sensors will divide each sensor into a 10cm
area for which it is responsible.  This is not perfect, but will hopefully
suffice for the purposes of d).


-- 
Signature withheld by request of author.