... | ... | @@ -23,10 +23,12 @@ Follow the instructions given in the lesson plan \[1\]. |
|
|
First, you should mount the sensor on the LEGO 9797 car as described in LEGO Mindstorms Education NXT Base Set 9797 building instruction page 32 to page 34. Second, make a program that use and test the class *BlackWhiteSensor.java*. After calibration, place the car with the light sensor over different dark and bright areas and investigate how well the BlackWhiteSensor works.
|
|
|
|
|
|
#### Execution ####
|
|
|
First, we rebuilt the robot to utilise a light sensor. Our initial construction can be seen in <<<<<<indsæt reference til billedet her >>>>>>.
|
|
|

|
|
|
First, we rebuilt the robot to utilize a light sensor. Our initial construction can be seen in Figure 1.
|
|
|
Secondly, we programmed an application which used the *BlackWhiteSensor.java* <<<<<<indsæt reference til koden her >>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsæt kode eller reference til git med kode>>>>>>. We used this application to analyse the effectiveness of application calibration.
|
|
|
|
|
|
<img src="https://gitlab.au.dk/martinwp/LegoGroup2/raw/develop/lesson-04/images/sensor_location_high.jpg" alt="Figure 1" width="200px" />
|
|
|
*Figure 1 : The initial construction of the robot, Note hight of sensor location*
|
|
|
|
|
|
The *BlackWhiteSensor.java* class prints light values to the display as a percentage <<<<indsæt reference til hvor dette er kendt fra >>>>>. We noted these in table <<<<<table ref >>>>>.
|
|
|
|
|
|
**White** | **Black**
|
... | ... | @@ -34,8 +36,10 @@ The *BlackWhiteSensor.java* class prints light values to the display as a percen |
|
|
51 | 33
|
|
|
|
|
|
We noticed that the application was very effective at classifying the differences between black and white. It does this by calculating the median between the black and white readings and setting this value as the threshold between the two colors.
|
|
|
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be in <<<<<indsæt ref til billede>>>>>>.
|
|
|

|
|
|
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be seen in Figure 2.
|
|
|
|
|
|
<img src="https://gitlab.au.dk/martinwp/LegoGroup2/raw/develop/lesson-04/images/sensor_black_white.jpg" alt="Figure 2" width="200px" />
|
|
|
*Figure 2 : Messuring the *
|
|
|
|
|
|
### Line Follower with Calibration ###
|
|
|
|
... | ... | @@ -191,6 +195,7 @@ This is not the conclusion your looking for!!!! |
|
|
## References ##
|
|
|
|
|
|
\[1\] : [Lesson Plan](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson4.dir/Lesson.html)
|
|
|
|
|
|
\[2\] : [A PID Controller For Lego Mindstorms Robots](http://www.inpharmix.com/jps/PID_Controller_For_Lego_Mindstorms_Robots.html)
|
|
|
|
|
|
<!--
|
... | ... | |