Go to Post ... simple things can amaze me. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 03-02-2015, 19:49
NeoTech2029 NeoTech2029 is offline
Registered User
FRC #2029
 
Join Date: Jan 2014
Location: Ramona, CA
Posts: 3
NeoTech2029 is an unknown quantity at this point
Mecanum Single Joystick Control not working

We have put together our Mecanum drive and have the default drive program for a single joystick and have the motor controllers assigned the right ID in the web config (we are using CAN Talon SRX's) and the right ID's in the right spots but when we try and drive the robot it doesn't move except in Mecanum which is moving it forward and backwards. we inverted the front motors and now it moves forward and back correctly but when we try to turn it Mecanums in the opposite direction. And when we try to Mecanum the wheels opposes each other and nothing happens. We are using a Logitech attack 3 to control the robot.

Any help would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2015, 19:54
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

Try this:

Swap the x and y inputs.
Invert your left motors in Begin.
Go into HolonomicDrive.vi and change the inputs as well.

It should look like this, Begin not shown. You may want to change rotation to 0 as the Attack 3's third axis is the throttle and that may cause unwanted movement.


__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)

Last edited by pastelpony : 03-02-2015 at 20:09.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2015, 20:32
NeoTech2029 NeoTech2029 is offline
Registered User
FRC #2029
 
Join Date: Jan 2014
Location: Ramona, CA
Posts: 3
NeoTech2029 is an unknown quantity at this point
Re: Mecanum Single Joystick Control not working

Thank you your picture helped a lot but we are still having some issues could we see your begin.vi for the drive. Also what controller are you using?
Thank you aging.
Team 2029
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2015, 20:49
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

We used both jags and Victor 884s for our frame (at different times). Our code had the left motors ininverted in Begin. I cannot provide said picture atm because I am away from my computer. You should try to play aound with your axises and see what happens.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2015, 21:49
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,113
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: Mecanum Single Joystick Control not working

Quote:
Originally Posted by pastelpony View Post
Go into HolonomicDrive.vi and change the inputs as well.
No, don't do that.

Just make absolutely sure that the corners you have your motors on are the same as the corners you're telling the program they are on in Begin. Usually it's the two right side motors that need to be inverted.

How did you change it from Open 2 Motors to Open 4 Motors? If you used the "Replace" menu option, you might find that some of the constants' labels are left over from the default code and don't match what are actually connected to. You might find it easiest to delete the Open 4 Motor Drive function and all its associated inputs from Begin.vi, then replace them.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2015, 16:52
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,659
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Mecanum Single Joystick Control not working

Quote:
Originally Posted by Alan Anderson View Post
. Usually it's the two right side motors that need to be inverted.
Which ones need to be inverted depends on the number of stages in your gearbox; each stage reverses the rotation direction.

The reason that only one side needs to be inverted is that the motors themselves have opposite orientations. A clockwise shaft rotation (viewed from the motor side) is forward on the left and reverse on the right for no gearbox or a spur gearbox with an even number of stages.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2015, 18:54
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

For some reason, it seems as the inputs in the default mecanum code are inverted for some people, including myself. I'm not sure if this occurs for everyone, but just try to play with your joystick inputs and inversions. I personally had to edit the default code to get the wheels to spin the right way. You probably don't have to.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2015, 19:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Mecanum Single Joystick Control not working

Quote:
Originally Posted by pastelpony View Post
just try to play with your joystick inputs
If by "play with your joystick inputs" you mean "wire the joystick values to the wrong inputs on the robot drive vi", that should never be necessary... and it makes your code confusing and difficult for others to help you.

Quote:
I personally had to edit the default code to get the wheels to spin the right way. You probably don't have to.
If by "edit the default code" you mean "edit the inverse kinematic computation", that should never be necessary...and it makes your code confusing and difficult for others to help you.


Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2015, 20:00
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

Quote:
Originally Posted by Ether View Post
If by "play with your joystick inputs" you mean "wire the joystick values to the wrong inputs on the robot drive vi", that should never be necessary... and it makes your code confusing and difficult for others to help you.



If by "edit the default code" you mean "edit the inverse kinematic computation", that should never be necessary...and it makes your code confusing and difficult for others to help you.


Correct me if I'm wrong, but I've been reading that the default mecanum code in the WPI library actually takes the incorrect inputs by default. I'm not sure if thats true for everyone, but it was only with that advice I recieved on this forum concerning possible incorrect code that we were able to get mecanum working. And this was after countless tests, wire swaps, and inversions.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2015, 20:04
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

[quote=pastelpony;1438465]Good point. Thanks.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2015, 20:33
NeoTech2029 NeoTech2029 is offline
Registered User
FRC #2029
 
Join Date: Jan 2014
Location: Ramona, CA
Posts: 3
NeoTech2029 is an unknown quantity at this point
Re: Mecanum Single Joystick Control not working

Thank you all we got it working our wheels were inverted.
Reply With Quote
  #12   Spotlight this post!  
Unread 04-02-2015, 21:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Mecanum Single Joystick Control not working

Quote:
Originally Posted by pastelpony View Post
Correct me if I'm wrong, but I've been reading that the default mecanum code in the WPI library actually takes the incorrect inputs by default.
Would you please post a link to where you've been reading that?

I don't have access to LabVIEW to inspect its code, but here's the inverse kinematics code taken straight from 2015 WPILib RobotDrive.Java:

Code:

wheelSpeeds[MotorType.kFrontLeft_val] = xIn + yIn + rotation;
   
wheelSpeeds[MotorType.kFrontRight_val] = -xIn + yIn - rotation;
      
wheelSpeeds[MotorType.kRearLeft_val] = -xIn + yIn + rotation;
      
wheelSpeeds[MotorType.kRearRight_val] = xIn + yIn - rotation;
I'm not a Java guru, but it looks correct to me.


Reply With Quote
  #13   Spotlight this post!  
Unread 04-02-2015, 21:20
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

Quote:
Originally Posted by Ether View Post
Would you please post a link to where you've been reading that?

I don't have access to LabVIEW to inspect its code, but here's the inverse kinematics code taken straight from 2015 WPILib RobotDrive.Java:

Code:

wheelSpeeds[MotorType.kFrontLeft_val] = xIn + yIn + rotation;
   
wheelSpeeds[MotorType.kFrontRight_val] = -xIn + yIn - rotation;
      
wheelSpeeds[MotorType.kRearLeft_val] = -xIn + yIn + rotation;
      
wheelSpeeds[MotorType.kRearRight_val] = xIn + yIn - rotation;
I'm not a Java guru, but it looks correct to me.


I'm not quite sure how credible this is, but it sure did help me.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #14   Spotlight this post!  
Unread 04-02-2015, 22:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Mecanum Single Joystick Control not working

I compared the LV code to the attached Java, and they are the same.

The LV code first does a gyro transformation in case you have one and want to use field coordinates.

The code then uses the same expressions on the same inputs with the same output names. The code then normalizes the motor outputs.

If you have an issue with the code, can you be more specific about what was wrong with it?

Greg McKaskle
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 21:26.

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