Go to Post Volunteers are in short supply and we always need more. - Koko Ed [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
  #16   Spotlight this post!  
Unread 18-01-2007, 13:25
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: Slow down teh motors!

Quote:
Originally Posted by Alan Anderson View Post
Joey probably has it right. The pwm values are unsigned char, and it's likely that the compiler isn't accounting for the possibility of underflow when subtracting 127. If your joystick puts out 125, the result wraps around to 254, which gets divided down to 127 and shifted back up to 254 by the final addition. Forward control on the joystick will work okay, but the slightest backward movement will cause the robot to go full speed forward. Using 1-stick control, barely moving the joystick to either side will make it circle madly in the opposite direction.

Adding the cast to (int) will force the compiler to deal properly with the signed values, and everything should be okay.
Thanks for the support. I seem to remember smashing a mentor into the tool cabinet a couple years back because any input value less than 127 would send the output to 0, and thus sent the robot into full reverse as soon as I touched the joystick. I'm pretty sure that was the quick-and-dirty way of fixing it. Good luck, brennerator.
__________________
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

_
  #17   Spotlight this post!  
Unread 18-01-2007, 13:27
bcieslak
 
Posts: n/a
Re: Slow down teh motors!

We tried the same thing with the same results last year...

Thats when we learned why the FIRST code always added 2000 calucations then subtracted it from the final result in their mix limit. It prevented sign and overflow issues.

Another project for you to consider is to ramp the motor commands to the new speed when your driver slams the stick from one direction to the other.(or pushed the button). With 26 Ms between pwm updates your motor could be commanded to go full forward at one update and then full backwards at the next up date. Your poor drive train won't last to long doing that.

Good Luck
BC
  #18   Spotlight this post!  
Unread 18-01-2007, 13:41
Bob22341 Bob22341 is offline
Registered User
FRC #1870
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Alberta
Posts: 48
Bob22341 will become famous soon enough
Re: Slow down teh motors!

I did this a couple of days ago. here's the jist of it:

if (buttonpressed)
motorspeed = transmission
else
motorspeed = joystickinput


transmission(){
speed -= 127;
speed /= divider;
speed +=127;
}

p.s. you'll have to modify this to make it work with your robot, but this should help you. Also, in binary, division is better than multiplication for using the transmission.

{edit}
you can have the motors running through the transmission normally, and have when the buttonpressed equals transmission bypass. Have fun playing around with it.
{/edit}

Last edited by Bob22341 : 18-01-2007 at 13:43.
  #19   Spotlight this post!  
Unread 18-01-2007, 14:35
Ted Weisse's Avatar
Ted Weisse Ted Weisse is offline
Registered User
AKA: xMentor/Inspector/Referee
no team
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Green Bay, WI
Posts: 106
Ted Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of light
Re: Slow down teh motors!

A dead zone is a very good idea for your input controls. If you establish this zone in the input from 125-129 on each input it helps, keeps from jerking the drive back and forth. Test if the input is in the zone and if true set the value to 127, if not then the input value would be used as Full_Speed. Now set scaled values for speeds such as ½ by using the value of Full_Speed. Therefore: Half_Speed = 127 - ( 127 - Full_Speed ) / 2. You would need to do this for each side/motor. If you wanted ¼ speed just divide by 4 instead of 2 and so on. Now test for the inputs of the triggers and set the output to the desired value either the Full_Speed or Half_Speed results. This has been tested and works, hope it helps. Remember you can test for either trigger or even both to form an “AND” so you can have multiple speeds.
__________________
If I am not for myself, who will be for me?
If I am not for others, what am I?
And if not now, when?

-Rabbi Hillel
Jewish scholar & theologian (30 BC - 9 AD)

Last edited by Ted Weisse : 18-01-2007 at 21:28. Reason: edit signature
  #20   Spotlight this post!  
Unread 18-01-2007, 21:36
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Slow down teh motors!

If using the Vector 884 speed controllers, these already have a built-in deadband from 117-137.

http://www.ifirobotics.com/victor-88...r-robots.shtml
  #21   Spotlight this post!  
Unread 18-01-2007, 21:41
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Re: Slow down teh motors!

Here's a quick and simple way of reducing speed, by any factor you like (ex, 2, 3, 4, etc. Non whole numbers make the RC unhappy, it dosen't like fractions)

_NEW_VALUE_=127+((_INPUT_SPEED_-127)/_FACTOR_);

Simply replace the bold words with your variables.
__________________
Jimmy Cao

Team 469 2006-2010 Student/Alumni
Team 830 2011-2012 Mentor
  #22   Spotlight this post!  
Unread 18-01-2007, 23:30
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: Slow down teh motors!

Thanks all!

Joey's fix worked perfectly
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
Cheapest and easiest way to slow down a motor sanddrag Technical Discussion 41 21-12-2005 07:26
Slowing Down Drive Motors Arc736UV Programming 5 24-01-2005 22:35
How slow is too slow? Joe Ross Rules/Strategy 23 12-10-2004 20:23
Gearing down motors MechaJag Motors 11 17-01-2004 02:27
teh funnah Zeinin Chit-Chat 1 15-04-2002 15:02


All times are GMT -5. The time now is 13:35.

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