Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Drive Backwards Causes A Rotation Movement (http://www.chiefdelphi.com/forums/showthread.php?t=134509)

tanogirl 02-13-2015 02:59 PM

Drive Backwards Causes A Rotation Movement
 
We are using the Logitech Extreme 30 Pro Joystick to control our mechanum drive base this year. Drive forward works fine and so does strafing. When we drive backwards the robot wants to rotate instead. We used smart dash board to locate the problem. When we pull the joystick backwards the Z axis has an input greater than the Y axis input.

Our Code is:

Code:

myRobot.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetTwixt()/3, 0)
We divided the twist input by 3 to try to help with the problem. It helped a little but not much. Any ideas?

Alan Anderson 02-13-2015 03:34 PM

Re: Drive Backwards Causes A Rotation Movement
 
A twist-style joystick seems obvious for controlling a holonomic drivebase, but in practice it's just too easy to twist it by accident. My suggestion is to use a separate joystick for rotation control.

tanogirl 02-13-2015 03:43 PM

Re: Drive Backwards Causes A Rotation Movement
 
The problem is our driver gets confused when using two joysticks and prefers one

Ether 02-13-2015 04:15 PM

Re: Drive Backwards Causes A Rotation Movement
 
Quote:

Originally Posted by tanogirl (Post 1443430)
When we pull the joystick backwards the Z axis has an input greater than the Y axis input.

Please run a test and post the Z vs Y pairs for Y=0 to Y=max for several values of Y.



tanogirl 02-13-2015 04:44 PM

Re: Drive Backwards Causes A Rotation Movement
 
Forward=

Y = 1.000
Z = 0.008

Backwards =

Y = -1.000
Z = -0.0062

It's a small difference but it makes the robot rotate.

Ether 02-13-2015 05:00 PM

Re: Drive Backwards Causes A Rotation Movement
 
Quote:

Originally Posted by tanogirl (Post 1443522)
Forward=

Y = 1.000
Z = 0.008

Backwards =

Y = -1.000
Z = -0.0062

It's a small difference but it makes the robot rotate.

The above does not agree with your previous post:

When we pull the joystick backwards the Z axis has an input greater than the Y axis input.




tanogirl 02-13-2015 05:23 PM

Re: Drive Backwards Causes A Rotation Movement
 
Yes the Y axis is greater than the Z axis but the robot still rotates when driving backwards.

Ether 02-13-2015 05:24 PM

Re: Drive Backwards Causes A Rotation Movement
 
Quote:

Originally Posted by tanogirl (Post 1443552)
Yes the Y axis is greater than the Z axis but the robot still rotates when driving backwards.

Please post results for Y=0, Y=.2, Y=.4, Y=.6, Y=.8;
repeat for negative Y commands.

If all the Z values are within +/-0.0099,

try adding deadband to your code:

if (fabs(Z)<.01) Z=0;



tanogirl 02-13-2015 05:30 PM

Re: Drive Backwards Causes A Rotation Movement
 
Where would you put that in the code?

Ether 02-13-2015 05:32 PM

Re: Drive Backwards Causes A Rotation Movement
 
Quote:

Originally Posted by tanogirl (Post 1443556)
Where would you put that in the code?

Right after you read the joystick Z axis (i.e. before you use it).




All times are GMT -5. The time now is 10:08 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi