View Single Post
  #8   Spotlight this post!  
Unread 07-04-2008, 02:29
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Accurately "Arcing" in Auton/Hybrid Mode

Hey Kiet. I did some thinking about how to do this earlier but haven't talked to anyone on 254/968 about it, so I'll just tell you here.

Here's some of the math I came up with:

If:
V_L = Velocity of the left wheels
V_R = Velocity of the right wheels
w = Width of robot (distance from left wheels to right wheels)

Then:
Code:
omega = angular speed = (V_R - V_L) / w
r = turning radius = w/2 * (V_R + V_L) / (V_R - V_L)
A turning radius of 5 feet means you are turning around a point 5 feet to the left of the center of the robot.

So if you use Uberbots' code and do V_R = v + x, V_L =v - x, then you can solve for x for a desired r:

Code:
x = w/2 * v/r
Of course I've been talking about velocity all this time, not voltage. You can try to find what PWM outputs give you the right velocities, but like you said that can be a problem. The best thing is a feedback loop for each side, some sort of PID loop.

Using the gyro and encoders like Adam suggested will work too. In that case you can calculate the turning radius from just V_L = left velocity, and omega = gyro output:

Code:
r = V_L / omega + w/2

Last edited by Jay Lundy : 07-04-2008 at 02:32.