|
|
# Group 3
|
|
|
|
|
|
## Lab Notebook 1
|
|
|
|
|
|
**Date:** 11/02 2016
|
|
|
|
|
|
**Group members participating:**
|
|
|
|
|
|
* Sujeeth Nalliah
|
|
|
* Christoffer Okkels
|
|
|
* Jens Poulsen
|
|
|
* Kasper West Hansen
|
|
|
|
|
|
**Activity duration:** 8 hours
|
|
|
|
|
|
## Goal
|
|
|
The goal of this lab session was to build the LEGO 9797 car, work with the java classes "lineFollower.java" and "dataLogger.java" and to complete the exercises 1-6.
|
|
|
|
|
|
## Plan
|
|
|
We have already completed the LEGO 9797 car from the last lab session. Today we will complete the exercises.
|
|
|
|
|
|
## Results
|
|
|
|
|
|
### Exercise 1
|
|
|
Placing the light sensor above different colours we were able to create the following table.
|
|
|
|
|
|
| Color | Light Percent Values |
|
|
|
| -------- | -------- |
|
|
|
| White | 53% |
|
|
|
| Blue | 33% |
|
|
|
| Green | 38% |
|
|
|
| Red | 62% |
|
|
|
| Yellow | 50% |
|
|
|
| Black | 28% |
|
|
|
|
|
|
The program sets the "blackWhiteThreshold" to 45. We can find our threshold by manipulating the LPV's of white and black as follows: (53-28/2)+28 = 40.5
|
|
|
|
|
|
The value 40.5 is pretty close to the black-white threshold in the program. The difference between our threshold and 45 can come from different readings from the sensor when finding black and white color.
|
|
|
|
|
|
### Exercise 2
|
|
|
|
|
|
We measured the ambient light level with the LED turned off to produce the following table:
|
|
|
|
|
|
| Color | Light Percent Values |
|
|
|
| -------- | -------- |
|
|
|
| White | 25% |
|
|
|
| Blue | 22% |
|
|
|
| Green | 22% |
|
|
|
| Red | 22% |
|
|
|
| Yellow | 27% |
|
|
|
| Black | 18% |
|
|
|
|
|
|
Curiously, the yellow color has a higher LPV than white. This could possibly be explained by the spectrum emitted by the fluorescent lights.
|
|
|
|
|
|
### Exercise 3
|
|
|
|
|
|
#### 10ms
|
|
|
The car follows the black line, oscillating back and forth.
|
|
|
|
|
|
#### 100ms
|
|
|
The car follows the black line except when the car drives in a straight line, then it doesn't oscillate as much.
|
|
|
|
|
|
#### 500ms
|
|
|
The car has problems detecting the black line. Sometimes, depending on luck, it follows the black line.
|
|
|
|
|
|
#### 1000ms
|
|
|
The car does not detect the black line at all.
|
|
|
|
|
|
By comparing the intervals we can conclude that the car will easily go off its course due to longer intervals.
|
|
|
|
|
|
### Exercise 4
|
|
|
|
|
|
#### A graph for 10ms
|
|
|
![lab1_4_1](/uploads/01f01b94b1367418cec5f4c011e98e1b/lab1_4_1.png)
|
|
|
|
|
|
The car is driving along a black line.
|
|
|
|
|
|
#### A graph for 100ms
|
|
|
![lab1_4_2](/uploads/12ad95a2646466085a695eb1154ab12c/lab1_4_2.png)
|
|
|
|
|
|
The car is driving along a black line. Then it makes 1 turn around itself as you can see in time interval between 3000 and 5300.
|
|
|
|
|
|
#### A graph for 500ms
|
|
|
![lab1_4_3](/uploads/1707c0cb974c09dd289e5e0ccf692a01/lab1_4_3.png)
|
|
|
|
|
|
The car goes in circle around itself. But because of the sampling interval set to 500ms it only sees the black lines ones around time interval 6700.
|
|
|
|
|
|
### Exercise 5
|
|
|
|
|
|
We modified the "SensorPortTest.java" class to also print out the light percent. Then we made some experiments measuring reflected light from different textures and colours. What we found was, that in the raw light values the intensity increased towards 0. Whereas in the light percent formula, the intensity increases towards 100.
|
|
|
|
|
|
#### Light Percent
|
|
|
The light percent is a normalised value between 0 and 100. If all light sensors used in the project have as a precondition, that they have to be normalised, then it is easy to swap out light sensors.
|
|
|
|
|
|
#### Raw Value
|
|
|
This value is not normalised. A raw number between 0 and 1023 is more precise than a number converted to a number between 0 and 100. One could also imagine a scenario where you are only interested in a specific range - then this would probably be the way to go.
|
|
|
|
|
|
### Exercise 6
|
|
|
![lab1_6](https://dl.dropboxusercontent.com/u/27201185/img/mis.png)
|
|
|
|
|
|
If you use the direct string method it looks like you will use the max amount of memory faster, but it will also be freed up faster.
|
|
|
|
|
|
With the indirect string method, the string is stored in a variable. This will cause you to hit the max more slowly, but will also prevent the memory from being freed as fast.
|
|
|
|
|
|
## Conclusion
|
|
|
We have become comfortable with using the light sensor and adjusting parameters in the code. In addition, we have learned how the light sensor measures the raw light values and the percentage values, and how the ambient lighting influences the measured values.
|
|
|
|
|
|
## References
|
|
|
http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson1.dir/Lesson.html |
|
|
\ No newline at end of file |
|
|
[press here](https://gitlab.au.dk/legolab3-emmet/LAB1/wikis/pages) |
|
|
\ No newline at end of file |