Log in

View Full Version : Sensitivity Wheels - help please


naor52
18-01-2006, 12:05
hi, 'sup doods?

I have a problem in setting the program code for the wheels. :(
In my program code I've already set the wheels but there is a problem.
The Joystick is too Sensitive! When I pull it full froward the robot just flies!!! :ahh:

Can someone please give me the code for Sensitivity? :rolleyes:

KenWittlief
18-01-2006, 12:13
if you want full forward to go half as fast as it is now, divide the joystick readying by two

since the center (off) reading is 128, you need to add 64 to the result to get off back to 128

joystick := (joystick / 2) + 64

if you want it even slower, divide by 4 and add 96 to get zero back to 128.

Something to consider: if your robot is way too fast with the motors running full speed, you might need to gear down your drivetrain (or use smaller wheels). This will bring down your top end, and give your robot more pushing and climbing power.

Jared Russell
18-01-2006, 20:15
You might also find it useful to change the characteristics of the joystick vs. speed curve.

Basically, make it so that if you push the joystick within zero and halfway (for example), it gives you up to 1/2 of your max speed, then from halfway to full forward it gives you the rest.

Example:

#define SENSITIVITY_TOLERANCE 179 /* play with this value */
#define SENSITIVITY_DIVISOR 2 /* and this one too */
#define SENSITIVITY_EDGE (SENSITIVITY_TOLERANCE-127)/SENSITIVITY_DIVIDER+127

int reverse_p1_y = 0;

if( p1_y < 127 )
{
p1_y = 254-p1_y;
reverse_p1_y = 1;
}

if( p1_y < SENSITIVITY_TOLERANCE )
p1_y = (p1_y - 127 )/SENSITIVITY_DIVISOR + 127;
else
p1_y = SENSITIVITY_EDGE + (p1_y-SENSITIVITY_TOLERANCE)*(254-SENSITIVITY_EDGE)/(254-SENSITIVITY_TOLERANCE);

if( reverse_p1_y )
p1_y = 254 - p1_y;

The result is that you can move your robot at max speed, but it is more controllable at lower speeds.

KenWittlief
18-01-2006, 22:35
You might also find it useful to change the characteristics of the joystick vs. speed curve.

Basically, make it so that if you push the joystick within zero and halfway (for example), it gives you up to 1/2 of your max speed, then from halfway to full forward it gives you the rest.


I think you meant to say if you push it up to half way it gives you up to 1/4 speed, and above that the outputs increase twice as fast.

the default RC code gives you half speed at half-stick, right?

Jared Russell
18-01-2006, 22:42
I think you meant to say if you push it up to half way it gives you up to 1/4 speed, and above that the outputs increase twice as fast.

the default RC code gives you half speed at half-stick, right?

Yeah, that's what I meant.

TimCraig
18-01-2006, 23:01
hi, 'sup doods?

I have a problem in setting the program code for the wheels. :(
In my program code I've already set the wheels but there is a problem.
The Joystick is too Sensitive! When I pull it full froward the robot just flies!!! :ahh:


The output from the Victor speed controllers is very nonlinear with respect to the input value. You're at around 90% output at half the input range. What you want to do is insert a transfer function between the joystick input and the PWM setting to the speed controllers. With this you can linearize the response of the motors with respect to the joystick or even tailor it to have "sweet spots" for sensitive control where you want it, usually at the low end.

pclements
20-01-2006, 09:13
Don't pull the joystick foward all the way, it's like a car.