| ... | @@ -37,24 +37,24 @@ We noticed that if the robot titled forward all the way, it had no chance of rec |
... | @@ -37,24 +37,24 @@ We noticed that if the robot titled forward all the way, it had no chance of rec |
|
|
#### White Cardboard Surface
|
|
#### White Cardboard Surface
|
|
|
Challenging the advice Phillippe Hurbain we tried to change the surface on which we are sensing (see image 6 in the above gallery). As expected, the performance was even worse and the robot showed very aggressive corrections, which may indicate that the light sensor may have zeroed on something.
|
|
Challenging the advice Phillippe Hurbain we tried to change the surface on which we are sensing (see image 6 in the above gallery). As expected, the performance was even worse and the robot showed very aggressive corrections, which may indicate that the light sensor may have zeroed on something.
|
|
|
|
|
|
|
|
**This behavior can be seen in this video: [Self-balancing robot with light sensor - Control](http://1drv.ms/1EFIGRZ)**
|
|
**This behavior can be seen in this video: [Self-balancing robot with light sensor - Cardboard](http://1drv.ms/1EFIGRZ)**
|
|
|
|
|
|
|
|
#### Experimenting with PID Constant Values
|
|
#### Experimenting with PID Constant Values
|
|
|
The native constants of Brian Bagnall's PID, allowed the robot to balance for a few seconds, which we didn't find satisfying. Through trial-and-error we've narrowed in on the following constants, which gave us increased performance:
|
|
The native constants of Brian Bagnall's PID, allowed the robot to balance for a few seconds, which we didn't find satisfying. Through trial-and-error we've narrowed in on the following constants, which gave us increased performance:
|
|
|
|
|
|
|
|
**Power = 40**
|
|
**Power = XXXX**
|
|
|
|
|
|
|
|
This forces the robot to correct its errors fast enough, and avoid tilting over as often as the native values.
|
|
This forces the robot to correct its errors fast enough, and avoid tilting over as often as the native values.
|
|
|
|
|
|
|
|
**Integral = 20**
|
|
**Integral = XXXX**
|
|
|
|
|
|
|
|
This handles accumulating errors by increasing the error value for each consecutive error.
|
|
This handles accumulating errors by increasing the error value for each consecutive error.
|
|
|
|
|
|
|
|
**Differential = 40**
|
|
**Differential = XXXX**
|
|
|
|
|
|
|
|
If we are experiencing accelerating errors we correct accordingly. Thus, if we are lowering our error, the acceleration (differential) will be negative and the corrections will get smaller.
|
|
If we are experiencing accelerating errors we correct accordingly. Thus, if we are lowering our error, the acceleration (differential) will be negative and the corrections will get smaller.
|
|
|
|
|
|
|
|
**Scale = 18**
|
|
**Scale = XXXX**
|
|
|
|
|
|
|
|
The scale factor is a simple mapping between the sensor values and the output variables, which changes the optimal dimensions of the constants. Thus, if we change the Scale, then we have to adjust the Power, Integral, and Differential factors accordingly.
|
|
The scale factor is a simple mapping between the sensor values and the output variables, which changes the optimal dimensions of the constants. Thus, if we change the Scale, then we have to adjust the Power, Integral, and Differential factors accordingly.
|
|
|
|
|
|
| ... | @@ -86,9 +86,18 @@ Finally, we made it balance for a whole 17 seconds! In this case, we used the ba |
... | @@ -86,9 +86,18 @@ Finally, we made it balance for a whole 17 seconds! In this case, we used the ba |
|
|
|
|
|
|
|
To sum up, we can conclude that the balance bar made it easier to find the balance point and that playing around with the PID constants plausibly increased performance. However, the significant improvement was introduced by combining these sources of improvement, which resulted in a best-case test of 17 seconds of self-balancing. Nonetheless, there are still many more physical aspects to explore, e.g. lowering the balance point, adding more weight instead of the wheels, using bigger wheels, etc.. Further experiments with the PID constants could also improve performance.
|
|
To sum up, we can conclude that the balance bar made it easier to find the balance point and that playing around with the PID constants plausibly increased performance. However, the significant improvement was introduced by combining these sources of improvement, which resulted in a best-case test of 17 seconds of self-balancing. Nonetheless, there are still many more physical aspects to explore, e.g. lowering the balance point, adding more weight instead of the wheels, using bigger wheels, etc.. Further experiments with the PID constants could also improve performance.
|
|
|
|
|
|
|
|
## Self-balancing robots with color sensor
|
|
## Choice of parameters on-the-fly
|
|
|
|
|
|
|
|
Instead of having to manually alter the source code, compile it, and upload it to the NXT, we can create a GUI that will allow us to do this more efficiently on-the-fly, for faster debugging and experimentation.
|
|
|
|
|
|
|
### Setup & Approach
|
|
### Setup & Approach
|
|
|
|
|
|
|
|
|
As a source of inspiration and initial code setup, we use the example [PCcarController.java](legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/Lesson5Programs/PCcarController.java) [3], which creates an initial GUI, initiates the NXT Communication facilities, and the required data input-output handling (over a Bluetooth connection). The code has to be altered to fit our needs. The full source code can be found in [PCbalancerController.java]() [4] and [BTcontrolledBalancer.java]() [5]. Below is a screendump of the GUI.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## Self-balancing robots with color sensor
|
|
|
|
### Setup & Approach
|
|
|
|
|
|
|
|
## Self-balancing robots with gyro sensor
|
|
## Self-balancing robots with gyro sensor
|
|
|
### Setup & Approach
|
|
### Setup & Approach
|
| ... | @@ -99,8 +108,9 @@ To sum up, we can conclude that the balance bar made it easier to find the balan |
... | @@ -99,8 +108,9 @@ To sum up, we can conclude that the balance bar made it easier to find the balan |
|
|
### References
|
|
### References
|
|
|
* [1], [Philippe Hurbain](http://www.philohome.com/nxtway/nxtway.htm)
|
|
* [1], [Philippe Hurbain](http://www.philohome.com/nxtway/nxtway.htm)
|
|
|
* [2], [Sejway.java](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/Lesson5Programs/Sejway.java)
|
|
* [2], [Sejway.java](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/Lesson5Programs/Sejway.java)
|
|
|
* [3], [Signal Generator](https://play.google.com/store/apps/details?id=radonsoft.net.signalgen), RadonSoft.
|
|
* [3], [PCcarController.java](legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/Lesson5Programs/PCcarController.java)
|
|
|
* [4], Sivan Toledo, A Clap Counter, Oct 2006.
|
|
* [4], [PCbalancerController.java](MISSING LINK)
|
|
|
|
* [5], [BTcontrolledBalancer.java](MISSING LINK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|