... | ... | @@ -18,7 +18,7 @@ The plan is to follow the instructions for Lesson 5 [1]. |
|
|
|
|
|
We have chosen to develop a standard software architecture that can be used in each of the three scenarios (light, color and gyro sensor). This architecture is seen in the following diagram
|
|
|
|
|
|
![Software architecture](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ClassDiagram.jpg)
|
|
|
![Software architecture](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ClassDiagram.png)
|
|
|
|
|
|
In order to simplify the implementation of the software related to the three sensors we have made a generic PID controller with abstract methods to calculate the error and control signal. The specific PID controller will extend this class and define logic for these methods making it easier to manage the code. The program uses the PCconnection class to establish a Bluetooth connection between the NXT and the PC which is used to pass parameters from a GUI on the PC to the NXT. The “Segway” class is the main class which controls the flow of the program by first letting the user chose a balancing point which then is defined as an offset making the set point of the PID controller 0. Afterwards the control algorithm is applied while the parameters are shown on the LCD.
|
|
|
|
... | ... | |