Go to Post It's OK to make some mistakes, as long as you learn from them. - Doug G [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 12-02-2010, 16:27
inventor1254 inventor1254 is offline
Registered User
FRC #1254
 
Join Date: Feb 2010
Location: Van Buren Technology Center
Posts: 5
inventor1254 is an unknown quantity at this point
4 motor Mecanum wheel code request

does any one have a working example for a four motor, mecanum wheeled (not sure if I spelled that right, just google "Mecanum wheel", the top wikipedia page has a picture), with 2 joy sticks, for LabView.

My team members are currently watching tutorial videos on how to do basic LabView programming, and most of my experience is in lower level languages.

Any and all help is greatly appreciated!!! (we lost our code from last year, so we're kind of at square one here)
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2010, 16:34
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: 4 motor Mecanum wheel code request

I have one, but I won't be able to post a picture of it until late tonight.

How do you want the joysticks to control the robot?
  • Tank drive plus strafe
  • Arcade drive on one joystick, strafe on the other
  • Cartesian control on one joystick, rotation on the other
  • something else
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2010, 01:31
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: 4 motor Mecanum wheel code request

There is a Holonomic.vi in the WPIlib LabView files (should be under RobotDrive?). This VI takes 4 required inputs:

1) RobotDrive data cluster
2) Magnitude - Requires a value from -1 to 1. If you're using one joystick for strafing, this will be Pythgorean theorem (sqrt(Xaxis^2 + Yaxis^2)).
3) Direction - Requires a value from -180 to 180 (degrees). If you're using one joystick for strafing, this will be the Arctan2 between the two joysticks (found under Mathematics>Elementary>Trigonometric, it should be the last VI). Plug in the Y axis to Y and the X axis to X. This returns a value in radians, so you have to convert to degrees by dividing by Pi (Numeric>Constants>Pi) and multiplying by 180.
4) Rotation - Requires a value from -1 to 1. You can use the X axis of a second joystick, the rotation axis from a 3-axis joystick, or anything else that's convenient.

You can actually split the duties up between joysticks so you have forward/backward on one joystick and strafing on another joystick, and it will still work perfectly, just run the wires correctly. Our Girl Scouts team last year used this VI and to rotate, used the left and right buttons on top of one of the joysticks (full rotate left or full rotate right). We're using a 3-axis joystick this year that controls all of the driving. To rotate, you have to push the trigger, and to rotate with more control, you can push the button under the thumb, and it squares the value being sent to Rotate (all of the strafing still works, we just didn't want to accidentally rotate because the Z axis is so sensitive).

Hope this helps. If you were planning on using a different setup (like what Alan said with the tank steering with strafing) let us know and someone will be able to help you with that. This is just one way.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2010, 18:37
inventor1254 inventor1254 is offline
Registered User
FRC #1254
 
Join Date: Feb 2010
Location: Van Buren Technology Center
Posts: 5
inventor1254 is an unknown quantity at this point
Re: 4 motor Mecanum wheel code request

First thanks for the quick replies!

I have to say I'm not too sure what strafing is (googled it a little) I'm guessing thats when you use the rollers on the wheels to make the robot go sideways. I don't know too much about driving systems or their different advantages, (mostly math and lower level languages) but thats a different topic.

I would first ask for just the basic tank drive, just because we lost ours from last year, only with 2 motors per side. (I know LabView has a basic vi of the tank drive, but like I said most of my experience is with things like C++, too me Labview is just confusing.)

With the tank drive (y axis on 2 joysticks) leaves the x axis unused, I'm assuming that is where you would want to use the strafing [moving perpendicular to the wheels (correct me if I'm wrong on my vocabulary here]) but that leaves open 2 possible movements you can make with the joy sticks (that I can think of) one where both joy sticks go outward from each other, and the other where they point inward/toward each other. I'm not too sure what that would do or how those "gestures" could be utilized.


What I'd like is some thing that can utilize as much as possible, but still be simple to use. and thats where I have trouble with LabView is that seems like a lot of if statements, and I never quit get how those work.

So could we get a few basic examples, one with basic tank drive for 4 wheels, and one with the strafing. Plus maybe the strafing on one and tank on the other, but really this isn't my area of expertise. I'm only able to really talk with my team during the week, and am not sure exactly where they were going with this.

I'd just like to see a couple of different ones that I know work so I can kind of figure out how they work and how to edit them, because at the moment I'm not too sure what would work better.

Again thanks for any and all help, and all help already given! I don't want to ask for too much but I don't know too much about the drive system aspect, and if we were doing this in C++ a few of our teachers and I would probably be the main programmers, so we're kinda in the dark!
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2010, 19:33
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: 4 motor Mecanum wheel code request

Quote:
Originally Posted by inventor1254 View Post
First thanks for the quick replies!
...

I would first ask for just the basic tank drive, just because we lost ours from last year, only with 2 motors per side. (I know LabView has a basic vi of the tank drive, but like I said most of my experience is with things like C++, too me Labview is just confusing.)

...

Again thanks for any and all help, and all help already given! I don't want to ask for too much but I don't know too much about the drive system aspect, and if we were doing this in C++ a few of our teachers and I would probably be the main programmers, so we're kinda in the dark!
LabVIEW examples for WPILib are most easily reached from the Getting Started window. You can click on the Examples list and it is near the bottom. It demonstrates how to use the Y axis on two joysticks to control a skid steer driving platform. At least on the update I have, there wasn't a holonomic example.

If you actually want to learn LV, I'd suggest watching a few tutorials, perhaps with the students. NI has quite a few, and there are also good ones on LVMastery.com.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2010, 19:27
inventor1254 inventor1254 is offline
Registered User
FRC #1254
 
Join Date: Feb 2010
Location: Van Buren Technology Center
Posts: 5
inventor1254 is an unknown quantity at this point
Re: 4 motor Mecanum wheel code request

sorry, apparently my reply didn't get posted, been too busy to retype it.

Quote:
Originally Posted by Greg McKaskle

LabVIEW examples for WPILib are most easily reached from the Getting Started window. You can click on the Examples list and it is near the bottom. It demonstrates how to use the Y axis on two joysticks to control a skid steer driving platform. At least on the update I have, there wasn't a holonomic example.
yeah, I know LabView has a lot of examples, including the tank drive, but with my current understanding of LabView I don't understand what I am looking at. I tried editing basic things on them last year with little or no luck, plus with the basic tank drive we have 4 motors, and the example only has 2. That's why I was hoping to get an example on here, so I can ask questions about it, and it would have a better description of what it is, a lot of the examples in LabView are named things that I don't know what are. Plus we need something a little more advanced than basic tank drive.

I haven't looked through every thing yet though, we just recently got LabView on some other computers so we can really learn it (before it was just on the NetBook).

Quote:
Originally Posted by Greg McKaskle
If you actually want to learn LV, I'd suggest watching a few tutorials, perhaps with the students. NI has quite a few, and there are also good ones on LVMastery.com.
I really need to learn LabView, but I loathe having to do so, I'd rather just use C++, but my team wants LabView because they have a little more experience with it. I'm going to be watching more of the tutorials tomorrow though, one on LVMastery.com looks interesting to me, LabView for C programmers. Thanks for the site!

Most of our programmers can only program during the school day though, as they don't have LabView on their computers, (my self included) so we decided to ask so if we don't manage to learn LabView and program it in time we'll at least have some thing.

Again thanks for any and all help and all help already given!
Reply With Quote
  #7   Spotlight this post!  
Unread 15-02-2010, 20:37
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: 4 motor Mecanum wheel code request

here u go if you need deadzones for direction tell me because we already figured out a way to do it http://www.chiefdelphi.com/forums/at...7&d=1265942765
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2010, 07:28
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: 4 motor Mecanum wheel code request

I was pointing out the Getting Started Examples link because as you mention, LV ships with thousands of VIs that cover many devices and used in many industries. If you look at the FRC specific ones, they should all be more applicable.

One thing you may find helpful, open the Help>>Show Context Help. This will give information as you idle over a particular node or wire.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2010, 08:45
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: 4 motor Mecanum wheel code request

Quote:
Originally Posted by daltore View Post
There is a Holonomic.vi in the WPIlib LabView files (should be under RobotDrive?). This VI takes 4 required inputs:

1) RobotDrive data cluster
2) Magnitude - Requires a value from -1 to 1. If you're using one joystick for strafing, this will be Pythgorean theorem (sqrt(Xaxis^2 + Yaxis^2)).
3) Direction - Requires a value from -180 to 180 (degrees). If you're using one joystick for strafing, this will be the Arctan2 between the two joysticks (found under Mathematics>Elementary>Trigonometric, it should be the last VI). Plug in the Y axis to Y and the X axis to X. This returns a value in radians, so you have to convert to degrees by dividing by Pi (Numeric>Constants>Pi) and multiplying by 180.
4) Rotation - Requires a value from -1 to 1. You can use the X axis of a second joystick, the rotation axis from a 3-axis joystick, or anything else that's convenient.

You can actually split the duties up between joysticks so you have forward/backward on one joystick and strafing on another joystick, and it will still work perfectly, just run the wires correctly. Our Girl Scouts team last year used this VI and to rotate, used the left and right buttons on top of one of the joysticks (full rotate left or full rotate right). We're using a 3-axis joystick this year that controls all of the driving. To rotate, you have to push the trigger, and to rotate with more control, you can push the button under the thumb, and it squares the value being sent to Rotate (all of the strafing still works, we just didn't want to accidentally rotate because the Z axis is so sensitive).

Hope this helps. If you were planning on using a different setup (like what Alan said with the tank steering with strafing) let us know and someone will be able to help you with that. This is just one way.
I am actually interested in finding out how to program our team's mecanum wheels so that we can have a tank drive style steering with strafing. This is our second year of FRC and so I know some of the lingo of LabView, but pictures help a lot. Thanks
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2010, 10:18
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: 4 motor Mecanum wheel code request

Quote:
Originally Posted by furiousgeorge View Post
I am actually interested in finding out how to program our team's mecanum wheels so that we can have a tank drive style steering with strafing.
The following post might be of interest to you:

http://www.chiefdelphi.com/forums/sh...383#post916383


~
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2010, 11:03
eovnu87435ds eovnu87435ds is offline
Registered User
FRC #0087
 
Join Date: Jan 2010
Location: Mt. Holly NJ
Posts: 19
eovnu87435ds has a spectacular aura abouteovnu87435ds has a spectacular aura abouteovnu87435ds has a spectacular aura about
Re: 4 motor Mecanum wheel code request

Ether's Post was a lifesaver for holonomic drive(partly because it is so easy to make sense of.) I whipped this up after reading it. All you need to do is plug in your joystick dev ref to the one side, and then plug the 4 values that output on the right into your 4 drive VI's.

Download it here: http://files.me.com/eovnu87435ds/k0i3pn
(Link expires March 19, 2010)

Note, I did not test this yet, since we didn't get our mechanum wheels yet

hope this helps, and of course, all credit goes to Ether
Reply With Quote
  #12   Spotlight this post!  
Unread 17-02-2010, 11:27
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: 4 motor Mecanum wheel code request

Quote:
Originally Posted by eovnu87435ds View Post
I did not test this yet, since we didn't get our mechanum wheels yet
When you get your wheels, make sure you mount them properly:


http://www.chiefdelphi.com/forums/sh...d.php?p=907174

http://www.chiefdelphi.com/forums/sh...d.php?p=907168



~
Reply With Quote
  #13   Spotlight this post!  
Unread 19-02-2010, 19:14
inventor1254 inventor1254 is offline
Registered User
FRC #1254
 
Join Date: Feb 2010
Location: Van Buren Technology Center
Posts: 5
inventor1254 is an unknown quantity at this point
Re: 4 motor Mecanum wheel code request

Sorry I've been pretty busy I have 4 college classes to keep up with too.

I talked with our machine tool instructor and he explained a little better what we need, and to answer Alan Anderson's question way back, we need Tank drive plus strafe, 2 joysticks both controlling one side of the robot on the y for tank drive and one or both as strafe on the x. He is going to have some more students look for code through emailing people on youtube.

Again sorry I haven't been keeping up on this thread vary well, our tech center has 8th grade visits right now, so I wasn't even any where near the robot to try any of this code all week, nor am I now, and I won't be until Tuesday (Feb 23)

Again thanks for all the help the! The pdf that Ether posted http://lib.store.yahoo.net/lib/yhst-...lSpecSheet.pdf has has defiantly cleared a few things up for me, and the code http://files.me.com/eovnu87435ds/k0i3pn looks interesting, will try it when If I ever get my hands on the robot before the deadline lol.
Reply With Quote
  #14   Spotlight this post!  
Unread 20-02-2010, 22:19
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: 4 motor Mecanum wheel code request

Quote:
Originally Posted by inventor1254 View Post
...we need Tank drive plus strafe, 2 joysticks both controlling one side of the robot on the y for tank drive and one or both as strafe on the x.
That's very easy to do using the "Mecanum - Cartesian" vi. Use the average of the joysticks' X values as the X input, the average of the joysticks' Y values as the Y input, and the difference between the Y values (divided by 2) as the rotation input.
Reply With Quote
  #15   Spotlight this post!  
Unread 21-02-2010, 12:09
inventor1254 inventor1254 is offline
Registered User
FRC #1254
 
Join Date: Feb 2010
Location: Van Buren Technology Center
Posts: 5
inventor1254 is an unknown quantity at this point
Re: 4 motor Mecanum wheel code request

Quote:
Originally Posted by Alan Anderson
That's very easy to do using the "Mecanum - Cartesian" vi. Use the average of the joysticks' X values as the X input, the average of the joysticks' Y values as the Y input, and the difference between the Y values (divided by 2) as the rotation input.
"Mecanum - Cartesian" vi, is that in the example files? I don't know because I still don't have direct access to them, just a basic evaluation copy of LabView on my laptop.

Is there any where I can download those example files onto my computer so I don't have to be at the school?

Thanks to all the help again!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mecanum Wheel Setup Help Dylan5019 NI LabVIEW 16 10-02-2011 15:39
Mecanum Wheel Considerations abross General Forum 20 23-01-2010 19:34
Mecanum wheel size Mr. A Technical Discussion 7 18-01-2010 08:58
pic: New mecanum wheel? scottydoh Extra Discussion 5 16-01-2010 21:29
pic: 2" Mecanum Wheel Tytus Gerrish Technical Discussion 17 22-04-2006 12:22


All times are GMT -5. The time now is 22:43.

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