Go to Post Basically, just because you CAN do something doesn't mean you should and being savvy enough doesn't entitle you to being above the law. - Greg Needel [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 25-01-2011, 14:39
Robbypockets Robbypockets is offline
Registered User
FRC #3528
 
Join Date: Jan 2011
Location: Kansas City
Posts: 1
Robbypockets is an unknown quantity at this point
How to program mecanum wheels with two joysticks

My rookie team is going to use macanum wheels this year for our robot and we were wondering how to program it in Labview to where one joystick controls forward movement (When the joystick is forward the robot moves forward, and when the joystick is to the left the robot goes left), and one joystick for turning the robot.

Team Up Next 3528
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2011, 15:21
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: How to program mecanum wheels with two joysticks

That's easy. Use the Cartesian variety of Holonomic Drive. Connect the X and Y axes of the "translation" joystick to the X and Y inputs of the Drive vi. Connect the X axis of the "rotation" joystick to the Rotation input of the Drive vi.

Make sure you open a 4 Motor Drive in the Begin vi, with all the right PWM channels assigned to all the right motors. Depending in how you decide to wire the motors, you will probably need to set two of the Invert inputs to True, but don't just guess. Run the robot forward and make sure all the motors go the direction you expect them to. Once that's done, double-check with rotation. Then you can try strafing.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2011, 21:02
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is online now
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,884
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: How to program mecanum wheels with two joysticks

My team is running into a snag with the Holonomic VI. We can run forwards and backwards just fine. We can even turn left and right; no problem. We are having trouble strafing. When we try to do it the robot just stands in place with all 4 wheels spinning. We put it on blocks and noticed that when we ask for a strafe, the front wheels go forward and the back wheels go backward. This does not make sense given the "X" pattern we have set for the wheels.

My programmer did a great job creating his own drive code that works as intended, but does not have the Gyro support the holonomic VI has. So a few questions:

1.Will it be easier to: a: change the NI VI to allow us to strafe correctly or b: integrate the gyro to stabilize our drive base using our own code?

2. how would we go about doing 'A'?

3. how would we go about doing 'B'?
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.

Last edited by wilsonmw04 : 25-01-2011 at 21:12.
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2011, 21:23
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: How to program mecanum wheels with two joysticks

Quote:
Originally Posted by wilsonmw04 View Post
1.Will it be easier to: a: change the NI VI to allow us to strafe correctly
I am not aware of any issues with the LabVIEW vi. So I don't think you want to change it. Your problem likely lies elsewhere. If you would post your code I'd bet someone here could help you find it (the problem).

Quote:
or b: integrate the gyro to stabilize our drive base using our own code?
Not sure what you mean by "stabilize" your drive base. The gyro support in the LabVIEW vi is for field-centric control of the translation commands. If your drive base is not "stable" (e.g. turns when not commanded), the gyro support in the LabVIEW vi will not stop it from doing so. It will simply make it so the vehicle keeps going in the commanded direction while rotating. If you want to add the aforementioned gyro support (ie field-centric control) to your own code, all that is required is to do a coordinate rotation of the translation portion of the command.


If you want to use the gyro to prevent unwanted rotation, or to make the robot turn and align with a joystick direction command, that can be done, but it's a separate problem from the field-centric gyro support built in to the LabVIEW vi.




Last edited by Ether : 25-01-2011 at 21:29.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2011, 21:35
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is online now
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,884
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: How to program mecanum wheels with two joysticks

I'll get the code posted tomorrow, however, I swear there doesn't seem to be as much drift while driving with the NI VI than with our homemade code. Maybe it's just me.
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2011, 21:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: How to program mecanum wheels with two joysticks

Quote:
Originally Posted by wilsonmw04 View Post
I swear there doesn't seem to be as much drift while driving with the NI VI than with our homemade code.
What do you mean by "drift"? Could you please be more specific.


Reply With Quote
  #7   Spotlight this post!  
Unread 25-01-2011, 21:55
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is online now
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,884
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: How to program mecanum wheels with two joysticks

Sorry for the vague terminology. By "drift" I mean unwanted rotation. We start driving forward but slowly rotate to the left or right while maintaining the same vector of velocity. The drive tries to change this yaw rotation, to put it in aeronautical terms, but creates a whole other set of problems (think new car driver who isn't looking far enough ahead of where they are).
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #8   Spotlight this post!  
Unread 25-01-2011, 22:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: How to program mecanum wheels with two joysticks

Quote:
Originally Posted by wilsonmw04 View Post
Sorry for the vague terminology. By "drift" I mean unwanted rotation. We start driving forward but slowly rotate to the left or right while maintaining the same vector of velocity. The drive tries to change this yaw rotation, to put it in aeronautical terms, but creates a whole other set of problems (think new car driver who isn't looking far enough ahead of where they are).
while maintaining the same vector of velocity: does this mean a) while maintaining the same joystick direction command or b) while the vehicle maintains a constant direction

The drive tries to change this yaw rotation : did you mean the driver tries to change this yaw rotation? If not, what did you mean?

creates a whole other set of problems : what sort of problems? Could you give a couple of examples please?


I re-read your earlier posts and you never stated whether you are using omni or mec wheels.




Last edited by Ether : 25-01-2011 at 22:07.
Reply With Quote
  #9   Spotlight this post!  
Unread 25-01-2011, 22:28
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is online now
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,884
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: How to program mecanum wheels with two joysticks

a video is worth at least 2000 words...

http://www.youtube.com/watch?v=V1ifzK1Q14w

We keep the same joystick position and the yaw rotation changes. It could be due to slight differences in the wheels or motor strengths.

What I mean about problems is the over correction that "small" corrections can make.

BTW: it's mech wheels in an "X" formation

\ /
\ /
\ /


/ \
/ \
/ \
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.

Last edited by wilsonmw04 : 25-01-2011 at 22:31.
Reply With Quote
  #10   Spotlight this post!  
Unread 25-01-2011, 22:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: How to program mecanum wheels with two joysticks

Quote:
Originally Posted by wilsonmw04 View Post
We keep the same joystick position and the yaw rotation changes. It could be due to slight differences in the wheels or motor strengths.
Those are likely candidates. Three others might be 1) not all the rollers are spinning freely 2) the frame is so rigid that not all 4 wheels have sufficient normal force to prevent slipping 3) calibration and/or tolerance differences in the motor controllers



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:15.

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