Go to Post Am I the only one who thinks robots are the main attraction of a regional, and there isn't a need for more distraction? - Adam Richards [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 24-01-2010, 12:21
chsrobotics3283's Avatar
chsrobotics3283 chsrobotics3283 is offline
Registered User
FRC #3283 (Clarksburg Robotics)
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Clarksburg, Maryland
Posts: 41
chsrobotics3283 is an unknown quantity at this point
Mecanum Wheels Programming

So from what I read on how to program Mecanum wheels so far:
Under Telop, switch Arcade Drive to to Holonomic Drive.

My questions are:
Do you configure the code under Begin.vi and Telop.vi etc, to 2 joysticks?
And what other additonal things do you need to do to have mecanum wheels?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2010, 12:42
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: Mecanum Wheels Programming

There is a VI in Begin.vi that says something like "Open 2 Motor Drive" that needs to be changed to "Open 4 Motor Drive". These VI's are under "WPI Robotics Library > Drive" (I think). You then need to run 2 more PWM port constants into the VI (there needs to be a PWM constant for Front Left, Front Right, Rear Left, and Rear Right). You also need two more inversion boolean constants to run into the new VI which will tell it which motors to invert (not strictly necessary, should default to "false" and then you can just wire the motors accordingly, but it's good to specify).

As far as joysticks go, it will be under "WPI Robotics Library > Driver Control?/Driver Station?". You need an "Open Joystick" VI and the VI which sets the joystick refnum (picture of an arrow pointing to a file icon). You then create a string constant for the "Open Joystick" VI with the name of the joystick (like "Joystick 2" or "Rotation Joystick" or something). You also need to create a constant to tell which USB port to look at. You then wire the refnum cluster from the open VI to the refnum VI. You should also run the error wire through and open a new spot on the error array block (where all the dark green lines run together, drag down the bottom of that block one spot, and run the error wire from the refnum VI to that new spot.

To access this new joystick, you'll have to use the other joystick refnum VI (next to the other one, arrow pointing away from a file icon), and wire it to a Get Joystick VI. This will have breakout pins for the axis and button clusters. You can open both with an "Open Cluster By Name" block (can't quite remember what it's called, but it's something like that).

Note: I don't have access to LabView right this moment, this is all from memory, so your milage may vary.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2010, 13:59
chsrobotics3283's Avatar
chsrobotics3283 chsrobotics3283 is offline
Registered User
FRC #3283 (Clarksburg Robotics)
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Clarksburg, Maryland
Posts: 41
chsrobotics3283 is an unknown quantity at this point
Re: Mecanum Wheels Programming

Thanks a lot, I will start programming this afternoon, and if I have any questions I will be sure to contact you.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2010, 15:03
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 Wheels Programming

Quote:
Originally Posted by chsrobotics3283 View Post
And what other additonal things do you need to do to have mecanum wheels?
The holonomic drive vi wants three inputs: magnitude, direction, and rotation.

Magnitude is a value from 0 to 1 describing how fast you want to move.
Direction is an angle in degrees, with zero being straight ahead.
Rotation is -1 for full speed counterclockwise, +1 for full speed clockwise.

Rotation could be taken directly from a joystick axis, but magnitude and direction are a vector that you'll have to derive based on how you want your joystick control to behave.

We made our own SubVI to replace the example's Joystick Read. It uses the difference between the left and right joysticks' y axes to determine rotation. The average of the y axes and the average of the x axes go into a rectangular-to-polar coordinate conversion (the Re/Im to r/theta vi), and the angle from that conversion is further scaled and rotated to match the "0 is forward" requirement of the holonomic drive vi.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2010, 15:26
chsrobotics3283's Avatar
chsrobotics3283 chsrobotics3283 is offline
Registered User
FRC #3283 (Clarksburg Robotics)
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Clarksburg, Maryland
Posts: 41
chsrobotics3283 is an unknown quantity at this point
Re: Mecanum Wheels Programming

http://www.facebook.com/CAG.Vignesh5...2&id=600658907

This is what I have done so far. What else do I need to do with the other VI's? should I change Arcade to Holomonic in Telop. vi?
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2010, 21:08
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: Mecanum Wheels Programming

hey what is the phase when the vector is Zero? and which if any motors are inverted?

Last edited by bladetech932 : 27-01-2010 at 22:20.
Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2010, 23:01
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 Wheels Programming

Quote:
Originally Posted by chsrobotics3283 View Post
should I change Arcade to Holomonic in Telop. vi?
You should if you want to control a holonomic drive system in teleoperated mode.

Quote:
Originally Posted by bladetech932 View Post
hey what is the phase when the vector is Zero? and which if any motors are inverted?
The direction is unimportant when the magnitude is zero.

Which motors need to be flagged as inverted depends on which direction the motors want to move the robot when you apply "positive" power control. If you don't want to trace the wiring and gear directions, you can just put the robot up on blocks, try running the robot forward, and see which motors are going the wrong way.
Reply With Quote
  #8   Spotlight this post!  
Unread 27-01-2010, 23:06
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: Mecanum Wheels Programming

oh one other thing what is the scale that comes out of the magnitude?
how did you have to scale it?
Reply With Quote
  #9   Spotlight this post!  
Unread 28-01-2010, 00:15
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: Mecanum Wheels Programming

Magnitude has to be between 0 and 1. The most general way to do it is to have the Y and X axes of one joystick just act as point-and-shoot and use Pythagorean theorem (Magnitude = sqrt(X^2 + Y^2)). However, this results in a scale of 0 to 1.141, which means that with the limiting blocks they have inside Holonomic.vi, when driving while using multiple joystick axes with high values, come of the motor values will get capped, so you won't quite end up with the right vectors (because the over-1 magnitude will cause the motors to try to go faster than they can).

One way to get around this is to multiply the magnitude by .7, which will bring the max value back down to 1. However, this means that you can't go as fast forward or sideways, and you're only getting full speed diagonally. The way I prefer is to measure all of the motor values, and if any of them are out of range, scale all of the motors down to the most out-of-range motor (if the fastest motor is getting a value of 1.141, divide all of the motors by 1.141). This allows you to have full power in all directions, while maintaining correct vectors.
Reply With Quote
  #10   Spotlight this post!  
Unread 28-01-2010, 18:20
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Mecanum Wheels Programming

Quote:
Originally Posted by daltore View Post
One way to get around this is to multiply the magnitude by .7, which will bring the max value back down to 1. However, this means that you can't go as fast forward or sideways, and you're only getting full speed diagonally. The way I prefer is to measure all of the motor values, and if any of them are out of range, scale all of the motors down to the most out-of-range motor (if the fastest motor is getting a value of 1.141, divide all of the motors by 1.141). This allows you to have full power in all directions, while maintaining correct vectors.
Just FYI, very similar changes were made to the WPILib code a while back and will be in the next update.
Reply With Quote
  #11   Spotlight this post!  
Unread 29-01-2010, 22:50
fimmel's Avatar
fimmel fimmel is offline
Founding Mentor, Team 2370
AKA: Forest Immel
FRC #2370 (iBots 2370)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Castleton, Vermont
Posts: 325
fimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond repute
Re: Mecanum Wheels Programming

Quote:
Originally Posted by jhersh View Post
Just FYI, very similar changes were made to the WPILib code a while back and will be in the next update.
Is there a date as to when this is going to be released?

...Forest
__________________



Reply With Quote
  #12   Spotlight this post!  
Unread 04-02-2010, 15:26
BryanF BryanF is offline
Registered User
FRC #0930
 
Join Date: Feb 2010
Location: Mukwonago Wisconsin
Posts: 2
BryanF is an unknown quantity at this point
Re: Mecanum Wheels Programming

Just to let you know with mechanum wheels it is very important that you have all WHEELS turning the same speed because as we all know motor speed is not very accurate some time i recommend putting encoders on your wheels using one joystick and a button to switch between tank drive and strafing back to the encoders 100% sure you will need to use PID but the benefits will show when you get it working
Reply With Quote
  #13   Spotlight this post!  
Unread 05-02-2010, 01:32
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Mecanum Wheels Programming

Quote:
Originally Posted by fimmel View Post
Is there a date as to when this is going to be released?
Looks like it will be next week.
Reply With Quote
  #14   Spotlight this post!  
Unread 05-02-2010, 23:55
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: Mecanum Wheels Programming

the best way to scale the input into the holonomic drive vi is to set a case for overflow
if > 100 then = 100
that way
.70=.70
.80=.80
.90=.90
1.00=1.00
1.41=1.00
Reply With Quote
  #15   Spotlight this post!  
Unread 06-02-2010, 04:30
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: Mecanum Wheels Programming

Quote:
Originally Posted by jhersh View Post
Just FYI, very similar changes were made to the WPILib code a while back and will be in the next update.
So, this has happened twice so far this season First, it's the scaling I added in, and then this week, it was the single Jaguar CAN refnum VI I hacked together (and got working, thank you very much) that we just got the update for. I seem to be coding one step ahead of release...
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 Wheels tennispro9911 Technical Discussion 6 07-11-2008 00:04
Mecanum Wheels? Maxpower57 Kit & Additional Hardware 17 17-03-2008 16:50
Friction coefficients for Omni wheels and Mecanum wheels from AndyMark Andy Baker Technical Discussion 11 16-12-2006 19:40
Mecanum Wheels chaolin2007 Control System 1 25-02-2006 19:16
Mecanum Wheels TheFerret Technical Discussion 8 16-01-2006 09:23


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

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