View Single Post
  #2   Spotlight this post!  
Unread 26-05-2010, 08:59
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: crab drive control scheme

The easiest way is to implement P or PID control of the steering, here's some psuedo-code for Proportional (P):
Code:
error = setpoint - process_variable
output = error * gain
Nice and easy. You can increase the gain until it goes as fast as possible without overshooting/oscillating.

If you need finer control of PID (Proportional Integral Derivative) you can use the NI PID toolkit in LabVIEW, but P will probably be good enough for swerve steering.

If you have independent control of each wheel, you can calculate the optimum wheel angle when turning. Assuming you dont, you still turn like a skid-steer. When translating sideways, use the "front" and "back" motors as "left" and "right" for turning.

Edit: Forgot about user interface.

There are a few common ways to do this:
1. Gaming controls: Map the translation angle to the angle of the right joystick and the speed to the magnitude of the right joystick. Map the rotation to the X axis of the left joystick. Use Arcade Drive based on whatever wheels are currently left and right. This is generally combined with a gamepad type controller, and will be very familiar with drivers who are also gamers. These are generally the most common.

2. We have also used "tank-hybrid" when the driver was heavily trained in skid-steer driving. We mapped the speed to the Y axis of the two joysticks, just like tank, and the translation angle to the average of the X. The driver liked this, and it worked, although it did not allow us to utilize the power of four wheel independent steering.
__________________
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

Last edited by apalrd : 26-05-2010 at 09:04.