![]() |
Re: Desensitizing Joysticks
We are going to map our joystick input to a function (y=x^3 or something) and then map the output to the motors. We were also considering a recursive approach, such that it finds the delta (change-in joystick postion) and alters accelleration accoordingly.
|
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Quote:
Would a larger array of 255 members be okay to use, or would it slow the program down? Thanks! |
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
however, you'll probably want to put it in rom, as you only have 1800 bytes of variable space in user memory. just add the keyword "rom" to the list of type modifiers in the declaration.
|
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Hold on a sec folks...
I'm assuming before you've done any of this, you've gone through and recalibrated the Victors with the joysticks you plan on using, right? Right? The option to recalibration is really just there because not all joysticks are created equal. The output from one stick to another varies, espically from model to model. By calibrating each victor to the joystick you use, you'll get a smooth, consistent output from it, instead of either: A: Peaking early (I've seen victors putting out %100 at only half stick), which leads to ultra sensitive sticks or B: Never peaking. Which leads to speed and power you never get, just because your stick doesn't let you move the pot that extra bit. Honestly, calibrate the Victors before you do anything else. I suspect that a great deal of the trouble teams are having with the new sticks is because the victors factory calibration is off from were they 'want' to be with the new sticks. Check your documentation for the procedure. It takes 30 seconds, and can do only good. -Andy A. |
Re: Desensitizing Joysticks
Compared to last year's, the new sticks are more seensitive. I think it's because the centering springs aren't as powerful.
|
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Quote:
When the value is above my deadband, I add a fixed offset to the value. When it is below my deadband, I subtract a fixed offset. This way the output "jumps" from dead to the first value that causes the Victor to do something. I actually did the process on absolute values and restored the sign at the end. BTW, I have found that working with signed ints saves a lot of headaches. But you need to be careful when converting back to unsigned char that the value is in the range 0-255! Code:
int speed; // signed motor speed; negative means backwardsThe function clipInt() is: Code:
int clipInt( int in, int low, int high ) |
Re: Desensitizing Joysticks
I know that people have said what to do, but, I'm new to this and do not understand how to modify the sensitivity. Could anyone please post up the code to desensitize the joysticks and where to put it. Thanks! :D
|
Re: Desensitizing Joysticks
there is no specific "the code" - there a plenty of ways to do this. however, I have included an example below - it maps the joystick values to an approximation of an x-squared curve. it's not perfect, and i would probably do it differently if i were putting a ton of effort into it, but this is for an example. it should still be functional though.
Code:
const rom signed char JOYSTICK_SMOOTHING[128] = |
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
Quote:
|
Re: Desensitizing Joysticks
We are using an array of values.
First we worked out in excel a parabolic equation for all the values from -127 to +127 (with zero as neutral) Then input the adjusted speed into the array. It was decided to have the parabola reach linear at about 1/4 throttle/joystick movement. unsigned int throttle_curve[50] = {value0,value1,......}; then we write a quick little function to take the motor speed in and transform it. unsigned int adjust_throttle(unsigned int speed_in) { int speed_out; if (speed_in > 104 && speed_in < 150) speed_out = throttle_curve[speed_in - 104]; else speed_out = speed_in; return speed_out; } call it like this. p1y = adjust_throttle(p1y); The nice part of this setup is that you just adjust array values to flatten or sharpen the curve. Phil |
| 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