... | ... | @@ -157,13 +157,17 @@ In the datalogger class we had to replace FileOutputStream with BufferedOutputSt |
|
|
>![Gyro sensor udsving (1)](http://gitlab.au.dk/uploads/group-22/lego/37fe3da9fe/Gyro_sensor_udsving__1_.jpg)
|
|
|
> ##### Fig. 7: Swing path of gyro sensor.
|
|
|
>
|
|
|
> We ran the GyroTest class to examine the readings of the gyro sensor. The default sensor reading (raw value) when stationary was about 611-612 on a scale from 0 to 1024. By shaking the robot hard, we could get the minimum reading down to 184, and the maximum reading up to 1003. It was hard to read the on screen values of the gyro sensor when the robot was going, so we tried implemented the data logger to get some more accurate readings. NOPE?
|
|
|
> We ran the GyroTest class to examine the readings of the gyro sensor. The default sensor reading (raw value) when stationary was about 611-612 on a scale from 0 to 1024. By shaking the robot hard, we could get the minimum reading down to 184, and the maximum reading up to 1003. It was hard to read the on screen values of the gyro sensor when the robot was moving. We wanted to implement the datalogger, to get some more accurate readings, but had issues with the memory overflowing, so we did not capture enough data to make a graph from.
|
|
|
>
|
|
|
>We used the remnants of our SejwayColor and SejwayLight classes to make a SejwayGyro class using gyro.getAngularVelocity(); to get the measurements we needed for balancing. Unfortunately we learned from another group, after a long time of trial and error, that the robot could not balance using the gyro sensor simply based on the simple calculation of the old light sensor class.
|
|
|
>
|
|
|
> #### Results
|
|
|
>
|
|
|
> Forventet resultat:
|
|
|
Gyroers offset drifter når den trækker strøm fra samme batteri som de to elmotorer alt efter om motorerne kører på samme tid.
|
|
|
Desuden kan lav spænding på batteriet også påvirke gyroens offset.
|
|
|
> We found out to start with that we had mounted the gyro sensor wrong, so we had to place it with the “side” facing forwards to get the required readings.
|
|
|
> ##### Expected results:
|
|
|
> We expected the gyro sensor offset to move when the gyro sensor drew power from the battery at the same time as the two engines.
|
|
|
> Low power on the battery could also potentially affect the measurements of the gyro.
|
|
|
> It would likely be a good idea to combine the readings from the gyro sensor with the readings of a light sensor to prevent the offset of the gyro from drifting. We did not try this.
|
|
|
>
|
|
|
>---
|
|
|
>
|
... | ... | @@ -173,6 +177,7 @@ Desuden kan lav spænding på batteriet også påvirke gyroens offset. |
|
|
The robot’s struggle to balance can be due to it’s centre of gravity. As shown in (fig. ?) the robot used for this exercise (placed on the right) has a tall centre of gravity indicated by the horizontal line. We found the centre of gravity by balancing the robots to find their pivot points. Because of this inaccurate method, the centre of gravity might be slightly different if we made the appropriate mathematical calculations, but as the figure only serves as an illustration we found our method adequate.
|
|
|
>
|
|
|
> ![centre-of-gravity-robots (1)](http://gitlab.au.dk/uploads/group-22/lego/3d98c9c591/centre-of-gravity-robots__1_.jpg)
|
|
|
> ##### Fig. 8 - Lines indicate the centre of gravity
|
|
|
>
|
|
|
> One the most important factor with balancing the robots in one axis is the inverted pendulum problem.This means that the robot has its center of mass higher than its pivot point. On our robot the pivot point is the center of the wheels and while the robot is standing, the weight is distributed on top of that pivot point. Because of this, the robot is constantly unstable and the wheels have to correct for the instability. Theoretically the further away the center of mass is from the pivot point, the more stable it should be. An example of this theory is easily observable by trying to balance a broom on a finger; it is much easier to balance it when the head is on top, as the weight is higher on the other side(right side) of the pivot point as seen in fig. kost.
|
|
|
>
|
... | ... | @@ -184,6 +189,11 @@ The robot’s struggle to balance can be due to it’s centre of gravity. As sho |
|
|
>
|
|
|
> ## Conclusion
|
|
|
>
|
|
|
> During this lab session we learned how to get the NXT robot to balance. We found out that when using light and color sensors, the surrounding environment was a very important factor.
|
|
|
>Weather conditions heavily affected even indoor lighting, so experiments had to be carried out in a controlled environment.
|
|
|
>While doing experiments, we encountered issues with the datalogger, due to the very memory of the NXT. We had to work around this to avoid it having too big of an impact on our experiments.
|
|
|
>We also learned that the gyro sensor was quite advanced to work with, and that the calculations we used with the simpler sensors could not be used to balance the robot with the gyro.
|
|
|
|
|
|
>
|
|
|
> ## References
|
|
|
>
|
... | ... | |