Go to Post You know you're overdosed on FIRST when you see the thread titled "team 228 can and bottle drive" and think "what kind of crazy drivetrain is that?" - Joe G. [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 20-02-2006, 21:22
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Preventing drift

anyone having problems with the robot drifting severely ? probably due to different chain tensions or something... how do you prevent this...

i am running watsons PID code on each wheel but it doesn't really work fast enough to cause the robot to go straight?
Gyro perhaps?
or do you just ask the mechanical team to tension the freakin' wheels
__________________
Team 701
  #2   Spotlight this post!  
Unread 20-02-2006, 21:31
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Preventing drift

You can run both sides 2/3'rds full speed, and then record the speed of the left and right wheels. get the ratio of the two speeds, and use it to constantly descrease the output of the faster wheel.

For example, lets say the output of the right side is always about 80% of the left side when they are both commanded to the same speed. You'd then always scale the left side's output by 4/5'ths.

That's a rough scaling that teams did back in the days of the drill motors, and their winding bias. You said you are running some PID code, so that should account for the errors you didn't catch.

And again with that PID. If its not responding fast enough, then perhaps that's because you haven't limited the magnitude of the error before tuning? If you are using the PID to control velocity, then limiting the error may not do much good (you are already limited by the max speed of the robot).
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #3   Spotlight this post!  
Unread 20-02-2006, 22:14
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Preventing drift

You could over-complicate things and mount encoders on each side.

Or you could record each side's RPMs and do

Faster Side RPM / Slower Side RPM

Multiply that value by the speed you would normally output to the faster motor and you are done. This theoretically will vary with battery voltage and the like, but it comes to the point where it is not noticable.

Sample code:
Code:
#define SPEED_COMP .95 // This is Faster Side RPM / Slower Side RPM

// Assuming your left side is faster
RIGHT_SIDE = p1_y;
LEFT_SIDE = p2_y * SPEED_COMP;
KISS.

EDIT: Happy 700th post to me =)
__________________
http://www.mikesorrenti.com/
  #4   Spotlight this post!  
Unread 20-02-2006, 23:48
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Preventing drift

we already have encoders mounted on both sides,
it should be fairly easy to do what you have described (measure RPM differences) , only thing i'm worried is that it is a non-linear change and simply putting a ratio of one wheel to the other may not work in all situations but I'm sure I can come up with some kind of simple algorithm based on 2-3 data points or someting.

For PID i am actually not doing velocity on each wheel, what I'm doing is just positional both wheels are to come to a target distance of 1000 encoder clicks.
what bugs me is that the drift is only when i drive forward and not backwards ! (?!)

EDIT: We are only running PID during autonomous, during regular driving drift is not a problem because our driver can compensate (its not bad in that the robot drives a half circle or anything, but enough that over 10 ft it goes 3 ft to the right during autonomous)
__________________
Team 701

Last edited by Salik Syed : 20-02-2006 at 23:51.
  #5   Spotlight this post!  
Unread 21-02-2006, 00:08
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Preventing drift

Quote:
Originally Posted by Salik Syed
we already have encoders mounted on both sides,
it should be fairly easy to do what you have described (measure RPM differences) , only thing i'm worried is that it is a non-linear change and simply putting a ratio of one wheel to the other may not work in all situations but I'm sure I can come up with some kind of simple algorithm based on 2-3 data points or someting.

For PID i am actually not doing velocity on each wheel, what I'm doing is just positional both wheels are to come to a target distance of 1000 encoder clicks.
what bugs me is that the drift is only when i drive forward and not backwards ! (?!)

EDIT: We are only running PID during autonomous, during regular driving drift is not a problem because our driver can compensate (its not bad in that the robot drives a half circle or anything, but enough that over 10 ft it goes 3 ft to the right during autonomous)
I think that that with a simple system that I described, you would maybe accumulate at most... 5 inches of drift error. This depends on the accuracy of your RPM measurements.

Another level of complexity is another point at which your programming could not work.
__________________
http://www.mikesorrenti.com/
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
Yaw Rate Sensor Drift? phrontist Control System 13 19-08-2004 10:55
Preventing motor burnout Jim Harbison Motors 1 10-01-2003 23:05


All times are GMT -5. The time now is 01:37.

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