View Single Post
  #16   Spotlight this post!  
Unread 23-05-2010, 20:48
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Swerve vs. Mecanum Programming

While I can't look at your code since I don't have LV on this computer, I can say a few things in general:

1. P should be good for steering, unless you have a lot of friction.
2. You should rely on the sensor. Not too much, but don't program all kinds of safeties like it going in the wrong direction. good limits are out of bounds, lost sensor (0 volts), and not moving if you are really worried about it. We have no mechanical limits on our swerve, except the wiring, and we leave a lot of extra wire. Using window and globe motors (especially the window motors), it doesn't have enough power to damage much in our application.
3. Use the same code in auto as teleop - best to put it in a new thread.
4. Make kP (gain) a front-panel control or global to tune it. If you are using four identical motors (e.g. window motors), you would probably be fine with one gain and volts/deg, and x centerpoints (where x is the number of controllers), if you mix motors (e.g. window+555 or window+globe), then you would need a different gain for each motor and volts/deg for each different sensor (e.g. when sensor gearing or # of turns is different).
5. Pots never completely fall off. We have had many problems with set screws coming loose and pots loosing connection, but never completely fall off.
6. Don't be scared of code changes. We change our code quite frequently, and generally try to test it before playing, depending on how major the change was (we don't generally test autonomous kick distance changes, for instance).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack