View Single Post
  #11   Spotlight this post!  
Unread 09-04-2004, 19:27
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: trentonDrive.c: our joystick/wheel drive code

Quote:
Originally Posted by Astronouth7303
I managed to figure that much out, fortumately. I just couldn't figure out how to solve for Radius.

And Skid Steer/Tamk Dirve, right? just put the 'Left' and the 'right' at the average point of where the wheels touch the ground
Yeah, that's right -- any bot with just two independent rolling points on the ground. Track drives work best on slippery or sandy surfaces, but carpet is tougher. Some people have the drive wheels in the center of each track and a little bit lower than the rest of the track, so that it can turn without dragging the entire track sideways across the carpet. Tracks certainly help when climbing. We opted to stay off the platform -- our bot has less than 1" clearance to the floor. It's never flipped over.

Enough on drive philosophy.

Quote:
sI/sO = 1-W/rO? You're good.

sI*rO = (rO - W)sO
sI*rO = rO*sO - W*sO
sO*rO - sI*rO = W*sO
(sO-sI)*rO = W*sO
rO = (W*sO)/(sO-sI)
rI=W-rO


Thank you!
You're welcome! I think your last equation is reversed: the inner radius is less than the outer radius, so rI = rO - W. But I'm sure you knew that.

trentonDrive() sets the inner wheel speed as

sI = yAxis * ( 1 - abs( xAxis ) )

where abs( x ) goes from 0 to 1. This means that at the extreme of the xAxis, the inner wheel stops. That makes the bot turn around the inner wheel -- the turning radius of the inner wheel is zero.

But if you double the xAxis in that equation:

sI = yAxis * ( 1 - 2 * abs( xAxis ) )

now the inner wheel goes full speed reverse at the extreme of the xAxis, and the robot can spin on a dime. You can think of that as the inner radius going negative! I didn't like that on our machine, but it might work better on yours. trentonDrive would have to be reworked a bit to support negative values where it currently expects only positive.

When I first worked out the "radius ratio" idea, I only thought to slow down the inner wheel -- I just sent the yAxis directly to the outer wheel:

sI = yAxis * ( 1 - abs( xAxis ) )
sO = yAxis

But that made it steer funny, like dragging your foot on one side or the other to make it turn. I didn't like how the robot slowed down when it turned. So I sped up the outer as much as I slowed down the inner:

sI = yAxis * ( 1 - abs( xAxis ) )
sO = yAxis * ( 1 + abs( xAxis ) )

Now it maintains speed as it turns. Like a car.

If you're going to nationals look me up at Team 381!
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.