Weird Behavior from REV Through-Bore Encoder into Top of CANSparkMax

We are using a CANSparkMax with a brushed motor and a REV through-bore encoder plugged into the top port (where the NEO usually goes)

mEncoder = mMotor.getEncoder(Type.kQuadrature, 8192);

When zero the position, at any point, and turn in one direction, the rotation count looks good and increments correctly and decrements correctly if I go back. If I turn the other way, from wherever it was when I zeroed the position with setPosition, it jumps to 274. Has anyone else encountered this?

Thanks!

Did you enable continuous input?

getEncoder produces a RelativeEncoder object, it doesn’t seem to have a continuous input method?

1 Like

After a bit more poking, it appears that the RelativeEncoder class from the SparkMax can’t track negative positions. Fortunately, for our application, I can pad it up.