|
Re: Encoder Information Unknown
I am coaching a rookie team and still figuring all this out myself, but I did just successfully program that encoder yesterday.
We have that encoder on the back end of a motor with a 71:1 gear reduction. So with 7 pulses per rev x 71 we get 497 Codes per Rev. Multiplied times 4 for Quadrature is 1988, which I actually verified was the output from one rotation by reading System.out.println(talon.getEncPosition());
So ultimately I used the 497 as the Codes per Rev, but when I used the talon's PID set function for distance, I had to do it a slightly different way:
If I wanted one-half rotation (which is 497 * 1/2 * 4 = 994), then the line of code I would use was
talon.set(994/1998.0)
For some reason, it uses position in terms of rotation as its metric for determining how far to go. Maybe this is normal or maybe there is a way to change that part of it -- we are still learning.
Anyway, I hope that helped!
|