FIRST Forums  

Go Back   FIRST Forums > General Discussions > FIRST Programs > FIRST LEGO League > The Challenge > Programming

Reply
 
Thread Tools
  #1  
Old 12-08-2011, 09:39 PM
jemorris80 jemorris80 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 21
Default Ultrasonic Calibration?

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
Reply With Quote
  #2  
Old 12-08-2011, 10:53 PM
Dean Hystad Dean Hystad is offline
Senior Member
 
Join Date: Sep 2008
Location: Minnesota
Posts: 1,700
Default Re: Ultrasonic Calibration?

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?
Reply With Quote
  #3  
Old 12-09-2011, 07:17 AM
jemorris80 jemorris80 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 21
Default Re: Ultrasonic Calibration?

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.
Reply With Quote
  #4  
Old 12-09-2011, 07:57 AM
timdavid timdavid is offline
Senior Member
 
Join Date: Sep 2009
Location: Minnesota
Posts: 881
Default Re: Ultrasonic Calibration?

Quote:
Originally Posted by jemorris80 View Post
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
That's a valid task for the ultrasonic sensor. Our team used the sensor to wall follow last year along the south wall. We were trying to wall follow at a distance of about 7 to 8 cm, which is very close to the minimum valid distance the sensor will read. If you are trying to following between 11 and 12 cm, that should be OK.

Things that I remember that the kids found out include
  • position of the sensor is important. You want the sensor to be positioned at least a little forward of the driver wheels.
  • The robot should start the wall follow fairly close to the desired distance you want the robot to be from the wall
  • The robot should start the wall follow roughly parallel to the wall
  • Proportional algorithms work fairly well

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
Reply With Quote
  #5  
Old 12-09-2011, 10:24 AM
jemorris80 jemorris80 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 21
Default Re: Ultrasonic Calibration?

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!
Reply With Quote
  #6  
Old 12-09-2011, 10:44 AM
timdavid timdavid is offline
Senior Member
 
Join Date: Sep 2009
Location: Minnesota
Posts: 881
Default Re: Ultrasonic Calibration?

Quote:
Originally Posted by jemorris80 View Post
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!
Glad to hear it's working. Sounds like you're on the right track.

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!
Reply With Quote
  #7  
Old 12-09-2011, 01:52 PM
jemorris80 jemorris80 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 21
Default Re: Ultrasonic Calibration?

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
Reply With Quote
  #8  
Old 12-09-2011, 02:04 PM
Dean Hystad Dean Hystad is offline
Senior Member
 
Join Date: Sep 2008
Location: Minnesota
Posts: 1,700
Default Re: Ultrasonic Calibration?

Quote:
Originally Posted by jemorris80 View Post
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
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.
Reply With Quote
  #9  
Old 12-09-2011, 04:47 PM
dnb dnb is offline
Senior Member
 
Join Date: Nov 2009
Location: Massachusetts
Posts: 169
Default Re: Ultrasonic Calibration?

Quote:
Originally Posted by jemorris80 View Post
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.
Good luck!
Reply With Quote
  #10  
Old 12-09-2011, 07:34 PM
henkemeyer henkemeyer is offline
Junior Member
 
Join Date: Sep 2009
Posts: 24
Default Re: Ultrasonic Calibration?

Quote:
Originally Posted by jemorris80 View Post
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
Good luck from here, as well. Being nervous means you've put a lot of work into the season. Thank you for doing what you do!

David

p.s. I was a wreck on the inside at our QT last weekend.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibration Nik Bhatt Robot Game Strategy 8 11-01-2011 09:55 PM


All times are GMT -4. The time now is 09:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.