View Single Post
  #9   Spotlight this post!  
Unread 15-03-2006, 16:31
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: calculating distance

Quote:
Originally Posted by sur2124
I was talking in general, we needed the shaft encoder to find the distance to a point in autonomus mode. We used the Gyro to find direction, y-accelemoter to find tilt angle, and tried to use the shaft encoder to find distance to a point on the field.
why didn't you use another gyro to find the tilt angle? it makes things a bit easier

anyway, if you want to calculate distance (without using the camera), you might want to use that encoder.
the encoder counts can be extremely useful, (AFAIK) they count more times per revolution then a GTS can, and (once again, AFAIK) they miss less counters then a GTS.

anyway, what you have to do is figure out the amount of counts per revolution, and then how far each revolution makes the robot go. as far as I'm concerned, this is simple math.
once you have figured that out, assign a PWM value and count up to that value. you might have to use a bit of PI or PID to make sure that the robot will STOP at the desired length, but counting the encoder output is definitely a good idea.

If you are trying to discover position, then you would have to take into account the GYRO angle. By doing this (and a bit of trig i think) you can determine the position of the robot on the Field.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY