... | ... | @@ -29,14 +29,23 @@ The first measurement of light values, was done by placing the light sensor over |
|
|
|
|
|
The measurements above seemed off, as some colors reflected less than the black color, and the difference between having the LED on and having the LED off, seemed random. We therefore tested with a different light sensor, which yielded the results below.
|
|
|
|
|
|
| First measurement | Sort | Hvid | Rød | Grøn | Blå | Grå |
|
|
|
| Second measurement | Sort | Hvid | Rød | Grøn | Blå | Grå |
|
|
|
|------------------- |------ |------ |----- |------ |----- |----- |
|
|
|
| LED tændt | 24 | 42 | 40 | 28 | 28 | 34 |
|
|
|
| LED slukket | 18 | 31 | 27 | 22 | 23 | 25 |
|
|
|
|
|
|
These results appear to be more plausible.
|
|
|
|
|
|
To find the value for the blackWhiteThreshold-variable, we added the light values (with the LED turned on) and divided by two, to find the average. This yielded the result: 33
|
|
|
After these initial measurements we had a chat with Ole, which resulted in us questioning our choice of bigger tires, which we from testing found was faster, but meant that the light sensor was farther away from the floor/track then when using the standard tires from the building instructions. The following measurements was with the standard tires from the building instructions.
|
|
|
|
|
|
| Third measurement | Sort | Hvid | Rød | Grøn | Blå | Grå |
|
|
|
|------------------- |------ |------ |----- |------ |----- |----- |
|
|
|
| LED tændt | 34 | 61 | 60 | 40 | 38 | 49 |
|
|
|
| LED slukket | 16 | 23 | 20 | 16 | 16 | 18 |
|
|
|
|
|
|
From these measurements we logged a much bigger gap between readings of white and black, making the distinction much easier for the light sensor, when following the line.
|
|
|
|
|
|
To find the value for the blackWhiteThreshold-variable, we added the light values (with the LED turned on) and divided by two, to find the average. This yielded the result: 47
|
|
|
|
|
|
With the LED turned off the observed values were lower, as would be expected, as there is less light to be reflected.
|
|
|
|
... | ... | @@ -44,11 +53,13 @@ With the LED turned off the observed values were lower, as would be expected, as |
|
|
|
|
|
*In this exercise we increase the sample interval, observe the changes, and try to explain these changes.*
|
|
|
|
|
|
As we increased the sample interval, the LEGO-car seemed to behave more and more erratically.
|
|
|
the intervals between light value samples became longer.
|
|
|
As we increased the sample interval, the LEGO-car seemed to behave more and more erratically. The car was able to follow the line at sample values 10 and 100 but with a sample interval of 500, the car was no longer able to follow the line, but, after some initial random driving, started to follow the edge of the paper. With higher intervals the car just kept spinning.
|
|
|
|
|
|
The sample interval determines the frequency, with which light value samples are collected. As the intervals between light value samples became longer, the car had a longer time to do a turning action, resulting in the car not being able to follow certain lines.
|
|
|
|
|
|
### Exercise 4
|
|
|
|
|
|
*In this exercise .*
|
|
|
### Exercise 5
|
|
|
|
|
|
### Exercise 6
|
... | ... | |