Electronics
Introduction
Mechanics
Electronics
Software
Pictures

IR Beacon Sensors

Carousel Encoder

Tape Sensors

Power Supply Regulation


Wilt's circuit board

IR Beacon Sensors

The greatest challenge in designing the beacon sensors was to successfully identify the 700 Hz IR transmission from the beacon itself while being immune to the 120 Hz interference of the florescent lights in the room.  Without even a decade between these frequencies, we found it necessary to use two filtering stages to improve the SNR to about 24 dB.  Since we used three beacon sensors on the robot, the following description of a single processing channel was in triplicate on the final analog board.

Phototransistor: To capture the beacon transmissions we used the LTR-3208E NPN phototransistor in a sinking configuration with a large collector resistance (10 kΩ).  Although a transconductance amplifier may have been the preferred method, given that it maintains a constant VCE across the device and thereby limits its nonlinearity, we did not consider that best approach.  Without a negative rail the best VCE we could have achieved was only 2.5V, which would limited the output voltage swing to 2.5V while consuming the area of yet another op-amp.  Further, since we would be employing dedicated filters in subsequent stages, the harmonics from non-linear behavior in the phototransistor could be suppressed down the line.  Lastly, using the sinking configuration with a large resistor gave us the ability to achieve a large output swing (theoretically approaching VCC-0.9V), without turning off the transistor.

DC Level Shifting: Once the transmitted modulation is received it passes through a capacitor and resistive network designed to re-bias the signal at 2.5V DC. This is important because subsequent processing depends on the fact that the op-amps are fed 2.5V as their ground and 0 V as their negative supply. Once this artificial ground is introduced, the signal will be properly processed in the inverting op-amps to follow.

Passive Filtering: In addition to resetting the DC value of the signal, the values of the R’s and C in the network are chosen to provide passive, one-pole high-pass filtering with a – 3dB a corner at 677 Hz.  Although this roll-off will not even provide 20 dB attenuation of the 120 Hz interference, it should still improve the SNR by about 10.5 dB.

Active Filtering: To further increase the SNR, the passive filter is followed by an active high-pass filter, or differentiator, with a 530 Hz knee.  This system yields a gain of 1.3 at 700 Hz but only 0.23 at 120 Hz.  Thus, we have an additional 15.3 dB of SNR from the active filter, to give us over two decades of noise immunity. Note that in order to limit the high-frequency gain of the differentiator to 5, we included a 330 kΩ series resistance chosen to force the gain to one right around 700 Hz. This reduces the SNR improvement in this stage to 13.5 dB but is necessary to prevent sharp edges in the input signal from being gained up so high that they distort the output.

Gain: A simple inverting op-amp with a variable input resistance is chose to provide gain for the signal leaving the active filter.

Rectification:  A fast-recovery 1N4935 diode and a 0.01µF capacitor form a simple peak detector which rectifies the resultant signal to provide a DC input for the MicroCore’s ADC.  While precision rectification that includes op-amp feedback could overcome the limitations of the diode’s forward voltage drop, we found that the slight reduction in dynamic range was tolerable is software, while the active rectifiers we constructed seemed to exhibit only marginal performance.  We believe that the internal compensation of the op-amp may be at fault for the instability of the unity feedback configuration.

Carousel Encoder

To keep track of the position of the carousel, we used  pair of IR sensors straddled across the acrylic encoder ring at its center.  The IR passes unperturbed through the acrylic so we simply need to detect when the IR beam is broken and send a 1-bit logic signal to the processor.  To do so, we employ IR techniques that look very similar to both the beacon sensors and IR lab performed in the course:

Modulation: To generate the IR signal for this system we modulated an LTR-2871 photodiode using an LM555 timer.  The configuration is identical to that of Lab #3, in which we also drove both a visible and an IR diode using a square-wave generated by an LM555.  However, we selected a timing resistor ratio that would yield a frequency of 5 kHz, and made this potentiometer adjustable so that we could tune in to exactly 5 kHz on the fly in case of drift.

Phototransistor: Using the same phototransistor as the beacon sensor, we chose in this instance to utilize a sourcing configuration.  Knowing that on account of their proximity and our control over their alignment that the emitter/detector pair would yield a very strong signal, we were not concerned with the output swing of the first stage. Instead, we almost needed to attenuate the input so that we could employ a filter stage following it.  Thus, we chose a small emitter resistance of just 680Ω.

Multiple Feedback Band-pass: To extract only the IR information in 5 kHz band we chose for modulating the carousel encoder, we used a multiple feedback band-pass filter.  Centered at 5 kHz with a Q of 9.8, this filter was able to eliminate any IR interference from the room, the beacons, or the other electronic systems on the robot.  In addition, it provided a gain of nearly 200, which we found to be more than sufficient for achieving a high dynamic range.

Rectification:  A fast-recovery 1N4935 diode and a 0.01µF capacitor form a simple peak detector which rectifies the resultant signal to provide a DC input for the MicroCore’s ADC.  While precision rectification that includes op-amp feedback could overcome the limitations of the diode’s forward voltage drop, we found that the slight reduction in dynamic range was tolerable is software, while the active rectifiers we constructed seemed to exhibit only marginal performance.  We believe that the internal compensation of the op-amp may be at fault for the instability of the unity feedback configuration.

Comparator: In order to send a logic signal to the microprocessor, we used the output of the rectifier to drive a simple comparator, the LM339, whose reference level was potentiometer-adjustable.  This reference level was chosen so that a ‘1’ would be sent when the IR beam was sufficiently interrupted.  In addition, a second comparator was used to drive an LED that indicated the status of the sensor directly.  One dilemma we encountered with the LM339 was that it seemed to limit the swing of our rectifier once the two were connected.  Perhaps because of is large input impedance, there was not a path for discharging the capacitor in any reasonable amount of time. As a result, the signal would remain fixed at a very high voltage no matter how the sensors were aligned. Thus, we employed a 4.7 kΩ resistor to ground on the output of the rectifier.  This provided a discharge path and although it introduced some ripple, we were willing to tolerate that ripple in software in exchange for higher dynamic range.

Tape Sensors

In many regards, the tape sensor circuitry is identical to that of the carousel encoder described above.  On a recommendation from our coach, we chose to modulate our tape sensors to make them immune to interference from the other IR systems on the robot.  Thus, we selected a 9 k Hz modulation frequency with the hope of avoiding even harmonic distortion from the neighboring 5 kHz system for the encoder.  The only other key difference between this system and the encoder IR is that the tape sensors are pre-packaged to include a matched photodiode and phototransistor in the same plastic housing.  Since they are already aligned to send and receive IR reflections at a certain focus, it is important to place them at the proper distance from the playing surface or the amplitude of the received signal can be drastically altered.  The following circuitry is instantiated twice on our analog board since the robot employed two tape sensors.

Modulation: To generate the IR signal for this system we modulated the photodiode using an LM555 timer.  The configuration is identical to that of Lab #3, in which we also drove both a visible and an IR diode using a square-wave generated by an LM555.  However, we selected a timing resistor ratio that would yield a frequency of 9 kHz, and made this potentiometer adjustable so that we could tune in to exactly 9 kHz on the fly in case of drift.

Phototransistor: Using the packaged phototransistor, we chose in this instance to utilize a sourcing configuration.  Knowing that on account of their proximity and our control over their alignment that the emitter/detector pair would yield a very strong signal, we were not concerned with the output swing of the first stage. Instead, we almost needed to attenuate the input so that we could employ a filter stage following it.  Thus, we chose a small emitter resistance of just 250Ω.

Multiple Feedback Bandpass: To extract only the IR information in 9 kHz band we chose for modulating the tape sensors, we used a multiple feedback band-pass filter.  Centered at 9 kHz with a Q of 9.8, this filter was able to eliminate any IR interference from the room, the beacons, or the other electronic systems on the robot.  In addition, it provided a gain of nearly 200, which we found to be more than sufficient for achieving a high dynamic range.

Rectification:  A fast-recovery 1N4935 diode and a 0.01µF capacitor form a simple peak detector which rectifies the resultant signal to provide a DC input for the MicroCore’s ADC.  While precision rectification that includes op-amp feedback could overcome the limitations of the diode’s forward voltage drop, we found that the slight reduction in dynamic range was tolerable is software, while the active rectifiers we constructed seemed to exhibit only marginal performance.  We believe that the internal compensation of the op-amp may be at fault for the instability of the unity feedback configuration.

Comparator: In order to send a logic signal to the microprocessor, we used the output of the rectifier to drive a simple comparator, the LM339, whose reference level was potentiometer-adjustable.  This reference level was chosen so that a ‘1’ would be sent when the IR beam reflection was sufficiently interrupted. We also an LED that indicated the status of the sensor directly.  One dilemma we encountered with the LM339 was that it seemed to limit the swing of our rectifier once the two were connected.  Perhaps because of is large input impedance, there was not a path for discharging the capacitor in any reasonable amount of time. As a result, the signal would remain fixed at a very high voltage no matter how the sensors were aligned. Thus, we employed a 4.7 kΩ resistor to ground on the output of the rectifier.  This provided a discharge path and although it introduced some ripple, we were willing to tolerate that ripple in software in exchange for higher dynamic range.

 

Power Supply Regulation

            To provide the steady 5 V that would be necessary to run all the op-amps, comparators, and voltage dividers on the board, we used an LM2940T Low-dropout regulator.  The key learnings from this device were: the importance of choosing a regulator that can supply enough current to run all portions of the board (our previous choice did not have such capability, while the 2940 can source 1A), and the vital role that power supply bypass capacitors can have on the performance of the circuit.  Without bypass, oscillations from the modulating sources on our board could propagate through the rails and disrupt the carefully tuned comparator thresholds on other channels.