|
|
# Group 22
|
|
|
|
|
|
## Lab Notebook 2 - Installing PID controller on Megatron
|
|
|
## Lab Notebook 2 - Installing PID controller on our NXT
|
|
|
**Date:** 24/2/2015
|
|
|
|
|
|
**Group members participating:**
|
... | ... | @@ -13,7 +13,7 @@ Jesper Kurtzmann Svith |
|
|
**Activity duration:** 3+8+4 = 15 hours.
|
|
|
|
|
|
## Overall goal
|
|
|
To successfully get Megatron to follow a wall without stopping or turning away.
|
|
|
To successfully get the NXTt to follow a wall without stopping or turning away.
|
|
|
|
|
|
## Overall plan
|
|
|
In this week we will do experiments focusing on the NXT Ultrasonic sensor to investigate how accurate it is at certain ranges. Then we will incorporate it in a program to make the robot follow an ordinary straight wall.
|
... | ... | @@ -31,4 +31,29 @@ We tested the sensor with the setup shown in the picture. |
|
|
![Lab2-Megatron](http://gitlab.au.dk/uploads/group-22/lego/083adaa357/Lab2-Megatron.png)
|
|
|
Fig. 1 - Measuring distance to wall
|
|
|
|
|
|
We measured the distance from the sensor to the wall and read the value displayed on the NXT. After each reading we increased the distance by 5 cm and noted the reading. The result of the test is shown in the table below |
|
|
\ No newline at end of file |
|
|
We measured the distance from the sensor to the wall and read the value displayed on the NXT. After each reading we increased the distance by 5 cm and noted the reading. The result of the test is shown in the table below
|
|
|
|
|
|
## Exercise 2
|
|
|
|
|
|
**Task:**
|
|
|
The test program was originally compiled with leJOS NXJ version Alfa_03. Because of limitations the program was made with a 300 ms sample interval between readings of the distance. We want to test if changes on the sample interval will cause an effect on the readings by changing the value from 300 ms to 1ms, 5ms, 50ms, 100ms and 200ms.
|
|
|
|
|
|
**Result:**
|
|
|
We changed the sampling rate in the program SonicSensorTest.java. We started with a sample rate of 1ms and ran up to 200ms. We used the same setup as in exercise 1. The results are shown in the tables below and will be explained by the end of this section.
|
|
|
|
|
|
1ms:
|
|
|
![Skærmbillede 2015-02-26 kl. 15.30.12](http://gitlab.au.dk/uploads/group-22/lego/09349122cf/Sk%C3%A6rmbillede_2015-02-26_kl._15.30.12.png)
|
|
|
The table shows that the readings get more accurate the further away from the object the sensor gets.
|
|
|
|
|
|
5ms:
|
|
|
![Skærmbillede 2015-02-26 kl. 15.34.03](http://gitlab.au.dk/uploads/group-22/lego/7179374ee4/Sk%C3%A6rmbillede_2015-02-26_kl._15.34.03.png)
|
|
|
|
|
|
100ms:
|
|
|
![Skærmbillede 2015-02-26 kl. 15.35.08](http://gitlab.au.dk/uploads/group-22/lego/4ed9ae8b12/Sk%C3%A6rmbillede_2015-02-26_kl._15.35.08.png)
|
|
|
|
|
|
200ms:
|
|
|
![Skærmbillede 2015-02-26 kl. 15.35.30](http://gitlab.au.dk/uploads/group-22/lego/00a5233500/Sk%C3%A6rmbillede_2015-02-26_kl._15.35.30.png)
|
|
|
|
|
|
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 |