@@ -218,8 +218,10 @@ Ved måling ved start-hvile-position: skriv at vi bruger teoretisk setpoint (i.e
...
@@ -218,8 +218,10 @@ Ved måling ved start-hvile-position: skriv at vi bruger teoretisk setpoint (i.e
### Self balancing robot with gyro sensor
### Self balancing robot with gyro sensor
---
---
The offset was mesuared by placing the robot by a wall, and observing the value over a period of time. The reading was 597-598 and we felt that it was most 598.
The offset was mesuared by placing the robot by a wall, and observing the value over a period of time. The reading was 597-598 and we felt that it was most 598.
The offset for angular velosity is therefor -2.
The offset for angular velosity is therefor -2. (Nicolai: Is this right?)
To test the drift, we started by starting the GyroTest.java and let it run for 10 minutes to check if the sensor developed heat which would then maybe resulting in the read value to drift.
To test the drift, we started by starting the GyroTest.java and let it run for 10 minutes to check if the sensor developed heat which would then maybe resulting in the read value to drift.
- It didn't. At the end it still switftet between 597 and 598.
- It didn't. At the end it still switftet between 597 and 598.
...
@@ -230,6 +232,10 @@ Afterwards we modified the Gyrotest to let both motors run while the program ran
...
@@ -230,6 +232,10 @@ Afterwards we modified the Gyrotest to let both motors run while the program ran
Average reading with wheels on: 596.698744 (No noticeable average drift)
Average reading with wheels on: 596.698744 (No noticeable average drift)
Average reading without wheels: 596.5979995 (No noticeable average drift)
Average reading without wheels: 596.5979995 (No noticeable average drift)
Based on the code in [Ref or lesson plan], we tried implementing integration to calculate the angle of the gyro based on the sample interval and the gyro motion readings. 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 was 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.
No we would have attempted to fix the inaccurate angle calculation and then use this as a means of creating a balancing robot using the gyro, but at this point we simply spent too much time on these exercises and have to cut our gyro implementation short and leave it at this.
NOTE: To make the robot balance it would be a good thing to combine the different sensors
NOTE: To make the robot balance it would be a good thing to combine the different sensors