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.