|
|
sad |
|
|
\ No newline at end of file |
|
|
# Group 22
|
|
|
|
|
|
## Lab Notebook 1 - The birth of Megatron
|
|
|
|
|
|
**Date:** 12/02 2015
|
|
|
|
|
|
**Group members participating:** Nikolaj, Jesper, Claus, Christian, Rasmus
|
|
|
|
|
|
**Activity duration:** 3 hours
|
|
|
|
|
|
## Goal
|
|
|
Goals of today are as described in the lesson 1 exercises notes:
|
|
|
Install the leJOS Java system
|
|
|
Build the 9797 LEGO car with light sensor
|
|
|
Exercise 1
|
|
|
Exercise 2
|
|
|
Exercise 3
|
|
|
Exercise 4
|
|
|
Exercise 5
|
|
|
Exercise 6
|
|
|
Because of the thorough guide described in the lesson 1 exercises notes, no further planning was necessary.
|
|
|
|
|
|
|
|
|
## Plan
|
|
|
We followed the goals as described earlier, and started off with installing the leJOS Java System on all our machines, with three running Windows 7, one running Windows 8 and one running iOS Yosemite and then building the 9797 LEGO car with attached light sensor.
|
|
|
Then we did the exercises as explained in Lab Lesson 1.
|
|
|
|
|
|
## Results
|
|
|
|
|
|
### Exercise 1 & 2
|
|
|
#### Experiment
|
|
|
We placed the light sensor above different LEGO bricks with different colors (see Figur 1)and made a table of light values corresponding to the different colors. We also did this to see if the distance from the sensor to the bricks had any impact on the sensordata. All the data was put into a table (see Table 1). Data from exercise 2 with no ligt emitted can also be seen in table 1.
|
|
|
![Figur 1](http://gitlab.au.dk/uploads/group-22/lego/6d446eb735/Ex._2_farver.jpg)
|
|
|
Figur 1
|
|
|
|
|
|
Data from exercise 1
|
|
|
|
|
|
![Data 1](http://gitlab.au.dk/uploads/group-22/lego/df5359bd3b/Data_1.png)
|
|
|
|
|
|
Table 1
|
|
|
|
|
|
### Exercise 3
|
|
|
|
|
|
When increasing the delay on the NXT it became harder for the sensor to read the values at the correct time. This resulted in the robot moving out from the line before the next reading was made. This is shown in video 1.
|
|
|
|
|
|
[![image alt text](http://gitlab.au.dk/uploads/group-22/lego/e1cdceda7e/download.jpg)](https://drive.google.com/file/d/0B4Vn_sxU595ganVtNFNSbFFqdzg/view?usp=sharing)
|
|
|
|
|
|
Video 1
|
|
|
Link to vide: https://drive.google.com/file/d/0B4Vn_sxU595ganVtNFNSbFFqdzg/view?usp=sharing
|
|
|
|
|
|
|
|
|
### Exercise 4
|
|
|
|
|
|
We uploaded the SLineFollower programs with the different time intervals and tested it on the table. Results are shown below.
|
|
|
|
|
|
|
|
|
20ms
|
|
|
|
|
|
![Graph 20](http://gitlab.au.dk/uploads/group-22/lego/a748d26814/Graph_20.jpg)
|
|
|
|
|
|
|
|
|
100ms
|
|
|
|
|
|
![Graph 100](http://gitlab.au.dk/uploads/group-22/lego/aa5780e5ee/Graph_100.jpg)
|
|
|
|
|
|
|
|
|
500ms
|
|
|
|
|
|
![Graph 500](http://gitlab.au.dk/uploads/group-22/lego/1da153d595/Graph_500.jpg)
|
|
|
|
|
|
|
|
|
1000ms
|
|
|
|
|
|
![Graph 1000](http://gitlab.au.dk/uploads/group-22/lego/dfdce3131c/Graph_1000.jpg)
|
|
|
|
|
|
|
|
|
### Exercise 5
|
|
|
|
|
|
We ran a test similar to exercise 1 and 2. Only this time we used the SensorPortTest program. Our data can be seen in Table 2.
|
|
|
|
|
|
![Table 2](http://gitlab.au.dk/uploads/group-22/lego/cfa3fabc08/Table_2.jpg)
|
|
|
|
|
|
Table 2
|
|
|
|
|
|
|
|
|
The raw data has a span of 0 to 1024. This means that raw data is ideal if the robot is looking for something very specific. Instead if you are looking for a broader span in colors, it is better to use the percentage as it takes into account small variations in color.
|
|
|
|
|
|
|
|
|
### Exercise 6
|
|
|
|
|
|
We used the SLineFollower program but changed the use of strings in the code.
|
|
|
|
|
|
```
|
|
|
LCD.drawString("Turn right", 0, 1);
|
|
|
```
|
|
|
|
|
|
This resulted in the memory usage as seen in table 3.
|
|
|
|
|
|
![Table 3](http://gitlab.au.dk/uploads/group-22/lego/63e7105f45/Table_3.jpg)
|
|
|
|
|
|
Table 3
|
|
|
|
|
|
|
|
|
We can see there is a difference between using a string directly and a predetermined variable when writing to the LCD screen. The memory usage of the direct input was somewhat higher than the predetermined variable, as depicted on the graph, where it is observable that the time between the graphs’ minimums and maximums are different. The sudden drop of memory use can indicate there is a garbage collector clearing the memory.
|
|
|
|
|
|
## Conclusion
|
|
|
|
|
|
#### After having completed the exercices we can conclude the following:
|
|
|
|
|
|
#### Light Values
|
|
|
Sensed light values will change dependant of the colors of the material. Also, how far away you move the sensor from the material will also impact how well it is sensed. Furthermore, turned the red LED on/off will have an impact according to the ambient lighting in the room.
|
|
|
|
|
|
#### Different Sensing Intervals
|
|
|
We have found that changing the sensing intervals will change the behavior of the robot. If the sensing interval is large (e.g. 1000ms), the robot will behave more inaccurate.
|
|
|
|
|
|
#### Memory Use
|
|
|
We have shown that the memory usage of a direct input is higher than a predetermined variable. This means that we should avoid using the strings if possible and instead point to a variable in the memory.
|
|
|
|
|
|
## References
|
|
|
|
|
|
All code used is from the Lesson plan: http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson1.dir/Lesson1programs.zip |
|
|
\ No newline at end of file |