Go to Post All I need now is a plow atachment for this year's robot - team 3311 [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 04-12-2014, 22:21
matthewdenny's Avatar
matthewdenny matthewdenny is offline
Registered User
FRC #6054 (Dukes)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: United States
Posts: 310
matthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant future
Swerve Programming Spreadsheet

We're planning on making a Robot-Oriented Drive system this year (game willing). In this process it became obvious that programming is a bit tricky, so we made a spreadsheet that takes X,Y,and Rotation values and gives each of the 4 wheel orientations and speeds.

The spreadsheet was made such that you should be able to follow step by step through the calculations and translate it to programming.

Enjoy, and pass along any suggestions or questions.

-Matt
Attached Files
File Type: xls Swerve Sim.xls (29.0 KB, 111 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 05-12-2014, 01:57
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,224
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: Swerve Programming Spreadsheet

Quote:
Originally Posted by matthewdenny View Post
We're planning on making a Robot-Oriented Drive system this year (game willing). In this process it became obvious that programming is a bit tricky, so we made a spreadsheet that takes X,Y,and Rotation values and gives each of the 4 wheel orientations and speeds.

The spreadsheet was made such that you should be able to follow step by step through the calculations and translate it to programming.

Enjoy, and pass along any suggestions or questions.

-Matt
Very cool! Saved to my computer to peruse later.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-12-2014, 09:16
ajlapp ajlapp is offline
Registered User
AKA: Anthony Lapp
None #0118 (Team RUSH and Robonauts)
 
Join Date: Sep 2001
Rookie Year: 1996
Location: Ortonville, MI
Posts: 648
ajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond repute
Re: Swerve Programming Spreadsheet

There is a very detailed set of papers and a simulation spreadsheet available here as well...

More is more.

Ether's Swerve Stuff
__________________
Anthony Lapp
FIRST Engineering Mentor
Owner/Operator 221 Robotic Systems
221 Robotics Systems - Quality Hardware, Made in the USA
RobotOpen
anthony@221robotics.com
Twitter us: @221RobotSystems
Team 1 --> 94 --> 68 --> 221 --> 857 --> 27 --> 118
Design Engineer/Fabricator and 17 year vet
Team Rush (FRC27) and Robonauts (FRC118)
Reply With Quote
  #4   Spotlight this post!  
Unread 08-12-2014, 12:50
mr. giggums mr. giggums is offline
Registered User
AKA: Bennett Bernardoni
FRC #2451 (PWNAGE)
Team Role: Programmer
 
Join Date: Jun 2012
Rookie Year: 2007
Location: Batavia, IL
Posts: 10
mr. giggums is on a distinguished road
Re: Swerve Programming Spreadsheet

The method used in the spreadsheet seems slightly incorrect and will give some wrong numbers. One of these cases is when Joystick Y = 1 and Rotation = -1. The spreadsheet will give the following results.
Code:
	Angle 	Power
Wheel 1 270.00	0.45
Wheel 2	333.44	1.00
Wheel 3	26.57	1.00
Wheel 4	90.00	0.45
The robot will look as follows (where the length of the arrow roughly equals the power).

In the image above the robot might seem to move correctly but the wheels will scrape across the ground and will lose a lot of power. The robot should look like the following.

This is caused by a slightly incorrect algorithm. For a correct algorithm I would heavily suggest that you look at Ether's swerve stuff as posted above, specifically, the first attachment.

Also, the way you deal with scaling the power values is incorrect. The two following cases give the same results.
Joystick Y = 1 and Rotation = -1
Joystick Y = 0.1 and Rotation = -0.1
To solve this problem you need to take the power values and multiply by the maximum magnitude of the joysticks.

Last edited by mr. giggums : 08-12-2014 at 13:04.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-12-2014, 21:29
matthewdenny's Avatar
matthewdenny matthewdenny is offline
Registered User
FRC #6054 (Dukes)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: United States
Posts: 310
matthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant future
Re: Swerve Programming Spreadsheet

Mr. Giggums

Thanks for taking a look. I went back to my sheet and found 3 errors. First I had switch wheels 3 & 4 on the layout diagram. Second I had weighted both the X and Y components of rotation at 1.0 which gives a total resultant of 1.41 which makes the vector from rotation too heavily factored into the overall resultant. I corrected that and the weighting to .707.

I also found the problem with scaling. Turns out that I was scaling the numbers so max motor value was 1.0. I changed it so it only scales if a motor value is >1 now.

Thanks for checking it for me. It seems to correlate pretty well to Ethers numbers now.

I'll attach a new version with corrections for anyone whose interested.
Attached Files
File Type: xls Swerve Sim3.xls (102.5 KB, 9 views)
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 18:36.

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