AMT103-V Encoder to RoboRio

Hello,

Where should I connect the 5 pins into the Roborio from the AMT103-V encoders? I think that I should connect 3 of each encoder pins into the DIO port. Do 5V and G go someplace else?

Was searching online and couldn’t find a direct answer. Thanks in advance for your help!

A and B should go to DIO signal pins. X is optional, as it’s an “index” pin which ticks whenever the encoder makes a full revolution. 5V and G go to 5 volts and ground, which are supplied by the roboRIO.

2 Likes

Out of my own curiosity, is there any viable way to use this pin in a sensible way? For example using a simple Counter within code and counting the ticks on that pin?

Yes, the Encoder class has integrated support for an index channel, which will reset the encoder value when it is triggered. See Encoder (WPILib API 2023.4.3)

You can alternatively hook up a Counter to it if you want 1 PPR for some other reason.

1 Like

Sample point:

Way back in the day we did a swerve drive that used the functionality to get absolute angle of each module.

When the robot first enabled we had to run a “calibration” routine to spin the modules open loop until we saw a pulse on the pin and could “reset” to the known position.

While possible, I wouldn’t recommend this for new designs. There’s plenty of high-quality absolute encoders available.

2 Likes