Go to Post Great things don't just happen to HoF teams; HoF teams make great things happen. - Siri [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-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 05-02-2005, 00:54
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Absolute Positioning System Help

I am in the process of creating a robot absolute positioning system, such as stangPS, and was wondering if any teams or programmers could help me with a few concepts.

I am keeping track of robot x and y values (relative to the origin at bottom left of field, field would be quadrant 1 on a Cartesian plane) in integer variables, and trying to keep track of the robots 2d position. I understand how I can increment these value by keeping track of distance traveled with shaft encoders and a yaw gyro. But, my theory only works with straight line movement. Heres why:

When the robot moves straight from its starting position, I could increase the x variable with the distance traveled. Then if I turn and drive a distance I could find the y and x value of change by taking the sin and cosine of the angle I turned, multiplied by the distance of that line traveled (hypotenuse of a right triangle).

But, I am totally stuck on how to code this for arcing robot movement. The robot does not always travel in a linear fashion, and I am not sure how to compensate for this.

Has anyone ever used the same method as I am, and know what to do to solve my problem?
  #2   Spotlight this post!  
Unread 05-02-2005, 01:02
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: Absolute Positioning System Help

I've worked with a similar positioning system.
I haven't worked in a situation where a robot arcs, but I have an idea about how you might approach the problem. If you think about it, in 26.2 ms, your robot won't really make that much of an arc. In that time frame, you can assume that your robot has moved in a straight path.

If you take the initial heading (angle) of your robot and the final heading of the robot (before/after 26.2 ms), and take an average, you should get the approximate heading of what the robot is traveling on. I'm not quite sure, but I have a suspicion that this will (along with all the other trig i'm sure you'll figure out) generate pretty accurate results about how much x and y distance you have covered.

And of course, there are better ways to "average" the heading of the robot, by sampling the gyro many times (interrupt) and taking a more significant average.
__________________
Code Red Team 639 Winners of the 2005 FingerLakes Regional with 191 and 494.
--
http://pset.deu83.com << my baby
http://www.setgame.com/set/ << it's mother
  #3   Spotlight this post!  
Unread 05-02-2005, 08:25
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Absolute Positioning System Help

probizzle is correct, except for two things. I think the gyro does not output changes fast enough to sample more than 26.2ms, or even that fast. The other thing is that averaging to find the values for integration may be overkill. It may just be possible to use the first or last value for the interval and still be accurate enough.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #4   Spotlight this post!  
Unread 05-02-2005, 09:10
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Absolute Positioning System Help

We've been doing this for a couple of years with good results. As others have said already, all you really need to do is for each loop, read your delta from the encoder wheel and read the most recent angle measured from your gyro and just pretend that you travelled in a straight line since the last time you did the calculation. This happens so fast that you end up approximating the arc with a series of very small straight lines which works well enough for what you're trying to do.

How many encoders are you using? You only need 1 when you use the gyro with it. If you're using more than one you might just be doing unnecessary calculations.
  #5   Spotlight this post!  
Unread 05-02-2005, 09:12
ZZII 527's Avatar
ZZII 527 ZZII 527 is offline
"Scale Electric Vehicle"
AKA: Shane Colton
FRC #0097
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Cambridge, MA
Posts: 366
ZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond repute
Send a message via AIM to ZZII 527
Re: Absolute Positioning System Help

The encoders are giving you a nice actual value of position(like an accelerometer that's already integrated twice, in a way), so those won't have this problem.

The gyro is giving you a rate, though, which is where the problem you are describing occurs. Enter Euler's Method: given rate data at every point and a starting position, you can approximate a solution by using very small straight lines, as everyone else has mentioned. The 26.2 ms loop assures that the step size will be very small. Even if you have one of the gyros that can measure 150 degrees/sec (the BEI one from two years ago is 75 degrees/second I think), 150 degrees/second * 0.026 second/loop = 4 degrees/loop before your gyro reaches its limit and the data is useless anyway. So for any given loop, you can assume the robot has not deviated from a straight path by more than 4 degrees, a pretty good approximation.

If you are looking for more accuracy, you can average two rates as probizzle suggested. Through some mathematical property which I can't explain, error in these numerical integration methods is approximately proportional the step size raised to the power of the number of slopes sampled per step. So if you have a small step size and you sample two slopes, you will have a very accurate approximation.

For the purposes of FIRST, you are more likely to have error due to not being in the exact starting position or getting bumped by another robot and sending the gyro above its yaw rate limit, so averaging slopes may be unneccesary. However, it doesn't eat computing time and it's a cool project anyway. Have you thought about adding an accelerometer to get position data that isn't dependent on the wheels not slipping (but does have the disadvantage of having an acceleration limit of something like 1.5g, which can be easily broken by running into something)?
__________________
MIT Mechanical Engineering
>> College Mentor, Team 97: Cambridge Rindge and Latin School with The Edgerton Center, MIT Mechanical Engineering, Bluefin Robotics, and Draper Laboratory
>> Alumnus, Team 527: Plainedge HS

Last edited by ZZII 527 : 05-02-2005 at 09:21.
  #6   Spotlight this post!  
Unread 05-02-2005, 10:32
gc02 gc02 is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Anaheim CA
Posts: 28
gc02 is on a distinguished road
Re: Absolute Positioning System Help

Quote:
Originally Posted by Tom Bottiglieri
I am in the process of creating a robot absolute positioning system, such as stangPS, and was wondering if any teams or programmers could help me with a few concepts.

I am keeping track of robot x and y values (relative to the origin at bottom left of field, field would be quadrant 1 on a Cartesian plane) in integer variables, and trying to keep track of the robots 2d position. I understand how I can increment these value by keeping track of distance traveled with shaft encoders and a yaw gyro. But, my theory only works with straight line movement. Heres why:

When the robot moves straight from its starting position, I could increase the x variable with the distance traveled. Then if I turn and drive a distance I could find the y and x value of change by taking the sin and cosine of the angle I turned, multiplied by the distance of that line traveled (hypotenuse of a right triangle).

But, I am totally stuck on how to code this for arcing robot movement. The robot does not always travel in a linear fashion, and I am not sure how to compensate for this.

Has anyone ever used the same method as I am, and know what to do to solve my problem?
Here's a couple of articles on dead reckoning with differential drive.
http://rossum.sourceforge.net/papers...DiffSteer.html
http://www.seattlerobotics.org/encod...g_article.html
__________________
Greg
Enigma Industries
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
White Paper Discuss: Code and Walkthrough for Global Positioning System using IR Sensors CD47-Bot Extra Discussion 2 20-05-2004 21:22
What do you wish you knew about the new control system? Joe Ross Control System 2 09-01-2004 21:47
positioning system srjjs Technical Discussion 5 05-04-2003 14:49
control system worth more than $500 archiver 2001 8 24-06-2002 02:00
New Innovation FIRST control system and the dashboard archiver 2000 0 23-06-2002 22:15


All times are GMT -5. The time now is 19:16.

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


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