... | ... | @@ -58,16 +58,19 @@ In the datalogger class we had to replace FileOutputStream with BufferedOutputSt |
|
|
>
|
|
|
>---
|
|
|
>
|
|
|
>## Exercise 2: Line Follower with Calibration
|
|
|
>## Exercise 2: Choice of parameters on the fly
|
|
|
>
|
|
|
>#### Task
|
|
|
>Try the LineFollowrCal.java. The program uses the simple class Car.java to move the car.
|
|
|
>During the development of a balancing robot a lot of adjustment of constants is needed. This can be done by editing the Java source code, compile and transfere it to the NXT before the next trial. To speed up this trial and error process a wireless communication could be established between PC and NXT so the constants of the program can be changed on-the-fly.
|
|
|
>
|
|
|
>#### Plan
|
|
|
> Upload the code to the robot and observe what happens.
|
|
|
> We implemented the NXT GUI in our code with five parameters so that we could adjust the parameters while holding the robot in balance.
|
|
|
>
|
|
|
>#### Results
|
|
|
>After running the LineFollowerCal.java we observed that it runs fine along a black line but as soon it encounters a different color eg. green or grey it starts spinning uncontrollably. This is partly due to the program only distinguishing between black and non-black colors. This means that whenever the robot encounters a color different from black it will diverse from its course. From this point it might not detect black colors even though it drives over a black line due to its sample interval of 10ms. This interval makes the robot detect colors once every 10ms and all other time it is blind to it's surrounding meaning that we cannot be sure that i makes a reading as it drives over black.
|
|
|
>During the testing of our robot we used the GUI (see fig. ??) to adjust the PID values as well as the offset and SCALE values. We found it necessary to be able to adjust the offset as the value would change a little just by clicking the enter button for the selection.
|
|
|
>
|
|
|
> ![PID_gui](http://gitlab.au.dk/uploads/group-22/lego/56fed5f205/PID_gui.png)
|
|
|
> ##### Fig. 4 - Control GUI used to adjust the PID values as well as offset (o) and SCALE (s).
|
|
|
>
|
|
|
>---
|
|
|
>
|
... | ... | |