... | ... | @@ -185,12 +185,13 @@ Initially the I-value was 4, and as just explained we needed a stronger reaction |
|
|
|
|
|
After increasing the I-value to 6 or 7, the robot appears to react more violently to steadily increasing errors and as such prevents the slow-but-certain fall behavior it previously had. However, it ultimately still tips over to either side rather quickly.
|
|
|
|
|
|
We decided to finish up the experiments (long) before having tried all possible combinations of parameters values, as it seemed pointless to go on when seeing no significant improvements to the robot's behaviour - continuing would not improve on our understanding of the effects of the different PID parameters further. However, the parameter search inspired by grid search did provide us with a more structured insight into the effects of the different parameters than had we just tried varying each parameter on a whim.
|
|
|
We decided to finish up the experiments (long) before having tried all possible combinations of parameters values, as it seemed pointless to go on when seeing no significant improvements to the robot's behavior - continuing would not improve on our understanding of the effects of the different PID parameters further. However, the parameter search inspired by grid search did provide us with a more structured insight into the effects of the different parameters than had we just tried varying each parameter on a whim.
|
|
|
|
|
|
### Self balancing robot with color sensor
|
|
|
---
|
|
|
We replaced the light sensor with a color sensor and did some trial runs with the robot to see how well it performed on the basic settings (p = 28, i = 4, d = 33). These initial runs led to the following interesting observation:
|
|
|
NOTE (Camilla): Havde vi ikke ændret til værdierne fra forrige eksperiment? Altså p = 40, i=6 ?)
|
|
|
NOTE (Nicolai): Fwuak, kan jeg ikke huske...
|
|
|
|
|
|
Changes in the robot's position seemed to be reflected less strongly in the readings of the color sensor than those of the light sensor - that is, the same angle seemed to induce less of a change in the color sensor's readings. We therefore speculated that we needed to multiply the error by a larger value in order to adequately correct the robot's position, which means that a larger value of *p* might result in the robot balancing better as the change in reading would then have a larger effect. We tested this by trying out different values of ***p***, using the same *p*-values as when testing the light sensor. We weren't able to observe any improvements for certain and did not press on with this approach. Instead, we decided to compare the two types of sensor more closely.
|
|
|
|
... | ... | @@ -212,9 +213,9 @@ During the process of switching from the color sensor to the light sensor, the l |
|
|
|
|
|
*Figure 6: Plot of readings from color sensor (orange) and light sensor (brown), during tilt, along with their setpoints*
|
|
|
|
|
|
The two graphs have about the same shape, with two peaks separated by a valley. The first ~800 ms is the calibration of the setpoint. Then we see the reading values rise as the robot is tilted to its starting position, causing the sensor to get closer and closer to the surface below. After the second peak, we see the reading decrease as the robot is tilted backwards. We are not sure as to the reason for the occurence of the valleys - a guess could be that the robot is lifted slightly from the table again because Camilla, who tilting the robot, was wary of letting the sensor hit the surface too hard (regrettably, we did not make a video recording that includes the calibration of the setpoint and the following move to the start position and so cannot look back and confirm this visually). The different depths of the valleys could be due to the change in lighting level, as described previously.
|
|
|
The two graphs have about the same shape, with two peaks separated by a valley. The first ~800 ms is the calibration of the setpoint. Then we see the reading values rise as the robot is tilted to its starting position, causing the sensor to get closer and closer to the surface below. After the second peak, we see the reading decrease as the robot is tilted backwards. We are not sure as to the reason for the occurrence of the valleys - a guess could be that the robot is lifted slightly from the table again because Camilla, who tilting the robot, was wary of letting the sensor hit the surface too hard (regrettably, we did not make a video recording that includes the calibration of the setpoint and the following move to the start position and so cannot look back and confirm this visually). The different depths of the valleys could be due to the change in lighting level, as described previously.
|
|
|
|
|
|
We see that the color sensor actually has a larger maximum deviation (***max. dev.***) from the setpoint than the light sensor. The color sensor has a larger average deviation (***avg. dev.***) as well. This goes against our immediate visual observations. However, as pointed out above, the two valleys have very different depths - the depth of the color sensor valley is much larger than that of the light sensor. The large valley of the color sensor skews the average, and the values computed for the two graphs mmay not be comparable. When we simply look at the graph, we see the light sensor peak at around 120 above its setpoint while the color sensor peaks at around 20-30 above its setpoint. The lowest measurement, aside from the valley, is reached around 100 below for the color sensor and a little more than 100 below for the light sensor. These observations support our initial visual observations.
|
|
|
We see that the color sensor actually has a larger maximum deviation (***max. dev.***) from the setpoint than the light sensor. The color sensor has a larger average deviation (***avg. dev.***) as well. This goes against our immediate visual observations. However, as pointed out above, the two valleys have very different depths - the depth of the color sensor valley is much larger than that of the light sensor. The large valley of the color sensor skews the average, and the values computed for the two graphs may not be comparable. When we simply look at the graph, we see the light sensor peak at around 120 above its setpoint while the color sensor peaks at around 20-30 above its setpoint. The lowest measurement, aside from the valley, is reached around 100 below for the color sensor and a little more than 100 below for the light sensor. These observations support our initial visual observations.
|
|
|
|
|
|
Also, the slope of the graph for the color sensor is less steep than that of the light sensor, which might also explain our observations. The different slopes, however, could also be due to different speeds of the movement when tilting the robot - it should be noted, though, that this could also have affected our results in a way that diminishes the actual difference which could then be larger than it appears, which might support our observations.
|
|
|
|
... | ... | @@ -224,16 +225,16 @@ Further exploration might have included testing the color sensor in different co |
|
|
|
|
|
### Self balancing robot with gyro sensor
|
|
|
---
|
|
|
After having tried both light and color sensors to get the robot standing we moved on to a gyro sensor. This sensor gives readings of movement and would therefore be ideal for a two wheel balancing robot. These motion readings are ment to be 600 (in raw values) [6] when completely steady and return smaller or greater numbers depending on the direction of the motion. How much smaller or greater these values are depends on the speed of the motion, as the returned gyro value is measured in angle velocity.
|
|
|
After having tried both light and color sensors to get the robot standing we moved on to a gyro sensor. This sensor gives readings of movement and would therefore be ideal for a two wheel balancing robot. These motion readings are meant to be 600 (in raw values) [6] when completely steady and return smaller or greater numbers depending on the direction of the motion. How much smaller or greater these values are depends on the speed of the motion, as the returned gyro value is measured in angle velocity.
|
|
|
However not all gyro sensors have a stand still value of 600. It might be either greater or lower depending on the specific gyro [6]. Therefore we started by measuring our specific gyro sensors steady value - called offset.
|
|
|
|
|
|
This was done by placing the robot against a wall, and observing the value over a period of time. The reading varying between 597 and 598, with 598 occuring the most. Our sensor's offset for angular velosity is therefore 598.
|
|
|
This was done by placing the robot against a wall, and observing the value over a period of time. The reading varying between 597 and 598, with 598 occurring the most. Our sensor's offset for angular velocity is therefore 598.
|
|
|
|
|
|
Gyro sensors does not only vary in offset value, they also vary in measured value depending on surronding temperature and given voltage [6 and 7]. This is called the drift of the gyro, as the initial offset value will move when these factors effect the sensor.
|
|
|
Gyro sensors does not only vary in offset value, they also vary in measured value depending on surrounding temperature and given voltage [6 and 7]. This is called the drift of the gyro, as the initial offset value will move when these factors effect the sensor.
|
|
|
|
|
|
To test the drift of our sensor, we began by starting ***GyroTest.java*** and letting it run for 10 minutes to check if the sensor developed heat which could then maybe result in a drift of the reading value. This didn't seem to be the case - in the end, the sensor readings were still shifting between 597 and 598.
|
|
|
|
|
|
Afterwards, we modified ***GyroTest*** [15] 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 to. We took off the wheels in the hopes that this would lessen the vibrations of the robot resulting in a more stable position.
|
|
|
Afterwards, we modified ***GyroTest*** [15] 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 unmodified. In the second case, the robot's wheels were taken off to. 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 | Highest offset | Lowest offset | Upper deviation | Lower deviation |
|
|
|
| ----------- | --------------- | ------------- | ------------- | --------------- | -------------- |
|
... | ... | @@ -242,7 +243,7 @@ Afterwards, we modified ***GyroTest*** [15] to let both motors run while the pro |
|
|
|
|
|
*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 difference is negligible.
|
|
|
There seems to be no significant difference between the robot when wearing wheels 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.
|
|
|
|
|
|
In both cases the readings fluctuate around the average offset and there does not seem to be a clear drift towards neither upper nor lower values (see figure 7). If testing for a longer duration of time we might expect to see a drift towards lower values as the average deviation in that direction is larger than towards higher values, in both cases. The maximum and minimum offsets measured are the same in both cases, further suggesting that vibrations from the wheels have no significant effect.
|
... | ... | |