View Single Post
  #23   Spotlight this post!  
Unread 01-04-2012, 14:11
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: Curve Driving Generator

Quote:
Originally Posted by Ether View Post
[smooth path: perhaps for esthetic reasons? the OP did not specify why
Sorry for the confusion guys,

The reason for this problem is in aiding the drive in autonomous and teleop - more so autonomous. Also, this is just an exercise for the future programmers of our team. I had noticed that although the rotate in place is the "shortest distance" method it is not always the fastest - especially for a very smooth control - as that the robot must slow down, rotate, and then speed back up. While if the robot drove in a curve it would never need to stop, only change wheel speeds. So then, I'm looking for the fastest route possible. (The reason I did not want to discuss why is because most times I post a thread there always seems to be a discussion as to why not or why and completely turn away from the answer I wanted. I apologize for not being more specific).

I am planning on integrating this with distance PID loops to control the drive. Essentially this is an add-on to a drive system I am creating that pulls from a list of coordinates that I want to go to, sets the left and right wheel distances that the robot must travel to get to that point, and then feeds those distances into a PID loop. Once the error in the pid loop reaches around 0-5% it then pulls the next coordinate to go to. I also, figured that a coordinate system relative to the robots current position would be more beneficial than a coordinate system that is fixed for what I am trying to do.

The equations that the robot uses to determine left and right distances use the arc length of the path, and the angle through which the robot will turn while it is driving along that path. If the angle is 0 then it drives in a straight line, if the distance is 0 then it rotates in place. The equations are thus:

double rightDistance = ((wheelWidth*angle) + (2*distance))/2;
double leftDistance = ((2*distance) - (wheelWidth*angle))/2;

The advantage of this is that I only need one set of equations to drive curves, or perform the traditional rotate and drive.

I am also planning on working with trapezoidal motion profiling in this. I am using these equations:

x = x0 +dx(P(u));
P(u) = -2u^3+3u^2;
u = currentTime - startTime/delta_time;

Where x is the distance travelled in 1 dimension and dx is delta_x and x0 is the startingX --> which is normally 0. P(u) is a function with these properties: f(0)=0, f'(0) =0; f(1)=1, f'(1)=0 and P(u)=[0,1] and u=[0,1].
There is a second set of equations I plan on replacing the above with that include max acceleration and max velocity, I just haven't yet because I'm not sure how to go about testing for those due to a very very small workspace - and running the robot on blocks is inaccurate for our heavy bot.

Last edited by theNerd : 01-04-2012 at 14:49.