... | ... | @@ -129,15 +129,16 @@ The ***Sejway.java*** [13] program is a modification of Bagnall's Sejway program |
|
|
|
|
|
As both these programs can't run simultanously on the NXT, we also made the ***NXTSegwayRunner.java*** [14] program which simply creates a Sejway instance, starts it and creates and starts a PCconnection instance with a reference to the Sejway instance. For this reason, the two classes previously described extend Thread to enable simultaneous execution.
|
|
|
|
|
|
#### Search for good PID parameters
|
|
|
### Search for good PID parameters
|
|
|
---
|
|
|
After implementing the programs enabling easy PID parameter search, we started playing around with different values for P, I and D using a by-hand-calibrated setpoint. We quickly realized that this method didn't enhance our understanding of the different variables and neither of the robot's ability to self-balance. We therefore decided to use a more systematic way of testing and deciding on variable values than this approach based on gut feeling and experience (the latter of which we had very little).
|
|
|
|
|
|
To systematically observe which values of P, I and D worked better for our robot we needed to have a best possible starting point (i.e. the robot being in equilibrium), and we therefore began by trying to find a good setpoint. This is presented below, along with our search for the other parameters.
|
|
|
|
|
|
##### Grid-inspired search and extrema exploration
|
|
|
#### Grid-inspired search and extrema exploration
|
|
|
We decided to test the effect of different values for the parameters using a technique inspired by grid search: We selected a range of values to try out for each parameter (*setpoint*, *P*, *I*, and *D*) and then varied one parameter while keeping the others fixed. We began by testing different values with rather large intervals in between, including extreme values on either side of the value provided in Bagnall's code (p = 28, i = 4, d = 33). By extreme, we mean values far away from the provided values. According to which values gave the best results we then made the search around these values more fine-grained.
|
|
|
|
|
|
*Finding a good setpoint:*
|
|
|
#####Finding a good setpoint
|
|
|
To find the best possible setpoint, we followed the procedure described above and narrowed our way into a good value by starting with (from our prior experience) low and high values. The resulting observations are presented in table 1. We ended up selecting an SP value of 577. The process is described more closely below.
|
|
|
|
|
|
| Setpoint value | Status | Observation |
|
... | ... | |