View Single Post
  #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