## Lab Notebook 2 - Installing PID controller on Megatron
**Date:** 24/2/2015
**Group members participating:**
Christian Bonde Andersen
Nikolaj Cilleborg Haulrik
Rasmus Meldgaard Petersen
Claus Hedeager Rasmussen
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.
## 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.
## Exercise 1
**Task:**
To compare distances measured by the ultrasonic sensor facing a solid surface.
**Result:**
We attached the sensor according to Base Set 9797 building instruction page 28 to page 30. We then ran the program with a failing result. After looking at the code it turned out the sensor is connected to port S1 and NOT S4 as of the 9797 guide. After changing the port we were ready to do the tests with the program SonicSensorTest.
We tested the sensor with the setup shown in the picture.
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.