View Single Post
  #1   Spotlight this post!  
Unread 20-06-2005, 17:07
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Backwards Mounted Motors

The way our tank drive was made, one tranny was mounted so that 254 would drive forward, and one mounted so that 254 would drive backwards. To deal with this, I added the following bit of code to my Drive() function.
Code:
if(intSpeed > 127)
{
	RIGHT_MOTORS	=	127 - (intSpeed - 127);
}
else
{
	RIGHT_MOTORS	=	127 + (127 - intSpeed);
}
The problem with this though, is that forwards speed is always higher than backwards speed. To solve this, I took the backwards RPM and divided it by the forwards RPM. Then, on the side that was forwards, I had the following code
Code:
if(intSpeed > 127)
{
	LEFT_MOTORS	=	intSpeed * .952;
}
else
{
	LEFT_MOTORS	=	intSpeed * (1 / .952);
}
After Battlecry, the driver told me that it was still veering to the right. Could the maximum RPM's have changed? How do you guys get around backwards tranny's?
__________________
http://www.mikesorrenti.com/