Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Swerve Programming Spreadsheet (http://www.chiefdelphi.com/forums/showthread.php?t=131362)

matthewdenny 04-12-2014 22:21

Swerve Programming Spreadsheet
 
1 Attachment(s)
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

asid61 05-12-2014 01:57

Re: Swerve Programming Spreadsheet
 
Quote:

Originally Posted by matthewdenny (Post 1411630)
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.

ajlapp 05-12-2014 09:16

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

mr. giggums 08-12-2014 12:50

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.

matthewdenny 08-12-2014 21:29

Re: Swerve Programming Spreadsheet
 
1 Attachment(s)
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.


All times are GMT -5. The time now is 05:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi