Go to Post In my line of work, we affectionately refer to this approach as "Seagull Engineering". Why? Because we swoop in, flap around making a lot of noise and commotion, leave a big mess of "stuff" behind and then fly off. - billbo911 [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 13-01-2007, 14:06
Brad Voracek Brad Voracek is offline
.999~=1
FRC #0399 (Eagle Robotics)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lancaster, CA (SoCal)
Posts: 328
Brad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of light
Send a message via AIM to Brad Voracek
Dampening function for driving.

Our driver this year wants a kind of "transmission" in the programming, where if he has a switch up the speed is halfed(or any other number I suppose) for both motors. Or if it's down it drives normally. I have the function all set for the switch and everything, what's throwing me off is trying to half the motor speed in arcade drive. I have the entire thing done in tank drive, with the switch "transmission" and everything, the problem is in arcade drive... It's driving me crazy trying to think about it and any help would be appreciated. Thanks.

~Brad.
  #2   Spotlight this post!  
Unread 13-01-2007, 14:12
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: Dampening function for driving.

In general, a good way to alter an output by a constant factor is:
Code:
pwm01 = (pwm01-127)*0.5+127
This will give you half the magnitude of your original output... change the 0.5 to taste. (Also, be careful, and pretend that this is pseudo-code. Because PWM values are stored as unsigned chars, you may get some interested errors with casting when you go in reverse. Maybe cast pwm01 as an int first?)
__________________
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

_
  #3   Spotlight this post!  
Unread 13-01-2007, 14:18
Brad Voracek Brad Voracek is offline
.999~=1
FRC #0399 (Eagle Robotics)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lancaster, CA (SoCal)
Posts: 328
Brad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of light
Send a message via AIM to Brad Voracek
Re: Dampening function for driving.

Ahh, I got it. I'll get my outputs from the joystick, then half them... I was trying to find a way to do it incorporating it into the joystick function (x - y + 127 or x + y - 127) type thing. But doing it after I get those number is just as good, thanks.
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
Scoring function in C mgreene Programming 7 12-01-2007 02:36
Tips for something big....(Driving cross-country) Greg Perkins Chit-Chat 25 25-10-2006 16:02
Loop time for OperatorControl function? Debug blows... Chris_Elston Programming 10 13-02-2006 14:42
Limit_Mix() Function EricWilliams Programming 2 27-07-2005 23:19
Delaying/Dampening motor response cadets Control System 4 05-02-2004 18:27


All times are GMT -5. The time now is 02:06.

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