Test

From Mech
Revision as of 10:29, 19 August 2009 by Gll059 (talk | contribs)
Jump to navigationJump to search


LED Angle vs Color Sensor Signal

The second experiment is designed to see how much interference will be caused as the angle between LED and color sensor changes. Different from the first experiment, Vi, the voltage before amplified, is mesured since amplified output, Vo, easily reaches to the maximum.

Setup and Results

1. A white LED is used again in this experiment with the same reason above for the first experiment.

  • LED: 18950 mcd, Digikey part number: C503B-WAN-CABBB151-ND

2. The experiment was performed under the two conditions; with the ambient light and without the ambient light.

3. In this experiment, the distance between LED and color sensor is kept constant, 1 inch.

4. Angle between LED and color sensor is increased by 15º each time from 0º to 90º.

When the angle is 0º, the LED and the color sensor is placed at the same horizontal plane. The LED is facing toward the color sensor(this means that the LED is parallel to the horizontal plane with its head facing the color sensor, which is placed on the same horizontal plane), and the color sensor is facing upward. We increased the angle by 15º each time, and increasing amounts of light from the LED shines onto the color sensor. When the angle is 90º, the LED is right above the color sensor, facing the color sensor directly. This means that the LED and the color sensor are now on the same vertical line, and the LED is facing downward.

5. The voltage before amplified, Vi as shown in the circuit diagram above, of each photodiode is measured.

  • The reason to measure the volatage before amplified is that the output becomes too large after amplified.

With the Ambient Light

Angle vs output with room light.gif
  • Unit: Volt, V
Angle vs Voltage Before Amplified
Angle R G B
0.437 0.425 0.404
15º 0.475 0.470 0.451
30º 0.490 0.491 0.501
45º 0.505 0.506 0.520
60º 0.484 0.468 0.484
75º 0.457 0.453 0.440
90º 0.439 0.430 0.408


Without the Ambient Light

Angle vs output without room light.jpg
  • Unit: Volt, V
Angle vs Voltage Before Amplified
Angle R G B
0.446 0.436 0.416
15º 0.454 0.491 0.461
30º 0.493 0.505 0.480
45º 0.512 0.521 0.520
60º 0.498 0.486 0.491
75º 0.498 0.492 0.487
90º 0.485 0.479 0.515


As the first experiment, two graph above shows that the color sensor is affected by the light from the LED. The color sensor is most affectd by the LED when the angle between two is 45º. The inteference increases as the angle goes to 45º, and reaches to the peak at 45º. Then it decreases as the angle goes to 90º. When the color sensor is most affected by the LED under the presence of the room light, the output increases upto 15.6%, 19.1%, and 28.7% of Vi. As angle becomes 90º, the output becomes very close to the value at the angle of 0º. The reason why the interference is reduced as the angle reaches 90º is that the ambient light presented are blocked by the LED board. When we perform this experiment, the LEDs are implemented on the LED plane. This LED plane blocks the light and make a shadow on the color sensor. Thus, the amount of light that the color sensor receives decreases. That is why the output becomes close to its original value while the angle increases.









Next Steps

The LED Pattern Board design above needs to be modified in the following parts.

  • The hole size for the LEDs has to increase so that it can accomodate the standoff of the LED chosen.
  • The hole size for the switch has to increase so that the switch can be completely inserted through the hole.
  • Currently, 10 pos 2mm pitch socket is used to connect the color sensor to the circuit using wires. Instead, the proper header for the color sensor has to be found to connect the color sensor and the circuit more conveniently.

Machine Vision Localization System Modification

The Machine Vision Localization System takes the real (color) image from the four cameras, and converts it into a grey-scale image. Then, using a threshold set in the machine vision code, the grey-scaled image is divided into black and white, and this black and white image is presented on the machine vision system computer screen. With the current set-up, the white background on the floor is presented as black, and black dot patterns on e-pucks are presented as white patterns. The system recognizes theses white dot patterns and identify e-pucks, and broadcasts the position coordinates to each e-puck via the Xbee Radio. For more information about the theory and operation of the system, look through the Machine Vision Localization System article.

However, there is a problem with using black dot patterns to identify e-pucks. Since the machine vision system and code use a preset threshold to divide the grey image into black and white, black dot patterns are affected by the background color due to lack of contrast. For instance, if the background is black, or any color besides white, the system would have a difficult time distinguishing the pattern from the background, and possible not capture them at all. In addition, other problems arise from dirt and debris tracked onto the white surface of the floor, resulting in false patterns, further throwing the system.

A solution is to substitute the black dots with LEDs placed atop the e-pucks, allowing the machine vision system to capture the identification pattern clearly regardless of background color and condition. By adjusting the threshold set in the machine vision code, the system will rely on the contrast of light intensity, minimizing the interference of the operating environment whose light intensity is which is naturally weaker than LEDs'.

Compatibility Problem of Original Code with LEDs

With the original code implementation, the system could not recognize LED patterns on e-puck; it only recognizes white patterns on the screen, which are black patterns in the reality. This problem can be simply fixed with modifying code to make the system capture LED patterns and present them as white patterns on the screen. The change of program will be shown in the next section. With this change, the system now makes LED patterns white dot patterns on the screen, so it can recognize them and identify e-pucks.

Change from Original Code

In main.cpp in VisionTracking project, the code has been changed in

Line 48:

cvThreshold(greyImage[camerai], thresholdedImage[camerai], threshold, 255, '''CV_THRESH_BINARY_INV''');

to

cvThreshold(greyImage[camerai], thresholdedImage[camerai], threshold, 255, '''CV_THRESH_BINARY''');

and

Line 735:

cvThreshold(grey, thresholded_image, threshold, 255, CV_THRESH_BINARY_INV);

to

cvThreshold(grey, thresholded_image, threshold, 255, CV_THRESH_BINARY);

Also, in global_vars.h,

Line 65:

double threshold = 75;   //black/white threshold

to

double threshold = 200;   //black/white threshold

As change CV_THRESH_BINARY_INV in both line 48 and 735 to CV_THRESH_BINARY and adjust the value of threshold from 75 to 200, the system now clearly presents LED patterns as white dot patterns on the screen, so it can identify e-pucks according to LED patterns.

Further Threshold Testing

The threshold value of 200 is determined to be good enough for the test inside. With various conditions, however, the threshold value can, or should, be changed more properly. In addition, the results for different range of threshold under the same test condition is presented below:

Threshold range
Range Result
0 - 94 System cannot caputure LED patterns at all; whole screen is white.
95 - 170 System can recognize the pattern but it is unstable, since most of background becomes white.
171 - 252 System cleary captures and recognizes LED patterns.
253 System can recognize the pattern but it is unstable since pattern is too small; stronger intensity is required.
254 - 255 System cannot caputure LED patterns at all; whole screen is black.


An e-puck was fitted with a LED pattern board and then tested with the machine vision localization system. With the changes implemented, the machine vision localization system did not show any problems, showing the ability to capture and locate the e-puck located in anywhere in the field of vision of the cameras. In addition, the vision system was able to capture and locate the e-puck as it moved. There was no loss of positional accuracy as compared to previous implementations of identification systems. The recognition of the e-puck by the machine vision localization system displayed the stability of the LED boards with the vision system, further supporting their implementation for further experiments.

Additional Considerations

While there do not need to be any additional changes to the set up of the machine vision localization system, there may be additional considerations for further development. One such consideration is the 'background', or floor material, of the setup. With the modified machine vision code, light intensity is what is picked up and filtered by the system, thus rendering the LEDs from the e-pucks to be the only tracked objects. However, with more advanced set ups, such as one featuring light that is projected onto the background, this may present a problem with the machine vision system picking up reflected light. More testing has to be done with modifying the machine vision system threshold to see if there is an ideal threshold to accommodate this setup. Another option may be to use a non-reflective or matte surface for the background.

Another consideration involves the hardware of the setup, or the themselves. The cameras are equipped with the Logitech software which automatically adjusts the exposure and light contrast settings to correct for poor lighting and setup conditions. However, this leads to issues as with increased exposure (due to light blocking set up) and bright LEDs results in blurry or blobby images received. The machine vision localization system cannot read these images, and as a result cannot track the e-pucks. One potential solution may be to adjust the threshold of the vision system. Other solutions may be to use less intense or bright LEDs, or increase the background lighting of the setup, for instance with upward casting lights.

Conclusion

The new XBee Interface Extension Board design was tested, and we found out that it does not have any problem. In addition, the black dot pattern of the e-pucks are upgraded to LED patterns. The advantage of this improvement is that the machine vision system can recoginize each e-puck no matter where the e-pucks are located. The color of the background also does not affect the vision system. However, we had to move the color sensor to the LED pattern board since the LED pattern board will block the sensor if the sensor is located in the XBee Interface Extension Board. Thus, we now consider the light interference between the LEDs and the color sensor. In the light interference test, we found out that the color sensor is affected by the light from LED. However, since we used much brighter LEDs in our light interference test than the LEDs used for the LED pattern board, we have to do more experiment on this in order to have more accurate interference data.