![]() |
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
That is very helpful file.
What i was thinking is, have a max change function in real-time like you mentioned. Basically you jus need a variable that holds the current joystick input. For example if your joystick was at 135 and you pushed it to 250 all of a sudden, You can check you current motor output which was 135 and then current joystick input which is 250, now you keep adding a certain number lets say 10 to the motor output untill it reaches 250. This is one way to do it, the other way is to subtract 250-135, you get 115 devide it by a number lets say 10 so you get 11.5 , now ur max change is 11.5 , add that 10 times to your motor output or until it reaches desired position, this way you will have variable max change function. |
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Quote:
Quote:
|
Re: Desensitizing Joysticks
What we use is a exponenetial function. This simply shifts the power curve out some while still retaining full power at the edges. Instead of it being completely linear, it follows a curve (that looks suspiciously like a cubic function). At 50% joystick travel, you may only have 33% motor output, but at 100% joystick travel, you have 100% motor output.
Another technique that I learned from flying R/C Heli's is to grip the joystick at the bottom with just a few fingers....This helps to make movements less extreme....they only downside is that it is a little tuffer to get to the buttons...The advantage is that the movement comes from the fingers instead of the arm and wrists, and it affords you alot more accuracy. Bill |
Re: Desensitizing Joysticks
This is what I came up with during our team's meeting today after school:
/* pwm is a jostick value, 0-254 pwm_in is the pwm_out of the default code pwm_out is the new value going to the joysticks null_zone_swing_fraction is the amount you'd want the joystick to move without the motors kicking in. */ pwm_out = (pwm_in / (1-null_zone_swing_fraction)) - null_zone_swing_fraction(1 - null_zone_swing_fraction) So. Its quite simply a y = mx + b "transfer" function. enjoy. |
Re: Desensitizing Joysticks
Exponential Function: simple sin(x) function:
amplitude = 2 * 127 (pwm max) period = 4 * 127 make sure, as i forgot to in my previous post (above): pwm = pwm - 127; That way the origin is the middle of the null zone. makes for nice calculations. |
Re: Desensitizing Joysticks
Quote:
The new drills introduced last year have almost no delay at low power values. The deadstick area is still nice, but you also need to scale the output rather than start at 138. |
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.
|
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!
|
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:
...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. :) |
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; |
Re: Desensitizing Joysticks
Thanks for the warnings.
|
Re: Desensitizing Joysticks
Quote:
We used a switch statement and it did not slow down anything. It is a big improvement from what we had. :) |
| All times are GMT -5. The time now is 05:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi