View Single Post
  #1   Spotlight this post!  
Unread 10-10-2003, 03:37
Sachiel7's Avatar
Sachiel7 Sachiel7 is offline
<Yes I managed to flip it
AKA: Shayne Helms
FRC #1132 (RAPTAR Robotics)
 
Join Date: Sep 2002
Rookie Year: 2002
Location: Richmond, VA
Posts: 541
Sachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really nice
Send a message via AIM to Sachiel7
Talking Multi Drive Fun...

Well, as I've posted in a few other threads, I've got this great Multi-Drive system cooked up for this year. I'll list the Drive types one more time:

-Skid-Steer
-Crab/Swerve (I will refer to it as Crab)
-Car
-Angle

Well, as far as the designs go, they're done. I've "proto'd" them about 3 times, and each attempt was a success.
Anyway, I had some concepts for control/sensors, and decided to prep the programming pre-season as well. So, I worked on getting down the math.
So far, I've gotten the Crab done. That's the only thing I've worked on so far.
Anyway, for those who are interested in crab control, here's what I came up with:
-First off, Jump for Joy! The new PIC can calculate negative numbers! This has always been a pain for 1 joystick drive in the past.
-Plot your Joysticks X and Y axis' at a point on a graph(for visual example)
-Get the Dx (Distance of X from origin) and Dy (same of y).
-Flip Dx and Dy so Dx=Dy, Dy=Dx
-Get the Hypotenuse of the Vector to form a triangle. Basically
H = SQR(DX^2+DY^2)
-Next, you need the Angle that H is from DX.
To get an accurate readout, you need the inverse sign (sin-1) of (DX/Y) Remember, DX is actually the original DY value.
Since no known Programming Language (or none I've used) has a function for sin-1, or ArcSin, you must define it as this:

A = (2 * ATN((DX / H) / (1 + SQR(1 - (DX / H) ^ 2)))) * (180 / PI)

This will give you the Angle in Degrees.
Now, you know the angle. Orient it properly with the graph.
My system is designed to have the wheels pivot 180 degrees. They start in the 90 degree position. We Want (-127,0) to be 0 degrees, (0,0) to be 90 degrees, and (127,0) to be 180 degrees.
Instead of a fancy wheel turning system, it's smoother, and worth a little math. If you look carefully you will begin to realize that the angle of the wheel when reflected over both axis' is the same. In other words, if you know the direction of the hypotenuse (negative, for example) than you know which direction to turn your drive motor, and how many degrees to pivot the wheel(s). So, if you wanted to drive forward, without pivoting the wheels, and then you shift backward, you don't need to waste time and energy rotating your wheels all the way around, just reverse the drive. The same applies for angles reflected over the x axis.

Now, to determine your PWM output:
-Get the Hypotenuse, and make sure it has the proper sign for it's quadrant.
-Double the Hypotenuse. This allows the maximum output to the motors

When tinkering with this, you may realize that when corners are approached, the output is well over 254. That's simply because the hypotenuse is longer than the sides in a 45 degree angle. So in other words, you need to limit the Hypotenuse.
Now, there are better ways to do this, I'm sure. This is just the path I decided to take, because it is good enough for the application we're using it for.
Here's Some simple math:

C=H
If C > 127 then C = 127
if C < -127 then C = /127
C=C*2
Drive =C

You will notice that the range in which 127 resides as C is from 127 to 90, roughly 37 values set the same.
Now, for us, this is just fine. We're glad that we can achieve full speed when one value is 0.
Anyway, I put together a small program that takes a used defined point, and displays the drive speed/direction, the Hypotenuse, Wheel Angle, DX, DY, etc., and draws it as a triangle.
It works just right, and even though it's dull looking, it still shows that the math works. I need to go back and clean out the code, but I'm just glad it's working.

Anyway, the Skid/Car/Angle coding is simple as pie.
For those wondering what I'm calling "Angle" drive, it is like car where a set of wheels pivot, but 2 setd pivot opposite directions on the front and back. It's really easy to do some figure 8's with that one
Car only pivots 2 wheels, Crab pivots all 4, and Skid locks 'em in back at 90 deg.
I think we may be one (if not the) first teams to build this kind of system on the east coast. Another slight variant from typical designs is the fact that motors aren't connected to the wheel assemblies. Their force is transferred out to 2 sets of wheels each, across a chain system.
I won't post tooo much info on my lovely system, though. At least, not until it's built...
__________________
-=Sachiel7=-

There's no such thing as being too simple!
Look for Team #1132, RAPTAR Robotics at the VCU Regional this year!

Last edited by Sachiel7 : 10-10-2003 at 03:40.