Joystick help (Rookie)

Hello everyone I was wondering if there is a way to change the sensitivity of the joysticks right now we barely touch them and the wheels go we would like a little less sensitivity help greatly appreciated

A.Tup
2620

its in the programming code, i dont remember exactly because im not at school but i can probably help you tomorrow. What our team did was make three different “gears” you could call them for reverse, and 5 for forward, so that you gradually get faster.

The following code will scale down your joystick sensitivity:

if your original code was

pwm01 = p1_y;

change it to:

pwm01 = ( ((signed int)p1_y) - 127 ) / 2 + 127;

Change pwm01 and/or p1_y according to which PWM output and joystick you are using. You can change the scaling factor by changing the 2 (right now it’s set to 1/2). For example, to set it at 1/3 power, change the 2 to a three. If you want to use a fraction like 2/3, change / 2 to * 2 / 3. Note: use fractions this way and not decimals, as it will make your code run faster because it only does integer math.

Hope that wasn’t too confusing,
–Ryan

Edit: That’s for MPLAB. If you’re using EasyC, I’m not sure if I can help as much.

This thread has great solution that uses a cubic function.

ok thank you all for all the help

This thread is from 2004. It’s a cubic transfer function like above.

http://www.chiefdelphi.com/forums/showpost.php?p=301722&postcount=54

Good luck!

Adam,
Something no one mentioned is to ask the question “Are your speed controllers calibrated?” Quite often, the Victors do not match the charachteristics of your joysticks. Move your joysticks forward and reverse and see at which point the Victor LED is fully red and fully green. If this occurs at less than full travel on the joystick, you need to calibrate the Victor. For teams who do not perform this calibration in the software, the only way to calibrate is following the method in the 884 users manual found on the IFI website. This procedure matches the full travel of your joystick to the full output of the Victor. The joysticks and the Victors are not matched before they are put in the KOP.

ok thank you i will check that next time in with the robot thanks again

i think our driver just needs to learn how to drive!!!