Encoder not reading properly in auton

Hello!
The Amt 103v encoder were are using is only reading between 0 and 1 tick. We’ve changed the distance per tick, which has changed the readout, but it doesn’t add up each tick, It only fluctuates between 0 and the other value.

The code we used was from team 358’s guide to programming, and we have had this encoder setup working before, but we seem to be stuck this time.

Auton vi:

Begin vi:

Video of dashboard output:

Any help is appreciated!!

That looks like it’s only reading one port and the other is open. Are the two digital input ports correct? If so, double-check for bad wiring/loose connections.

Quadrature Encoding works by having 2 digital inputs that read out of phase by 90 degrees, meaning it can have 4 possible values (0/0, 0/1, 1/1, 1/0). This allows you to be able to count AND detect direction (e.g. 0/0 -> 0/1 is increasing, 0/0 -> 1/0 is decreasing).

If one of the pins is unconnected (or always low or high), then your possible values gets cut in half (0/0 and 1/0), which would appear to the counter as +1 -> -1 -> +1 -> -1

If you take out all of that math, I think you’ll find that the value you’re seeing is actually following this pattern.

If you post your code I would be willing to try and help you with the flow. I can give you ideas and suggestions on what you can to do improve your code.

I agree with Fletch
One of the signal wires is disconnected.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.