... | @@ -24,6 +24,8 @@ Self-balancing robot with light sensor |
... | @@ -24,6 +24,8 @@ Self-balancing robot with light sensor |
|
|
|
|
|
### Setup
|
|
### Setup
|
|
|
|
|
|
|
|
#### Physical setup
|
|
|
|
|
|
For this exercise we used a LEGO model build according to the description in [2]. Our final model is shown in the following image.
|
|
For this exercise we used a LEGO model build according to the description in [2]. Our final model is shown in the following image.
|
|
|
|
|
|
![NXTWay robot with light sensor mounted](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/LightSensorRobot.JPG)
|
|
![NXTWay robot with light sensor mounted](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/LightSensorRobot.JPG)
|
... | @@ -33,6 +35,11 @@ We know that the surface which the robot is placed on affects the control mechan |
... | @@ -33,6 +35,11 @@ We know that the surface which the robot is placed on affects the control mechan |
|
![Surfaces which the self-balancing NXTWay robot is tested on](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/LightSensorSurfaces.jpg)
|
|
![Surfaces which the self-balancing NXTWay robot is tested on](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/LightSensorSurfaces.jpg)
|
|
|
|
|
|
By inspecting the robots control mechanism we concluded that the best of the three surfaces was the blank white surface and therefore the following tuning and analysis of the PID parameters are performed on this surface.
|
|
By inspecting the robots control mechanism we concluded that the best of the three surfaces was the blank white surface and therefore the following tuning and analysis of the PID parameters are performed on this surface.
|
|
|
|
|
|
|
|
We also know that the surrounding light can be a key factor when using a light sensor in a PID control context. Two cases of surrounding light was analyzed; natural light and artificial light. Despite our expectations the surrounding light did not seem to affect the control mechanism significantly.
|
|
|
|
|
|
|
|
#### Software setup
|
|
|
|
|
|
We have created a standard PID software architecture which makes the replacement of a sensor easy. The architecture is shown in the following image.
|
|
We have created a standard PID software architecture which makes the replacement of a sensor easy. The architecture is shown in the following image.
|
|
|
|
|
|
![Software architecture](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ClassDiagram.png)
|
|
![Software architecture](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ClassDiagram.png)
|
... | @@ -119,11 +126,15 @@ This plot shows the PID controllers offset as the red line and the output of the |
... | @@ -119,11 +126,15 @@ This plot shows the PID controllers offset as the red line and the output of the |
|
When the LEGO robot is tilting forward the light sensor will get closer to the surface which yields less light coming in and therefore the output value of the sensor will decrease. Otherwise when the LEGO robot is tilting backwards more light is coming in and the output value will increase. In order for the LEGO robot to keep balance it must constantly try to keep an upright position by applying motor force in the tilting direction (forward or backward). Due to the LEGO robots high center of gravity it is difficult to maintain an upright position resulting in the toggling back and forth between the offset until it is no longer able to adjust for the tilting.
|
|
When the LEGO robot is tilting forward the light sensor will get closer to the surface which yields less light coming in and therefore the output value of the sensor will decrease. Otherwise when the LEGO robot is tilting backwards more light is coming in and the output value will increase. In order for the LEGO robot to keep balance it must constantly try to keep an upright position by applying motor force in the tilting direction (forward or backward). Due to the LEGO robots high center of gravity it is difficult to maintain an upright position resulting in the toggling back and forth between the offset until it is no longer able to adjust for the tilting.
|
|
|
|
|
|
|
|
|
|
## Exercise 2, Self-balancing robots with color sensor
|
|
## Exercise 2
|
|
|
|
|
|
|
|
Self-balancing robots with color sensor
|
|
|
|
|
|
### Setup
|
|
### Setup
|
|
The robot was assembled according to [3] with some minor modifications. Since the upright motor is not used in the case of a segway. An image of the robot is seen in the following image.
|
|
The robot was assembled according to [3] with some minor modifications. Since the upright motor is not used in the case of a segway. An image of the robot is seen in the following image.
|
|
|
|
|
|
|
|
This robot is tested
|
|
|
|
|
|
![NXT Segway with Rider with light sensor mounted](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ColorSensorRobot.JPG)
|
|
![NXT Segway with Rider with light sensor mounted](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson5/Images/ColorSensorRobot.JPG)
|
|
|
|
|
|
| Parameter | Value |
|
|
| Parameter | Value |
|
... | @@ -138,6 +149,7 @@ The robot was assembled according to [3] with some minor modifications. Since th |
... | @@ -138,6 +149,7 @@ The robot was assembled according to [3] with some minor modifications. Since th |
|
|
|
|
|
|
|
|
|
## Exercise 3
|
|
## Exercise 3
|
|
|
|
|
|
Self-balancing robots with gyro sensor
|
|
Self-balancing robots with gyro sensor
|
|
|
|
|
|
### Setup
|
|
### Setup
|
... | | ... | |