Encoders and distance (labview)

I’m trying to program for autonomous, using the encoders. However, the formula I’m using for finding the right number of ticks for one inch and such isn’t working. Does anyone have a formula, or an input value for a distance of one inch? I’m using LabVIEW. Help me please ^^

If you’re using the encoder VIs, then they should be doing 4x decoding. That is, they’ll return 4 ticks for every cycle of the encoder. So if your encoder is 1024 pulses/cycles per revolution, the VI will actually read 4096 ticks per revolution. After that, it’s just properly figuring how many inches you have per revolution.

This is difficult to do without more information. Needed is: Ticks/rev of the encoder used, Gear ration in the drive AFTER the encoder has sampled, wheel diameter.

The formula you are looking for is this

distance = (ticks) * (Gear Ratio) * (wheel diameter * pi)/(ticks per rev * scale)

Where Gear ratio is amount of times the wheel spins per amount of times the encoder spins, and scale is 4 (per what Kevin said above).

As I last saw them, the WPI Robotics Library encoder VI’s had provisioning for real world unit distance feedback. The VI’s had setters and getters for the gear ratio and distance travelled, respectively.