... | ... | @@ -132,18 +132,18 @@ In the datalogger class we had to replace FileOutputStream with BufferedOutputSt |
|
|
>
|
|
|
> #### Results
|
|
|
>
|
|
|
>We tested the robot with the color sensor in a similar way as in exercise 1. We used the GUI to change the values while the program was running to get a more precise balancing robot. To eliminate any outside interference we did the test in a closed dark room with a white shiny surface. The program from exercise 1 was modified to use a color sensor and read the normalizedLightValue for the initial offset and the normVal. The program can be found at sejwayColor.java [?].
|
|
|
>We tested the robot with the color sensor in a similar way as in exercise 1. We used the GUI to change the values while the program was running to get a more precise balancing robot. To eliminate any outside interference we did the test in a closed dark room with a white shiny surface. The program from exercise 1 was modified to use a color sensor and read the normalizedLightValue for the initial offset and the normVal. The program can be found at sejwayColor.java [10].
|
|
|
>
|
|
|
>
|
|
|
>
|
|
|
>
|
|
|
>---
|
|
|
>
|
|
|
>## Exercise 4: Line Follower that stops in a Goal Zone
|
|
|
>## Exercise 4: Self-balancing robots with gyro sensor
|
|
|
>
|
|
|
>
|
|
|
> #### Task
|
|
|
>Both the robots in [2] and [3] use the light sensor to measure the tilt of the robot by measuring the distance to the surface. In [5] and [6] other more reliable types of sensors are used to measure the tilt of the robot during balancing. One such sensor is the HiTechnic gyro sensor, investigate the readings from the gyro sensor and how they relate to the motion of the gyro sensor. As a simple tool for such an investigation use the program GyroTest.java. Estimate the offset of the gyro sensor, [9], [10], when the sensor is not moving and experiment with the gyro sensor drifts e.g. when motors are activated.
|
|
|
>Both the robots in [1] and [2] use the light sensor to measure the tilt of the robot by measuring the distance to the surface. In [4] and [5] other more reliable types of sensors are used to measure the tilt of the robot during balancing. One such sensor is the HiTechnic gyro sensor, investigate the readings from the gyro sensor and how they relate to the motion of the gyro sensor. As a simple tool for such an investigation use the program GyroTest.java. Estimate the offset of the gyro sensor, [8], [9], when the sensor is not moving and experiment with the gyro sensor drifts e.g. when motors are activated.
|
|
|
>
|
|
|
> #### Plan
|
|
|
> We plan to do some experiments with placement of the gyro, as we suspect that precision of the gyro sensor is dependent on where it is placed on the robot. At first, we will try using the gyro as the only sensor mounted on the smaller robot with the higher centre of gravity.
|
... | ... | @@ -155,7 +155,7 @@ In the datalogger class we had to replace FileOutputStream with BufferedOutputSt |
|
|
> We figured that If the distance from the sensor to the center of gravity of the robot is large, the gyro sensor will have a wider path to swing, making the values larger, as can be seen in (fig. 7).
|
|
|
>
|
|
|
>![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.
|
|
|
> ##### 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 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.
|
|
|
>
|
... | ... | @@ -182,11 +182,12 @@ The robot’s struggle to balance can be due to it’s centre of gravity. As sho |
|
|
> 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.
|
|
|
>
|
|
|
> ![de7438cb-bbeb-43c1-9240-79e1e64a6ad0](http://gitlab.au.dk/uploads/group-22/lego/86adb8ce21/de7438cb-bbeb-43c1-9240-79e1e64a6ad0.gif)
|
|
|
> ##### Fig. 9 - Center of mass at the finger
|
|
|
>
|
|
|
> In our experiments with the two different robots we have found that the Segway segway was much more stable while performing both experiment 1 & 3, than the legway robot. Our initial thoughts were that a robot with a vertically low center of mass would be more stable, as the wheels only would need to correct a small bit. But this was disproven both by the experiments and the physics involved in the inverted pendulum. The problem with having a center of mass close to the pivot point is that when the robot tilts just a tiny bit, it’s easy for wheels to over correct the error and make it even worse. This is because the short distance between the pivot point and the center of mass is easy to oversteer. Additionally the detection the tilt will be harder as the robot would fall faster. This is easier when the distance between the two points are longer.
|
|
|
>
|
|
|
>---
|
|
|
>
|
|
|
>
|
|
|
> ## 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.
|
... | ... | @@ -201,7 +202,8 @@ The robot’s struggle to balance can be due to it’s centre of gravity. As sho |
|
|
> * Exercise 1: www.youtube.com/watch?v=k6nARWC63OY
|
|
|
>
|
|
|
> Code:
|
|
|
> * Full code from our programs can be found here: https://drive.google.com/open?id=0B4Vn_sxU595gfldGdndjajFfTndQcmlvSkR6VEN3SWdfWW5xeUdhZzJ6UTlsU29LUVFNdXc&authuser=0
|
|
|
> * Full code from our programs can be found here:
|
|
|
> [10] https://drive.google.com/open?id=0B4Vn_sxU595gfldGdndjajFfTndQcmlvSkR6VEN3SWdfWW5xeUdhZzJ6UTlsU29LUVFNdXc&authuser=0
|
|
|
>
|
|
|
> Links:
|
|
|
>
|
... | ... | |