... | ... | @@ -57,4 +57,22 @@ The table shows that the readings get more accurate the further away from the ob |
|
|
|
|
|
As the tables show, there is not a big difference between the readings with the different sample rates. There seemed to be more inaccuracy in the shorter sample rates than with the longer. The only difference is an increase of 1 or 2 in the readings, but this could come down to how accurate we measured the distance with the ruler.
|
|
|
|
|
|
The results indicate that there is no longer a need for a sample rate of 300ms and that explains why the limitation has been fixed since LeJOS NXJ version alfa_03. |
|
|
\ No newline at end of file |
|
|
The results indicate that there is no longer a need for a sample rate of 300ms and that explains why the limitation has been fixed since LeJOS NXJ version alfa_03.
|
|
|
|
|
|
##Exercise 3
|
|
|
|
|
|
**Task:**
|
|
|
To find out what might affect Megatron’ capacity to measure distance with the use of the Ultrasonic Sensor.
|
|
|
|
|
|
**Result:**
|
|
|
We used the sensor against a wall and measured the max distance in which it was possible to get a reading. The result was not conclusive as we tested the sensor against different surfaces, however the max reading was conducted at about 172 cm.
|
|
|
|
|
|
The limitations of the sensor is influenced by the speed of sound as there is a physical limit to the time it takes to conduct a reading. If the distance is 255 cm it takes approximately 15 ms to conduct a reading.
|
|
|
|
|
|
![Skærmbillede 2015-02-26 kl. 15.43.55](http://gitlab.au.dk/uploads/group-22/lego/fd1735d1ed/Sk%C3%A6rmbillede_2015-02-26_kl._15.43.55.png)
|
|
|
|
|
|
The function takes the overall travel distance and divide it by the the speed of sound converted to cm/ms.
|
|
|
|
|
|
The calculation reveals a physical limitation to how frequent readings can be made. The sampling rate between each reading cannot be lower than this number. Eg. If we want to measure a distance of 255 cm we can’t conduct more than one reading pr 14.98 ms.
|
|
|
|
|
|
In exercise 2 we measured with a sampling rate of only 1ms. According to our calculation we should not have been able to get a reading. But after the lecture in week 4, we were informed that a buffer of 30ms is already integrated in the getDistance() method. This means our delay of 1ms would add to the 30ms and thus we were able to get a reading. |
|
|
\ No newline at end of file |