Quote:
Originally Posted by beefy23
I have tried to look for some guides about Gear tooth sensor, but what I`ve found doesn`t really help me.
Some stuff is ambiguous for me.
What are the meanings of quadrature encoder`s states, what does each of them tell me about?
What is Get_Encoder_1_Count() and Get_Encoder_2_Count() , and what`s the meaning of the number in the name of the function.
Thank you in advance.
|
Quadrature encoders are similar in purpose to gear tooth sensors but are different in functionality. A quadrature encoder has an additional channel that indicates the direction the encoder is being turned.
In Kevin Watson's FRC code the functions like Get_Encoder_1_Count() return the net number of pulses sent by the encoder plugged into the port as declared in the encoder.h file. The numbers are used to distinguish between encoders, I believe Kevin's code allows for 6 to be used at a time.
The value returned by Get_Encoder_1_Count() can be converted into distance traveled since the encoder was last reset by multiplying the value by the ratio of encoder turns to wheel turns then by multiplying by the wheel circumference.