Go to Post We want people to exercise Gracious Professionalism® and play at their best, but also not really because we find this archaic rule to satisfy something related to inspiring students to pursue careers in science and technology.™ - PayneTrain [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 12-02-2005, 17:50
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
speed controller max speed

we were testing our robot and we realized that the mototrs are way to sensitive. how do we make the max speed on the speed controllers from 255 to around 200. what is the code for that. whenever we use the triggers the robots moves and we dont want that. HELP!!!! thanks.
  #2   Spotlight this post!  
Unread 12-02-2005, 18:53
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

any help plz. i kind of need the answer as quick as possible
  #3   Spotlight this post!  
Unread 12-02-2005, 18:57
whakojacko's Avatar
whakojacko whakojacko is offline
Registered User
FRC #1072 (hrt)
Team Role: College Student
 
Join Date: Feb 2003
Rookie Year: 2003
Location: San Jose, California
Posts: 137
whakojacko is on a distinguished road
Send a message via AIM to whakojacko Send a message via MSN to whakojacko
Re: speed controller max speed

yay for fellow San Jose Team. What you need to do is add a limit to the pwm values that are being sent to the speed controllers.
For instance
(insert x for the pwm number)

if(pwmX >= 200)
{
pwmX=200;
}

or

pwmX= pwmX >=200 ? 200 : pwmX;

We also added a dead band where any value +30 or the middle 127 on the joystick will not make the motors move since the joysticks are so sensitive
__________________
Harker Robotics:1072
http://www.harker-robotics.org
  #4   Spotlight this post!  
Unread 12-02-2005, 18:59
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

You could one of three basic things:
You could use a formula to squish things in, which may take longer, but consume less space
or you could use a lookup table, which would take less time, but consume more space.
Or you could just cut everything off after 200, which is small and takes little time.
Here is a an example fomula one:
Code:
unsigned int Limit(unsigned int pwmin)
{
unsigned int tmppwm = 0;
tmppwm = (unsigned int)(((pwmin-127)*72)/127) + 127);
return (tmppwm+127);
}
__________________
- from B B frank


Last edited by AIBob : 12-02-2005 at 19:06. Reason: typo
  #5   Spotlight this post!  
Unread 13-02-2005, 12:48
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

how do u set the dead band because the joysticks are really sensitive? thanks for your help
  #6   Spotlight this post!  
Unread 13-02-2005, 12:54
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

Quote:
Originally Posted by Team 668
how do u set the dead band because the joysticks are really sensitive? thanks for your help
I think this is what you mean:
Code:
unsigned int DeadLimit(unsigned int pwmin)
{
if(((pwmin-127) && 0x7F) >15 ) return pwmin;
else return 127;
}
Which would make anything from 112 to 142 all to 127.
__________________
- from B B frank

  #7   Spotlight this post!  
Unread 13-02-2005, 13:04
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

it comes up with an error on the line that has the " { " on it
  #8   Spotlight this post!  
Unread 13-02-2005, 13:06
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

Quote:
Originally Posted by Team 668
it comes up with an error on the line that has the " { " on it
What does the error say?
__________________
- from B B frank

  #9   Spotlight this post!  
Unread 13-02-2005, 13:11
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

error: syntax eror c:233. it says it when i compile it. on line 233 is the " { " after:

unsigned int deadlimit (unsigned int pwmin)
{ <--- that is where the error is
  #10   Spotlight this post!  
Unread 13-02-2005, 13:22
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

It might be because you left a bracket open from another peice of code earlier in the code..

If that is not the problem... it might be that you did not define
"unsigned int DeadLimit(unsigned int pwmin);" in an h file for referring to it in anotehr piece of code.
__________________
- from B B frank

  #11   Spotlight this post!  
Unread 13-02-2005, 13:23
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

nvm that i figured it out but now it says pwmin has not been defined. do i just do #define or do io have to define it a different wway. thanks a lot for your help.
  #12   Spotlight this post!  
Unread 13-02-2005, 13:25
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

Quote:
Originally Posted by Team 668
nvm that i figured it out but now it says pwmin has not been defined. do i just do #define or do io have to define it a different wway. thanks a lot for your help.
no you do not need to use a define....
you should just call it as a function like so:
Code:
pwm01 = deadlimit(pwm01);
or something like that...

The pwmin is defined by the function...
be sure that you define:
"unsigned int DeadLimit(unsigned int pwmin);"
inside of an h file that you have included in it.
__________________
- from B B frank


Last edited by AIBob : 13-02-2005 at 13:28.
  #13   Spotlight this post!  
Unread 13-02-2005, 13:38
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

Quote:
Originally Posted by AIBob
no you do not need to use a define....
you should just call it as a function like so:
Code:
pwm01 = deadlimit(pwm01);
or something like that...

The pwmin is defined by the function...
be sure that you define:
"unsigned int DeadLimit(unsigned int pwmin);"
inside of an h file that you have included in it.
so i should add unsigned int deadlimit ..... into and h file and then the

"{
if (((pwm-127) && 0x7f >15) return pwmin
else return 127;
}"

into user_routines.c. where do i put the pwm01 = deadlimit(pwm01)?
  #14   Spotlight this post!  
Unread 13-02-2005, 13:41
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

im really confused right now. so if you could right it out in a post that would be really appreciated.
  #15   Spotlight this post!  
Unread 13-02-2005, 13:57
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
Re: speed controller max speed

is there an easier way to do this because it to compile but then when it gets to the 3rd stage it says : could not find definition of symbol deadlimit in file user_routines.o
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
Speed controllers won't communicate w/robot controller steven114 Control System 12 03-02-2005 21:26
How to make a max speed Team 668 Programming 3 02-02-2005 17:54
PID control loops - closed loop feedback KenWittlief Technical Discussion 56 26-04-2004 21:27
not quite sure...speed controller...spike. tophq Programming 8 26-03-2004 13:43
making speed controller digital CharlieWilken Electrical 4 01-03-2002 20:15


All times are GMT -5. The time now is 17:58.

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