... | ... | @@ -6,18 +6,29 @@ |
|
|
|
|
|
**Group members participating:** Ivan Grujic, Lasse Brøsted Pedersen, Steffan Lildholdt, René Nilsson
|
|
|
|
|
|
**Activity duration:** 3 hours
|
|
|
**Activity duration:** 5 hours
|
|
|
|
|
|
## Goal
|
|
|
The goal of this exercise is to make a self-balancing robot.
|
|
|
The goal of this exercise is to test three different sensors and physical robot constructions in a self-balancing robot context.
|
|
|
|
|
|
## Plan
|
|
|
The plan is to follow the instructions for Lesson 5 [1].
|
|
|
|
|
|
## Results
|
|
|
|
|
|
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
|
|
|
|
|
|
[INSERT CLASS DIAGRAM]
|
|
|
|
|
|
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.
|
|
|
|
|
|
### Exercise 1, Self-balancing robot with light sensor
|
|
|
|
|
|
For this exercise we used a LEGO model build according to the description in [2]. Our final model is shown in the following picture:
|
|
|
|
|
|
[INSERT PICTURE OF MODEL]
|
|
|
|
|
|
The standard software architecture is used along with the “LightPIDController” class.
|
|
|
|
|
|
|
|
|
### Exercise 2, Choice of parameters on-the-fly
|
... | ... | |