Since we’re a bit behind on the lab sessions, I decided to take a look at what we’re missing. Duration of ~3 hours, attended by Troels.
Plan
I just wanted to play around with the ultrasonic sensor, getting a feel of how it worked, so my plan for today was something like:
1. mounting the ultrasonic sensor on the robot according to the book.
2. getting the simple test program transferred.
3. doing tests with the sensor.
Execution
1. This was easy enough, although I did not have the right parts, and no access to the spare parts room.
2. I’m just glad I remembered to write down in details last time, how I used the command promt to compile and transfer a program to the NXT, so this time it was rather painless.
3. I had no instrument to measure the real distance to the object I tested the program on, but a normal piece of A4 paper is ~297mm long, so that was used instead.
Then trying to run the program, I got an error:
Exception: 134
FExec...
something
something
...
I tried to google it, but found no solution. It seemed like this was a java error rather than some leJOS error, though that was not much help.
In the end it was fixed by flashing the NXT, and transferring the program again.
Now back to the tests.
First I tested against the wooden panels dividing the legolab room. One could think that some materials would be better to reflect the sound while others might absorb it. This however did not seem to be the case for me, as I tried it against the wooden panels, the windows, the door to the spare parts room and the blue fabric covered noticeboards around the lab. Although I did get small errors of about 2 cm in measurements when the object was closer than 15 cm. This might just be due to the imprecision of my paper measure. Other minor errors might just as well be because I did place the sensor at exactly the correct real world distance.
The results:
| Real distance (cm) | NXT ultrasonic distance (cm) |
| 15 | 18 |
| 30 | 30 |
| 45 | 45 |
| 60 | 59 |
| 75 | 74 |
| 90 | 89 |
This may not have been the most precise way to do it, preferably I would have had a tape measure or a ruler. Still the distance measured with the paper was most of the time consistent with the distance measured by the ultrasonic sensor.
Status
I think it went rather well today. The test was a bit imprecise, but I still think I learned from it and the sensor seems to be reliable. Next lab session, we should be ready to complete (hopefully rather fast) the last part of this lab exercise.
No comments:
Post a Comment