Go to Post And who knows, maybe one day you'll prove the impossible possible! - MissInformation [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 17-02-2008, 14:32
Lesman's Avatar
Lesman Lesman is offline
Registered User
FRC #1014 (Bad Robot)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Dublin
Posts: 35
Lesman will become famous soon enough
Re: Code For Mecanum Wheels

Which way is more 'correct'

Basically, my method calculates the angle of motion, and uses that to generate motor outputs. Then scales everything back based on the magnitude of the motion. Afterwards it adds the rotation by simply adding the z axis to the four motor outputs, and then, if necessary, scales them back to fit in 0-255.

The other methods I have seen appropriately add up all the x,y,z inputs and and then, one way or another, scale it back to fit into 0-255 (some do it better than others).

Which of these methods produce a more desirable result (ignoring code complexity and execution time)? I personally feel that my method is more 'correct'. For example: sliding at a 45 degree angle at full magnitude is not full forward + full sideways, as that would result in root(2) magnitude (on a scale of -1 to 1) in that direction, which is obviously not possible. As opposed to my code, which handles angles, and always outputs an appropriate magnitude.

I'm no expert, but that's just my gut feeling.
  #2   Spotlight this post!  
Unread 17-02-2008, 15:26
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Code For Mecanum Wheels

Quote:
Originally Posted by Lesman View Post
Which way is more 'correct'

Without considering complexity and execution time I would say without a doubt your method is superior in that it is mathematically most correct. This would, to me, lend itself better to creating a virtual model of the motions involved in a computer or PDA display. It's a well organized and logical method for defining the motor speeds and motions.
That being said, if your code and a simpler code both give the desired results I'm not sure the word "correct" can apply. Both work so both would be "correct" but I personally admire the work and math you've applied in this problem. I just am not the brightest bulb in the hallway so I must be content with a lesser solution. (Ask me about cooking instead... I have a killer cheesecake recipe that's REALLY correct!)

Steve
  #3   Spotlight this post!  
Unread 17-02-2008, 15:46
JonA's Avatar
JonA JonA is offline
Embedded Firmware Engineer
no team (Semi-Retired)
Team Role: Engineer
 
Join Date: Dec 2002
Rookie Year: 2002
Location: Milwaukee, WI
Posts: 31
JonA has a spectacular aura aboutJonA has a spectacular aura about
Re: Code For Mecanum Wheels

Quote:
Originally Posted by Lesman View Post
Which way is more 'correct'
Well, neither method is more correct. The only true measures are of usability, controllability and accuracy. You can look at all sorts of data and generate all sorts of graphs and you could probably choose variations on algorithms that allow the most control and accuracy at a given range of speeds. In the end, it comes down to "does it do what you need it to do?"

Here is one easy way to look at it:

Usability is usually subjective. This includes how complicated it is for the driver to drive and, perhaps, how complicated it is for the programmers to write.

Controllability is closely tied to usability but focuses more on consistency. (ie: when I put the stick in this position, will it do the same thing?)

Accuracy is more objective and measurable. (ie: when I put my stick at 45 degrees, does the robot travel at 45 degrees?)

Quote:
Originally Posted by Lesman View Post
...sliding at a 45 degree angle at full magnitude is not full forward + full sideways, as that would result in root(2) magnitude (on a scale of -1 to 1) in that direction, which is obviously not possible.
In the end, for controllability and usability, it is usually best to limit the maximum speed in any heading to be the same. Just because you can you can drive faster in the forward direction as opposed to 45 degrees does not mean you should as when you start to turn, your speed is not proportional.
__________________
"That mecanum guy"

- Woodie Flowers Finalist Award Winner: 2010 Minnesota North Star Regional
- Mentor and Founder of 7 FRC Teams since 2003.
- FRC Regional Competition Score Keeper/Field Power Controller, Robot Inspector, Control System Adviser, Judge
- Co-Founder, Alumni: Milwaukee FIRST Support Organization
- Board Member, Game Design Committee, Judge, MVP-FTA: Midwest Vex Programs
- Computer Engineering Alumni '06: MSOE
- Embedded Firmware Engineer: Rockwell Automation
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
Mecanum wheels akash155 General Forum 12 20-02-2007 22:15
Friction coefficients for Omni wheels and Mecanum wheels from AndyMark Andy Baker Technical Discussion 11 16-12-2006 19:40
Looking for Mecanum Wheels Armando Gonzalez General Forum 30 24-05-2006 12:54
Mecanum Wheels chaolin2007 Control System 1 25-02-2006 19:16
Mixing Joystick Values for mecanum wheels Leav Programming 10 15-01-2006 14:51


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

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