|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||||
|
|||||
|
Re: Moderating Acceleration / Deceleration
Hi Tom, It's a be-deviling problem, isn't it
Here's a thread with a plot (from last year) that may shed some light on what you are dealing with: pwm / voltage dat and just a day or 2 ago, I saw a plot of a team's wheel speeds vs joystick input that is also good data....but I'll be darned if I can find it again Anyway, you might try something like a rate limiter. We've done this in the past, but just ended up in an argument among team members on robot handling qualities. You can also search on something like "exponential drivetrain" to see how some teams re-map the joystick to motor relationship. Here's a shot at some rate limit code that shows the general idea ... it ain't tested, so caveat cursor Code:
//
// a joy stick rate limiter
//
unsigned char RateLImitJoyStick(unsigned char* joy, // current joystick
unsigned char* LPjoy, // LastPass joystick
int RateLimit) // rate of change limit
{
int speed ;
unsigned char limited = 0;
speed = (int)*joy - (int)*LPjoy ;
if(speed > RateLimit)
{
speed = RateLImit;
*joy = speed + (int)*LPjoy ;
limited = 1 ;
}
else if(speed < -RateLImit)
{
speed = -RateLImit;
*joy = speed + (int)*LPjoy ;
limited = 1 ;
}
else{}
*LPjoy = *joy
return(limited) ;
}
I'm sure there are others on this forum that can improve on these ideas. Good Luck! (not quite in panic mode)Eric PS the fighting pi's is a great name! Ha! Last edited by EricS-Team180 : 13-02-2007 at 12:51. Reason: forgot a line...yikes! |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Acceleration Curve | EricWilliams | Programming | 5 | 01-02-2006 16:27 |
| Acceleration Sensor Connected, but values are odd.... | Leav | Electrical | 7 | 04-02-2005 15:28 |