Broken or damaged TTB Analog Absolute Encoders?

Hi everyone,

I am currently working on getting our swerve drive (MK4, NEOs, TTB analog encoders) working again after it broke apart due to multiple compounding issues in the offseason so far. For now, I am currently just trying to get the wheels to turn in the direction I want them to turn, so I created a function that just drives all the modules in the same direction like a crab drive. I also have a function that resets the relative encoders to the absolute encoder positions. I’ve gotten it to the point that they all seem to work, except for one module that acts strangely.

I think I’ve traced the problem to the absolute encoder by printing the absolute encoder and relative encoder values to the dashboard, and what happens is all of the values match what is supposed to be happening, except the one absolute encoder that off by around 90 degrees. When driving straight forward, the relative encoders and 3 of the absolute encoders all print 0 radians, pi radians, or 2pi radians which is correct given optimize() is working correctly. However, the one absolute encoder is printing either 0.7 radians or 2 radians and alternating between those two values after I press the button that resets the encoders.

I have already checked the magnet and it appears to be glued properly as it doesn’t move when I try to move it either by touching or scratching it with a magnetic object. I believe we have been having this issue since last competition season where we would just spam the reset encoder button until the wheel was close enough that we could drive (janky I know). However, at the time I didn’t really think it was an issue as it would still drive (I think the other wheels would pretty much just drag it into position). Is there any way to diagnose/fix an issue with the encoders themselves? Should I just buy a replacement encoder?

i’d suggest verifying the encoder output with a voltmeter. it should vary smoothly from 0 to 5 volts as you turn the steering axis by hand. if it does, then the problem might be in the wiring between the encoder and the RIO.

1 Like

@Ryan_Dognaux

2 Likes

This seems somewhat like a loose connection. Typically when an analog device gets unplugged from the RIO it will give some value (not zero). When it is reading is jumping between the 2 values I would try unplugging and see if the value stays on one of the values, if so I would check your 3 pin cable and the connection at the roboRIO.

3 Likes

Replied via DM to gather some data. You can always contact us at [email protected] as well for issues like this as well. Thanks!

1 Like

Additional troubleshooting steps I would take (you may have already done some or all):

  1. Trade the rio inputs that the encoders are plugged into. Does the problem follow the encoder, or is it a problem with the rio port or possibly in code?
  2. Trade the pwm wires with a good encoder. Maybe the wire has a bad crimp.
  3. Trade the module that the encoder is bolted to. Does the problem follow the encoder, or is it a problem with the magnet?
  4. Double check the position of the problematic encoder on the module. Is it situated above the magnet in the same orientation and vertical spacing as the other encoders.
  5. Check the encoder with a voltmeter as already suggested.

If all that still pointed to a bad encoder, i’d look into replacing it. Looks like you’re already in contact with the right people to do that!

3 Likes

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