Date: 16.12.2007
Duration of activity: 8 hours
List of participants: Alessandro, Daniela, Samuele
Plan of the day:
- Design and build a prototype of sound follower robot.
- Test the effectiveness of its implementation
- Test sound sensor capability of working in presence of multiple sound sources.
We considered different options, similar to the ones met within the course.
Among those, we considered of using a single sound sensor per agent and making the robot periodically stop and rotate 360° to sample around and choose the direction to follow.
We also thought of using two sound sensors, and interpolating their readings, estimate the direction from which the sound could come.
As a first try, we chose to implement a simple robot similar to the Braitenberg's vehicle, which uses sound sensors as inputs; we made this choice because, as we have seen during the course, this model seems to be the simplest and better working model for moving according to some kind of input.
As Braitenberg states: "Braitenberg's vehicles consist of the simplest sort of wheeled robots in which sensors that are sensitive to different stimuli are wired directly to motors that drive the wheels".
Valentino Braitenberg also makes an important comment, that we must be aware of: "In these models, we assume that the sensor generates a signal that is proportional to the stimulus".
As said in previous posts, we experimented that within some range of frequencies the sound level is almost proportional to distance of sound sources.
In Braitenberg's model we must connect sensor outputs to motor inputs, but before of doing that, sensor readings must be normalized with some function.
We defined the following normalizing function:
public int normalize(int value) {
final int MIN_VALUE = 0;
final int MAX_VALUE = Utils.LOUD_VALUE;
value = Math.min(MAX_VALUE, Math.max(MIN_VALUE, value));
return Math.max(0, Math.min(MAX_SPEED, (value - MIN_VALUE)
* MAX_SPEED / (MAX_VALUE - MIN_VALUE)));
}
This function implements a linear mapping between two ranges, the first related to sound values [MIN_VALUE, MAX_VALUE] and the second to motor speeds [0, MAX_SPEED].where:
- MIN_VALUE represents a threshold value for ambient noise, in this case 0.
- MAX_VALUE represents the threshold for loud sounds. Like said in previous post, the value we used is around 70. Everything above that threshold must be considered equal.
- MAX_SPEED represents the maximum speed that we want the robot's motors to have.
We built a simple robot with two sound sensors and two motors and we tried the above software.
We spent a lot of time to test, but the robot only went straight, with some random steering.
We tried changing some implementation detail, but, after a deeper analysis, we identified (at least) two major problems:
- The robot always went forward. It was because the difference between the sound sensors readings was too small, compared to the difference between motor powers needed to steer toward the sound.
- The robot always drove, even when there was no sound. It was because of the motors' noise.
We then added twice the difference between the two readings to the maximum of the two values, obtaining a difference three times larger than it was.
About the second problem, we noticed that the motors were too close to the sound sensors, as it can be seen from the same photo as above.
As partial solution to this problem, we decided to move motors, trying to put them as far as possible from the sound sensors, to reduce their noise.
After having rebuilt our robot, and updated the code several times, we got a robot able to go toward sound.
We then performed some tests on it.
We tried at first with beeps played by old RCX bricks, but they were basically too quiet, and weren't heard from this robot.
We then tried with the frequencies we established with previous tests. Robot didn't seem to react as expected.
But when trying with those frequencies, we noticed that the robot rather followed our voices, instead of pure frequencies generated by our laptops.
We started then some tests on music, and we got better results, because of their wide range of frequencies. We also noticed that songs with electric guitars worked even better. This can be explained by the fact that the overdrive effect on guitar makes the sound wave squared, which spreads the energy of the sound among more frequencies.
Conclusion
We obtained good results and we are happy with that, we will proceed in this direction.
Next time we will try to plug into the robot some location saving capability.
References
Tom Dean, Introduction to Machina Speculatrix and Braitenberg Vehicles
No comments:
Post a Comment