Rev Througbore Absolute Reporting Tiny Negative Numbers

Our Rev Througbore Encoder is reporting incorrect values. getPosition() is returning tiny negative numbers in prints while shuffleboard says 0 and Rev hardware client says the correct number.


This was also a problem sometimes yesterday, but not always. The encoder is connected directly to the SparkMAX. Also, a code restart did not fix it.

What numbers are you expecting for a full rotation? 0.149 isn’t that tiny when the expected range is only 1.000 for a full rotation.

Intermittent problems are a pain to chase.

I am not really the right person to answer your question, but some more context in the numbers/ranges you are seeing vs expecting would be useful.

The 0.149 is the correct number. The -3.3 * 10^-6 is the issue. That is what is coming out in the prints and Shuffleboard reports as 0 likely because it is so small.

I am intending the operating range to be between 0.023 and 0.35.

Okay, turns out that the problem was an incredibly dumb mistake on my part. I had disconnected part of the CAN bus to move some stuff and though that not everything was needed for testing. Turns out that the RoboRIO was one of those “not needed” things.

Stuff does not work when the RIO is unplugged. Who would have thought?

2 Likes