Go to Post How we respect the rules of the game is a reflection of our character and integrity - win, lose, or draw - JaneYoung [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 24-01-2005, 17:57
Arc736UV Arc736UV is offline
Registered User
#1611
 
Join Date: Jan 2005
Location: Savannah
Posts: 2
Arc736UV is an unknown quantity at this point
Slowing Down Drive Motors

This is team 1611 "rookies" having a little trouble with the single joystick method of control.When a direction is used the motors "jump" to an almost to fast speed but still allows for a top speed with gradual acceleration, the problem is trying to get rid of this "jump" through programming.Iv'e allready lowered the speed_setting to its lowest of 127 any suggestions?
  #2   Spotlight this post!  
Unread 24-01-2005, 18:53
Cory's Avatar
Cory Cory is offline
Registered User
AKA: Cory McBride
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: May 2002
Rookie Year: 2001
Location: Redwood City, CA
Posts: 6,815
Cory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond repute
Send a message via AIM to Cory
Re: Slowing Down Drive Motors

Our programmers used something they referred to as a "drivemap" to scale the accelleration gradually. I have no idea how to do such a thing, but from my understanding it was some sort of table of values that they came up with
__________________
2001-2004: Team 100
2006-Present: Team 254
  #3   Spotlight this post!  
Unread 24-01-2005, 20:40
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Re: Slowing Down Drive Motors

Quote:
Originally Posted by Cory
Our programmers used something they referred to as a "drivemap" to scale the accelleration gradually. I have no idea how to do such a thing, but from my understanding it was some sort of table of values that they came up with
Sounds like a lookup chart, rather than coming up with an equation to follow, and nasty FLOPS to do, you have a value for you x-axis that corresponds with a number that you add or subtract from the Y-axis value. Lets you change it to make it more or less linear. Basically you are substituting memory for processor time. Not sure how to implement this in a simple manner though.
  #4   Spotlight this post!  
Unread 24-01-2005, 21:30
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Slowing Down Drive Motors

Quote:
Originally Posted by ConKbot of Doom
Sounds like a lookup chart.
Exactly!

Although it could theoretically do it, the PIC in the RC isn’t exactly up for exponential equations.

What we have done every year is a lookup table... it takes more effort then writing an equation; you need to come up with a chart with 127 (or 256, depending on how you write your code) like this made up example:

Code:
int speed[] =  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,8,9,10,11,12,13,14,15,17,19,21,24....
etc... i will try to find the exact code out of an old bot. the idea is that when you get the joystick value, you just take:
Code:
p1_y = speed[p1_y];
its that easy!

this also gives you a chance to tweak your robots response time and "aggressiveness"

best of luck -- jsd
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
  #5   Spotlight this post!  
Unread 24-01-2005, 22:01
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Slowing Down Drive Motors

Instantiate two ints named temp15 and temp16. After the limit mixing functions have run, do this:
Code:
temp15=(int)pwm15-127;
temp16=(int)pwm16-127;
pwm15=(int)(.007874*pow(temp15,3)/fabs(temp15)+127);
pwm16=(int)(.007874*pow(temp16,3)/fabs(temp16)+127);
My real code is structured a little differently, but it works the same. 0 still outputs 0. 127 still outputs 127. 254 still outputs 254. Everything else in between is much less touchy, and it gives the driver a lot more control. It's also much simpler than making a lookup table, and won't eat up all your memory. (Yes, this is how I actually code. No, nobody else can ever figure out what I'm doing.)
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #6   Spotlight this post!  
Unread 24-01-2005, 22:35
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Slowing Down Drive Motors

http://www.chiefdelphi.com/forums/sh...ad.php?t=24613

That should answer it.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
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
2 drive motors VS 4 drive motors Conor Ryan Motors 9 19-01-2005 22:35
What motors do you use to drive your robot? _GP_ General Forum 25 25-01-2004 21:14
How many motors are you using to drive? Joseph F Motors 18 16-10-2002 21:24
Looking for practice motors & extra tape drive parts? archiver 2000 1 23-06-2002 22:54
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32


All times are GMT -5. The time now is 18:49.

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