Thread: Differential?
View Single Post
  #14   Spotlight this post!  
Unread 08-01-2008, 15:03
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Differential?

Depending on your application, you might be able to save a bit of weight if each of your rear wheels is independently driven, with a software differential.

To make a software differential, we break the robot down into simpler parts. As we turn the steerable wheels in the front (Ackermann-steering would have an advantage here), we can use the angle that the wheels have turned from center to gauge how much of a nominal radius the center of the robot will turn at.

For this, you can do calculations and create a lookup table (variable array) to save processor time on the playing field, and map out the nominal radius for a given turn angle. Once we know the nominal radius to the center of the robot, we subtract half the width of the robot for the inside wheel and add half the width of the robot for the outer wheel.

Next, we read the operator interface values for how fast we want the robot to be going, as we set this to the outer wheel. (Unless the robot is going perfectly straight, then both wheels). Here's the [simplified] calculations involved:

Code:
// We assume that our existing calculations determined the outer radius to be 124 inches, and the inner to be 100 inches. opInterfaceSpeed is how fast the driver is telling us to drive the robot
outerRadius = 124;
innerRadius = 100;
opInterfaceSpeed = 255;

// First, we shift the opInterfaceSpeed by 127, so that -127 is reverse and 127 is forward. 
robotDriveSpeed = opInterfaceSpeed - 127;

// Find our circumference of both circles
outerCir = ((outerRadius * 100) * 2 * 314) / 100;
innerCir = ((innerRadius * 100) * 2 * 314) / 100;

// Now since we want the robot to complete both inner circles and outer circles at the same time, we find the ratio between the two. The diameterRatio should an integer between 0 and 100
diameterRatio = (innerCir * 100) / (outerCir);

// Now we find out how much we want to slow down the inner wheel. The output will be between 0 and 255, the PWM signal we want to send to the inside motor.
innerSpeed = 127 + ((robotDriveSpeed * diameterRatio) / 100);
Now this example is very simplified. Right now, this example will work just like a real car; it will only make your robot turn if you "give it gas". Also, there are no checks in here for frictional losses, or attempting to turn in radaii so small the innerSpeed value is so small it cannot overcome the friction of the drive train.

Some additional tweaks to the code can solve this, but that's something for all of you to experiment with and figure out. What are you waiting for?! Go get a Vex robot and an Advanced Gear Kit from VexLabs, and start testing code!
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.