Our strategy heavily relied on the ability to find the 1 kHz beacons in order to deliver the chips to the force bins, therefore accurate IR sensing was vital. The base component we needed for this sensing system were photo transistors. We decided to use three of them, one on each side of the bot and one in the front. This way, we could follow the line in any direction and know when we were in front of a bin by using the side IR sensors. Then, we could begin turn, stop turning when the front IR sensor detected the beacons, and deposit our chips in the bin. This required of us to build a circuit that could detect a 1 kHz (force bins) or 5 kHz (FLAP zone) signal at a range of 6 feet of or less.
This circuit manifested itself in four parts :
At the output of the circuit, we get a square signal of amplitude 5V with a duty cycle of 50% and the same frequency as the beacon if the photo transistor is oriented towards the beacon, and a flat signal around 0V if it is not. We used the PulseIn function to read the period of the signal to recognize the three cases: no signal, 1 kHz or 5 kHz. Note that we had to bias the read period and set up a tolerance to take Arduino inaccuracies and noise into account.
Mechanically, we fixed the photo transistors at a height matching the height of the beacons, and we surrounded them with straws to confine the range in which they detected.
In practice, this system was quite robust and good enough to see all the needed beacons from anywhere in the field. Although we never used the 5 kHz functionality as we never went to the FLAP zone, it functioned well and would have allowed us to optimize our strategy for competition if we had desired. Attached below are the data sheets for the various components used in the circuit, as well as a written description of the circuit and a few pictures of the physical circuit used.
This circuit manifested itself in four parts :
- A photo-transistor with a load resistor to detect the signal. We chose a small value for the resistor so that the response of the photo transistor is fast.
- A non inverting amplifier to amplify the output signal of the photo transistor. After some experimental tuning, we decided to use a gain around 3.
- A high pass filter to get rid of DC or quasi DC offsets in IR light due to the sun or to the lights in the room (~60 Hz). We chose a cutoff frequency around 600 Hz.
- A comparator with hysteresis to get a square signal at the output (easier to interpret in software). Our threshold values are 2.67V and 2.78V.
At the output of the circuit, we get a square signal of amplitude 5V with a duty cycle of 50% and the same frequency as the beacon if the photo transistor is oriented towards the beacon, and a flat signal around 0V if it is not. We used the PulseIn function to read the period of the signal to recognize the three cases: no signal, 1 kHz or 5 kHz. Note that we had to bias the read period and set up a tolerance to take Arduino inaccuracies and noise into account.
Mechanically, we fixed the photo transistors at a height matching the height of the beacons, and we surrounded them with straws to confine the range in which they detected.
In practice, this system was quite robust and good enough to see all the needed beacons from anywhere in the field. Although we never used the 5 kHz functionality as we never went to the FLAP zone, it functioned well and would have allowed us to optimize our strategy for competition if we had desired. Attached below are the data sheets for the various components used in the circuit, as well as a written description of the circuit and a few pictures of the physical circuit used.
|
|
|
IR Sensing Circuit Description | |
File Size: | 154 kb |
File Type: | docx |
A few screenshots of the IR sensing CAD subassembly can be seen below, and the code used for IR sensing is also attached (note this code may differ slightly from the code actually used in our final implementation).
ir_sensing.ino | |
File Size: | 2 kb |
File Type: | ino |