OCCRA
Go to Post No one would climb Mount Everest before climbing the hill in the park down the street. - RbtGal1351 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-25-2012, 08:04 PM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: Programmer
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 194
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Measuring Distance With Sensors

Ok so every year (for ~12 yrs now) my team has always done "dead-reckoning" Autonomous, but as programmer I am determined to use some sensors. (Last yr was 1st year to get the camera display).

Recently I managed to get the gyro to work and have the robot travel in a straight line down a long hallway. Now I would like to measure the distance of the robot moving, What would be best for this? (Accelerometer, my mentor suggested Hall Effect Sensors with a magnet mounted on the wheel, or different kind of encoder).
__________________
FRC Team 539
Member Length: 2010 Breakaway - Present

Programed using C++ since 2011 Off-season
  #2   Spotlight this post!  
Unread 02-25-2012, 08:15 PM
Grim Tuesday's Avatar
Grim Tuesday Grim Tuesday is offline
Registered User
AKA: Simon Bohn
FRC #0639 (Code Red)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Baltimore MD (JHU)
Posts: 1,576
Grim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond reputeGrim Tuesday has a reputation beyond repute
Re: Measuring Distance With Sensors

Many teams (we do) use optical encoders. If you use a standard gearbox (toughbox, supershifters, etc), there is an output shaft on those that fit these. They can measure speed and distance, as well as let you set up a PID loop.
__________________

-Buckeye Regional Champion 2013, 2014
-Newton Division Finalists 2012 thanks to 68 and 330
  #3   Spotlight this post!  
Unread 02-25-2012, 09:16 PM
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Feeling Honorable
FRC #1676 (Pascack PI Oneers)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Montvale NJ
Posts: 6,510
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Measuring Distance With Sensors

To measure distance traveled, a topic known as odometry, one would normally use a sensor that measures how many turns one or more wheels have made.

An optical encoder was included in the KoP for this, you mount a small wheel to a 1/4" shaft and it delivers something like 250 360 pulses per revolution. Since it has two signals you can also tell whether the wheel is traveling forward or backward. There are other ways to sense rotation, but most teams use the optical encoders supplied.

Naturally the accuracy of such a system depends on many factors, most important a relative lack of slippage between the wheel and the surface on which it travels. If you anticipate significant slippage, an unpowered 'fifth' wheel can be used (google it)

Wiring up the sensor is not difficult - power, ground, signal A and signal B. We wire up power and Signal A to one digital I/O on the sidecar, and ground and signal B to another digital I/O. I'm not a programmer, but I believe there are routines in every language for handlingt his data stream. They're a bit finicky (as judged by the number of CD posts asking for help) so use care to ensure it works first time.

Good luck, you are on the right track away from dead reckoning.
__________________

I am N2IRZ - What's your callsign?

Last edited by DonRotolo : 02-26-2012 at 11:42 AM. Reason: Thanks sljin for the correction
  #4   Spotlight this post!  
Unread 02-25-2012, 09:38 PM
slijin's Avatar
slijin slijin is offline
Pockets
AKA: Samuel Lijin
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York City
Posts: 537
slijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to behold
Re: Measuring Distance With Sensors

Quote:
Originally Posted by DonRotolo View Post
An optical encoder was included in the KoP for this, you mount a small wheel to a 1/4" shaft and it delivers something like 250 pulses per revolution.
For reference, the included encoder is the USDigital E4P encoder, with a 360CPR wheel. In 2009, the included wheel was 250CPR.
__________________

2010-12 CT Chairman's
2011 Galileo 5th seed
2010 NY Regional Winners
  #5   Spotlight this post!  
Unread 02-25-2012, 09:56 PM
ianonavy ianonavy is offline
Programming Mentor/Alumnus
AKA: Ian Adam Naval
FRC #3120 (RoboKnights)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Sherman Oaks
Posts: 32
ianonavy is an unknown quantity at this point
Re: Measuring Distance With Sensors

Note that while optical encoders are great for distance, they are limited by the fact that they only measure how much the wheel has rotated. If your wheels lose traction with the ground, they will NOT accurately measure the position of the robot. This can happen, for example, on the bridge.
  #6   Spotlight this post!  
Unread 02-26-2012, 10:03 PM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: Programmer
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 194
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Measuring Distance With Sensors

Thanks for the info. That should work on the competition drive train, but for a programming class I am helping with the bot has 2 Banebots as direct drive motors (it is a much smaller bot).

So any ideas for this?
__________________
FRC Team 539
Member Length: 2010 Breakaway - Present

Programed using C++ since 2011 Off-season
  #7   Spotlight this post!  
Unread 02-26-2012, 10:29 PM
Michael Hill's Avatar
Michael Hill Michael Hill is online now
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,030
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Measuring Distance With Sensors

There are quite a few options. I don't think I've seen a team that's done it (but I don't know how you COULD see a team do this), but if you want to take into account slippage, you could attach a >= 2-axis accelerometer as well as an encoder. You will notice the behavior of slippage in an accelerometer (or the lack thereof behavior). You can use that information as a sanity check for your encoder. If you see your encoder moving and you know you should be accelerating but don't see it in your accelerometer, then you know you're slipping. As mentioned before, an unpowered 5th (and 6th) wheel would work just as well.

I think there are also options for the ultrasonic sensor.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:43 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi