... | ... | @@ -63,19 +63,19 @@ During our experiment we noted some disturbances to the readings due to the nois |
|
|
## Exercise 2: Vehicle with two light sensors
|
|
|
|
|
|
#### Task
|
|
|
To conduct experiments with two light sensors mounted in front of the robot and imlement both exibitory and inhibitory connections between motors and sensor readings.
|
|
|
To conduct experiments with two light sensors mounted in front of the robot and implement both exitatory and inhibitory connections between motors and sensor readings.
|
|
|
|
|
|
#### Plan
|
|
|
We will test three different positions of the light sensors and test how it affects the behaviour of the robot. Furthermore we will implement and test both exibatory and inhibitory behavior. The tests will be conducted under the same circumstances in a darkened room. As a light source we use the camera flash of a smartphone.
|
|
|
We will test three different positions of the light sensors and test how it affects the behaviour of the robot. Furthermore we will implement and test both exitatory and inhibitory behavior. The tests will be conducted under the same circumstances in a darkened room. As a light source we use the camera flash of a smartphone.
|
|
|
|
|
|
For the first experiment we mounted the two sensors at the front of the robot at an angle of ~45 degrees and a space of 12 cm. For the second experiment we used an angle of 0 degrees, where the sensors pointed in the direction of the robot and for the third we placed the sensors at ~10 degrees. (see Fig. 4)
|
|
|
For the first experiment we mounted the two sensors at the front of the robot at an angle of ~45 degrees and a space of 12 cm. For the second experiment we used an angle of 0 degrees, where the sensors pointed in the direction of the robot and for the third we placed the sensors at ~10 degrees. (see Fig. 5)
|
|
|
|
|
|
![opstilling2](http://gitlab.au.dk/uploads/group-22/lego/3831a07e03/opstilling2.jpg)
|
|
|
##### Fig. 5 - The three experiments setup.
|
|
|
|
|
|
To conduct our experiments we configured a LightVehicle.java class which mapped the light readings from each of the two sensors to the motors (see Fig. 6).
|
|
|
|
|
|
For each experiment we implemented both the inhibitory and the exitatory behavior [1]. The exitatory behavior causes the robot to accelerate as it nears the light source, and the inhibatory behavior caused the robot to decelerate as it detects more light. The different behaviors were implemented using this mapping of the motors and sensors:
|
|
|
For each experiment we implemented both the inhibitory and the exitatory behavior [1]. The exitatory behavior causes the robot to accelerate as it detects more light, and the inhibatory behavior caused the robot to decelerate as it detects more light. The different behaviors were implemented using this mapping of the motors and sensors:
|
|
|
|
|
|
Exitatory behavior:
|
|
|
```
|
... | ... | @@ -91,14 +91,23 @@ int lightValRight = (int) (100-(lightRight.readValue()*scale)); |
|
|
|
|
|
|
|
|
#### Results
|
|
|
First experiment with 45 degree angle:
|
|
|
The two sensors were mounted at an angle of ~45 degrees and a space of 12 cm. Both sensors were “lying down” on the side (see Fig. 5). The results showed that the robot was able to move towards the light. However it also resulted in a large blind spot. The large blind spot resulted in the robot sometimes not being able to see the light source despite the source being right in front of it.
|
|
|
First experiment with ~45 degree angle:
|
|
|
The two sensors were mounted at an angle of ~45 degrees and a space of 12 cm. Both sensors were rotated on the side (see Fig. 5). The results showed that the robot was able to move towards the light. However it also resulted in a large blind spot. The large blind spot resulted in the robot sometimes not being able to see the light source despite the source being right in front of it.
|
|
|
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/ZejM8vRiHFs/0.jpg)](http://www.youtube.com/watch?v=ZejM8vRiHFs)
|
|
|
##### Fig. 7 - Video demo of the robot with the light sensors in a ~45 degree angle.
|
|
|
|
|
|
Second experiment with 0 degree angle:
|
|
|
Two light sensors mounted at the same angle, both pointing straight ahead while remaining upright with a space of 8 centimeters between them. The experiment showed that the robot was able to navigate towards a light source placed directly in front of it. The placement of the sensors with no angle also meant that once the light source was placed too far to the side of the robot, it would not be able to see it due to the blind spot.
|
|
|
|
|
|
Third experiment with a 15 degree angle:
|
|
|
For the third experiment we placed the sensors at a 15 degree angle. This experiment turned out to be the best of the three experiments as the blind spot to the sides and the front (see Fig. 5) were minimised, and the robot was able to navigate towards light placed directly in front of it and towards light placed by its side. Though the blind spots were minimised they were still present meaning that once the robot comes too close to the light source, the light will go between the sensors (See Fig. 5). This problem could be solved using a ultrasonic distance to measure the distance to objects placed in front of the robot.
|
|
|
|
|
|
##### Fig. 8 - The video shows how the robot react with the light sensors in a 0 degree angle.
|
|
|
|
|
|
Third experiment with a ~15 degree angle:
|
|
|
For the third experiment we placed the sensors at a ~15 degree angle. This experiment turned out to be the best of the three experiments as the blind spot to the sides and the front (see Fig. 5) were minimised, and the robot was able to navigate towards light placed directly in front of it and towards light placed by its side. Though the blind spots were minimised they were still present meaning that once the robot comes too close to the light source, the light will go between the sensors (See Fig. 5). This problem could be solved using a ultrasonic distance to measure the distance to objects placed in front of the robot.
|
|
|
|
|
|
##### Fig. 9 - The video shows how the robot react with the light sensors in a ~15 degree angle.
|
|
|
|
|
|
---
|
|
|
|
... | ... | |