Go to Post Screwing up is part of the game. Iterating, testing, and analyzing your failures separates the great from the average. - Jon Stratis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2010, 12:03
lollypop2020 lollypop2020 is offline
Registered User
FRC #2733 (Pigmice)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Portland, OR
Posts: 19
lollypop2020 is an unknown quantity at this point
Questions about mecanum wheels

My team decided to use mecanum wheels this year, which are currently being assembled, but are not yet on our test robot. Using the advice that has already been posted, our programming team made some code that we think is correct. It wasn't quite as simple as converting xy to polar, we had to make our brains hurt with radian-degree conversions,and angles being shifted 90deg, but the code we have seems to work correctly. Since the wheels aren't actually on the robot yet, we can't see how it moves, but from what I've read about mecanum wheels, the motors are spinning in the correct directions based on the input from the joystick. My only concern is that often times the motors are not going at full speed:

Rotation(which we have on a separate joystick) works fine, pushing it all the way one direction sets -1 or 1 to each side based on which direction we're tuning.

However, for all other situations, the motors are rarely at full power. I have a feeling this is the way the sin and cos functions in holomicdrive.vi inherently are going to work to make sure your speed is consistent in any direction, but I am still worried.

When we push the main joystick full forward, and give the holonomicdrive.vi the equivalent of 1 magnitude, 0 heading, and 0 rotation, the motors all go in the same direction but at about ~70% power. A similar thing happens when we strafe straight sideways, the motors are all going in the correct direction to cancel force vectors for sideways motion, but it is not at 100%.

The only other time any motor ever gets to 100% besides purely rotating, is when we push the joystick into one of its corners. In that case, two motors go to 100%.

We want to get as much power out of our drive system as possible, even if it means the robot will move slower in certain directions. Even just for full forward or backward, I would like to be able to set all the motors to 100% forward without any extra functions.

Is there anything we can do about this? Is this how mecanum wheels are supposed to work? I could always make a button that sets full power to all the wheels, but having it built into the regular control system would be better.

Thanks.
  #2   Spotlight this post!  
Unread 21-01-2010, 12:31
kE7JLM's Avatar
kE7JLM kE7JLM is offline
KE7JLM `
AKA: John Harris
FRC #0842 (Falcon Robotics)
Team Role: Driver
 
Join Date: May 2007
Rookie Year: 2006
Location: Phoenix, AZ`
Posts: 136
kE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to all
Send a message via MSN to kE7JLM
Re: Questions about mecanum wheels

What is your wheel config?

Here is the code I've done for off season projects, you may want to add dead zones. This also does not have the power problems -

Code:
                if (ws.ButtonState.Two == true)
                {
                    leftmotorcontrol.motors[0].Velocity = -100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y + turn); // front left
                    leftmotorcontrol.motors[1].Velocity = -100 * (ws.AccelState.Values.X + ws.AccelState.Values.Y + turn); // rear left
                    rightmotorcontrol.motors[0].Velocity = 100 *(ws.AccelState.Values.X + ws.AccelState.Values.Y - turn); // front right
                    rightmotorcontrol.motors[1].Velocity = 100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y - turn); // rear right
                }
                else
                {
                    leftmotorcontrol.motors[0].Velocity = 0.00;
                    leftmotorcontrol.motors[1].Velocity = 0.00;
                    rightmotorcontrol.motors[0].Velocity = 0.00;
                    rightmotorcontrol.motors[1].Velocity = 0.00;
                }
The if statement is a safety measure

I was using a wiimote so the "joystick values" (Really i used the accelerometers) gave an output of -1 to 1, you get a 0 - 255?. Its really simple just add up the x,y,z(rotation) and give each wheel the values they need.Diagrams help alot.

Are you using two or one joystick?

Take a look at this thread -
http://www.chiefdelphi.com/forums/sh...hlight=wiimote

PM me if you need more help
__________________
Team 842 Programmer

Pictures at:
http://picasaweb.google.com/KE7JLM
&
http://picasaweb.google.com/john.h.842

Videos -
http://www.youtube.com/user/KE7JLM

When your not busy with FIRST try NURC

  #3   Spotlight this post!  
Unread 21-01-2010, 12:35
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: Questions about mecanum wheels

A piece of advice that I'd give is to also use a PID controller. This way you can tweak values to however you'd like them. Also makes for smoother control.

Jacob
  #4   Spotlight this post!  
Unread 21-01-2010, 12:38
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: Questions about mecanum wheels

You could always write your own "HolonomicDrive.vi" to make the calculations the way you expect them to be made.
  #5   Spotlight this post!  
Unread 21-01-2010, 13:01
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Questions about mecanum wheels

the WPILib Joystick class has a GetDirectionDegrees and GetDirectionRadians, I'm sure Labview has something similar
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #6   Spotlight this post!  
Unread 21-01-2010, 21:57
Todd's Avatar
Todd Todd is offline
Software Engineer
FRC #1071 (Team Max)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Connecticut, Wolcott
Posts: 51
Todd is just really niceTodd is just really niceTodd is just really niceTodd is just really niceTodd is just really nice
Re: Questions about mecanum wheels

Quote:
the WPILib Joystick class has a GetDirectionDegrees and GetDirectionRadians, I'm sure Labview has something similar
Actually it unfortunately doesn't (At least as far as we can tell). We also had to do the conversion from X/Y axis to direction/magnitude.

Quote:
When we push the main joystick full forward, and give the holonomicdrive.vi the equivalent of 1 magnitude, 0 heading, and 0 rotation, the motors all go in the same direction but at about ~70% power.
This is also true and is how the holonomic vi is coded.

If you want to change it so that your motors are running at full power I'd advise making a copy of the holonomic vi and reworking the math inside of it to your liking.
  #7   Spotlight this post!  
Unread 21-01-2010, 22:51
willson.thomas willson.thomas is offline
Registered User
FRC #1595
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 50
willson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nice
Re: Questions about mecanum wheels

I don't know how you are doing your direction and magnitude calculations but in LabVIEW, we used the ATAN2 function for direction which takes the joystick x and y as inputs. While you still have to do Radian-Degree conversions, I believe this will handle the Quadrant issues for you. Then, for the magnitude, we simply did sqrt(x^2+y^2).
__________________
Team Leader
Team 1595
  #8   Spotlight this post!  
Unread 21-01-2010, 23:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Questions about mecanum wheels

In LabVIEW, you can also use "Re/Im To Polar Function".
  #9   Spotlight this post!  
Unread 21-01-2010, 23:30
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,554
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Questions about mecanum wheels

Quote:
Originally Posted by Todd View Post
Actually it unfortunately doesn't (At least as far as we can tell). We also had to do the conversion from X/Y axis to direction/magnitude.

This is also true and is how the holonomic vi is coded.

If you want to change it so that your motors are running at full power I'd advise making a copy of the holonomic vi and reworking the math inside of it to your liking.
Actually, labview DOES have this function in an easy-to-use VI that can output degrees and magnitude from your joystick direction.

Edit: Doh, Joe beat me to it. That's what I get for leaving the window open while I go out to a machine breakdown
Closed Thread


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
need help about Mecanum Wheels mahmosh Technical Discussion 4 18-01-2008 11:50
A few Questions about Omni Wheels.... kSniper Technical Discussion 4 08-01-2008 00:15
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 02:19.

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