![]() |
joystick sensitivity
i have been tampering with the code to make joysticks less sensitive. i cannot figure it out. it either has an error or nothing responds. does any1 kniw the code to make tha joystick less sensitive
|
Re: joystick sensitivity
I'm not really into programming, but I do know from driving the robot that our controls are also really sensitive and sometimes do get stuck so the robot moves by itself after someone has driven it. If you want to make a makeshift fix on your joystick, you can probably take apart the joystick and play around with the springs in the joystick and see if they are better or not after doing that. It might work...it might not...but good luck writing the program...
...Actually...once I think of my method...it seems really stupid...sorry. |
Re: joystick sensitivity
Are you working with the white joysticks ? If so the best thing you could do is throw them away and get some new ones. We used 1 of them last year to control our arm and i wished we hadn't. I happen to be both the programmer and the arm operator and i did the best i could to get them some what usable. Anyway here are some possibilities.
What you can do to fix this problem is put a parabola in your joystick code, this makes the beginning movements less sensitive. I think if you look through the white papers, in the programing section you'll find one on adding a parabola. Other teams have replaced the springs to make the movement less "floppy", in return making them easier to control. |
Re: joystick sensitivity
One thing we did was add in a "deadband" to the center of the joysticks, which has really helped. The code makes use of an absolute value function that we created. Today, we'll also be adding a ramping function to the joysticks just like what was described above, I can get you that code too if you need it.
Code:
#define DEADBAND 10 |
Re: joystick sensitivity
Quote:
Code:
#define DEADBAND 10 |
Re: joystick sensitivity
OK where does this code go into the rest of the default program. Can I put it anywhere in user routines.c or does it have a special place?
|
Re: joystick sensitivity
Quote:
top of the page, or in an included file: Code:
#define DEADBAND 10Code:
if (((((signed int)p1_x-127) && 0x7f) < DEADBAND) p1_x=127; |
Re: joystick sensitivity
Quote:
The deadband will solve your problem of the robot not stopping when you let the joysticks return to "center," but it doesn't help with your sensitivity problem. You can go for a full PID controller, but a low pass filter, which is basically just the P of a PID, will probably do the trick. I can get you our code from this year in an hour or two. :) |
Re: joystick sensitivity
Quote:
Negative numbers are not stored in sign-magnitude form. They are in "two's-complement" form. The value -1 masked with 0x7F yields a value of 127, a far cry from the expected 1. (The second reason is that && is a logical operator, giving a true or false result. The arithmetic and is represented by a single &.) The simplest syntax I know of for an absolute value function uses the ternary if operator. It's cryptic, but effective: Code:
(value<0?-value:value) |
Re: joystick sensitivity
Quote:
Thanks for letting me know. |
Re: joystick sensitivity
Quote:
http://en.wikipedia.org/wiki/Negativ...tive_in_binary http://en.wikipedia.org/wiki/Two%27s_complement |
Re: joystick sensitivity
i just decreased the limit mix to the joystick drive, which should be at 2000 when to begin with, so it will move less when u move the joystick, using the normal white joysticks :D
|
| All times are GMT -5. The time now is 00:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi