@@ -229,16 +229,19 @@ To test the drift, we began by starting ***GyroTest.java*** and letting it run f
Afterwards, we modified ***GyroTest*** to let both motors run while the program was running, in order to see the effect of the resulting voltage drop. We also added a data logger to the program to gather information for later observations. We used this to calculate the average reading and the average drift, presented in table 2 below. Two cases were investigated: In the first case, the robot was un-modified. In the second case, the robot's wheels were taken off. We took off the wheels in the hopes that this would lessen the vibrations of the robot resulting in a more stable position.
| | Average reading | Average drift | Maximal drift |
| Wheels on | 596.698744 | ***3.3TODO*** | ***TODO*** |
| No wheels | 596.5979995 | ***3.4TODO*** | ***TODO*** |
| Wheels on | 596.698744 | 612 | 577 |
| No wheels | 596.5979995 | 612 | 577 |
*Table 2: Data on readings from the gyro sensor*
There seems to be no significant difference between the robot when whearing weels and when not - there is only a difference of 0.1 between the average readings in the two cases. We concluded that the average drift was negligible in both cases.
There seems to be no significant difference between the robot when whearing weels and when not - there is only a difference of 0.1 between the average readings in the two cases. We concluded that the difference is negligible.
It is interesting that the average reading this time (in both cases) was closer to 597 than to 598, as opposed to what we concluded from the preceding run. However, we were not necessarily wrong in our observation as 598 could simply result from that specific testing situation being an extreme with respect to the average.
TODO: Ida, skriv om lowest og highest + indsæt plot
Based on code presented in [the lesson plan](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/Lesson.html), we tried implementing integration to calculate the angle of the gyro based on the sample interval and the motion readings of the gyro. The result was, however, extremely inaccurate, and would for some reason slowly slide in one direction, even when the gyro was motionless. We assumed this to be a result of the constant small speed readings made by the gyro even when still, but these should work in both directions as the offset remains the same despite fluctuations to either side, so the drifting angle is a mystery to us.
We would have attempted to amend the inaccurate angle calculation and then use this as a means of creating a balancing robot using the gyro sensor, but at this point we had simply spent too much time on the exercises and were forced to cut our gyro implementation short and leave it at this. Had we had the time to continue, our ideas regarding the implementation of a balancing robot included combining the different sensors to have a form of "second opinion" to take into account when responding to the gyro sensor's readings.