Go to Post Dean Kamen is my Shaquille O'niel (or any other generic sports star). - Daniel Brim [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 25-01-2008, 18:28
AHepperla's Avatar
AHepperla AHepperla is offline
Oh yeah, you know it...
AKA: Wheels
FRC #2202 (B'East Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Brookfield
Posts: 8
AHepperla is an unknown quantity at this point
Motor Speed

Hey guys, I was just wondering why, when we set the same PWM values to two different motors, why the motors are going two different speeds? Anyone know how to fix this through calibration or something???
  #2   Spotlight this post!  
Unread 25-01-2008, 18:43
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
Re: Motor Speed

It's because you've got one motor mounted backwards, and the motors actually have a preferential direction. If you have encoders on your drive shafts, we have some code we're working on right now that will make it drive straight.

I'm sure someone else will have some code up before I will, but if you send me an email to remind me I'll put it up by monday.

P.S. I'm literally working on it RIGHT now ... final touches ... (which means nothing, of course)
__________________
What place are we at? ... TODAI!
  #3   Spotlight this post!  
Unread 25-01-2008, 19:11
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Motor Speed

also, manufacturing isn't perfect. we had this problem last year. what happens is 255 to one motor might only act like 230 (exaggeration) on another. one wyay to fix this is to individually slow down each motor to calibrate them:

pwmXX-=127;
pwmXX*=0.9 //for 90% power
pwmXX+=127;


the other (and preferred) way is to use sensors like (ideally) encoders, but you could use a gyro to make it go straight, or, dare i say it, gear tooth sensors as encoders (it only requires a slight modification to kevin's encoder code). the only problem is that GTS's have to be almost touching the gear to get a reading, and thereadings are usually pretty sketchy.

good luck!
__________________


  #4   Spotlight this post!  
Unread 25-01-2008, 20:02
AHepperla's Avatar
AHepperla AHepperla is offline
Oh yeah, you know it...
AKA: Wheels
FRC #2202 (B'East Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Brookfield
Posts: 8
AHepperla is an unknown quantity at this point
Re: Motor Speed

Thanks for the help. Just wondering what kind of encoders you use/what kind do you recommend? Thanks again!
  #5   Spotlight this post!  
Unread 25-01-2008, 20:11
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Motor Speed

as far as what kind of encoders, i'm not too sure. just do a search on these forums for encoders, and you'll find more than you need
__________________


  #6   Spotlight this post!  
Unread 25-01-2008, 21:31
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,534
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Motor Speed

Use any type of encoder, but use the same one for both wheels.

It should be this simple, though I haven't done it yet (that's for tomorrow if we have a rolling chassis).

right_encoder = Get_Encoder(1);
left_encoder = Get_Encoder(2);

difference = right_encoder - left_encoder;

if (p1_y < (p2_y + 15)) && (p1_y > (p2_y - 15)) //If they're within 15 of eachtoher
{
right_drive = p1_y - difference * constant; //adjust based on difference of encoders
left_drive = p2_y + difference * constant; //adjust based on difference of encoders
}
else
{
right_drive = p1_y;
left_drive = p2_y;
}
Adjust constant until you go straight. This is essentially a PID loop based on the encoder difference. This assumes a tank drive system, but the same concept is applicable to other drive systems.
  #7   Spotlight this post!  
Unread 25-01-2008, 21:39
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Motor Speed

Quote:
Originally Posted by AHepperla View Post
Hey guys, I was just wondering why, when we set the same PWM values to two different motors, why the motors are going two different speeds? Anyone know how to fix this through calibration or something???
Calibrating the victors would not hurt. Instructions are here. Either calibrate both Victors or reset them both to Factory default (your choice).

Also, I use US Digital encoders. Other people have mentioned Banebots and Grayhill.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
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
Controlling motor speed WGRAY Programming 9 16-02-2009 22:50
Motor speed HellBoy Programming 2 05-02-2007 10:41
Multi-Speed motor Questions Burg Robotics Education and Curriculum 2 23-12-2004 15:54
Drill Motor Speed Difference Mark Jones Motors 2 14-02-2003 15:23
Drill motor true speed? archiver 2001 0 23-06-2002 23:58


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

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