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

What I have so far

This is the stuff I wrote for interface:

3) Interface Subsystem 3.1 Assessment of Problem
	The interface subsystem provides the pathway that closes the
control and feedback loop, providing the computer with useful data from
the environment and implementing the instructions sent by the computer. In
order to play tag autonomously within the RFP guidelines, locomotion of
the robot must be controlled effectively and appropriate sensory inputs
from the surroundings are required.  Sensory inputs from the environment
can be divided into two broad categories -those related to the immediate
surroundings of the robot and those related to the tag opponent tracking
mechanism.  For example, the detection of the presence of obstacles is a
necessary sensory input from the immediate surroundings, whereas sensory
inputs indicating beacon detection enables tag opponent tracking.
Therefore, the requirements for the subsystems can be decomposed into four
key criteria: 1) control of the mechanical drive system, 2) feedback from
the immediate surroundings, 3) generation of beacon signals, and 4)
detection of beacon signal.  The goal of the interface subsystem is to
become an effective link between the computer and the mechanical drive
system and between the computer and the environment. 3.2 Solution
	To meet the criteria set forth by the design proposal, five
circuits with different functionality were designed and implemented: motor
control circuits, speed sensors, touch sensors, beacon signal emitter, and
beacon signal detection circuit.  Table 3.4.1 shows a summary of all the
circuitry on board.  Since most of the circuits required duplication, only
the pin outs for a particular duplication of the circuit are labeled in
each circuit diagram.  Table 3.4.2 is a summary of the pin outs of all the
circuits. 3.2.1 Control of the Mechanical Drive System
	Control of the mechanical drive system was implemented via motor
control coupled with wheel speed feedback.  A mixed relay transistor
circuit was used to execute motor control (see figure 3.4.1).  The relay
was only used to change the direction of the motor rather than to turn the
motor on and off.  Hence, the switching speed of the relay was not a
significant factor, and pulse width modulation of motor speed could be
executed effectively via the transistors.  Due to the current drawn by the
motor when driving the load, heat sinks were mounted on the back of the
TIP142 transistors in order to keep the temperature of the transistors
within the working limits. 
	Voltage spikes from the motor power supply could at times be as
high as 1kV.  To contain voltage spikes, capacitors that have high
capacitance values and voltage ratings coupled with zener diodes that have
high power ratings were used to clip voltage spikes.  Using IN5355B zener
diodes, which are 18V zeners with a power rating of 5W, the voltage spike
should be clipped at circa 18V.  Moreover, since voltage spikes from the
motor power supply could potentially cause damage to other components, the
circuitry was powered from a separate battery. 
	Noise generated from the motor could lead to anomalous behaviour
in sensitive circuitry such as the beacon detection circuit. To minimize
electromagnetic noise generated from the motor leads, the leads were
winded around each other and shielded using aluminum foil.  The foil was
then grounded so that it would act effectively as a shield.  The foil was
also insulated using electrical tape to prevent the potential for short
circuits with other electronic components. 
	To enable the computer to calculate the appropriate pulse width
modulation required at any given time, a wheel speed sensor was
constructed (see figure 3.4.2).  The speed sensor consisted of a slotted
optical switch and an opto-encoder disk.  Infrared light was emitted from
one side of the optical switch, while a detector on the other side
received the signal.  The sensor sent a high signal to the computer (+5V) 
whenever an opaque object interrupted the infrared beam in the slot.  The
encoder disk was a black disk with "teeth" that were 2cm apart (SEE
DIAGRAM), and each time a "tooth" was in the slot, the output signal would
be high.  Hence, by determining the number of times the signal from the
optical switch turned high within a fixed period of time, the speed of the
robot could be readily calculated. 3.2.2 Feedback from Immediate
	Feedback from the immediate surroundings was implemented with
contact sensors.  Touch sensors were placed at the bumpers such that they
would trigger off when Zeta collided with an obstacle.  Two sturdy
microswitches were attached to each bumper plate, acting as touch sensors.
Eight bumper plates were mounted on Zeta, surrounding its entire base with
the exception of the wheels.  However, since Zeta changed direction by
modifying the speed of the driving wheels, collisions between the driving
wheels and any obstacles were impossible.  Hence, with eight touch
sensors, Zeta could detect all possible collisions with obstacles. The
microswitches were deliberately wired in a series formation to minimize
the number of connections to the circuit, thereby allowing for more
convenient access to the base level (see figure 3.4.3). Sturdy
microswitches provided the appropriate sensitivity to bumper movement. 
Initially, microswitches with weaker switch arms were utilized, resulting
in overly sensitive bumpers that could be set off by the sole weight of
the bumper plate.  Microswitches with less sensitive switch arms solved
the problem and would only set off when a collision has occurred. The
touch sensors were mounted in a manner as to maximize the robustness of
the bumpers.  Instead of fixing the sensors tightly onto the base, the
sensors were allowed to rock backwards in the event of a collision, making
the collision as elastic as possible for the touch sensors.  Therefore,
the energy absorbed by the bumper in the event of a collision was
minimized.  3.2.3 Generation of Beacon Signal
	Modulated infrared (IR) light was used as the beacon signal.  Due
to the presence of infrared light from the ambience such as emission from
fluorescent lighting, a unique infrared signal must be generated so that
it was distinguishable from ambient light.  Ambient infrared light is
modulated at circa 300 to 400 Hz; therefore, a desirable beacon emission
frequency should be significantly higher than 800Hz (REF P.197 MANUAL). 
An emitter circuit based on the 555 Timer was constructed to generate a
frequency-modulated signal (see figure 3.4.4).  The two variable resistors
were adjusted appropriately until an infrared emitter output with a
carrier frequency of 8.33kHz and an even duty cycle was produced. 
	To ensure maximum detection range, the beacon emission intensity
was maximized in two ways: firstly by employing an infrared-light emitting
diode with relatively high intensity and secondly by optimizing the
forward current of the diodes.  LD271 was used as the IR-light emitting
diode in the beacon, and it has a maximum power output of 16mW (SEE DATA
SHEET), which is about an order of magnitude higher than maximum power
output of most other IR-light emitting diodes.  Twelve emitters were
mounted on the beacon in an evenly spaced fashion to minimize the number
of blind spots.  To optimize the strength of the beacon signal without
compromising on the 400g weight limit imposed on the beacon, the twelve
emitters had to be wired into three parallel chains of four emitters (see
figure 3.4.4).  Since the power supply to the circuitry was a 9V battery,
using a 30( at each branch of emitters was calculated and tested to
deliver the optimal forward current to the emitters, and hence maximum
output power was extracted from the LD271s (SEE CALCULATIONS). 
	The structure of the beacon was a used yogurt tub.  Matching holes
of 1cm in diameter were cut on the lid as well as on the bottom of the tub
such that the beacon could be interfaced with the peg on the opponent. 
The LD271s were first soldered on small pieces of solder board and later
mounted onto the beacon.  The circuitry and battery fit snugly inside the
container, and the beacon sits securely on the robot and interfaces with
the peg. 3.2.4 Detection of Beacon Signal
	The IR sensor circuitry is composed of three main components: IR
photosensor, photosensor selector circuitry, and filter-amplification
stages (figure 3.4.5).  Eight IR detectors were mounted on Zeta just below
the beacon interface to ensure adequate coverage in all directions.  The
maximum range obtained from the circuitry was circa 18 ft in a relatively
noise-free environment; such a range would have been sufficient to cover
the specified competition area. 
	The IR photosensors used in the circuitry were OP505As (SEE
DATASHEET).  OP505As have a narrow receiving angle of circa 15o (SEE
DATASHEET).  Due to the limited detection angle, calculations showed that
blind spots would be a major problem (SEE CALCULATIONS).  As a result, to
increase detection angle, two OP505As were wired in parallel, acting as a
single IR photosensor with a wider receiving angle (see figure 3.4.5).  To
eliminate cross talk problems among sensors, each sensor was powered
individually with a 9V battery.  Hence, eight 9V batteries were required
to power all the photosensors. 
	As an alternative to building eight detector circuits, a
sensor-selecting scheme was implemented instead.  The collector signal at
each photosensor was wired to a corresponding relay.  SPST reed relays
were chosen for their low switching time as sensors could be cycled
through more frequently.  By selecting to close a particular connection in
a particular relay, the collector signal was outputted to the
filter-amplification circuitry (figure 3.4.6).  In light of the maximum
detection range of 18ft, the relays appeared to have only caused a
negligible loss of signal integrity. A CMOS implementation of the
switching scheme using 4066s was tested since such an implementation would
require less circuitry and components.  However, despite the separation of
power supplies of the photosensors, the problem of cross talk among
sensors persisted.  Since a switch based on CMOS technology is not a
"perfect" switch in the sense that a mechanical switch would be, and due
to the high sensitivity of the filter-amplification circuit, a weak signal
could have been transmitted through a presumably open connection on the
CMOS and amplified, creating cross talk and yielding a false positive
output to the computer.  An open mechanical switch, as in a relay,
completely eliminated the transmission of signals from a photosensor, so
each IR detector could be reliably checked. When the corresponding relay
contact was closed, the collector signal from a particular detector would
be transmitted to the filter-amplification circuitry where the signal
would be processed.  The filter-amplification circuit was composed of
three parts: filter-amplification stages, a full wave rectifier, and a
peak rectifier.  The final output of the circuit was a digital signal to
the computer - +5V for a positive detect, and 0V for no detect. Since
OP505As detect all infrared signals, filter-amplification stages must be
set up to distinguish the beacon signal from ambient infrared light.  A
basic unit in the filter-amplification stages consisted of a high pass
filter followed by a voltage amplifier.  However, the collector signal
first entered a voltage follower in order to maintain a steadier signal. 
Afterwards, the signal was processed through three units of
filter-amplification (see figure 3.4.5).  The cutoff frequency of the high
pass filters was 1.6kHz (SEE CALCULATIONS), which was considerably higher
than the frequency of ambient noise and lower than the beacon emission
frequency of 8.3kHz; hence, the desired frequency would not be too close
to the cutoff, minimizing any loss of signal.  The amplification factor on
each voltage amplifier was 10.  The signal was filtered before passing
through a voltage amplifier each time to minimize amplification of noise
in the signal.  The signal was processed through three
filter-amplification stages; therefore, the signal was magnified 30 times
before entering the full wave rectifier.  A fourth stage was not
constructed since experimentation showed that the circuit became unstable
at the fourth stage, and even minor noise in the signal became amplified
to the extent that the output after the fourth stage was always a positive
	After three stages of filter-amplification, the signal was
rectified via a full wave rectifier.  In addition to rectifying the input
signal, the full wave rectifier also had amplification capabilities.  The
two diodes caused a voltage drop of 1.4V; however, they also smoothed out
the signal enabling more effective amplification.  In order to boost
detection range, an amplification factor of 5 was determined to be the
most optimum at this stage, as it produced the most stable signal. 
Therefore, in addition to the amplification factor of 30 from the
filter-amplifier stages, the signal experienced another amplification
factor of 5 at the full wave rectifier stage.  The net amplification
effect was slightly less than 35 times due to the voltage drop across the
	The final component of the sensor signal processing circuitry was
the peak rectifier which produced a digital signal for the computer (see
figure 3.4.5).  The peak rectifier further smoothed out the signal from
the full wave rectifier, and taking advantage of the fairly sharp
switching of CMOS logic, the rectified waveform was converted to a digital
signal of either +5V signal or 0V.  The time constant of the peak
rectifier was of particular concern since a detector switching strategy
was adopted.  A high time constant would limit the frequency that the
eight IR sensors could be cycled through.  The resistance and capacitance
values used in the circuit resulted in a calculated time constant of 10ms
(SEE CALCULATIONS).  However, tests conducted while the circuitry was
integrated with the computer showed that the reset time of the circuit was
on average about 30ms.  Nonetheless, with these values, the eight sensors
could be cycled through twice per second, which would be sufficient to
play tag. 
	The IR sensor circuitry was the most sensitive circuit of all, and
thus the selection of components and the electrical arrangement of the
components could cause dramatic effects on the performance of the
circuitry.  All operational amplifiers in the circuit were LM741s.  LM741s
were selected due to their insusceptibility from oscillations (SEE
DATASHEET).  Oscillations are an imperfection of operational amplifiers,
and in sensitive circuitry such as the IR sensor circuit, electrical noise
generated from the circuitry itself should be minimized.  Moreover, the
voltage supplies to the detector selector and filter-amplification parts
of the circuitry (i.e. the +12V, -12V to the operational amplifiers, the
+12V to the relay circuitry, and the +5V to the CMOS components) were
different from the +9V power supply of the IR photosensor and the power
supplies to other circuitry.  The separation of power supplies minimized
the noise generation due to slight changes in the voltage supply, which
would otherwise occur if all circuits drew from the same power supply. 
Although the approach was not popular among design groups, there were
several advantages to sensor switching scheme.  Firstly, only one
filter-amplification circuit had to be tested and built, so all detectors
could share the same perfected circuit.  Secondly, since all the detectors
share the same filter-amplification circuit, in theory, the ranges of all
the sensors should be fairly consistent.  However, in practice, although
the detectors did share the same circuit, sensor ranges did vary.  Most
did have around the same range, but a couple of them at times had ranges
which were only about half of that of the rest.  Due to the sensitivity of
the circuit, such difference could have been caused by a number of
factors, including the geometrical arrangement, orientation, or position
of connections and wires, and the non-uniformity of the properties of the
components used. 3.2.5 On/Off and Pursue/Evade Selects
	As specified in the request for proposal, an on/off select and
pursue/evade select are required.  Simple two terminal switches were used
to implement the selects (see figure 3.4.7).  For on/off select, a high
signal of +5V represented the on mode, while for pursue/evade select, the
pursue mode was associated with a high signal. 3.2.6 Power Supply
	The power supply circuits are shown figure 3.4.8.  The 5V voltage
regulator, 7805, conveniently provided a 5V supply to necessary
components.  Between all power supply lines and the ground lines are
capacitors of fairly high capacitances; 220(F and 47(F capacitors were
used amply.  The capacitors were utilized to maintain a steady voltage and
prevent large voltage fluctuations, increasing the electrical stability of
the circuits.  3.3 Suggestions for Improvement
	Although all the circuitry and the subsystem as a whole fulfill
the design requirements, steps can be taken to better improve the
subsystem.  For the motor circuitry, a relay with a higher current rating
would reduce the chances of breaking the relay.  Several times, the relay
broke after the motor stalled as it attempted to turn the pulley and belt
system.  A relay that could withstand a higher current draw would reduce
debugging time as well as the cost of replacing broken relays.  As for the
speed sensor, a reflective optical switch that detects the reflection of
its emitted infrared beam from a reflective part of the axle would have
been more functional than the break-beam switch used.  Since the axle had
a tendency to shift slightly during operation, the encoder wheel at times
became caught at the slotted optical switch.  A reflective switch would
solve the problem.  Lastly, the sensor circuitry could be made more
efficient by using SPDT relays to turn the power supply to the optical
detectors on and off instead.  By turning the power supplied to the
optical detectors, the detectors may be able to share the same power
supply and the problem of cross talk should not occur.  SPDT relays should
be used in place of SPST relays, because by employing SPDT relays, the
collectors of the sensors that are not of interest could be grounded. 
Hence, neither collectors nor emitters are left floating, so
theoretically, those sensors should be completely disabled.  Such a
circuit involving SPDT relays would still have the same advantages as the
SPST implementation used on Zeta; however, by eliminating cross talk and
sharing the same power supply, the new design may save countless debugging
hours and be more space efficient.