This is an old revision of the document!
In this milestone you will implement a full working laser-tag system, which consists of a kit (backpack and gun) for each team in your group. This means that you must have a working transmitter board and a working receiver board for each kit so you can actually demonstrate your system as you play the game. You will be unable to pass off this milestone unless you can show to the TA that you have these boards in your possession (as a group). This milestone will be accomplished as a group. However, each member of the team needs to fully contribute to the work. In this milestone, you will demonstrate the functionality of your system and write two reports as described further below.
Each team (typically 2 students) will:
As a group (typically 4 students), you will test your system (two kits working together) and demonstrate the ability to:
Finally, as a group you will subject your system to a series of statistical distance measurements.
You will need a microSD card for this task. Make sure that it is class 10 or above and has a capacity of at least 8 GB. The shop should have some of these for sale. If not, the bookstore or Amazon are good options.
Each team (typically 2 students) needs to checkout a laser-tag kit from the shop (CB 416). The kit contains everything you will need to implement a full game (except for the electronics that were implemented during ECEn 340), and includes:
NOTE: You will not use the ZYBO boards that are provided at your workstation. You will only use the ZYBO board that comes mounted in the clear electronics box. A view of the electronics box (opened) is shown below.
NOTE: No additional software is required for this milestone. You only need the software used during Task 3 of Milestone 3.
VIDEO: This video demonstrates how to assemble the kit with the gun, the receiver board, the transmitter board, microSD card, battery, etc.
Each team will need to provide a working analog receiver board and a transmitter board. Both of these were built during ECEn 340. You will install these boards into the electronics box - as you did during the first week of ECEn 390 - and you will connect the modified Nerf gun cables to the connectors on the top corner of the electronics box.
The connectors for the gun cables are at the top corner of the electronics box and are circled in the picture shown below.
Your laser-tag kit needs to be portable; the game wouldn't be much fun to play if you have to remain attached to a desktop computer via the USB programming/power cable. As such, the box contains a battery for powering the kit (you will need to charge this from time to time) and the ZYBO board has a slot for an microSD card containing the software that you have, to this point, downloaded to the ZYBO board via the USB cable. You will copy the software to the SD card using this procedure. Note that you can choose to use the software created by either pair in your group. However, I strongly suggest that you use the same software for both kits. Once the SD card is ready to go, insert it into the SD-card socket on the ZYBO board along with your receiver and transmitter boards and start testing. Here is a general outline that you can follow.
NOTE: It is typically a good idea to implement your software so that each kit ignores its own frequency. The light from the LED often leaks in and partially shines on the photo diode and causes you to be hit by your own gun.
The hit sensitivity can be adjusted by changing the fudge-factor value. To compute a reasonable fudge factor for use with the guns, come up with a value that will just barely detect (but not miss) “hits” at your testing distance. You will probably tweak your fudge factor as you do more testing. Just remember that a low fudge factor will result in a threshold that will more easily detect hits but that may have problems with false hits caused by noise. On the other hand, a higher fudge factor makes the receiving kit more immune to false hits caused by noise, but it will lower your overall sensitivity and the potential distance from a shooter that a hit can be detected.
The general idea behind this approach is that the threshold tracks the current background noise to some degree. Thus if the frequency channels all have power values that are a little high, the computed threshold also tracks higher. Vice versa, if the frequency channels all have power values that are lower, the computed threshold also tracks lower. In practice this detection strategy has worked quite well, often achieving distances of 100' in daylight.
Make sure that you have two laser-tag kits where each one consists of an electronic box with attached Nerf gun, programmed SD card, and charged battery. Here is how I suggest that you proceed.
If this doesn't work, don't bother trying shooter mode. Get continuous mode working first. At this point, because you passed off M3T3, you know that all of your software works correctly (that was the point of M3T3). All kits and cables were tested in the last few weeks so the problem is likely one of the following:
To enter shooter mode (as long as you are using the original, unmodified software for main.c with RUNNING_MODE_M3_T3 defined), just hold down BTN2 while you cycle power on the ZYBO board. The board will come up in shooter mode. Now, perform the same tests as before but watch to see that the histograms on both kits accumulate hits on the correct frequencies. If you do not detect hits, the problem is likely one of the following:
As a group, you will perform a set of statistical distance experiments as described below. Also, as a group you will write a report that describes the results and conclusions from your experiments.
Create shooter data by making shooting attempts at 20', 40', and 60'. Compute the statistics as discussed below for your system. Then, randomly contact another group in the class and get their shooter results. Compare the two systems. Is one system clearly better than the other under all situations?
By now, you have seen that many engineering problems can be modeled with random variables. For example, you learned in ECEn 240 that Ohm’s law dictates the exact voltage drop V across a resistor as a function of the current across the resistor I and the resistor’s resistance value R. That relationship is now familiar to you, and can be expressed as:
Yet, if you were to measure the resistance, the current, and the voltage, you probably wouldn’t be surprised to see a small deviation in the resulting relationship between the three measurements. In other words, you might actually observe:
for some small, but nonzero, value of epsilon.
Often these small differences occur from the inaccuracy of our measurements, and often they occur due to small differences in the environments or small defects in the materials. The combination of several of these small effects can easily be modeled by letting epsilon be a random variable with a certain distribution defined over its range of values. The Gaussian distribution tends to model several natural phenomena, resulting in its importance in statistical analysis. In many engineering applications, we want actual measurements to inform our understanding of the distribution of epsilon. Is it really Gaussian? What are the mean and variance of the distribution? Statistics can help us answer these questions.
Now, let’s apply this principle to your overall laser tag system. Although you have verified that your system “works” at 40 feet, we might naturally ask a follow on question: “How well does it work?” To answer this question, the principles of STAT 201 can help us form a meaningful statistical analysis. In other words, we will let W be a random variable with its distribution defined as:
where W = 1 indicates that your receiving laser-tag kit detects a ‘hit,’ and W = 0 indicates that it misses a detection. (This type of random variable is known as a Bernoulli random variable, and you probably recognize it as one of the simplest ways to model outcomes of a random experiment.) Missed detections may occur for a number of reasons. You should brainstorm several reasons why these occur while you conduct this experiment.
The purpose of this assignment is to apply probabilistic and statistical tools from STAT 201 to help you understand the reliability of your laser tag system. If you need a review, Kahn academy has some good explanatory videos on statistics (I used them and found them helpful for this task).
Pass off requires two teams, each with a laser tag kit, to work together:
Repeat the process with the other gun.
Here is an example report.
Produce a short report summarizing the design and the results of your statistical experiments. Include key equations, calculations and a table summarizing your results. Include a list of several factors that may be leading to the randomness of your outcomes. Draw conclusions on your experiments. Finally, if you were to sell this product, how would you market the range at which your laser tag system “works?”