![]() |
|
#1
|
|||
|
|||
|
We have been having a little trouble with the ultrasonic sensor (it could be the program)
But my son keeps telling me that the sensor needs calibrated. He said that the summer camp he went to they had trouble with the ultrasonic sensors and the instructor calibrated them and they started working. He assured me it was the ultrasonic and not the light sensor. Is there such a thing as calibrating the ultrasonic sensor? I thought it was just for the light sensors. Thanks, J |
|
#2
|
|||
|
|||
|
There is no ultrasonic sensor calibration. There is calibration for the light sensor and the sound sensor.
There is no need to calibrate the ultrasonic sensor. The sensor uses a clock to measure the time between when a sound is made and when the echo is heard. Unlike a light sensor or sound sensor the value is not affected by environmental variables unless you are underwater or inside a steel bar. The speed of sound doesn't change enough in open air for you to sense it with this device. If you are having problems with the US you are either using it wrong, expect it to do more than it is capable of doing, or have a bad sensor. Do some simple experiments to become aquainted with the sensor and determine if it is working. I would start by aiming it at a large flat wall, moving the sensor in 1" increments and recording what the sensor reading is. How close can you get a reliable reading? How far away? Next I would aim it at that flat wall again and start moving objects into the periphery. How wide is the angle of view? Then I might start placing different shaped object in front of the sensor and different distances. Can it see spindly things like the bacteria dispensors? How about round things like a pop can? |
|
#3
|
|||
|
|||
|
Thanks for your answer. That's what I thought. But I wanted to double check.
The kids are using the US to bounce off the wall surrounding the game mat so they can follow along the wall but not touch it. If the bot is closer than 11cm then turn out if it's further than 12 cm turn toward the wall. Usually it works but sometimes it hits the wall and sometimes it goes too far out. I suspect it's their program or their placement of the US on their robot. Or do you think they are they are asking for more sensitivity than the US is capable of? Thanks, J Update: I think I just figured out what they did wrong. It was the program. It's working much better now. Thanks again. Last edited by jemorris80; 12-09-2011 at 07:45 AM. |
|
#4
|
|||
|
|||
|
Quote:
Things that I remember that the kids found out include
If the robot starts too far away from the wall, it can turn too much to face directly toward the wall, and then the sensor will no longer read the correct distance from the wall. Those are the times the robot just runs into the wall. You can watch a video of our bot from last season here. The US is used on the long last mission to get past the bad cell area on the south side. The last mission starts at about 1:45 into the video. At times, you can see the sensor mounted on the right side of the bot, just forward of the wheel, tilted vertically. The kids debugged the wall-following program by setting a large cardboard box on the floor, and having the bot follow along the sides. It was really fun to play with. The basic proportional algorithm is something like this LOOP current distance = ultrasonic sensor reading error = current distance - desired distance correction = error * gain (a constant - I think ours was between 5 and 10 - it will vary by bot ) feed correction into steering hub on the move block END LOOP The algorithm works because if the bot is currently at the desired distance, the correction value calculated will be zero. A value of zero fed into the steering input on the move block makes the bot go straight. Non-zero values make the bot go either left or right. Note, you may end up with the sign wrong for the correction value, and see the bot turn in the wrong direction the first time, but that is an easy thing to correct. Last edited by timdavid; 12-09-2011 at 11:31 AM. Reason: add info about video |
|
#5
|
|||
|
|||
|
Thanks, this is my first year coaching and it's been a lot of learning for me. What you describe is basically what my kids are doing. Their algorithm isn't as graceful as yours but it's sort of the same idea.
After puttering with it a little bit, I realized the problem was actually in the move blocks. The turns to correct their position were too miniscule to be of any use. (I think they were using rotations and then accidentally switched to degrees at some point) When I made the turns greater it worked. Now if they can get it fixed before the competition tomorrow - EEK! Thanks again! |
|
#6
|
|||
|
|||
|
Quote:
My only comment is for many of the feedback-type algorithms such as I described in my last post, where the Move block is inside a loop, you are probably better off not specifying a duration for the Move block - use Unlimited instead. If you use Unlimited, the loop will iterate quite rapidly, and the robot will make rapid changes in response to the feedback provided by the sensor reading. Sometimes for debugging, it is useful to specify a small duration for the move block, and perhaps add a timed wait. Then the kids can watch the bot perform the task in slow motion. Good luck tomorrow! |
|
#7
|
|||
|
|||
|
Thanks, that's good to know for next time (last night was their last meeting.)
(Gulp!) I think I'm more nervous about the competition tomorrow than the kids. - J |
|
#8
|
|||
|
|||
|
There is absolutely nothing to worry about. I've coached teams that came in first and teams that came in last. Every kid said they had a great time. Just make sure the team takes some time to relax and enjoy the event. Walk around the pits, look at the robots, talk to other teams... I keep my teams away from the practice tables as much as possible. That way leads to the darkness, disappointment, despair.
Last edited by Dean Hystad; 12-09-2011 at 04:57 PM. |
|
#9
|
|||
|
|||
|
Good luck!
|
|
#10
|
|||
|
|||
|
Quote:
David p.s. I was a wreck on the inside at our QT last weekend. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calibration | Nik Bhatt | Robot Game Strategy | 8 | 11-01-2011 09:55 PM |