|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Desensitizing Joysticks
You could use low pass filter. I'm at school right now and don't have access to what I've written, but I'll try to post it when I get home.
|
|
#2
|
||||
|
||||
|
Re: Desensitizing Joysticks
This is what I love about programming...there are so many different ways to solve the same problem. All of these are nest ideas. Good luck everyone!
|
|
#3
|
||||
|
||||
|
Re: Desensitizing Joysticks
I've posted the low pass filter on the white pages. It's called low pass filter. (Duh!
)An example usage: Code:
... pwm01 = rampPWM(pwm01, where_we_want_it, 6, 5); ... By calling this function multiple times you get a nice gradual increase in output values, so if you move the joystick as fast as you can in circles, very little of that will be picked up. How sensitive it is to input is set by you. The exact equation for finding what to set sensitivity to: 255 -------------- = t (1000/26.2)*s t is time in this equation. deterimine what time (in seconds) you think is best for it to be able to go from full reverse to full forward and plug that equation. Solve and use that as your input to the function, ignoring any decimal portion. For instance, if t = 1 sec, then s = 6. Note that the equation assumes it is being called every 26.2 ms. Post again if you have any questions about the code or if you'd like to comment on it. PS I had to re-write it because somebody took my disk that I had that on, so it hasn't been complied. It should be right, though. ![]() Last edited by Ryan M. : 03-02-2004 at 14:56. |
|
#4
|
||||||
|
||||||
|
Re: Desensitizing Joysticks
Beware of low pass filters. We used an LPF on the joystick once and we decided that we didn't like using it. Under acceleration, it's fine, but under stopping, it's not so good. To make the story short, it will cause you to overshoot (because it ramps down your input just like it ramps it up). You can try some funky "if increasing do this, if decreasing do that" logic, but I really don't think it's worth it.
Also, the deadbands that have been described here are discontinuous deadbands, which are generally considered "hack" deadbands in the controls world (due to their abrupt change at the deadzone point). For a continuous deadzone (more commonly used), do this: DeadZone = 15; // Calibration parameter if (Joy > (127-DeadZone) && Joy < (127+DeadZone)) Joy = 127; else if (Joy <= (127-DeadZone)) Joy += DeadZone; else Joy -= DeadZone; Last edited by Chris Hibner : 03-02-2004 at 17:04. |
|
#5
|
||||
|
||||
|
Re: Desensitizing Joysticks
Thanks for the warnings.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming joysticks | NoRemorse | Programming | 29 | 24-02-2004 20:26 |
| number of joysticks | doy | Rules/Strategy | 5 | 01-02-2004 00:05 |
| Team 524 has Team 362's spare joysticks from last year. | archiver | 2001 | 0 | 24-06-2002 02:36 |
| Could use some help with joysticks . . . | archiver | 2001 | 5 | 23-06-2002 23:36 |
| Calibrating speed controllers and joysticks | thedillybar | Technical Discussion | 4 | 11-02-2002 13:24 |