Thread: Swerve Gear Box
View Single Post
  #23   Spotlight this post!  
Unread 27-08-2011, 23:02
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,498
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Swerve Gear Box

Quote:
Originally Posted by PAR_WIG1350 View Post
The initial derivation does indeed give you one equation, but that one equation has a lot of variables. The number of variables is so large it would be difficult to manipulate them all for the entirety of the match without really good (expensive) joysticks, and even then, it is sometimes just easier to have constants that can be used in place of certain variables. this also has the potential advantage of making the robot respond faster for two reasons. By pre-calculating certain parts of the equation, the code can execute faster, and, since certain values plugged in for some variables can result in the angle output for some modules return the same value despite the other inputs changing, by adding modes to set the values so that this is the case, mechanical reaction time improves at the cost of reduced maneuverability.

I hope that makes sense, If unicorn drive were Moby Dick, I fear I would have to be Captain Ahab, I hope I haven't reached the rambling stage yet.
The code just takes three inputs, X translation, Y translation, and rotation rate. The code outputs the proper wheel angles and speeds for all cases with <20 lines of calculations, very simple ones at that. The cRIO handles it with no problem.

This is very intuitive to control, one stick translates (move that way, it goes that way), and another is your rotation (move this and it rotates (in addition to the translation)).

Check Ether's uploads for his equations, you'll see it's almost a trivial problem at that point.