cvf06035 created page: home authored by Camilla Marie Vinther Frederiksen's avatar Camilla Marie Vinther Frederiksen
...@@ -73,7 +73,6 @@ At this point we started wondering whether the wires to the engines were creatin ...@@ -73,7 +73,6 @@ At this point we started wondering whether the wires to the engines were creatin
#### Testing condition 2: Surface #### Testing condition 2: Surface
As we saw no discernible difference with the lights turned on or off, we left it on for the remainder of the experiments as it was vastly easier to work with. As we saw no discernible difference with the lights turned on or off, we left it on for the remainder of the experiments as it was vastly easier to work with.
Because we know from past experiences that the measured reflected light for the light sensor is affected by the color of the surface, we suspected that either the color of the bathroom floor, or the inconsistency in the color (as seen in figure 2) could possibly affect the reliability of our balancing robot. Because we know from past experiences that the measured reflected light for the light sensor is affected by the color of the surface, we suspected that either the color of the bathroom floor, or the inconsistency in the color (as seen in figure 2) could possibly affect the reliability of our balancing robot.
...@@ -97,7 +96,6 @@ After all of these various experiments with change of different factors, we came ...@@ -97,7 +96,6 @@ After all of these various experiments with change of different factors, we came
### Algorithm-discussion ### Algorithm-discussion
Based on Hurbain [2], we know that the PID constants used in Sejway.java program were designed for Hurbain's specific light sensor and environment setup. We therefore decided to start testing which specific variables would be best for our setup. Based on Hurbain [2], we know that the PID constants used in Sejway.java program were designed for Hurbain's specific light sensor and environment setup. We therefore decided to start testing which specific variables would be best for our setup.
Note: Camilla & Nicolai: Vi valgte at udlade at vi ændrede ints til floats, fordi vi alligevel caster dem til ints de fleste steder og har svært ved at finde på argumentation for hvorfor det skulle gøres udover "ole said so" Note: Camilla & Nicolai: Vi valgte at udlade at vi ændrede ints til floats, fordi vi alligevel caster dem til ints de fleste steder og har svært ved at finde på argumentation for hvorfor det skulle gøres udover "ole said so"
...@@ -114,7 +112,7 @@ Later on we noticed that the lesson plan actually gave two java programs to use ...@@ -114,7 +112,7 @@ Later on we noticed that the lesson plan actually gave two java programs to use
We ended up writing (basically through capy-paste though) four programs; ***PICcontroller.java***, ***PCconnection.java***, ***Sejway.java*** and ***NXTSegwayRunner.java***. We ended up writing (basically through capy-paste though) four programs; ***PICcontroller.java***, ***PCconnection.java***, ***Sejway.java*** and ***NXTSegwayRunner.java***.
The ***PIDcontroller.java*** is the PC GUI to enable PC control of variables used on the NXT. This program sets up a GUI with six fields and two buttons. The first two fields contains name and bluetooth device ID, which is used when clicking the 'connect'-button, as this action starts NXT communication with the given device ID and sets up a dataOutPutStream [TODO ref]. The ***PIDcontroller.java*** is the PC GUI to enable PC control of variables used on the NXT. This program sets up a GUI with six fields and two buttons. The first two fields contains name and bluetooth device ID, which is used when clicking the 'connect'-button, as this action starts NXT communication with the given device ID and sets up a dataOutPutStream [TODO ref].
The last four fields are input fields for P, I, D and SP respectively, where SP is the calibration setpoint that the NXT program will aim for - i.e. it's offset. The last four fields are input fields for P, I, D and SP respectively, where SP is the calibration setpoint that the NXT program will aim for - i.e. it's offset. The last variable was added to the PC controller, as we wanted to avoid box-calibration which we suspected didn't entirely remove the button-push error of the calibration.
The ***PCconnection.java*** is inspired from the ***Tracker.java*** and therefore is responsible for retrieving the parameters send from the pc through the datastream and forwarding them to a running ***Sejway.java*** instance. The ***PCconnection.java*** is inspired from the ***Tracker.java*** and therefore is responsible for retrieving the parameters send from the pc through the datastream and forwarding them to a running ***Sejway.java*** instance.
...@@ -122,6 +120,16 @@ The ***Sejway.java*** program is a modification of Bagnall's Sejway program, whe ...@@ -122,6 +120,16 @@ The ***Sejway.java*** program is a modification of Bagnall's Sejway program, whe
As both these programs can't run simultanously on the NXT, we also made the ***NXTSegwayRunner.java*** program which simply starts a Sejway instance, starts it, starts a PCconnection instance with a reference to the Sejway instance. This also means that the upper two classes extends Thread to enable simultaneous execution. As both these programs can't run simultanously on the NXT, we also made the ***NXTSegwayRunner.java*** program which simply starts a Sejway instance, starts it, starts a PCconnection instance with a reference to the Sejway instance. This also means that the upper two classes extends Thread to enable simultaneous execution.
#### Search for good PID parameters
After implementing the programs enabling easy PID parameter search, we quickly concluded that before changing the PID values we needed to find a good offset with the specific weight distribution of our robot.
##### Finding a good setpoint
##### Grid search
##### Extrema exploration
(Camilla og Nicolai nåede hertil - for nu) (Camilla og Nicolai nåede hertil - for nu)
NOTE: Planen for resten af dette afsnit er: NOTE: Planen for resten af dette afsnit er:
1. Beskriv at vi legede med PID værdierne 1. Beskriv at vi legede med PID værdierne
... ...
......