... | ... | @@ -217,12 +217,26 @@ public class PIDCarController { |
|
|
#### Goal
|
|
|
In the LEGO Mindstorms series there is also a color sensor. The goal is to test the program ColorSensorSensor.java[1] and to investigate the information that the class ColorSensor provide in Full mode, and further see how it distinguish the three colors from each other.
|
|
|
Lastly, we will check if it Is possible to use the color sensor for both following the black line and stop in the goal zone.
|
|
|
|
|
|
#### Plan
|
|
|
First we will implement the ColorSensorSensor.java[1]. Afterwards we will use this program to measure the raw and cal values for different materials.
|
|
|
Hereafter we will use these values to make the code for the line follower. Finally test the line follower with the color sensor. This will be done on a track made from black masking tape and the goal will be to follow the line and stop at a green color at the end of the line.
|
|
|
|
|
|
#### Results
|
|
|
The different values that was shown on the screen on the robot have been set up in a table. Here we both have the raw and the cal values to make sure that we have all the values as possible when writing the code to the line follower. The values of the colors was very different when we tried measuring on different materials. Especially when measuring black, here we saw that when looking on black masking tape (which is the values seen in table 2) and mat black paper, there was a difference in the numbers. We discussed that it could be the masking tape that reflected the light in the sensor, and therefore we tried darken the room to reduce “noise” from the environment.
|
|
|
|
|
|
#### Conclusion
|
|
|
![Screen Shot 2015-03-10 at 14.25.14](http://gitlab.au.dk/uploads/u4099/legolabtimadala/f16db3e28c/Screen_Shot_2015-03-10_at_14.25.14.png)
|
|
|
|
|
|
##### Table 2: Color sensor data
|
|
|
-
|
|
|
|
|
|
We then used the values to make the robot follow a black line and stop when observing a green color. Here we first tried using our homemade lane (made of black masking tape on a mixed color linoleum floor), this was not optimal at all and we could not make the robot follow the line when using the color sensor. We went to use the pre-made robot lane in Zuse, where the lane is made of clear white, black and green. Instantly the robot followed the black line and stopped when reaching the green color on the lane as seen in video below [8]. The code for the program can be found in [9]
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/jcXVPVMcbpM/0.jpg)](http://www.youtube.com/watch?v=jcXVPVMcbpM)
|
|
|
##### Video 4: Demonstration of Color Sensor line follower.
|
|
|
|
|
|
#### Conclusion
|
|
|
We have tested if the color sensor can be used to follow a black line and stop when it hits a green color. Furthermore, we have investigated how the color sensor provides information about color. In our experiment, we found out that the reflection from light, and the material used to make the NXT follow a line has a great impact on how well it measures the color successfully since small variations can have a major impact on the red, green, blue and light values.
|
|
|
|
|
|
### Overall Conclusion
|
|
|
|
... | ... | @@ -232,7 +246,7 @@ Lastly, we will check if it Is possible to use the color sensor for both followi |
|
|
3. [Video 1: LineFollowerCal.java[1] test.](http://www.youtube.com/watch?v=lHlDTTMl_9s)
|
|
|
4. [Video 2: Car following line and stops in green zone.](http://www.youtube.com/watch?v=a1tTYuLr3_0)
|
|
|
5. [Video 3: Line Follower with PID controller.] (https://www.youtube.com/watch?v=Qi-XYG67Eiw&feature=youtu.be)
|
|
|
6. [CodeSnippet1: Implemented code for the three color sensor + line follower that stop in green zone.](???)
|
|
|
7. [CodeSnippet2: The implement code in our PID controlled line follower program.](?????)
|
|
|
6. [CodeSnippet1: Implemented code for the three color sensor + line follower that stop in green zone.](https://drive.google.com/file/d/0B9rkiUWl5k_kbnNUX29qaDBrcVk/view)
|
|
|
7. [CodeSnippet2: The implement code in our PID controlled line follower program.](https://drive.google.com/file/d/0B9rkiUWl5k_kbnNUX29qaDBrcVk/view)
|
|
|
8. [Video 4: Demonstration of Color Sensor line follower] (https://www.youtube.com/watch?v=jcXVPVMcbpM&feature=youtu.be)
|
|
|
9. [CodeSnippet 3: Implemented code of the Color Sensor line follower program](??????) |
|
|
\ No newline at end of file |
|
|
9. [CodeSnippet 3: Implemented code of the Color Sensor line follower program](https://drive.google.com/file/d/0B9rkiUWl5k_kbnNUX29qaDBrcVk/view) |
|
|
\ No newline at end of file |