tirsdag den 11. februar 2014

Date: 07/02 -2014
Duration of activity: 4hrs
Group members participating: 2

Goal: To complete exercises one through fives as described in lesson one:http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson1.dir/Lesson.html

Plan: To follow the steps methodical

Results:
Exercise 1 - Testing light values of different colors.
In the following two exercises we used lego bricks to establish a color baseline.  

Lightsensor values of different colors:
Color
White
Yellow
Red
Green
Blue
Black
Value
48
43
37
27
30
25

Looking at the chart it is clear that  black and white is at the their respective ends of the spectrum. When creating a threshold one should decide which colors should be determined as light. For Instance making threshold at 45 would make the system only distinguish between white and all other colors. If the system is planned to operate on a White/black field it might be wise to lower the threshold to value between black and white 35 for instance.

Exercise 2 - Testing light values of different colors without led on.
Lightsensor values with led turned off:
Color
White
Yellow
Red
Green
Blue
Black
Value
30
29
25
23
20
15

With the led turned off it is evident that it is much more difficult to distinguish between the different colors.

Exercise 3 - Testing different values of sample interval
In testing different sample intervals it is clear that intervals where the frequency is higher 250ms, makes the system unable to follow a line. The reason being that the system simply updates to slowly and there looses track of the line it follows. Values lower than
10ms does not seem to improve system accuracy.  



Exercise 4 - Data Logger

Data Logged with 5ms sample interval:
Approximate frequency is 3hrz.

Data Logged with 10ms sample interval:
Approximate frequency is 3hrz.

Data Logged with 50ms sample interval:
Approximate frequency is 2hrz
Data Logged with 100ms sample interval:
Approximate frequency is 1hrz
As shown by the graph above the sample rate is inversely related to numbers of oscillations. Then longer time between the samples the fewer oscillations. The exception being that when sampling rapidly ei. below 30ms. the system’s actuators react too slowly and as a result higher sampling rate will not have an effect.    



Exercise 5 - Memory
To test what happens when strings are used directly in method calls instead of variables, we used the data logger to log free memory with a system using variables and one that didn’t.
We then calculated the average usage over time and compared the 2 readings.
the readings are:
With variable: 47780.498
Without variable: 47644.653
Difference: 135.845
This shows that in this case, not using variables makes the program use approximately 0.2% less memory.
Conclusion:
The exercises was conducted successfully and no major problems arose.
References:
https://services.brics.dk/java/courseadmin/LEGO/pages/Week+2+-+PID+controllers+and+Embedded+Java+API

Ingen kommentarer:

Send en kommentar