Go to Post Theory is a nice place, I'd like to go there one day. - JamesCH95 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-13-2015, 02:59 PM
tanogirl's Avatar
tanogirl tanogirl is offline
Registered User
AKA: Emma
FRC #3038 (ICE)
 
Join Date: Jun 2014
Rookie Year: 2014
Location: Chisago City, Minnesota
Posts: 18
tanogirl is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-13-2015, 03:34 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-13-2015, 03:43 PM
tanogirl's Avatar
tanogirl tanogirl is offline
Registered User
AKA: Emma
FRC #3038 (ICE)
 
Join Date: Jun 2014
Rookie Year: 2014
Location: Chisago City, Minnesota
Posts: 18
tanogirl is an unknown quantity at this point
Re: Drive Backwards Causes A Rotation Movement

The problem is our driver gets confused when using two joysticks and prefers one
Reply With Quote
  #4   Spotlight this post!  
Unread 02-13-2015, 04:15 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,002
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Drive Backwards Causes A Rotation Movement

Quote:
Originally Posted by tanogirl View Post
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.


Reply With Quote
  #5   Spotlight this post!  
Unread 02-13-2015, 04:44 PM
tanogirl's Avatar
tanogirl tanogirl is offline
Registered User
AKA: Emma
FRC #3038 (ICE)
 
Join Date: Jun 2014
Rookie Year: 2014
Location: Chisago City, Minnesota
Posts: 18
tanogirl is an unknown quantity at this point
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-13-2015, 05:00 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,002
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Drive Backwards Causes A Rotation Movement

Quote:
Originally Posted by tanogirl View Post
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.




Last edited by Ether : 02-13-2015 at 05:02 PM.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-13-2015, 05:23 PM
tanogirl's Avatar
tanogirl tanogirl is offline
Registered User
AKA: Emma
FRC #3038 (ICE)
 
Join Date: Jun 2014
Rookie Year: 2014
Location: Chisago City, Minnesota
Posts: 18
tanogirl is an unknown quantity at this point
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 02-13-2015, 05:24 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,002
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Drive Backwards Causes A Rotation Movement

Quote:
Originally Posted by tanogirl View Post
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;


Reply With Quote
  #9   Spotlight this post!  
Unread 02-13-2015, 05:30 PM
tanogirl's Avatar
tanogirl tanogirl is offline
Registered User
AKA: Emma
FRC #3038 (ICE)
 
Join Date: Jun 2014
Rookie Year: 2014
Location: Chisago City, Minnesota
Posts: 18
tanogirl is an unknown quantity at this point
Re: Drive Backwards Causes A Rotation Movement

Where would you put that in the code?
Reply With Quote
  #10   Spotlight this post!  
Unread 02-13-2015, 05:32 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,002
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Drive Backwards Causes A Rotation Movement

Quote:
Originally Posted by tanogirl View Post
Where would you put that in the code?
Right after you read the joystick Z axis (i.e. before you use it).


Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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